@shaclmate/compiler 4.0.93 → 4.0.95
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/Eithers.d.ts +2 -1
- package/dist/Eithers.js +15 -0
- package/dist/ShapesGraphToAstTransformer.js +10 -0
- package/dist/_ShapesGraphToAstTransformer/ShapeStack.d.ts +2 -2
- package/dist/_ShapesGraphToAstTransformer/ShapeStack.js +2 -1
- package/dist/_ShapesGraphToAstTransformer/isNodeShape.d.ts +3 -0
- package/dist/_ShapesGraphToAstTransformer/isNodeShape.js +4 -0
- package/dist/_ShapesGraphToAstTransformer/isPropertyShape.d.ts +3 -0
- package/dist/_ShapesGraphToAstTransformer/isPropertyShape.js +4 -0
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.d.ts +2 -1
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +4 -3
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +7 -3
- package/dist/_ShapesGraphToAstTransformer/shapeOntology.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.js +34 -16
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +3 -2
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +3 -3
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstStructType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstStructType.js +86 -65
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +1 -1
- package/dist/ast/AbstractCollectionType.d.ts +2 -2
- package/dist/ast/AbstractConstruct.d.ts +25 -0
- package/dist/ast/AbstractConstruct.js +38 -0
- package/dist/ast/AbstractContainerType.d.ts +2 -2
- package/dist/ast/AbstractLazyType.d.ts +14 -36
- package/dist/ast/AbstractTermType.d.ts +2 -2
- package/dist/ast/AbstractType.d.ts +7 -17
- package/dist/ast/AbstractType.js +6 -22
- package/dist/ast/Ast.d.ts +2 -0
- package/dist/ast/DefaultValueType.d.ts +2 -2
- package/dist/ast/DiscriminatedUnionType.d.ts +2 -2
- package/dist/ast/DiscriminatedUnionType.js +3 -1
- package/dist/ast/LiteralType.d.ts +2 -2
- package/dist/ast/Operation.d.ts +67 -0
- package/dist/ast/Operation.js +32 -0
- package/dist/ast/Service.d.ts +17 -0
- package/dist/ast/Service.js +17 -0
- package/dist/ast/SetType.d.ts +2 -2
- package/dist/ast/StructCompoundType.d.ts +1 -1
- package/dist/ast/StructCompoundType.js +5 -5
- package/dist/ast/StructType.d.ts +64 -32
- package/dist/ast/StructType.js +62 -29
- package/dist/ast/index.d.ts +2 -0
- package/dist/ast/index.js +2 -0
- package/dist/generators/transformAstToLabeledPropertyGraph.js +13 -10
- package/dist/generators/ts/AbstractCallable.d.ts +20 -0
- package/dist/generators/ts/AbstractCallable.js +9 -0
- package/dist/generators/ts/AbstractCollectionType.d.ts +7 -9
- package/dist/generators/ts/AbstractCollectionType.js +11 -11
- package/dist/generators/ts/AbstractCompoundType.d.ts +18 -0
- package/dist/generators/ts/AbstractCompoundType.js +33 -0
- package/dist/generators/ts/AbstractConstruct.d.ts +31 -0
- package/dist/generators/ts/AbstractConstruct.js +31 -0
- package/dist/generators/ts/AbstractContainerType.d.ts +7 -4
- package/dist/generators/ts/AbstractContainerType.js +5 -2
- package/dist/generators/ts/AbstractDateType.d.ts +8 -5
- package/dist/generators/ts/AbstractDateType.js +22 -8
- package/dist/generators/ts/AbstractDiscriminatedUnionType.d.ts +43 -45
- package/dist/generators/ts/AbstractDiscriminatedUnionType.js +100 -258
- package/dist/generators/ts/AbstractIdentifierType.d.ts +8 -3
- package/dist/generators/ts/AbstractIdentifierType.js +34 -5
- package/dist/generators/ts/AbstractIntersectionType.d.ts +48 -0
- package/dist/generators/ts/AbstractIntersectionType.js +80 -0
- package/dist/generators/ts/AbstractLazyType.d.ts +28 -17
- package/dist/generators/ts/AbstractLazyType.js +61 -23
- package/dist/generators/ts/AbstractLiteralType.d.ts +2 -2
- package/dist/generators/ts/AbstractLiteralType.js +15 -1
- package/dist/generators/ts/AbstractNumericType.d.ts +5 -4
- package/dist/generators/ts/AbstractNumericType.js +4 -6
- package/dist/generators/ts/AbstractObjectSetType.d.ts +5 -6
- package/dist/generators/ts/AbstractObjectSetType.js +10 -13
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +7 -7
- package/dist/generators/ts/AbstractPrimitiveType.js +18 -36
- package/dist/generators/ts/AbstractStructuredType.d.ts +71 -0
- package/dist/generators/ts/AbstractStructuredType.js +273 -0
- package/dist/generators/ts/AbstractTermType.d.ts +8 -10
- package/dist/generators/ts/AbstractTermType.js +6 -18
- package/dist/generators/ts/AbstractType.d.ts +54 -78
- package/dist/generators/ts/AbstractType.js +25 -29
- package/dist/generators/ts/AbstractTypedLiteralType.d.ts +5 -4
- package/dist/generators/ts/AbstractTypedLiteralType.js +14 -3
- package/dist/generators/ts/BigDecimalType.d.ts +15 -13
- package/dist/generators/ts/BigDecimalType.js +13 -29
- package/dist/generators/ts/BigIntType.d.ts +10 -8
- package/dist/generators/ts/BigIntType.js +26 -51
- package/dist/generators/ts/BlankNodeType.d.ts +12 -12
- package/dist/generators/ts/BlankNodeType.js +9 -35
- package/dist/generators/ts/BooleanType.d.ts +12 -6
- package/dist/generators/ts/BooleanType.js +21 -11
- package/dist/generators/ts/Callable.d.ts +5 -0
- package/dist/generators/ts/Callable.js +2 -0
- package/dist/generators/ts/CodeThunk.d.ts +6 -0
- package/dist/generators/ts/CodeThunk.js +8 -0
- package/dist/generators/ts/DateTimeType.d.ts +7 -4
- package/dist/generators/ts/DateTimeType.js +8 -21
- package/dist/generators/ts/DateType.d.ts +7 -4
- package/dist/generators/ts/DateType.js +8 -21
- package/dist/generators/ts/DeclaredCallable.d.ts +23 -0
- package/dist/generators/ts/DeclaredCallable.js +59 -0
- package/dist/generators/ts/DefaultValueType.d.ts +24 -23
- package/dist/generators/ts/DefaultValueType.js +29 -59
- package/dist/generators/ts/FloatType.d.ts +7 -2
- package/dist/generators/ts/FloatType.js +16 -6
- package/dist/generators/ts/GraphqlSchema.js +1 -1
- package/dist/generators/ts/IdentifierType.d.ts +13 -13
- package/dist/generators/ts/IdentifierType.js +10 -39
- package/dist/generators/ts/Imports.d.ts +8 -0
- package/dist/generators/ts/Imports.js +15 -7
- package/dist/generators/ts/InlineCallable.d.ts +18 -0
- package/dist/generators/ts/InlineCallable.js +51 -0
- package/dist/generators/ts/IntType.d.ts +6 -1
- package/dist/generators/ts/IntType.js +16 -1
- package/dist/generators/ts/IriType.d.ts +12 -8
- package/dist/generators/ts/IriType.js +56 -43
- package/dist/generators/ts/LangStringType.d.ts +12 -7
- package/dist/generators/ts/LangStringType.js +37 -20
- package/dist/generators/ts/LazyOptionType.d.ts +10 -24
- package/dist/generators/ts/LazyOptionType.js +5 -26
- package/dist/generators/ts/LazySetType.d.ts +7 -2
- package/dist/generators/ts/LazySetType.js +5 -25
- package/dist/generators/ts/LazyType.d.ts +7 -2
- package/dist/generators/ts/LazyType.js +5 -21
- package/dist/generators/ts/ListType.d.ts +12 -7
- package/dist/generators/ts/ListType.js +45 -22
- package/dist/generators/ts/LiteralType.d.ts +11 -7
- package/dist/generators/ts/LiteralType.js +31 -21
- package/dist/generators/ts/ObjectDiscriminatedUnionType.d.ts +19 -2
- package/dist/generators/ts/ObjectDiscriminatedUnionType.js +105 -41
- package/dist/generators/ts/ObjectIntersectionType.d.ts +44 -0
- package/dist/generators/ts/ObjectIntersectionType.js +204 -0
- package/dist/generators/ts/ObjectSetType.js +0 -1
- package/dist/generators/ts/ObjectType.d.ts +78 -49
- package/dist/generators/ts/ObjectType.js +235 -362
- package/dist/generators/ts/Operation.d.ts +54 -0
- package/dist/generators/ts/Operation.js +206 -0
- package/dist/generators/ts/OptionType.d.ts +15 -13
- package/dist/generators/ts/OptionType.js +43 -33
- package/dist/generators/ts/RdfjsDatasetObjectSetType.js +14 -7
- package/dist/generators/ts/ReferenceCallable.d.ts +14 -0
- package/dist/generators/ts/ReferenceCallable.js +16 -0
- package/dist/generators/ts/Service.d.ts +15 -0
- package/dist/generators/ts/Service.js +53 -0
- package/dist/generators/ts/SetType.d.ts +11 -8
- package/dist/generators/ts/SetType.js +35 -35
- package/dist/generators/ts/SnippetFactory.d.ts +1 -1
- package/dist/generators/ts/Snippets.d.ts +80 -2
- package/dist/generators/ts/Snippets.js +622 -74
- package/dist/generators/ts/SparqlObjectSetType.js +1 -4
- package/dist/generators/ts/StringType.d.ts +10 -5
- package/dist/generators/ts/StringType.js +25 -17
- package/dist/generators/ts/TermType.d.ts +13 -7
- package/dist/generators/ts/TermType.js +61 -71
- package/dist/generators/ts/TsFeature.d.ts +4 -1
- package/dist/generators/ts/TsFeature.js +51 -0
- package/dist/generators/ts/TsGenerator.d.ts +2 -1
- package/dist/generators/ts/TsGenerator.js +98 -54
- package/dist/generators/ts/Type.d.ts +2 -1
- package/dist/generators/ts/TypeFactory.d.ts +10 -7
- package/dist/generators/ts/TypeFactory.js +193 -140
- package/dist/generators/ts/UberObjectDiscriminatedUnionType.d.ts +6 -2
- package/dist/generators/ts/UberObjectDiscriminatedUnionType.js +18 -12
- package/dist/generators/ts/ZodGenerator.js +6 -14
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_Discriminant.d.ts +3 -6
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_conversionFunctionExpression.d.ts → AbstractDiscriminatedUnionType_conversionFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_conversionFunctionExpression.js → AbstractDiscriminatedUnionType_conversionFunction.js} +2 -2
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_equalsFunctionExpression.d.ts → AbstractDiscriminatedUnionType_equalsFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_equalsFunctionExpression.js → AbstractDiscriminatedUnionType_equalsFunction.js} +4 -4
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_filterFunctionExpression.d.ts → AbstractDiscriminatedUnionType_filterFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_filterFunctionExpression.js → AbstractDiscriminatedUnionType_filterFunction.js} +7 -8
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_filterTypeExpression.js +1 -2
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.js +18 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_fromRdfResourceValuesFunctionExpression.d.ts → AbstractDiscriminatedUnionType_fromRdfResourceValuesFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromRdfResourceValuesFunction.js +57 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_hashFunctionExpression.d.ts → AbstractDiscriminatedUnionType_hashFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_hashFunctionExpression.js → AbstractDiscriminatedUnionType_hashFunction.js} +4 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_inferDiscriminant.js +6 -9
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_inlineExpression.js +5 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonObjectFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonObjectFunction.js +16 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toLoggableFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toLoggableFunction.js +20 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_toRdfResourceValuesFunctionExpression.d.ts → AbstractDiscriminatedUnionType_toRdfResourceValuesFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toRdfResourceValuesFunction.js +18 -0
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_toStringFunctionExpression.d.ts → AbstractDiscriminatedUnionType_toStringFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_toStringFunctionExpression.js → AbstractDiscriminatedUnionType_toStringFunction.js} +3 -3
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunctionExpression.d.ts → AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunctionExpression.js → AbstractDiscriminatedUnionType_valueSparqlConstructTriplesFunction.js} +4 -4
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunctionExpression.d.ts → AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunction.d.ts} +1 -1
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/{AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunctionExpression.js → AbstractDiscriminatedUnionType_valueSparqlWherePatternsFunction.js} +4 -4
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_equalsFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_equalsFunction.js +7 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_filterFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_filterFunction.js +7 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_hashFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_hashFunction.js +8 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toLoggableFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toLoggableFunction.js +14 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toStringFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_toStringFunction.js +17 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlConstructTriplesFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlConstructTriplesFunction.js +13 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlWherePatternsFunction.d.ts +5 -0
- package/dist/generators/ts/_AbstractIntersectionType/AbstractIntersectionType_valueSparqlWherePatternsFunction.js +13 -0
- package/dist/generators/ts/_AbstractType/AbstractType_DiscriminatedType.d.ts +9 -0
- package/dist/generators/ts/_AbstractType/AbstractType_DiscriminatedType.js +2 -0
- package/dist/generators/ts/_AbstractType/AbstractType_JsonType.d.ts +196 -11
- package/dist/generators/ts/_AbstractType/AbstractType_JsonType.js +411 -17
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunction.js +12 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.js +32 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_fromRdfResourceFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_fromRdfResourceFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_fromRdfResourceFunction.js +16 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_graphqlTypeVariableStatement.d.ts → ObjectDiscriminatedUnionType_graphqlTypeExpression.d.ts} +2 -2
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_graphqlTypeExpression.js +11 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_schemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_schemaVariableStatement.js → ObjectDiscriminatedUnionType_schemaExpression.js} +3 -8
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_toRdfResourceFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_toRdfResourceFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_toRdfResourceFunction.js +17 -0
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/{ObjectDiscriminatedUnionType_typeGuardFunctionDeclaration.d.ts → ObjectDiscriminatedUnionType_typeGuardFunction.d.ts} +4 -3
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_typeGuardFunction.js +14 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__fromRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__fromRdfResourceFunction.js +16 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__toRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType__toRdfResourceFunction.js +18 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunction.js +30 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunctionParameters.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createFunctionParameters.js +25 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createUnsafeFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_createUnsafeFunction.js +10 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlConstructTriplesFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlConstructTriplesFunction.js +19 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlWherePatternsFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_focusSparqlWherePatternsFunction.js +19 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromJsonObjectFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromJsonObjectFunction.js +15 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceFunction.js +9 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.js +8 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toJsonObjectFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toJsonObjectFunction.js +7 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceFunction.js +12 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceValuesFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_toRdfResourceValuesFunction.js +5 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_typeGuardFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_typeGuardFunction.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.d.ts +37 -23
- package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.js +19 -1
- package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.d.ts +15 -15
- package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.js +22 -56
- package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.d.ts +9 -10
- package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.js +40 -49
- package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.d.ts +8 -9
- package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.js +47 -14
- package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.d.ts +10 -10
- package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.js +41 -57
- package/dist/generators/ts/_ObjectType/ObjectType__fromRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfResourceFunctionExpression.js → ObjectType__fromRdfResourceFunction.js} +14 -11
- package/dist/generators/ts/_ObjectType/ObjectType__toRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType__toRdfResourceFunction.js +32 -0
- package/dist/generators/ts/_ObjectType/ObjectType_conversionFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_conversionFunction.js +28 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunction.js +31 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionParameters.d.ts +3 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionParameters.js +29 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createUnsafeFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createUnsafeFunction.js +10 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionExpression.d.ts → ObjectType_equalsFunction.d.ts} +2 -1
- package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionExpression.js → ObjectType_equalsFunction.js} +6 -4
- package/dist/generators/ts/_ObjectType/{ObjectType_filterFunctionExpression.d.ts → ObjectType_filterFunction.d.ts} +2 -1
- package/dist/generators/ts/_ObjectType/{ObjectType_filterFunctionExpression.js → ObjectType_filterFunction.js} +5 -2
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts → ObjectType_focusSparqlConstructTriplesFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionExpression.js → ObjectType_focusSparqlConstructTriplesFunction.js} +11 -4
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts → ObjectType_focusSparqlWherePatternsFunction.d.ts} +3 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionExpression.js → ObjectType_focusSparqlWherePatternsFunction.js} +11 -4
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonObjectFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonObjectFunction.js +19 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunction.js +9 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.js +8 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_hashFunctionExpression.d.ts → ObjectType_hashFunction.d.ts} +2 -1
- package/dist/generators/ts/_ObjectType/{ObjectType_hashFunctionExpression.js → ObjectType_hashFunction.js} +10 -14
- package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.d.ts +6 -2
- package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.js +1 -2
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunction.d.ts +20 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunction.js +39 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → ObjectType_sparqlConstructQueryStringFunction.d.ts} +11 -4
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunction.js +11 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonObjectFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonObjectFunction.js +16 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toLoggableFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toLoggableFunction.js +11 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunction.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceValuesFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceValuesFunction.js +8 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_toStringFunctionExpression.d.ts → ObjectType_toStringFunction.d.ts} +2 -1
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunction.js +10 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunction.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunction.js +17 -0
- package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunction.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunction.js +18 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts → ObjectType_valueSparqlConstructTriplesFunction.d.ts} +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunction.js +7 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts → ObjectType_valueSparqlWherePatternsFunction.d.ts} +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunction.js +9 -0
- package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_DateSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_FilterFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_FilterFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_FromJsonObjectFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_FromJsonObjectFunction.js +21 -0
- package/dist/generators/ts/_snippets/snippets_FromJsonValueFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_FromJsonValueFunction.js +21 -0
- package/dist/generators/ts/_snippets/snippets_HashFunction.js +1 -1
- package/dist/generators/ts/_snippets/snippets_Hasher.js +1 -1
- package/dist/generators/ts/_snippets/snippets_IdentifierJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_IdentifierJsonObject.js +12 -0
- package/dist/generators/ts/_snippets/snippets_LangStringJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LangStringJsonObject.js +14 -0
- package/dist/generators/ts/_snippets/snippets_Lazy.js +8 -1
- package/dist/generators/ts/_snippets/snippets_LazyOption.js +17 -1
- package/dist/generators/ts/_snippets/snippets_LazySet.js +8 -1
- package/dist/generators/ts/_snippets/snippets_LiteralJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LiteralJsonObject.js +16 -0
- package/dist/generators/ts/_snippets/snippets_NumericSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_ObjectTypeGuardFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ObjectTypeGuardFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_Primitive.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_Primitive.js +4 -0
- package/dist/generators/ts/_snippets/snippets_ProblemDetailsJson.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ProblemDetailsJson.js +41 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +11 -6
- package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryFunction.js +12 -0
- package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryStringFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_SparqlConstructQueryStringFunction.js +13 -0
- package/dist/generators/ts/_snippets/snippets_StringSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_TermJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_TermJsonObject.js +8 -0
- package/dist/generators/ts/_snippets/snippets_ToJsonObjectFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToJsonObjectFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_ToJsonValueFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToJsonValueFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_ToLoggableFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToLoggableFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_ToRdfResourceFunction.js +1 -1
- package/dist/generators/ts/_snippets/snippets_ToStringFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToStringFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_ToStringRecordFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ToStringRecordFunction.js +3 -0
- package/dist/generators/ts/_snippets/snippets_TypedLiteralJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_TypedLiteralJsonObject.js +14 -0
- package/dist/generators/ts/_snippets/snippets__ToRdfResourceFunction.js +1 -1
- package/dist/generators/ts/_snippets/snippets_arrayFromJsonArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_arrayFromJsonArray.js +13 -0
- package/dist/generators/ts/_snippets/snippets_arrayToJsonArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_arrayToJsonArray.js +6 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.js +3 -3
- package/dist/generators/ts/_snippets/snippets_bigDecimalLiteral.js +3 -2
- package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromJsonString.js +8 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.js +2 -2
- package/dist/generators/ts/_snippets/snippets_bigIntToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_bigIntToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.js +2 -3
- package/dist/generators/ts/_snippets/snippets_blankNodeToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeToJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromJsonBoolean.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromJsonBoolean.js +6 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_constrainPrimitive.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_constrainPrimitive.js +12 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.js +2 -13
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +2 -13
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +2 -15
- package/dist/generators/ts/_snippets/snippets_dateFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_dateFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateFromJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +3 -4
- package/dist/generators/ts/_snippets/snippets_dateSparqlWherePatterns.js +7 -6
- package/dist/generators/ts/_snippets/snippets_dateTimeFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.js +3 -4
- package/dist/generators/ts/_snippets/snippets_dateTimeToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_dateToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_dateToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromJsonValue.js +9 -0
- package/dist/generators/ts/_snippets/snippets_errorToProblemDetailsJson.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_errorToProblemDetailsJson.js +27 -0
- package/dist/generators/ts/_snippets/snippets_filterBigDecimal.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterBlankNode.js +1 -3
- package/dist/generators/ts/_snippets/snippets_filterBoolean.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterDate.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterIdentifier.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterIri.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterLiteral.js +1 -3
- package/dist/generators/ts/_snippets/snippets_filterString.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterTerm.js +17 -17
- package/dist/generators/ts/_snippets/snippets_floatFromJsonNumber.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_floatFromJsonNumber.js +6 -0
- package/dist/generators/ts/_snippets/snippets_floatFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_floatFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_hashArray.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashBigDecimal.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashBoolean.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashDate.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashDateTime.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashMaybe.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashNumeric.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashString.js +1 -2
- package/dist/generators/ts/_snippets/snippets_hashTerm.js +1 -2
- package/dist/generators/ts/_snippets/snippets_identifierFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.js +2 -3
- package/dist/generators/ts/_snippets/snippets_identifierToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierToJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_identifierToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierToJsonString.js +5 -0
- package/dist/generators/ts/_snippets/snippets_intFromJsonNumber.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_intFromJsonNumber.js +6 -0
- package/dist/generators/ts/_snippets/snippets_intFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_intFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_iriFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriFromJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriFromJsonString.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriToJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriToJsonString.js +6 -0
- package/dist/generators/ts/_snippets/snippets_langStringFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_langStringFromJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_langStringFromRdfResourceValues.js +2 -3
- package/dist/generators/ts/_snippets/snippets_langStringToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_langStringToJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_listFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listFromJsonObject.js +10 -0
- package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +6 -5
- package/dist/generators/ts/_snippets/snippets_listToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_literalFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalFromJsonObject.js +16 -0
- package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.js +2 -3
- package/dist/generators/ts/_snippets/snippets_literalToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalToJsonObject.js +15 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromJsonObject.js +12 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromJsonValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromJsonValue.js +12 -0
- package/dist/generators/ts/_snippets/snippets_maybeToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_maybeToJsonValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeToJsonValue.js +6 -0
- package/dist/generators/ts/_snippets/snippets_missingResolver.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_missingResolver.js +3 -0
- package/dist/generators/ts/_snippets/snippets_primitiveToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_primitiveToJsonObject.js +6 -0
- package/dist/generators/ts/_snippets/snippets_primitiveToJsonValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_primitiveToJsonValue.js +6 -0
- package/dist/generators/ts/_snippets/snippets_sparqlInstancesOfPattern.js +4 -3
- package/dist/generators/ts/_snippets/snippets_stringFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_stringFromJsonObject.js +9 -0
- package/dist/generators/ts/_snippets/snippets_stringFromJsonString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_stringFromJsonString.js +6 -0
- package/dist/generators/ts/_snippets/snippets_termFromJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termFromJsonObject.js +31 -0
- package/dist/generators/ts/_snippets/snippets_termToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termToJsonObject.js +14 -0
- package/dist/generators/ts/_snippets/snippets_typedLiteralToJsonObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_typedLiteralToJsonObject.js +5 -0
- package/dist/generators/ts/_snippets/snippets_wrap_ToRdfResourceFunction.js +23 -3
- package/dist/generators/ts/_snippets/snippets_zValidator.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_zValidator.js +16 -0
- package/dist/generators/ts/rdfjsTermExpression.d.ts +1 -1
- package/dist/generators/ts/rdfjsTermExpression.js +5 -54
- package/dist/input/ShapesGraph.d.ts +7 -3
- package/dist/input/ShapesGraph.js +74 -3
- package/dist/input/index.d.ts +3 -1
- package/dist/input/index.js +1 -1
- package/dist/input/input.shaclmate.d.ts +1507 -253
- package/dist/input/input.shaclmate.js +1226 -402
- package/dist/input/input.shaclmate.ttl +245 -0
- package/package.json +331 -98
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonFunctionExpression.d.ts +0 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonFunctionExpression.js +0 -14
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromRdfResourceValuesFunctionExpression.js +0 -22
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonSchemaExpression.d.ts +0 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonSchemaExpression.js +0 -32
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonTypeLiteral.d.ts +0 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_jsonTypeLiteral.js +0 -26
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonFunctionExpression.d.ts +0 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toJsonFunctionExpression.js +0 -10
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_toRdfResourceValuesFunctionExpression.js +0 -30
- package/dist/generators/ts/_AbstractType/AbstractType_DiscriminantProperty.d.ts +0 -9
- package/dist/generators/ts/_AbstractType/AbstractType_DiscriminantProperty.js +0 -2
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlConstructTriplesFunctionDeclaration.js +0 -13
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunctionDeclaration.js +0 -32
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_fromRdfResourceFunctionDeclaration.js +0 -17
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_graphqlTypeVariableStatement.js +0 -16
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_identifierTypeDeclarations.js +0 -14
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_schemaVariableStatement.d.ts +0 -4
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_toRdfResourceFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_typeGuardFunctionDeclaration.js +0 -16
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +0 -29
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +0 -12
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +0 -10
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.js +0 -22
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +0 -17
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +0 -10
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +0 -35
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -8
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.js +0 -12
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.js +0 -26
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.js +0 -7
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.js +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunctionExpression.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_typeGuardFunctionExpression.js +0 -14
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +0 -8
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +0 -10
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +0 -42
|
@@ -6,6 +6,7 @@ import { Maybe } from "purify-ts";
|
|
|
6
6
|
import reservedTsIdentifiers_ from "reserved-identifiers";
|
|
7
7
|
import { invariant } from "ts-invariant";
|
|
8
8
|
import * as ast from "../../ast/index.js";
|
|
9
|
+
import { AbstractType_JsonTypeFactory } from "./_AbstractType/AbstractType_JsonType.js";
|
|
9
10
|
import { BigDecimalType } from "./BigDecimalType.js";
|
|
10
11
|
import { BigIntType } from "./BigIntType.js";
|
|
11
12
|
import { BlankNodeType } from "./BlankNodeType.js";
|
|
@@ -25,6 +26,7 @@ import { LazyType } from "./LazyType.js";
|
|
|
25
26
|
import { ListType } from "./ListType.js";
|
|
26
27
|
import { LiteralType } from "./LiteralType.js";
|
|
27
28
|
import { ObjectDiscriminatedUnionType } from "./ObjectDiscriminatedUnionType.js";
|
|
29
|
+
import { ObjectIntersectionType } from "./ObjectIntersectionType.js";
|
|
28
30
|
import { ObjectType } from "./ObjectType.js";
|
|
29
31
|
import { OptionType } from "./OptionType.js";
|
|
30
32
|
import { SetType } from "./SetType.js";
|
|
@@ -32,48 +34,180 @@ import { StringType } from "./StringType.js";
|
|
|
32
34
|
import { TermType } from "./TermType.js";
|
|
33
35
|
export class TypeFactory {
|
|
34
36
|
configuration;
|
|
37
|
+
constructorParameters;
|
|
38
|
+
jsonTypeFactory;
|
|
35
39
|
logger;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
cachedObjectTypePropertiesByShapeIdentifier = new TermMap();
|
|
39
|
-
cachedObjectTypesByShapeIdentifier = new TermMap();
|
|
40
|
+
cachedObjectTypeShaclPropertiesByShapeIdentifier = new TermMap();
|
|
41
|
+
cachedTypesByShapeIdentifier = new TermMap();
|
|
40
42
|
constructor({ configuration, logger, reusables, }) {
|
|
41
43
|
this.configuration = configuration;
|
|
44
|
+
this.jsonTypeFactory = new AbstractType_JsonTypeFactory({
|
|
45
|
+
configuration,
|
|
46
|
+
reusables,
|
|
47
|
+
});
|
|
42
48
|
this.logger = logger;
|
|
43
|
-
this.
|
|
49
|
+
this.constructorParameters = {
|
|
50
|
+
configuration,
|
|
51
|
+
logger,
|
|
52
|
+
jsonTypeFactory: this.jsonTypeFactory,
|
|
53
|
+
reusables,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
createDiscriminatedUnionType(astType) {
|
|
57
|
+
if (astType.isStructDiscriminatedUnionType()) {
|
|
58
|
+
return this.createObjectDiscriminatedUnionType(astType);
|
|
59
|
+
}
|
|
60
|
+
return new DiscriminatedUnionType({
|
|
61
|
+
...this.constructorParameters,
|
|
62
|
+
comment: astType.comment,
|
|
63
|
+
identifierProperty: Maybe.empty(),
|
|
64
|
+
label: astType.label,
|
|
65
|
+
members: astType.members.map((member) => ({
|
|
66
|
+
discriminantValue: member.discriminantValue,
|
|
67
|
+
type: this.createType(member.type),
|
|
68
|
+
})),
|
|
69
|
+
name: astType.name.map((name) => this.tsName(name)),
|
|
70
|
+
recursive: astType.recursive,
|
|
71
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
72
|
+
synthetic: astType.synthetic,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
createIntersectionType(astType) {
|
|
76
|
+
if (astType.isStructIntersectionType()) {
|
|
77
|
+
return this.createObjectIntersectionType(astType);
|
|
78
|
+
}
|
|
79
|
+
throw new Error("non-object intersection types are unsupported");
|
|
80
|
+
}
|
|
81
|
+
createObjectDiscriminatedUnionType(astType) {
|
|
82
|
+
{
|
|
83
|
+
const cachedType = this.cachedTypesByShapeIdentifier.get(astType.shapeIdentifier);
|
|
84
|
+
if (cachedType) {
|
|
85
|
+
invariant(cachedType.kind === "ObjectDiscriminatedUnion", cachedType.kind);
|
|
86
|
+
return cachedType;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const objectDiscriminatedUnionIdentifierType = this.createIdentifierType(ast.StructCompoundType.identifierType(astType));
|
|
90
|
+
const objectDiscriminatedUnionTypeName = astType.name.map((name) => this.tsName(name));
|
|
91
|
+
const objectDiscriminatedUnionType = new ObjectDiscriminatedUnionType({
|
|
92
|
+
...this.constructorParameters,
|
|
93
|
+
comment: astType.comment,
|
|
94
|
+
identifierProperty: astType.isStructDiscriminatedUnionType() &&
|
|
95
|
+
astType.members.every((member) => {
|
|
96
|
+
switch (member.type.kind) {
|
|
97
|
+
case "DiscriminatedUnion":
|
|
98
|
+
return member.type.members.every((member) => member.type.identifierField.isJust());
|
|
99
|
+
case "Struct":
|
|
100
|
+
return member.type.identifierField.isJust();
|
|
101
|
+
default:
|
|
102
|
+
member.type;
|
|
103
|
+
throw new Error("should never reach this point");
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
? Maybe.of(new ObjectType.IdentifierProperty({
|
|
107
|
+
...this.constructorParameters,
|
|
108
|
+
name: `${this.configuration.syntheticNamePrefix}identifier`,
|
|
109
|
+
objectType: { name: objectDiscriminatedUnionTypeName },
|
|
110
|
+
type: objectDiscriminatedUnionIdentifierType,
|
|
111
|
+
}))
|
|
112
|
+
: Maybe.empty(),
|
|
113
|
+
identifierType: objectDiscriminatedUnionIdentifierType,
|
|
114
|
+
label: astType.label,
|
|
115
|
+
members: ast.StructCompoundType.memberStructTypes(astType).map((astStructType) => ({
|
|
116
|
+
discriminantValue: Maybe.empty(),
|
|
117
|
+
type: this.createObjectType(astStructType),
|
|
118
|
+
})),
|
|
119
|
+
name: objectDiscriminatedUnionTypeName,
|
|
120
|
+
recursive: astType.recursive,
|
|
121
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
122
|
+
synthetic: astType.synthetic,
|
|
123
|
+
});
|
|
124
|
+
this.cachedTypesByShapeIdentifier.set(astType.shapeIdentifier, objectDiscriminatedUnionType);
|
|
125
|
+
return objectDiscriminatedUnionType;
|
|
126
|
+
}
|
|
127
|
+
createObjectIntersectionType(astType) {
|
|
128
|
+
{
|
|
129
|
+
const cachedType = this.cachedTypesByShapeIdentifier.get(astType.shapeIdentifier);
|
|
130
|
+
if (cachedType) {
|
|
131
|
+
invariant(cachedType.kind === "ObjectIntersection", cachedType.kind);
|
|
132
|
+
return cachedType;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
const objectIntersectionIdentifierType = this.createIdentifierType(ast.StructCompoundType.identifierType(astType));
|
|
136
|
+
const objectIntersectionTypeName = astType.name.map((name) => this.tsName(name));
|
|
137
|
+
const objectIntersectionType = new ObjectIntersectionType({
|
|
138
|
+
...this.constructorParameters,
|
|
139
|
+
comment: astType.comment,
|
|
140
|
+
identifierProperty: astType.isStructIntersectionType() &&
|
|
141
|
+
astType.members.every((member) => {
|
|
142
|
+
switch (member.type.kind) {
|
|
143
|
+
case "Intersection":
|
|
144
|
+
return member.type.members.every((member) => member.type.identifierField.isJust());
|
|
145
|
+
case "Struct":
|
|
146
|
+
return member.type.identifierField.isJust();
|
|
147
|
+
default:
|
|
148
|
+
member.type;
|
|
149
|
+
throw new Error("should never reach this point");
|
|
150
|
+
}
|
|
151
|
+
})
|
|
152
|
+
? Maybe.of(new ObjectType.IdentifierProperty({
|
|
153
|
+
...this.constructorParameters,
|
|
154
|
+
name: `${this.configuration.syntheticNamePrefix}identifier`,
|
|
155
|
+
objectType: { name: objectIntersectionTypeName },
|
|
156
|
+
type: objectIntersectionIdentifierType,
|
|
157
|
+
}))
|
|
158
|
+
: Maybe.empty(),
|
|
159
|
+
identifierType: objectIntersectionIdentifierType,
|
|
160
|
+
label: astType.label,
|
|
161
|
+
members: ast.StructCompoundType.memberStructTypes(astType).map((astStructType) => ({
|
|
162
|
+
type: this.createObjectType(astStructType),
|
|
163
|
+
})),
|
|
164
|
+
name: objectIntersectionTypeName,
|
|
165
|
+
recursive: astType.recursive,
|
|
166
|
+
shapeIdentifier: astType.shapeIdentifier,
|
|
167
|
+
synthetic: astType.synthetic,
|
|
168
|
+
});
|
|
169
|
+
this.cachedTypesByShapeIdentifier.set(astType.shapeIdentifier, objectIntersectionType);
|
|
170
|
+
return objectIntersectionType;
|
|
44
171
|
}
|
|
45
172
|
createObjectType(astType) {
|
|
46
173
|
{
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
|
|
174
|
+
const cachedType = this.cachedTypesByShapeIdentifier.get(astType.shapeIdentifier);
|
|
175
|
+
if (cachedType) {
|
|
176
|
+
invariant(cachedType.kind === "Object", cachedType.kind);
|
|
177
|
+
return cachedType;
|
|
50
178
|
}
|
|
51
179
|
}
|
|
180
|
+
const objectTypeName = astType.name.map((name) => this.tsName(name, { synthetic: astType.synthetic }));
|
|
181
|
+
const objectTypeStub = { name: objectTypeName };
|
|
52
182
|
const discriminantProperty = astType.name.map((name) => new ObjectType.DiscriminantProperty({
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
objectType: { name: astType.name },
|
|
56
|
-
reusables: this.reusables,
|
|
183
|
+
...this.constructorParameters,
|
|
184
|
+
objectType: objectTypeStub,
|
|
57
185
|
value: name,
|
|
58
186
|
}));
|
|
187
|
+
const identifierType = this.createIdentifierType(astType.identifierType);
|
|
188
|
+
const identifierProperty = astType.identifierField.map(() => new ObjectType.IdentifierProperty({
|
|
189
|
+
...this.constructorParameters,
|
|
190
|
+
name: `${this.configuration.syntheticNamePrefix}identifier`,
|
|
191
|
+
objectType: objectTypeStub,
|
|
192
|
+
type: identifierType,
|
|
193
|
+
}));
|
|
59
194
|
const rdfTypeProperty = astType.fromRdfType.map((fromRdfType) => new ObjectType.RdfTypeProperty({
|
|
60
|
-
|
|
195
|
+
...this.constructorParameters,
|
|
61
196
|
fromRdfType,
|
|
62
|
-
|
|
63
|
-
objectType: { name: astType.name },
|
|
64
|
-
reusables: this.reusables,
|
|
197
|
+
objectType: objectTypeStub,
|
|
65
198
|
toRdfTypes: astType.toRdfTypes,
|
|
66
199
|
}));
|
|
67
|
-
const identifierType = this.createIdentifierType(astType.identifierType);
|
|
68
200
|
const objectType = new ObjectType({
|
|
201
|
+
...this.constructorParameters,
|
|
69
202
|
discriminantProperty,
|
|
70
203
|
comment: astType.comment,
|
|
71
|
-
configuration: this.configuration,
|
|
72
204
|
extern: astType.extern,
|
|
205
|
+
identifierProperty,
|
|
73
206
|
identifierType,
|
|
74
207
|
label: astType.label,
|
|
75
208
|
lazyProperties: (objectType) => {
|
|
76
209
|
const properties = astType.fields
|
|
210
|
+
.filter((field) => field.kind === "Shacl")
|
|
77
211
|
.toSorted((left, right) => {
|
|
78
212
|
if (left.order < right.order) {
|
|
79
213
|
return -1;
|
|
@@ -83,73 +217,42 @@ export class TypeFactory {
|
|
|
83
217
|
}
|
|
84
218
|
return this.tsName(left.name).localeCompare(this.tsName(right.name));
|
|
85
219
|
})
|
|
86
|
-
.map((astField) => this.
|
|
220
|
+
.map((astField) => this.createObjectTypeShaclProperty({
|
|
87
221
|
astStructField: astField,
|
|
88
222
|
objectType,
|
|
89
223
|
}));
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
name: `${this.configuration.syntheticNamePrefix}identifier`,
|
|
100
|
-
objectType,
|
|
101
|
-
reusables: this.reusables,
|
|
102
|
-
type: identifierType,
|
|
103
|
-
}));
|
|
224
|
+
for (const specialProperty of [
|
|
225
|
+
discriminantProperty,
|
|
226
|
+
rdfTypeProperty,
|
|
227
|
+
identifierProperty,
|
|
228
|
+
]) {
|
|
229
|
+
specialProperty.ifJust((specialProperty) => {
|
|
230
|
+
properties.splice(0, 0, specialProperty);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
104
233
|
return properties;
|
|
105
234
|
},
|
|
106
|
-
|
|
107
|
-
name: astType.name.map((name) => this.tsName(name, { synthetic: astType.synthetic })),
|
|
235
|
+
name: objectTypeName,
|
|
108
236
|
rdfTypeProperty,
|
|
109
237
|
recursive: astType.recursive,
|
|
110
|
-
reusables: this.reusables,
|
|
111
238
|
shapeIdentifier: astType.shapeIdentifier,
|
|
112
239
|
synthetic: astType.synthetic,
|
|
113
240
|
});
|
|
114
|
-
this.
|
|
241
|
+
this.cachedTypesByShapeIdentifier.set(astType.shapeIdentifier, objectType);
|
|
115
242
|
return objectType;
|
|
116
243
|
}
|
|
117
|
-
createObjectDiscriminatedUnionType(astType) {
|
|
118
|
-
{
|
|
119
|
-
const cachedObjectDiscriminatedUnionType = this.cachedObjectDiscriminatedUnionTypesByShapeIdentifier.get(astType.shapeIdentifier);
|
|
120
|
-
if (cachedObjectDiscriminatedUnionType) {
|
|
121
|
-
return cachedObjectDiscriminatedUnionType;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
const objectDiscriminatedUnionType = new ObjectDiscriminatedUnionType({
|
|
125
|
-
comment: astType.comment,
|
|
126
|
-
configuration: this.configuration,
|
|
127
|
-
identifierType: Maybe.of(this.createIdentifierType(ast.StructCompoundType.identifierType(astType))),
|
|
128
|
-
label: astType.label,
|
|
129
|
-
logger: this.logger,
|
|
130
|
-
members: ast.StructCompoundType.memberStructTypes(astType).map((astStructType) => ({
|
|
131
|
-
discriminantValue: Maybe.empty(),
|
|
132
|
-
type: this.createObjectType(astStructType),
|
|
133
|
-
})),
|
|
134
|
-
name: astType.name.map((name) => this.tsName(name)),
|
|
135
|
-
recursive: astType.recursive,
|
|
136
|
-
reusables: this.reusables,
|
|
137
|
-
shapeIdentifier: astType.shapeIdentifier,
|
|
138
|
-
synthetic: astType.synthetic,
|
|
139
|
-
});
|
|
140
|
-
this.cachedObjectDiscriminatedUnionTypesByShapeIdentifier.set(astType.shapeIdentifier, objectDiscriminatedUnionType);
|
|
141
|
-
return objectDiscriminatedUnionType;
|
|
142
|
-
}
|
|
143
244
|
createType(astType, parameters) {
|
|
144
245
|
switch (astType.kind) {
|
|
145
246
|
case "BlankNode":
|
|
146
247
|
return this.createBlankNodeType(astType);
|
|
147
248
|
case "DefaultValue":
|
|
148
249
|
return this.createDefaultValueType(astType);
|
|
250
|
+
case "DiscriminatedUnion":
|
|
251
|
+
return this.createDiscriminatedUnionType(astType);
|
|
149
252
|
case "Identifier":
|
|
150
253
|
return this.createIdentifierType(astType);
|
|
151
254
|
case "Intersection":
|
|
152
|
-
|
|
255
|
+
return this.createIntersectionType(astType);
|
|
153
256
|
case "Iri":
|
|
154
257
|
return this.createIriType(astType);
|
|
155
258
|
case "Lazy":
|
|
@@ -170,39 +273,14 @@ export class TypeFactory {
|
|
|
170
273
|
return this.createObjectType(astType);
|
|
171
274
|
case "Term":
|
|
172
275
|
return this.createTermType(astType);
|
|
173
|
-
case "DiscriminatedUnion":
|
|
174
|
-
return this.createDiscriminatedUnionType(astType);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
createDiscriminatedUnionType(astType) {
|
|
178
|
-
if (astType.isStructDiscriminatedUnionType()) {
|
|
179
|
-
return this.createObjectDiscriminatedUnionType(astType);
|
|
180
276
|
}
|
|
181
|
-
return new DiscriminatedUnionType({
|
|
182
|
-
comment: astType.comment,
|
|
183
|
-
configuration: this.configuration,
|
|
184
|
-
identifierType: Maybe.empty(),
|
|
185
|
-
label: astType.label,
|
|
186
|
-
logger: this.logger,
|
|
187
|
-
members: astType.members.map((member) => ({
|
|
188
|
-
discriminantValue: member.discriminantValue,
|
|
189
|
-
type: this.createType(member.type),
|
|
190
|
-
})),
|
|
191
|
-
name: astType.name.map((name) => this.tsName(name)),
|
|
192
|
-
recursive: astType.recursive,
|
|
193
|
-
reusables: this.reusables,
|
|
194
|
-
shapeIdentifier: astType.shapeIdentifier,
|
|
195
|
-
synthetic: astType.synthetic,
|
|
196
|
-
});
|
|
197
277
|
}
|
|
198
278
|
createBlankNodeType(astType) {
|
|
199
279
|
return new BlankNodeType({
|
|
280
|
+
...this.constructorParameters,
|
|
200
281
|
comment: astType.comment,
|
|
201
|
-
configuration: this.configuration,
|
|
202
282
|
label: astType.label,
|
|
203
|
-
logger: this.logger,
|
|
204
283
|
name: astType.name.map((name) => this.tsName(name)),
|
|
205
|
-
reusables: this.reusables,
|
|
206
284
|
shapeIdentifier: astType.shapeIdentifier,
|
|
207
285
|
});
|
|
208
286
|
}
|
|
@@ -212,14 +290,12 @@ export class TypeFactory {
|
|
|
212
290
|
});
|
|
213
291
|
invariant(DefaultValueType.isItemType(itemType));
|
|
214
292
|
return new DefaultValueType({
|
|
293
|
+
...this.constructorParameters,
|
|
215
294
|
comment: astType.comment,
|
|
216
|
-
configuration: this.configuration,
|
|
217
295
|
defaultValue: astType.defaultValue,
|
|
218
296
|
itemType,
|
|
219
297
|
label: astType.label,
|
|
220
|
-
logger: this.logger,
|
|
221
298
|
name: astType.name.map((name) => this.tsName(name)),
|
|
222
|
-
reusables: this.reusables,
|
|
223
299
|
shapeIdentifier: astType.shapeIdentifier,
|
|
224
300
|
});
|
|
225
301
|
}
|
|
@@ -229,12 +305,10 @@ export class TypeFactory {
|
|
|
229
305
|
return this.createBlankNodeType(astType);
|
|
230
306
|
case "Identifier":
|
|
231
307
|
return new IdentifierType({
|
|
308
|
+
...this.constructorParameters,
|
|
232
309
|
comment: astType.comment,
|
|
233
|
-
configuration: this.configuration,
|
|
234
310
|
label: astType.label,
|
|
235
|
-
logger: this.logger,
|
|
236
311
|
name: astType.name.map((name) => this.tsName(name)),
|
|
237
|
-
reusables: this.reusables,
|
|
238
312
|
shapeIdentifier: astType.shapeIdentifier,
|
|
239
313
|
});
|
|
240
314
|
case "Iri":
|
|
@@ -243,53 +317,45 @@ export class TypeFactory {
|
|
|
243
317
|
}
|
|
244
318
|
createIriType(astType) {
|
|
245
319
|
return new IriType({
|
|
320
|
+
...this.constructorParameters,
|
|
246
321
|
comment: astType.comment,
|
|
247
|
-
configuration: this.configuration,
|
|
248
322
|
hasValues: astType.hasValues,
|
|
249
323
|
in_: astType.in_,
|
|
250
324
|
label: astType.label,
|
|
251
|
-
logger: this.logger,
|
|
252
325
|
name: astType.name.map((name) => this.tsName(name)),
|
|
253
|
-
reusables: this.reusables,
|
|
254
326
|
shapeIdentifier: astType.shapeIdentifier,
|
|
255
327
|
});
|
|
256
328
|
}
|
|
257
329
|
createLazyOptionType(astType) {
|
|
258
330
|
return new LazyOptionType({
|
|
331
|
+
...this.constructorParameters,
|
|
259
332
|
comment: astType.comment,
|
|
260
|
-
configuration: this.configuration,
|
|
261
333
|
label: astType.label,
|
|
262
|
-
logger: this.logger,
|
|
263
334
|
name: astType.name.map((name) => this.tsName(name)),
|
|
264
335
|
partialType: this.createOptionType(astType.partialType),
|
|
265
336
|
resolveType: this.createOptionType(astType.resolveType),
|
|
266
|
-
reusables: this.reusables,
|
|
267
337
|
shapeIdentifier: astType.shapeIdentifier,
|
|
268
338
|
});
|
|
269
339
|
}
|
|
270
340
|
createLazySetType(astType) {
|
|
271
341
|
return new LazySetType({
|
|
342
|
+
...this.constructorParameters,
|
|
272
343
|
comment: astType.comment,
|
|
273
|
-
configuration: this.configuration,
|
|
274
344
|
label: astType.label,
|
|
275
|
-
logger: this.logger,
|
|
276
345
|
name: astType.name.map((name) => this.tsName(name)),
|
|
277
346
|
partialType: this.createSetType(astType.partialType),
|
|
278
347
|
resolveType: this.createSetType(astType.resolveType),
|
|
279
|
-
reusables: this.reusables,
|
|
280
348
|
shapeIdentifier: astType.shapeIdentifier,
|
|
281
349
|
});
|
|
282
350
|
}
|
|
283
351
|
createLazyType(astType) {
|
|
284
352
|
return new LazyType({
|
|
353
|
+
...this.constructorParameters,
|
|
285
354
|
comment: astType.comment,
|
|
286
|
-
configuration: this.configuration,
|
|
287
355
|
label: astType.label,
|
|
288
|
-
logger: this.logger,
|
|
289
356
|
name: astType.name.map((name) => this.tsName(name)),
|
|
290
357
|
partialType: this.createType(astType.partialType),
|
|
291
358
|
resolveType: this.createType(astType.resolveType),
|
|
292
|
-
reusables: this.reusables,
|
|
293
359
|
shapeIdentifier: astType.shapeIdentifier,
|
|
294
360
|
});
|
|
295
361
|
}
|
|
@@ -297,15 +363,13 @@ export class TypeFactory {
|
|
|
297
363
|
const itemType = this.createType(astType.itemType);
|
|
298
364
|
invariant(ListType.isItemType(itemType));
|
|
299
365
|
return new ListType({
|
|
366
|
+
...this.constructorParameters,
|
|
300
367
|
comment: astType.comment,
|
|
301
|
-
configuration: this.configuration,
|
|
302
368
|
identifierNodeKind: astType.identifierNodeKind,
|
|
303
369
|
itemType,
|
|
304
370
|
label: astType.label,
|
|
305
|
-
logger: this.logger,
|
|
306
371
|
mutable: astType.mutable,
|
|
307
372
|
name: astType.name.map((name) => this.tsName(name)),
|
|
308
|
-
reusables: this.reusables,
|
|
309
373
|
shapeIdentifier: astType.shapeIdentifier,
|
|
310
374
|
toRdfTypes: astType.toRdfTypes,
|
|
311
375
|
});
|
|
@@ -330,39 +394,37 @@ export class TypeFactory {
|
|
|
330
394
|
}
|
|
331
395
|
if (datatypes.size === 1) {
|
|
332
396
|
const datatype = [...datatypes][0];
|
|
333
|
-
const
|
|
397
|
+
const constructorParameters = {
|
|
398
|
+
...this.constructorParameters,
|
|
334
399
|
comment: astType.comment,
|
|
335
|
-
configuration: this.configuration,
|
|
336
400
|
datatype,
|
|
337
401
|
hasValues: astType.hasValues,
|
|
338
402
|
in_: astType.in_,
|
|
339
403
|
label: astType.label,
|
|
340
404
|
languageIn: astType.languageIn,
|
|
341
|
-
logger: this.logger,
|
|
342
405
|
name: astType.name.map((name) => this.tsName(name)),
|
|
343
|
-
reusables: this.reusables,
|
|
344
406
|
shapeIdentifier: astType.shapeIdentifier,
|
|
345
407
|
};
|
|
346
408
|
if (datatype.equals(rdf.langString)) {
|
|
347
|
-
return new LangStringType(
|
|
409
|
+
return new LangStringType(constructorParameters);
|
|
348
410
|
}
|
|
349
411
|
const datatypeDefinition = literalDatatypeDefinitions[datatype.value];
|
|
350
412
|
if (datatypeDefinition) {
|
|
351
413
|
switch (datatypeDefinition.kind) {
|
|
352
414
|
case "bigdecimal":
|
|
353
|
-
return new BigDecimalType(
|
|
415
|
+
return new BigDecimalType(constructorParameters);
|
|
354
416
|
case "bigint":
|
|
355
|
-
return new BigIntType(
|
|
417
|
+
return new BigIntType(constructorParameters);
|
|
356
418
|
case "boolean":
|
|
357
|
-
return new BooleanType(
|
|
419
|
+
return new BooleanType(constructorParameters);
|
|
358
420
|
case "date":
|
|
359
421
|
case "datetime":
|
|
360
|
-
return new (datatypeDefinition.kind === "date" ? DateType : DateTimeType)(
|
|
422
|
+
return new (datatypeDefinition.kind === "date" ? DateType : DateTimeType)(constructorParameters);
|
|
361
423
|
case "float":
|
|
362
424
|
case "int":
|
|
363
|
-
return new (datatypeDefinition.kind === "float" ? FloatType : IntType)(
|
|
425
|
+
return new (datatypeDefinition.kind === "float" ? FloatType : IntType)(constructorParameters);
|
|
364
426
|
case "string":
|
|
365
|
-
return new StringType(
|
|
427
|
+
return new StringType(constructorParameters);
|
|
366
428
|
}
|
|
367
429
|
}
|
|
368
430
|
this.logger.warn("unrecognized literal datatype: %s", datatype.value);
|
|
@@ -374,54 +436,49 @@ export class TypeFactory {
|
|
|
374
436
|
// // this.logger.debug("literal type has no datatypes");
|
|
375
437
|
// }
|
|
376
438
|
return new LiteralType({
|
|
439
|
+
...this.constructorParameters,
|
|
377
440
|
comment: astType.comment,
|
|
378
|
-
configuration: this.configuration,
|
|
379
441
|
hasValues: astType.hasValues,
|
|
380
442
|
in_: astType.in_,
|
|
381
443
|
label: astType.label,
|
|
382
444
|
languageIn: astType.languageIn,
|
|
383
|
-
logger: this.logger,
|
|
384
445
|
name: astType.name.map((name) => this.tsName(name)),
|
|
385
|
-
reusables: this.reusables,
|
|
386
446
|
shapeIdentifier: astType.shapeIdentifier,
|
|
387
447
|
});
|
|
388
448
|
}
|
|
389
|
-
|
|
449
|
+
createObjectTypeShaclProperty({ astStructField, objectType, }) {
|
|
390
450
|
{
|
|
391
|
-
const cachedProperty = this.
|
|
451
|
+
const cachedProperty = this.cachedObjectTypeShaclPropertiesByShapeIdentifier.get(astStructField.shapeIdentifier);
|
|
392
452
|
if (cachedProperty) {
|
|
393
453
|
return cachedProperty;
|
|
394
454
|
}
|
|
395
455
|
}
|
|
396
456
|
const property = new ObjectType.ShaclProperty({
|
|
457
|
+
...this.constructorParameters,
|
|
397
458
|
comment: astStructField.comment,
|
|
398
|
-
configuration: this.configuration,
|
|
399
459
|
description: astStructField.description,
|
|
400
460
|
display: astStructField.display,
|
|
401
461
|
label: astStructField.label,
|
|
402
|
-
|
|
462
|
+
minCount: astStructField.minCount,
|
|
403
463
|
mutable: astStructField.mutable,
|
|
404
464
|
name: this.tsName(astStructField.name),
|
|
405
465
|
objectType,
|
|
406
466
|
path: astStructField.path,
|
|
407
467
|
recursive: !!astStructField.recursive,
|
|
408
|
-
reusables: this.reusables,
|
|
409
468
|
type: this.createType(astStructField.type),
|
|
410
469
|
});
|
|
411
|
-
this.
|
|
470
|
+
this.cachedObjectTypeShaclPropertiesByShapeIdentifier.set(astStructField.shapeIdentifier, property);
|
|
412
471
|
return property;
|
|
413
472
|
}
|
|
414
473
|
createOptionType(astType) {
|
|
415
474
|
const itemType = this.createType(astType.itemType);
|
|
416
475
|
invariant(OptionType.isItemType(itemType));
|
|
417
476
|
return new OptionType({
|
|
477
|
+
...this.constructorParameters,
|
|
418
478
|
comment: astType.comment,
|
|
419
|
-
configuration: this.configuration,
|
|
420
479
|
itemType,
|
|
421
480
|
label: astType.label,
|
|
422
|
-
logger: this.logger,
|
|
423
481
|
name: astType.name.map((name) => this.tsName(name)),
|
|
424
|
-
reusables: this.reusables,
|
|
425
482
|
shapeIdentifier: astType.shapeIdentifier,
|
|
426
483
|
});
|
|
427
484
|
}
|
|
@@ -429,29 +486,25 @@ export class TypeFactory {
|
|
|
429
486
|
const itemType = this.createType(astType.itemType);
|
|
430
487
|
invariant(SetType.isItemType(itemType));
|
|
431
488
|
return new SetType({
|
|
489
|
+
...this.constructorParameters,
|
|
432
490
|
comment: astType.comment,
|
|
433
|
-
configuration: this.configuration,
|
|
434
491
|
itemType,
|
|
435
492
|
label: astType.label,
|
|
436
|
-
logger: this.logger,
|
|
437
493
|
mutable: astType.mutable,
|
|
438
494
|
minCount: astType.minCount,
|
|
439
495
|
name: astType.name.map((name) => this.tsName(name)),
|
|
440
|
-
reusables: this.reusables,
|
|
441
496
|
shapeIdentifier: astType.shapeIdentifier,
|
|
442
497
|
});
|
|
443
498
|
}
|
|
444
499
|
createTermType(astType) {
|
|
445
500
|
return new TermType({
|
|
501
|
+
...this.constructorParameters,
|
|
446
502
|
comment: astType.comment,
|
|
447
|
-
configuration: this.configuration,
|
|
448
503
|
hasValues: astType.hasValues,
|
|
449
504
|
in_: astType.in_,
|
|
450
505
|
label: astType.label,
|
|
451
|
-
logger: this.logger,
|
|
452
506
|
name: astType.name.map((name) => this.tsName(name)),
|
|
453
507
|
nodeKinds: astType.nodeKinds,
|
|
454
|
-
reusables: this.reusables,
|
|
455
508
|
shapeIdentifier: astType.shapeIdentifier,
|
|
456
509
|
});
|
|
457
510
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Logger } from "@rdfx/logger";
|
|
2
2
|
import { Maybe } from "purify-ts";
|
|
3
|
+
import type { ObjectIntersectionType } from "./ObjectIntersectionType.js";
|
|
3
4
|
import type { ObjectType } from "./ObjectType.js";
|
|
4
5
|
import type { Reusables } from "./Reusables.js";
|
|
5
6
|
import type { TsGenerator } from "./TsGenerator.js";
|
|
@@ -14,16 +15,19 @@ export declare class UberObjectDiscriminatedUnionType {
|
|
|
14
15
|
constructor({ configuration, members, reusables, }: {
|
|
15
16
|
configuration: TsGenerator.Configuration;
|
|
16
17
|
logger: Logger;
|
|
17
|
-
members: readonly
|
|
18
|
+
members: readonly UberObjectDiscriminatedUnionType.Member[];
|
|
18
19
|
reusables: Reusables;
|
|
19
20
|
});
|
|
20
21
|
get declaration(): Maybe<Code>;
|
|
21
22
|
private get equalsFunctionDeclaration();
|
|
22
23
|
private get name();
|
|
23
|
-
private get
|
|
24
|
+
private get toJsonObjectFunctionDeclaration();
|
|
24
25
|
private get toRdfResourceFunctionDeclaration();
|
|
25
26
|
private get hashFunctionDeclaration();
|
|
26
27
|
private get toStringFunctionDeclaration();
|
|
27
28
|
private memberTypeSwitch;
|
|
28
29
|
}
|
|
30
|
+
export declare namespace UberObjectDiscriminatedUnionType {
|
|
31
|
+
type Member = ObjectIntersectionType | ObjectType;
|
|
32
|
+
}
|
|
29
33
|
//# sourceMappingURL=UberObjectDiscriminatedUnionType.d.ts.map
|