@@ -5,47 +5,16 @@ import {
55 DataTypeRulesInputTypeConfig ,
66 DataTypeRulesInputTypesConfig ,
77 DataTypeRulesItemOfCollectionConfig , DataTypeRulesNumberRangeConfig ,
8- DataTypeRulesParentTypeConfig , DataTypeRulesRegexConfig ,
8+ DataTypeRulesParentTypeConfig , DataTypeRulesRegexConfig , DataTypeRulesVariant , DataTypeVariant ,
9+ GenericCombinationStrategyType ,
910} from "@code0-tech/sagittarius-graphql-types" ;
1011import {
1112 DataTypeIdentifier as TucanaDataTypeIdentifier ,
12- DefinitionDataType_Variant , DefinitionDataTypeRule
13+ DefinitionDataType_Variant , DefinitionDataTypeRule , GenericMapper_GenericCombinationStrategy
1314} from "@code0-tech/tucana/pb/shared.data_type_pb.ts"
1415import { GenericMapper as TucanaGenericMapper } from "@code0-tech/tucana/pb/shared.data_type_pb.ts"
15- import { ConstructedDataTypes , getID } from "../parser.js" ;
16- import { getTranslationConnection } from "./translation.js" ;
17-
18- export enum GenericMapper_GenericCombinationStrategy {
19- UNKNOWN = 0 ,
20- AND = 1 ,
21- OR = 2
22- }
23-
24- export enum GenericCombinationStrategyType {
25- And = 'AND' ,
26- Or = 'OR'
27- }
28-
29- enum DataTypeVariant {
30- Array = 'ARRAY' ,
31- DataType = 'DATA_TYPE' ,
32- Error = 'ERROR' ,
33- Node = 'NODE' ,
34- Object = 'OBJECT' ,
35- Primitive = 'PRIMITIVE' ,
36- Type = 'TYPE'
37- }
38-
39- enum DataTypeRulesVariant {
40- ContainsKey = 'CONTAINS_KEY' ,
41- ContainsType = 'CONTAINS_TYPE' ,
42- InputType = 'INPUT_TYPE' ,
43- ItemOfCollection = 'ITEM_OF_COLLECTION' ,
44- NumberRange = 'NUMBER_RANGE' ,
45- ParentType = 'PARENT_TYPE' ,
46- Regex = 'REGEX' ,
47- ReturnType = 'RETURN_TYPE'
48- }
16+ import { ConstructedDataTypes , getID } from "../parser.ts" ;
17+ import { getTranslationConnection } from "./translation.ts" ;
4918
5019function getDataType ( identifier : string , constructedDataTypes : ConstructedDataTypes ) : DataType | null {
5120 const dataType = constructedDataTypes . constructedDataTypes . find ( dt => dt . identifier === identifier )
@@ -77,7 +46,7 @@ function createRules(rule: DefinitionDataTypeRule[], constructedDataTypes: Const
7746 switch ( r . config . oneofKind ) {
7847 case "containsType" : {
7948 const ruleConfig : DataTypeRulesContainsTypeConfig = {
80- dataTypeIdentifier : getDataTypeIdentifier ( r . config . containsType . dataTypeIdentifier , constructedDataTypes ) , //TODO
49+ dataTypeIdentifier : getDataTypeIdentifier ( r . config . containsType . dataTypeIdentifier , constructedDataTypes ) ,
8150 }
8251 const rule : DataTypeRule = {
8352 variant : DataTypeRulesVariant . ContainsType ,
@@ -134,7 +103,7 @@ function createRules(rule: DefinitionDataTypeRule[], constructedDataTypes: Const
134103 console . log ( "AF: " + i . inputIdentifier )
135104 const input : DataTypeRulesInputTypeConfig = {
136105 dataTypeIdentifier : getDataTypeIdentifier ( i . dataTypeIdentifier , constructedDataTypes ) ,
137- inputType : null , //TODO (Later): This field is wrong in GraphQL => should be a string
106+ inputIdentifier : i . inputIdentifier ,
138107 }
139108 return input ;
140109 } ) ,
0 commit comments