@shaclmate/compiler 4.0.40 → 4.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ShapesGraphToAstTransformer.d.ts +1 -8
- package/dist/ShapesGraphToAstTransformer.js +11 -126
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +128 -160
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +17 -0
- package/dist/_ShapesGraphToAstTransformer/{transformPropertyShapeToAstObjectTypeProperty.js → transformPropertyShapeToAstStructTypeField.js} +71 -48
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +29 -20
- package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.d.ts → transformShapeToAstStructType.d.ts} +3 -3
- package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.js → transformShapeToAstStructType.js} +35 -45
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +2 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
- package/dist/ast/AbstractCompoundType.d.ts +3 -2
- package/dist/ast/AbstractCompoundType.js +5 -5
- package/dist/ast/AbstractContainerType.d.ts +2 -2
- package/dist/ast/AbstractContainerType.js +4 -4
- package/dist/ast/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +10 -12
- package/dist/ast/{AbstractLazyObjectType.js → AbstractLazyType.js} +3 -3
- package/dist/ast/AbstractType.d.ts +1 -1
- package/dist/ast/AbstractType.js +3 -0
- package/dist/ast/Ast.d.ts +2 -6
- package/dist/ast/DefaultValueType.js +2 -1
- package/dist/ast/IntersectionType.d.ts +2 -2
- package/dist/ast/IntersectionType.js +3 -3
- package/dist/ast/LazyOptionType.d.ts +6 -0
- package/dist/ast/LazyOptionType.js +5 -0
- package/dist/ast/LazySetType.d.ts +6 -0
- package/dist/ast/LazySetType.js +5 -0
- package/dist/ast/LazyType.d.ts +5 -0
- package/dist/ast/LazyType.js +5 -0
- package/dist/ast/ListType.d.ts +2 -2
- package/dist/ast/ListType.js +5 -5
- package/dist/ast/OptionType.js +2 -1
- package/dist/ast/SetType.js +2 -1
- package/dist/ast/StructCompoundType.d.ts +12 -0
- package/dist/ast/{ObjectCompoundType.js → StructCompoundType.js} +18 -18
- package/dist/ast/StructIntersectionType.d.ts +4 -0
- package/dist/ast/StructIntersectionType.js +2 -0
- package/dist/ast/{ObjectType.d.ts → StructType.d.ts} +28 -39
- package/dist/ast/{ObjectType.js → StructType.js} +81 -156
- package/dist/ast/StructUnionType.d.ts +4 -0
- package/dist/ast/StructUnionType.js +2 -0
- package/dist/ast/Type.d.ts +5 -5
- package/dist/ast/Type.js +4 -4
- package/dist/ast/UnionType.d.ts +2 -2
- package/dist/ast/UnionType.js +3 -3
- package/dist/ast/index.d.ts +7 -7
- package/dist/ast/index.js +7 -7
- package/dist/generators/AstJsonGenerator.js +7 -3
- package/dist/generators/transformAstToLabeledPropertyGraph.js +59 -56
- package/dist/generators/ts/AbstractCollectionType.d.ts +4 -11
- package/dist/generators/ts/AbstractCollectionType.js +3 -62
- package/dist/generators/ts/AbstractContainerType.d.ts +1 -2
- package/dist/generators/ts/AbstractContainerType.js +7 -10
- package/dist/generators/ts/AbstractDateType.d.ts +5 -8
- package/dist/generators/ts/AbstractDateType.js +7 -12
- package/dist/generators/ts/AbstractIdentifierType.d.ts +4 -0
- package/dist/generators/ts/AbstractIdentifierType.js +3 -0
- package/dist/generators/ts/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +8 -8
- package/dist/generators/ts/{AbstractLazyObjectType.js → AbstractLazyType.js} +30 -17
- package/dist/generators/ts/AbstractLiteralType.d.ts +3 -5
- package/dist/generators/ts/AbstractLiteralType.js +0 -21
- package/dist/generators/ts/AbstractNumericType.d.ts +1 -7
- package/dist/generators/ts/AbstractNumericType.js +17 -27
- package/dist/generators/ts/AbstractObjectSetType.d.ts +1 -1
- package/dist/generators/ts/AbstractObjectSetType.js +2 -2
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -1
- package/dist/generators/ts/AbstractPrimitiveType.js +1 -1
- package/dist/generators/ts/AbstractTermType.d.ts +7 -23
- package/dist/generators/ts/AbstractTermType.js +27 -58
- package/dist/generators/ts/AbstractType.d.ts +86 -63
- package/dist/generators/ts/AbstractType.js +48 -22
- package/dist/generators/ts/BigDecimalType.d.ts +7 -3
- package/dist/generators/ts/BigDecimalType.js +7 -9
- package/dist/generators/ts/BigIntType.d.ts +5 -3
- package/dist/generators/ts/BigIntType.js +8 -5
- package/dist/generators/ts/BlankNodeType.d.ts +2 -7
- package/dist/generators/ts/BlankNodeType.js +4 -9
- package/dist/generators/ts/BooleanType.d.ts +6 -4
- package/dist/generators/ts/BooleanType.js +13 -15
- package/dist/generators/ts/DateTimeType.d.ts +2 -2
- package/dist/generators/ts/DateTimeType.js +14 -4
- package/dist/generators/ts/DateType.d.ts +2 -2
- package/dist/generators/ts/DateType.js +14 -4
- package/dist/generators/ts/DefaultValueType.d.ts +40 -2
- package/dist/generators/ts/DefaultValueType.js +15 -14
- package/dist/generators/ts/FloatType.d.ts +5 -3
- package/dist/generators/ts/FloatType.js +8 -5
- package/dist/generators/ts/GraphqlSchema.js +2 -2
- package/dist/generators/ts/IdentifierType.d.ts +2 -2
- package/dist/generators/ts/IdentifierType.js +8 -11
- package/dist/generators/ts/IntType.d.ts +5 -3
- package/dist/generators/ts/IntType.js +8 -5
- package/dist/generators/ts/IriType.d.ts +2 -2
- package/dist/generators/ts/IriType.js +16 -16
- package/dist/generators/ts/{LazyObjectOptionType.d.ts → LazyOptionType.d.ts} +13 -11
- package/dist/generators/ts/LazyOptionType.js +75 -0
- package/dist/generators/ts/LazySetType.d.ts +20 -0
- package/dist/generators/ts/LazySetType.js +76 -0
- package/dist/generators/ts/LazyType.d.ts +19 -0
- package/dist/generators/ts/LazyType.js +65 -0
- package/dist/generators/ts/ListType.d.ts +11 -2
- package/dist/generators/ts/ListType.js +53 -26
- package/dist/generators/ts/LiteralType.d.ts +7 -2
- package/dist/generators/ts/LiteralType.js +12 -5
- package/dist/generators/ts/ObjectType.d.ts +24 -25
- package/dist/generators/ts/ObjectType.js +303 -161
- package/dist/generators/ts/ObjectUnionType.js +42 -42
- package/dist/generators/ts/OptionType.d.ts +6 -2
- package/dist/generators/ts/OptionType.js +16 -9
- package/dist/generators/ts/RdfjsDatasetObjectSetType.js +1 -4
- package/dist/generators/ts/SetType.d.ts +17 -2
- package/dist/generators/ts/SetType.js +85 -9
- package/dist/generators/ts/Snippets.d.ts +29 -9
- package/dist/generators/ts/Snippets.js +179 -39
- package/dist/generators/ts/StringType.d.ts +7 -4
- package/dist/generators/ts/StringType.js +23 -12
- package/dist/generators/ts/TermType.d.ts +9 -3
- package/dist/generators/ts/TermType.js +29 -7
- package/dist/generators/ts/TsGenerator.d.ts +1 -1
- package/dist/generators/ts/TsGenerator.js +62 -32
- package/dist/generators/ts/Type.d.ts +4 -4
- package/dist/generators/ts/TypeFactory.d.ts +5 -5
- package/dist/generators/ts/TypeFactory.js +90 -82
- package/dist/generators/ts/UnionType.d.ts +25 -23
- package/dist/generators/ts/UnionType.js +254 -261
- package/dist/generators/ts/ZodGenerator.d.ts +1 -1
- package/dist/generators/ts/ZodGenerator.js +29 -14
- package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +28 -16
- package/dist/generators/ts/_ObjectType/AbstractProperty.js +1 -24
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.d.ts +15 -17
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.js +24 -54
- package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +8 -2
- package/dist/generators/ts/_ObjectType/IdentifierProperty.js +48 -20
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +28 -0
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.js +15 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_filterTypeDeclaration.js → ObjectType_filterTypeExpression.js} +5 -10
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionExpression.js} +5 -13
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.js → ObjectType_focusSparqlWherePatternsFunctionExpression.js} +8 -31
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.js +43 -0
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_graphqlTypeVariableStatement.js → ObjectType_graphqlTypeExpression.js} +6 -13
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.js +30 -0
- package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.js +13 -0
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +11 -8
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +1 -2
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +2 -6
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +17 -0
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.js +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +5 -9
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +4 -8
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.js +14 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_toRdfResourceFunctionDeclaration.js → ObjectType_toRdfResourceFunctionExpression.js} +7 -13
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.js +7 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.js +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +8 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +10 -0
- package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +9 -2
- package/dist/generators/ts/_ObjectType/ShaclProperty.js +70 -38
- package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +4 -3
- package/dist/generators/ts/_snippets/snippets_DateSchema.js +4 -3
- package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +3 -3
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +6 -5
- package/dist/generators/ts/_snippets/snippets_IdentifierSchema.js +2 -1
- package/dist/generators/ts/_snippets/snippets_IriSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_Lazy.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_Lazy.js +22 -0
- package/dist/generators/ts/_snippets/snippets_LazyOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LazyOption.js +25 -0
- package/dist/generators/ts/_snippets/snippets_LazySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LazySet.js +40 -0
- package/dist/generators/ts/_snippets/snippets_LiteralFilter.js +1 -3
- package/dist/generators/ts/_snippets/snippets_LiteralSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_NumericSchema.js +2 -1
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +6 -8
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +32 -32
- package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
- package/dist/generators/ts/_snippets/snippets_StringSchema.js +5 -3
- package/dist/generators/ts/_snippets/snippets_TermFilter.js +3 -3
- package/dist/generators/ts/_snippets/snippets_TermSchema.js +4 -2
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_convertToArraySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToArraySet.js +8 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.js +15 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +33 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +27 -0
- package/dist/generators/ts/_snippets/snippets_convertToList.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToList.js +7 -0
- package/dist/generators/ts/_snippets/snippets_convertToScalarSet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToScalarSet.js +15 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.js +10 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterNumeric.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterTerm.js +1 -2
- package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.js +15 -0
- package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.js +11 -0
- package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.js +8 -0
- package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.js +8 -0
- package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.js +9 -0
- package/dist/generators/ts/_snippets/snippets_shaclPropertyFromRdf.js +13 -7
- package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_termFilterSparqlPatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.js +17 -0
- package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.js +60 -0
- package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
- package/dist/input/generated.d.ts +1116 -400
- package/dist/input/generated.js +1879 -1917
- package/package.json +2 -4
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.d.ts +0 -9
- package/dist/ast/LazyObjectOptionType.d.ts +0 -6
- package/dist/ast/LazyObjectOptionType.js +0 -5
- package/dist/ast/LazyObjectSetType.d.ts +0 -6
- package/dist/ast/LazyObjectSetType.js +0 -5
- package/dist/ast/LazyObjectType.d.ts +0 -5
- package/dist/ast/LazyObjectType.js +0 -5
- package/dist/ast/ObjectCompoundType.d.ts +0 -12
- package/dist/ast/ObjectIntersectionType.d.ts +0 -4
- package/dist/ast/ObjectIntersectionType.js +0 -2
- package/dist/ast/ObjectUnionType.d.ts +0 -4
- package/dist/ast/ObjectUnionType.js +0 -2
- package/dist/generators/ts/LazyObjectOptionType.js +0 -62
- package/dist/generators/ts/LazyObjectSetType.d.ts +0 -20
- package/dist/generators/ts/LazyObjectSetType.js +0 -61
- package/dist/generators/ts/LazyObjectType.d.ts +0 -19
- package/dist/generators/ts/LazyObjectType.js +0 -53
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +0 -65
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.js +0 -23
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.js +0 -24
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +0 -43
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js +0 -80
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.js +0 -10
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +0 -45
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +0 -16
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js +0 -31
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +0 -16
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js +0 -17
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +0 -14
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +0 -41
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.js +0 -36
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +0 -11
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +0 -13
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.js +0 -27
- package/dist/generators/ts/_snippets/snippets_LazyObject.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObject.js +0 -22
- package/dist/generators/ts/_snippets/snippets_LazyObjectOption.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObjectOption.js +0 -25
- package/dist/generators/ts/_snippets/snippets_LazyObjectSet.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObjectSet.js +0 -40
- package/dist/generators/ts/_snippets/snippets_convertToArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToArray.js +0 -8
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.js +0 -15
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.js +0 -31
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.js +0 -25
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +0 -15
- package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.js +0 -23
|
@@ -18,9 +18,9 @@ import { FloatType } from "./FloatType.js";
|
|
|
18
18
|
import { IdentifierType } from "./IdentifierType.js";
|
|
19
19
|
import { IntType } from "./IntType.js";
|
|
20
20
|
import { IriType } from "./IriType.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
21
|
+
import { LazyOptionType } from "./LazyOptionType.js";
|
|
22
|
+
import { LazySetType } from "./LazySetType.js";
|
|
23
|
+
import { LazyType } from "./LazyType.js";
|
|
24
24
|
import { ListType } from "./ListType.js";
|
|
25
25
|
import { LiteralType } from "./LiteralType.js";
|
|
26
26
|
import { ObjectType } from "./ObjectType.js";
|
|
@@ -49,40 +49,25 @@ export class TypeFactory {
|
|
|
49
49
|
return cachedObjectType;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
const discriminantProperty = astType.name.map((name) => new ObjectType.DiscriminantProperty({
|
|
53
|
+
configuration: this.configuration,
|
|
54
|
+
logger: this.logger,
|
|
55
|
+
name: `${this.configuration.syntheticNamePrefix}type`,
|
|
56
|
+
objectType: { name: astType.name },
|
|
57
|
+
reusables: this.reusables,
|
|
58
|
+
value: name,
|
|
59
|
+
}));
|
|
52
60
|
const identifierType = this.createIdentifierType(astType.identifierType);
|
|
53
61
|
const objectType = new ObjectType({
|
|
54
|
-
|
|
62
|
+
discriminantProperty,
|
|
55
63
|
comment: astType.comment,
|
|
56
64
|
configuration: this.configuration,
|
|
57
65
|
extern: astType.extern,
|
|
58
66
|
fromRdfType: astType.fromRdfType,
|
|
59
67
|
identifierType,
|
|
60
68
|
label: astType.label,
|
|
61
|
-
lazyAncestorObjectTypes: () => astType.ancestorObjectTypes.map((astType) => this.createObjectType(astType)),
|
|
62
|
-
lazyChildObjectTypes: () => astType.childObjectTypes.map((astType) => this.createObjectType(astType)),
|
|
63
|
-
lazyDescendantObjectTypes: () => astType.descendantObjectTypes.map((astType) => this.createObjectType(astType)),
|
|
64
|
-
lazyDiscriminantProperty: (objectType) => {
|
|
65
|
-
// Discriminant property
|
|
66
|
-
const discriminantDescendantValues = new Set();
|
|
67
|
-
for (const descendantObjectType of objectType.descendantObjectTypes) {
|
|
68
|
-
discriminantDescendantValues.add(descendantObjectType.discriminantValue);
|
|
69
|
-
}
|
|
70
|
-
return new ObjectType.DiscriminantProperty({
|
|
71
|
-
configuration: this.configuration,
|
|
72
|
-
logger: this.logger,
|
|
73
|
-
name: `${this.configuration.syntheticNamePrefix}type`,
|
|
74
|
-
objectType,
|
|
75
|
-
reusables: this.reusables,
|
|
76
|
-
type: new ObjectType.DiscriminantProperty.Type({
|
|
77
|
-
descendantValues: [...discriminantDescendantValues].sort(),
|
|
78
|
-
mutable: false,
|
|
79
|
-
ownValues: [objectType.discriminantValue],
|
|
80
|
-
}),
|
|
81
|
-
});
|
|
82
|
-
},
|
|
83
|
-
lazyParentObjectTypes: () => astType.parentObjectTypes.map((astType) => this.createObjectType(astType)),
|
|
84
69
|
lazyProperties: (objectType) => {
|
|
85
|
-
const properties = astType.
|
|
70
|
+
const properties = astType.fields
|
|
86
71
|
.toSorted((left, right) => {
|
|
87
72
|
if (left.order < right.order) {
|
|
88
73
|
return -1;
|
|
@@ -92,11 +77,13 @@ export class TypeFactory {
|
|
|
92
77
|
}
|
|
93
78
|
return this.tsName(left.name).localeCompare(this.tsName(right.name));
|
|
94
79
|
})
|
|
95
|
-
.map((
|
|
96
|
-
|
|
80
|
+
.map((astField) => this.createObjectTypeProperty({
|
|
81
|
+
astStructField: astField,
|
|
97
82
|
objectType,
|
|
98
83
|
}));
|
|
99
|
-
|
|
84
|
+
discriminantProperty.ifJust((discriminantProperty) => {
|
|
85
|
+
properties.splice(0, 0, discriminantProperty);
|
|
86
|
+
});
|
|
100
87
|
properties.splice(0, 0, new ObjectType.IdentifierProperty({
|
|
101
88
|
configuration: this.configuration,
|
|
102
89
|
logger: this.logger,
|
|
@@ -108,8 +95,10 @@ export class TypeFactory {
|
|
|
108
95
|
return properties;
|
|
109
96
|
},
|
|
110
97
|
logger: this.logger,
|
|
98
|
+
name: astType.name.map((name) => this.tsName(name, { synthetic: astType.synthetic })),
|
|
111
99
|
recursive: astType.recursive,
|
|
112
100
|
reusables: this.reusables,
|
|
101
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
113
102
|
synthetic: astType.synthetic,
|
|
114
103
|
toRdfTypes: astType.toRdfTypes,
|
|
115
104
|
});
|
|
@@ -124,18 +113,19 @@ export class TypeFactory {
|
|
|
124
113
|
}
|
|
125
114
|
}
|
|
126
115
|
const objectUnionType = new ObjectUnionType({
|
|
127
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
128
116
|
comment: astType.comment,
|
|
129
117
|
configuration: this.configuration,
|
|
130
|
-
identifierType: Maybe.of(this.createIdentifierType(ast.
|
|
118
|
+
identifierType: Maybe.of(this.createIdentifierType(ast.StructCompoundType.identifierType(astType))),
|
|
131
119
|
label: astType.label,
|
|
132
120
|
logger: this.logger,
|
|
133
|
-
members: ast.
|
|
121
|
+
members: ast.StructCompoundType.memberStructTypes(astType).map((astStructType) => ({
|
|
134
122
|
discriminantValue: Maybe.empty(),
|
|
135
|
-
type: this.createObjectType(
|
|
123
|
+
type: this.createObjectType(astStructType),
|
|
136
124
|
})),
|
|
125
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
137
126
|
recursive: astType.recursive,
|
|
138
127
|
reusables: this.reusables,
|
|
128
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
139
129
|
synthetic: astType.synthetic,
|
|
140
130
|
});
|
|
141
131
|
this.cachedObjectUnionTypesByShapeIdentifier.set(astType.shapeIdentifier, objectUnionType);
|
|
@@ -153,22 +143,22 @@ export class TypeFactory {
|
|
|
153
143
|
throw new Error("not implemented");
|
|
154
144
|
case "Iri":
|
|
155
145
|
return this.createIriType(astType);
|
|
156
|
-
case "
|
|
157
|
-
return this.
|
|
158
|
-
case "
|
|
159
|
-
return this.
|
|
160
|
-
case "
|
|
161
|
-
return this.
|
|
146
|
+
case "Lazy":
|
|
147
|
+
return this.createLazyType(astType);
|
|
148
|
+
case "LazyOption":
|
|
149
|
+
return this.createLazyOptionType(astType);
|
|
150
|
+
case "LazySet":
|
|
151
|
+
return this.createLazySetType(astType);
|
|
162
152
|
case "List":
|
|
163
153
|
return this.createListType(astType);
|
|
164
154
|
case "Literal":
|
|
165
155
|
return this.createLiteralType(astType, parameters);
|
|
166
|
-
case "Object":
|
|
167
|
-
return this.createObjectType(astType);
|
|
168
156
|
case "Option":
|
|
169
157
|
return this.createOptionType(astType);
|
|
170
158
|
case "Set":
|
|
171
159
|
return this.createSetType(astType);
|
|
160
|
+
case "Struct":
|
|
161
|
+
return this.createObjectType(astType);
|
|
172
162
|
case "Term":
|
|
173
163
|
return this.createTermType(astType);
|
|
174
164
|
case "Union":
|
|
@@ -176,11 +166,10 @@ export class TypeFactory {
|
|
|
176
166
|
}
|
|
177
167
|
}
|
|
178
168
|
createUnionType(astType) {
|
|
179
|
-
if (astType.
|
|
169
|
+
if (astType.isStructUnionType()) {
|
|
180
170
|
return this.createObjectUnionType(astType);
|
|
181
171
|
}
|
|
182
172
|
return new UnionType({
|
|
183
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
184
173
|
comment: astType.comment,
|
|
185
174
|
configuration: this.configuration,
|
|
186
175
|
identifierType: Maybe.empty(),
|
|
@@ -190,19 +179,22 @@ export class TypeFactory {
|
|
|
190
179
|
discriminantValue: member.discriminantValue,
|
|
191
180
|
type: this.createType(member.type),
|
|
192
181
|
})),
|
|
182
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
193
183
|
recursive: astType.recursive,
|
|
194
184
|
reusables: this.reusables,
|
|
185
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
195
186
|
synthetic: astType.synthetic,
|
|
196
187
|
});
|
|
197
188
|
}
|
|
198
189
|
createBlankNodeType(astType) {
|
|
199
190
|
return new BlankNodeType({
|
|
200
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
201
191
|
comment: astType.comment,
|
|
202
192
|
configuration: this.configuration,
|
|
203
193
|
label: astType.label,
|
|
204
194
|
logger: this.logger,
|
|
195
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
205
196
|
reusables: this.reusables,
|
|
197
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
206
198
|
});
|
|
207
199
|
}
|
|
208
200
|
createDefaultValueType(astType) {
|
|
@@ -211,14 +203,15 @@ export class TypeFactory {
|
|
|
211
203
|
});
|
|
212
204
|
invariant(DefaultValueType.isItemType(itemType));
|
|
213
205
|
return new DefaultValueType({
|
|
214
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
215
206
|
comment: astType.comment,
|
|
216
207
|
configuration: this.configuration,
|
|
217
208
|
defaultValue: astType.defaultValue,
|
|
218
209
|
itemType,
|
|
219
210
|
label: astType.label,
|
|
220
211
|
logger: this.logger,
|
|
212
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
221
213
|
reusables: this.reusables,
|
|
214
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
222
215
|
});
|
|
223
216
|
}
|
|
224
217
|
createIdentifierType(astType) {
|
|
@@ -227,12 +220,13 @@ export class TypeFactory {
|
|
|
227
220
|
return this.createBlankNodeType(astType);
|
|
228
221
|
case "Identifier":
|
|
229
222
|
return new IdentifierType({
|
|
230
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
231
223
|
comment: astType.comment,
|
|
232
224
|
configuration: this.configuration,
|
|
233
225
|
label: astType.label,
|
|
234
226
|
logger: this.logger,
|
|
227
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
235
228
|
reusables: this.reusables,
|
|
229
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
236
230
|
});
|
|
237
231
|
case "Iri":
|
|
238
232
|
return this.createIriType(astType);
|
|
@@ -240,66 +234,70 @@ export class TypeFactory {
|
|
|
240
234
|
}
|
|
241
235
|
createIriType(astType) {
|
|
242
236
|
return new IriType({
|
|
243
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
244
237
|
comment: astType.comment,
|
|
245
238
|
configuration: this.configuration,
|
|
246
239
|
hasValues: astType.hasValues,
|
|
247
240
|
in_: astType.in_,
|
|
248
241
|
label: astType.label,
|
|
249
242
|
logger: this.logger,
|
|
243
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
250
244
|
reusables: this.reusables,
|
|
245
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
251
246
|
});
|
|
252
247
|
}
|
|
253
|
-
|
|
254
|
-
return new
|
|
255
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
248
|
+
createLazyOptionType(astType) {
|
|
249
|
+
return new LazyOptionType({
|
|
256
250
|
comment: astType.comment,
|
|
257
251
|
configuration: this.configuration,
|
|
258
252
|
label: astType.label,
|
|
259
253
|
logger: this.logger,
|
|
254
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
260
255
|
partialType: this.createOptionType(astType.partialType),
|
|
261
256
|
resolveType: this.createOptionType(astType.resolveType),
|
|
262
257
|
reusables: this.reusables,
|
|
258
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
263
259
|
});
|
|
264
260
|
}
|
|
265
|
-
|
|
266
|
-
return new
|
|
267
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
261
|
+
createLazySetType(astType) {
|
|
262
|
+
return new LazySetType({
|
|
268
263
|
comment: astType.comment,
|
|
269
264
|
configuration: this.configuration,
|
|
270
265
|
label: astType.label,
|
|
271
266
|
logger: this.logger,
|
|
267
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
272
268
|
partialType: this.createSetType(astType.partialType),
|
|
273
269
|
resolveType: this.createSetType(astType.resolveType),
|
|
274
270
|
reusables: this.reusables,
|
|
271
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
275
272
|
});
|
|
276
273
|
}
|
|
277
|
-
|
|
278
|
-
return new
|
|
279
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
274
|
+
createLazyType(astType) {
|
|
275
|
+
return new LazyType({
|
|
280
276
|
comment: astType.comment,
|
|
281
277
|
configuration: this.configuration,
|
|
282
278
|
label: astType.label,
|
|
283
279
|
logger: this.logger,
|
|
280
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
284
281
|
partialType: this.createType(astType.partialType),
|
|
285
282
|
resolveType: this.createType(astType.resolveType),
|
|
286
283
|
reusables: this.reusables,
|
|
284
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
287
285
|
});
|
|
288
286
|
}
|
|
289
287
|
createListType(astType) {
|
|
290
288
|
const itemType = this.createType(astType.itemType);
|
|
291
289
|
invariant(ListType.isItemType(itemType));
|
|
292
290
|
return new ListType({
|
|
293
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
294
291
|
comment: astType.comment,
|
|
295
292
|
configuration: this.configuration,
|
|
296
293
|
identifierNodeKind: astType.identifierNodeKind,
|
|
297
294
|
itemType,
|
|
298
295
|
label: astType.label,
|
|
299
296
|
logger: this.logger,
|
|
300
|
-
minCount: 0n,
|
|
301
297
|
mutable: astType.mutable,
|
|
298
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
302
299
|
reusables: this.reusables,
|
|
300
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
303
301
|
toRdfTypes: astType.toRdfTypes,
|
|
304
302
|
});
|
|
305
303
|
}
|
|
@@ -328,7 +326,6 @@ export class TypeFactory {
|
|
|
328
326
|
switch (datatypeDefinition.kind) {
|
|
329
327
|
case "bigdecimal":
|
|
330
328
|
return new BigDecimalType({
|
|
331
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
332
329
|
comment: astType.comment,
|
|
333
330
|
configuration: this.configuration,
|
|
334
331
|
hasValues: astType.hasValues,
|
|
@@ -336,11 +333,12 @@ export class TypeFactory {
|
|
|
336
333
|
label: astType.label,
|
|
337
334
|
languageIn: [],
|
|
338
335
|
logger: this.logger,
|
|
336
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
339
337
|
reusables: this.reusables,
|
|
338
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
340
339
|
});
|
|
341
340
|
case "bigint":
|
|
342
341
|
return new BigIntType({
|
|
343
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
344
342
|
comment: astType.comment,
|
|
345
343
|
configuration: this.configuration,
|
|
346
344
|
datatype,
|
|
@@ -349,12 +347,13 @@ export class TypeFactory {
|
|
|
349
347
|
label: astType.label,
|
|
350
348
|
languageIn: [],
|
|
351
349
|
logger: this.logger,
|
|
350
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
352
351
|
primitiveIn: astType.in_.map((value) => LiteralDecoder.decodeBigIntLiteral(value).unsafeCoerce()),
|
|
353
352
|
reusables: this.reusables,
|
|
353
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
354
354
|
});
|
|
355
355
|
case "boolean":
|
|
356
356
|
return new BooleanType({
|
|
357
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
358
357
|
comment: astType.comment,
|
|
359
358
|
configuration: this.configuration,
|
|
360
359
|
datatype,
|
|
@@ -363,13 +362,14 @@ export class TypeFactory {
|
|
|
363
362
|
languageIn: [],
|
|
364
363
|
in_: astType.in_,
|
|
365
364
|
logger: this.logger,
|
|
365
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
366
366
|
primitiveIn: astType.in_.map((value) => LiteralDecoder.decodeBooleanLiteral(value).unsafeCoerce()),
|
|
367
367
|
reusables: this.reusables,
|
|
368
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
368
369
|
});
|
|
369
370
|
case "date":
|
|
370
371
|
case "datetime":
|
|
371
372
|
return new (datatypeDefinition.kind === "date" ? DateType : DateTimeType)({
|
|
372
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
373
373
|
comment: astType.comment,
|
|
374
374
|
configuration: this.configuration,
|
|
375
375
|
datatype,
|
|
@@ -378,15 +378,16 @@ export class TypeFactory {
|
|
|
378
378
|
label: astType.label,
|
|
379
379
|
languageIn: [],
|
|
380
380
|
logger: this.logger,
|
|
381
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
381
382
|
primitiveIn: astType.in_.map((value) => (datatypeDefinition.kind === "date"
|
|
382
383
|
? LiteralDecoder.decodeDateLiteral
|
|
383
384
|
: LiteralDecoder.decodeDateTimeLiteral)(value).unsafeCoerce()),
|
|
384
385
|
reusables: this.reusables,
|
|
386
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
385
387
|
});
|
|
386
388
|
case "float":
|
|
387
389
|
case "int":
|
|
388
390
|
return new (datatypeDefinition.kind === "float" ? FloatType : IntType)({
|
|
389
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
390
391
|
comment: astType.comment,
|
|
391
392
|
configuration: this.configuration,
|
|
392
393
|
datatype,
|
|
@@ -395,15 +396,16 @@ export class TypeFactory {
|
|
|
395
396
|
label: astType.label,
|
|
396
397
|
languageIn: [],
|
|
397
398
|
logger: this.logger,
|
|
399
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
398
400
|
primitiveIn: astType.in_.map((value) => (datatypeDefinition.kind === "float"
|
|
399
401
|
? LiteralDecoder.decodeFloatLiteral
|
|
400
402
|
: LiteralDecoder.decodeIntLiteral)(value).unsafeCoerce()),
|
|
401
403
|
reusables: this.reusables,
|
|
404
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
402
405
|
});
|
|
403
406
|
case "string":
|
|
404
407
|
if (!datatype.equals(rdf.langString)) {
|
|
405
408
|
return new StringType({
|
|
406
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
407
409
|
comment: astType.comment,
|
|
408
410
|
configuration: this.configuration,
|
|
409
411
|
datatype,
|
|
@@ -412,8 +414,10 @@ export class TypeFactory {
|
|
|
412
414
|
label: astType.label,
|
|
413
415
|
languageIn: astType.languageIn,
|
|
414
416
|
logger: this.logger,
|
|
417
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
415
418
|
primitiveIn: astType.in_.map((value) => value.value),
|
|
416
419
|
reusables: this.reusables,
|
|
420
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
417
421
|
});
|
|
418
422
|
}
|
|
419
423
|
break;
|
|
@@ -433,7 +437,6 @@ export class TypeFactory {
|
|
|
433
437
|
// // this.logger.debug("literal type has no datatypes");
|
|
434
438
|
// }
|
|
435
439
|
return new LiteralType({
|
|
436
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
437
440
|
comment: astType.comment,
|
|
438
441
|
configuration: this.configuration,
|
|
439
442
|
hasValues: astType.hasValues,
|
|
@@ -441,52 +444,54 @@ export class TypeFactory {
|
|
|
441
444
|
label: astType.label,
|
|
442
445
|
languageIn: astType.languageIn,
|
|
443
446
|
logger: this.logger,
|
|
447
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
444
448
|
reusables: this.reusables,
|
|
449
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
445
450
|
});
|
|
446
451
|
}
|
|
447
|
-
createObjectTypeProperty({
|
|
452
|
+
createObjectTypeProperty({ astStructField, objectType, }) {
|
|
448
453
|
{
|
|
449
|
-
const cachedProperty = this.cachedObjectTypePropertiesByShapeIdentifier.get(
|
|
454
|
+
const cachedProperty = this.cachedObjectTypePropertiesByShapeIdentifier.get(astStructField.shapeIdentifier);
|
|
450
455
|
if (cachedProperty) {
|
|
451
456
|
return cachedProperty;
|
|
452
457
|
}
|
|
453
458
|
}
|
|
454
459
|
const property = new ObjectType.ShaclProperty({
|
|
455
|
-
comment:
|
|
460
|
+
comment: astStructField.comment,
|
|
456
461
|
configuration: this.configuration,
|
|
457
|
-
description:
|
|
458
|
-
display:
|
|
459
|
-
label:
|
|
462
|
+
description: astStructField.description,
|
|
463
|
+
display: astStructField.display,
|
|
464
|
+
label: astStructField.label,
|
|
460
465
|
logger: this.logger,
|
|
461
|
-
mutable:
|
|
466
|
+
mutable: astStructField.mutable,
|
|
467
|
+
name: this.tsName(astStructField.name),
|
|
462
468
|
objectType,
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
recursive: !!astObjectTypeProperty.recursive,
|
|
469
|
+
path: astStructField.path,
|
|
470
|
+
recursive: !!astStructField.recursive,
|
|
466
471
|
reusables: this.reusables,
|
|
467
|
-
type: this.createType(
|
|
472
|
+
type: this.createType(astStructField.type),
|
|
468
473
|
});
|
|
469
|
-
this.cachedObjectTypePropertiesByShapeIdentifier.set(
|
|
474
|
+
this.cachedObjectTypePropertiesByShapeIdentifier.set(astStructField.shapeIdentifier, property);
|
|
470
475
|
return property;
|
|
471
476
|
}
|
|
472
477
|
createOptionType(astType) {
|
|
473
478
|
const itemType = this.createType(astType.itemType);
|
|
474
479
|
invariant(OptionType.isItemType(itemType));
|
|
475
480
|
return new OptionType({
|
|
476
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
477
481
|
comment: astType.comment,
|
|
478
482
|
configuration: this.configuration,
|
|
479
483
|
itemType,
|
|
480
484
|
label: astType.label,
|
|
481
485
|
logger: this.logger,
|
|
486
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
482
487
|
reusables: this.reusables,
|
|
488
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
483
489
|
});
|
|
484
490
|
}
|
|
485
491
|
createSetType(astType) {
|
|
486
492
|
const itemType = this.createType(astType.itemType);
|
|
487
493
|
invariant(SetType.isItemType(itemType));
|
|
488
494
|
return new SetType({
|
|
489
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
490
495
|
comment: astType.comment,
|
|
491
496
|
configuration: this.configuration,
|
|
492
497
|
itemType,
|
|
@@ -494,20 +499,23 @@ export class TypeFactory {
|
|
|
494
499
|
logger: this.logger,
|
|
495
500
|
mutable: astType.mutable,
|
|
496
501
|
minCount: astType.minCount,
|
|
502
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
497
503
|
reusables: this.reusables,
|
|
504
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
498
505
|
});
|
|
499
506
|
}
|
|
500
507
|
createTermType(astType) {
|
|
501
508
|
return new TermType({
|
|
502
|
-
alias: astType.name.map((name) => this.tsName(name)),
|
|
503
509
|
comment: astType.comment,
|
|
504
510
|
configuration: this.configuration,
|
|
505
511
|
hasValues: astType.hasValues,
|
|
506
512
|
in_: astType.in_,
|
|
507
513
|
label: astType.label,
|
|
508
514
|
logger: this.logger,
|
|
515
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
509
516
|
nodeKinds: astType.nodeKinds,
|
|
510
517
|
reusables: this.reusables,
|
|
518
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
511
519
|
});
|
|
512
520
|
}
|
|
513
521
|
tsName(name, options) {
|
|
@@ -26,39 +26,44 @@ export declare class UnionType<MemberTypeT extends Type> extends AbstractType {
|
|
|
26
26
|
get declaration(): Maybe<Code>;
|
|
27
27
|
get discriminantProperty(): Maybe<AbstractType.DiscriminantProperty>;
|
|
28
28
|
get equalsFunction(): Code;
|
|
29
|
+
get expression(): Code;
|
|
29
30
|
get filterFunction(): Code;
|
|
30
31
|
get filterType(): Code;
|
|
32
|
+
get fromRdfResourceValuesFunction(): Code;
|
|
31
33
|
get graphqlType(): AbstractType.GraphqlType;
|
|
32
34
|
get hashFunction(): Code;
|
|
35
|
+
get jsTypes(): AbstractType["jsTypes"];
|
|
33
36
|
get jsonSchemaFunctionDeclaration(): Code;
|
|
34
37
|
get jsonTypeAliasDeclaration(): Code;
|
|
35
38
|
get members(): readonly AbstractUnionType.Member<MemberTypeT>[];
|
|
36
39
|
get mutable(): boolean;
|
|
37
|
-
get
|
|
38
|
-
get
|
|
40
|
+
get referencesNamedType(): boolean;
|
|
41
|
+
get schema(): Code;
|
|
39
42
|
get schemaType(): Code;
|
|
40
43
|
get toRdfResourceValueTypes(): AbstractType["toRdfResourceValueTypes"];
|
|
41
|
-
get typeofs(): AbstractType["typeofs"];
|
|
42
44
|
get valueSparqlConstructTriplesFunction(): Code;
|
|
43
45
|
get valueSparqlWherePatternsFunction(): Code;
|
|
44
|
-
protected get inlineEqualsFunction(): Code;
|
|
45
|
-
protected get inlineFilterFunction(): Code;
|
|
46
|
-
protected get inlineFilterType(): Code;
|
|
47
|
-
protected get inlineFromJsonFunction(): Code;
|
|
48
|
-
protected get inlineFromRdfResourceValuesFunction(): Code;
|
|
49
|
-
protected get inlineHashFunction(): Code;
|
|
50
|
-
protected get inlineJsonSchema(): Code;
|
|
51
|
-
protected get inlineJsonType(): AbstractType.JsonType;
|
|
52
|
-
protected get inlineExpression(): Code;
|
|
53
|
-
protected get inlineToJsonFunction(): Code;
|
|
54
|
-
protected get inlineToRdfResourceValuesFunction(): Code;
|
|
55
|
-
protected get inlineToStringFunction(): Code;
|
|
56
|
-
protected get inlineValueSparqlConstructTriplesFunction(): Code;
|
|
57
|
-
protected get inlineValueSparqlWherePatternsFunction(): Code;
|
|
58
46
|
protected get schemaInitializers(): readonly Code[];
|
|
47
|
+
protected get schemaTypeExpression(): Code;
|
|
59
48
|
protected get staticModuleDeclarations(): Record<string, Code>;
|
|
49
|
+
private get equalsFunctionExpression();
|
|
50
|
+
private get filterFunctionExpression();
|
|
51
|
+
private get filterTypeLiteral();
|
|
52
|
+
private get fromJsonFunctionExpression();
|
|
53
|
+
private get fromRdfResourceValuesFunctionExpression();
|
|
54
|
+
private get hashFunctionExpression();
|
|
55
|
+
/**
|
|
56
|
+
* An inline expression of this type rather than a type reference/name.
|
|
57
|
+
*/
|
|
58
|
+
private get inlineExpression();
|
|
59
|
+
private get jsonSchemaExpression();
|
|
60
|
+
private get jsonTypeLiteral();
|
|
61
|
+
private get toJsonFunctionExpression();
|
|
62
|
+
private get toRdfResourceValuesFunctionExpression();
|
|
63
|
+
private get toStringFunctionExpression();
|
|
64
|
+
private get valueSparqlConstructTriplesFunctionExpression();
|
|
65
|
+
private get valueSparqlWherePatternsFunctionExpression();
|
|
60
66
|
fromJsonExpression({ variables, }: Parameters<AbstractType["fromJsonExpression"]>[0]): Code;
|
|
61
|
-
fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["fromRdfResourceValuesExpression"]>[0]): Code;
|
|
62
67
|
graphqlResolveExpression({ variables, }: {
|
|
63
68
|
variables: {
|
|
64
69
|
value: Code;
|
|
@@ -84,17 +89,14 @@ type HybridDiscriminant = {
|
|
|
84
89
|
readonly kind: "Hybrid";
|
|
85
90
|
readonly memberValues: readonly {
|
|
86
91
|
readonly kind: "Extrinsic" | "Intrinsic";
|
|
87
|
-
readonly
|
|
92
|
+
readonly values: readonly AbstractType.DiscriminantProperty.Value[];
|
|
88
93
|
}[];
|
|
89
94
|
readonly name: string;
|
|
90
95
|
};
|
|
91
96
|
type IntrinsicDiscriminant = {
|
|
92
97
|
readonly jsonName: string;
|
|
93
98
|
readonly kind: "Intrinsic";
|
|
94
|
-
readonly memberValues: readonly
|
|
95
|
-
readonly descendantValues: readonly AbstractType.DiscriminantProperty.Value[];
|
|
96
|
-
readonly ownValues: readonly AbstractType.DiscriminantProperty.Value[];
|
|
97
|
-
}[];
|
|
99
|
+
readonly memberValues: readonly AbstractType.DiscriminantProperty.Value[];
|
|
98
100
|
readonly name: string;
|
|
99
101
|
};
|
|
100
102
|
type TypeofDiscriminant = {
|