@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
|
@@ -9,56 +9,90 @@ import { camelCase } from "change-case";
|
|
|
9
9
|
import { Maybe } from "purify-ts";
|
|
10
10
|
import { invariant } from "ts-invariant";
|
|
11
11
|
import { Memoize } from "typescript-memoize";
|
|
12
|
-
import {
|
|
12
|
+
import { ObjectType__fromRdfResourceFunction } from "./_ObjectType/ObjectType__fromRdfResourceFunction.js";
|
|
13
|
+
import { ObjectType__toRdfResourceFunction } from "./_ObjectType/ObjectType__toRdfResourceFunction.js";
|
|
14
|
+
import { ObjectType_conversionFunction } from "./_ObjectType/ObjectType_conversionFunction.js";
|
|
15
|
+
import { ObjectType_createFunction } from "./_ObjectType/ObjectType_createFunction.js";
|
|
16
|
+
import { ObjectType_createFunctionParameters } from "./_ObjectType/ObjectType_createFunctionParameters.js";
|
|
17
|
+
import { ObjectType_createUnsafeFunction } from "./_ObjectType/ObjectType_createUnsafeFunction.js";
|
|
13
18
|
import { ObjectType_DiscriminantProperty } from "./_ObjectType/ObjectType_DiscriminantProperty.js";
|
|
14
|
-
import { ObjectType_equalsFunctionExpression } from "./_ObjectType/
|
|
15
|
-
import { ObjectType_filterFunctionExpression } from "./_ObjectType/
|
|
19
|
+
import { ObjectType_equalsFunctionExpression, ObjectType_equalsFunctionType, } from "./_ObjectType/ObjectType_equalsFunction.js";
|
|
20
|
+
import { ObjectType_filterFunctionExpression, ObjectType_filterFunctionType, } from "./_ObjectType/ObjectType_filterFunction.js";
|
|
16
21
|
import { ObjectType_filterTypeExpression } from "./_ObjectType/ObjectType_filterTypeExpression.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
22
|
+
import { ObjectType_focusSparqlConstructTriplesFunction } from "./_ObjectType/ObjectType_focusSparqlConstructTriplesFunction.js";
|
|
23
|
+
import { ObjectType_focusSparqlWherePatternsFunction } from "./_ObjectType/ObjectType_focusSparqlWherePatternsFunction.js";
|
|
24
|
+
import { ObjectType_fromJsonObjectFunctionExpression, ObjectType_fromJsonObjectFunctionType, } from "./_ObjectType/ObjectType_fromJsonObjectFunction.js";
|
|
25
|
+
import { ObjectType_fromRdfResourceFunction } from "./_ObjectType/ObjectType_fromRdfResourceFunction.js";
|
|
26
|
+
import { ObjectType_fromRdfResourceValuesFunctionExpression, ObjectType_fromRdfResourceValuesFunctionType, } from "./_ObjectType/ObjectType_fromRdfResourceValuesFunction.js";
|
|
21
27
|
import { ObjectType_graphqlTypeExpression } from "./_ObjectType/ObjectType_graphqlTypeExpression.js";
|
|
22
|
-
import { ObjectType_hashFunctionExpression } from "./_ObjectType/
|
|
28
|
+
import { ObjectType_hashFunctionExpression, ObjectType_hashFunctionType, } from "./_ObjectType/ObjectType_hashFunction.js";
|
|
23
29
|
import { ObjectType_IdentifierProperty } from "./_ObjectType/ObjectType_IdentifierProperty.js";
|
|
24
30
|
import { ObjectType_identifierTypeDeclarations } from "./_ObjectType/ObjectType_identifierTypeDeclarations.js";
|
|
25
|
-
import { ObjectType_jsonParseFunctionDeclaration } from "./_ObjectType/ObjectType_jsonParseFunctionDeclaration.js";
|
|
26
|
-
import { ObjectType_jsonSchemaExpression } from "./_ObjectType/ObjectType_jsonSchemaExpression.js";
|
|
27
|
-
import { ObjectType_jsonTypeExpression } from "./_ObjectType/ObjectType_jsonTypeExpression.js";
|
|
28
|
-
import { ObjectType_jsonUiSchemaFunctionExpression } from "./_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js";
|
|
29
31
|
import { ObjectType_objectSetMethodNames } from "./_ObjectType/ObjectType_objectSetMethodNames.js";
|
|
30
32
|
import { ObjectType_RdfTypeProperty } from "./_ObjectType/ObjectType_RdfTypeProperty.js";
|
|
31
33
|
import { ObjectType_ShaclProperty } from "./_ObjectType/ObjectType_ShaclProperty.js";
|
|
32
34
|
import { ObjectType_schemaExpression } from "./_ObjectType/ObjectType_schemaExpression.js";
|
|
33
35
|
import { ObjectType_schemaTypeExpression } from "./_ObjectType/ObjectType_schemaTypeExpression.js";
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
|
|
46
|
-
|
|
36
|
+
import { ObjectType_sparqlConstructQueryFunction } from "./_ObjectType/ObjectType_sparqlConstructQueryFunction.js";
|
|
37
|
+
import { ObjectType_sparqlConstructQueryStringFunction } from "./_ObjectType/ObjectType_sparqlConstructQueryStringFunction.js";
|
|
38
|
+
import { ObjectType_toJsonObjectFunctionExpression, ObjectType_toJsonObjectFunctionType, } from "./_ObjectType/ObjectType_toJsonObjectFunction.js";
|
|
39
|
+
import { ObjectType_toLoggableFunctionExpression, ObjectType_toLoggableFunctionType, } from "./_ObjectType/ObjectType_toLoggableFunction.js";
|
|
40
|
+
import { ObjectType_toRdfResourceFunction } from "./_ObjectType/ObjectType_toRdfResourceFunction.js";
|
|
41
|
+
import { ObjectType_toRdfResourceValuesFunctionExpression, ObjectType_toRdfResourceValuesFunctionType, } from "./_ObjectType/ObjectType_toRdfResourceValuesFunction.js";
|
|
42
|
+
import { ObjectType_toStringFunctionExpression, ObjectType_toStringFunctionType, } from "./_ObjectType/ObjectType_toStringFunction.js";
|
|
43
|
+
import { ObjectType_toStringRecordFunction } from "./_ObjectType/ObjectType_toStringRecordFunction.js";
|
|
44
|
+
import { ObjectType_typeGuardFunction } from "./_ObjectType/ObjectType_typeGuardFunction.js";
|
|
45
|
+
import { ObjectType_valueSparqlConstructTriplesFunctionExpression } from "./_ObjectType/ObjectType_valueSparqlConstructTriplesFunction.js";
|
|
46
|
+
import { ObjectType_valueSparqlWherePatternsFunctionExpression } from "./_ObjectType/ObjectType_valueSparqlWherePatternsFunction.js";
|
|
47
|
+
import { AbstractStructuredType } from "./AbstractStructuredType.js";
|
|
48
|
+
import { DeclaredCallable } from "./DeclaredCallable.js";
|
|
49
|
+
import { code, joinCode, literalOf } from "./ts-poet-wrapper.js";
|
|
50
|
+
export class ObjectType extends AbstractStructuredType {
|
|
51
|
+
rdfTypeProperty;
|
|
52
|
+
equalsFunctionExpression = ObjectType_equalsFunctionExpression;
|
|
53
|
+
equalsFunctionType = ObjectType_equalsFunctionType;
|
|
54
|
+
filterFunctionExpression = ObjectType_filterFunctionExpression;
|
|
55
|
+
filterFunctionType = ObjectType_filterFunctionType;
|
|
56
|
+
filterTypeExpression = ObjectType_filterTypeExpression;
|
|
57
|
+
fromJsonObjectFunctionExpression = ObjectType_fromJsonObjectFunctionExpression;
|
|
58
|
+
fromJsonObjectFunctionType = ObjectType_fromJsonObjectFunctionType;
|
|
59
|
+
fromRdfResourceValuesFunctionExpression = ObjectType_fromRdfResourceValuesFunctionExpression;
|
|
60
|
+
fromRdfResourceValuesFunctionType = ObjectType_fromRdfResourceValuesFunctionType;
|
|
61
|
+
hashFunctionExpression = ObjectType_hashFunctionExpression;
|
|
62
|
+
hashFunctionType = ObjectType_hashFunctionType;
|
|
63
|
+
schemaExpression = ObjectType_schemaExpression;
|
|
64
|
+
schemaTypeExpression = ObjectType_schemaTypeExpression;
|
|
65
|
+
toJsonObjectFunctionExpression = ObjectType_toJsonObjectFunctionExpression;
|
|
66
|
+
toJsonObjectFunctionType = ObjectType_toJsonObjectFunctionType;
|
|
67
|
+
toLoggableFunctionExpression = ObjectType_toLoggableFunctionExpression;
|
|
68
|
+
toLoggableFunctionType = ObjectType_toLoggableFunctionType;
|
|
69
|
+
toRdfResourceValuesFunctionExpression = ObjectType_toRdfResourceValuesFunctionExpression;
|
|
70
|
+
toRdfResourceValuesFunctionType = ObjectType_toRdfResourceValuesFunctionType;
|
|
71
|
+
toStringFunctionExpression = ObjectType_toStringFunctionExpression;
|
|
72
|
+
toStringFunctionType = ObjectType_toStringFunctionType;
|
|
73
|
+
valueSparqlConstructTriplesFunctionExpression = ObjectType_valueSparqlConstructTriplesFunctionExpression;
|
|
74
|
+
valueSparqlWherePatternsFunctionExpression = ObjectType_valueSparqlWherePatternsFunctionExpression;
|
|
75
|
+
discriminatedType;
|
|
47
76
|
extern;
|
|
48
77
|
graphqlArgs = Maybe.empty();
|
|
78
|
+
identifierProperty;
|
|
49
79
|
identifierType;
|
|
50
80
|
jsTypes = [
|
|
51
81
|
{ instanceof: "Object", typeof: "object" },
|
|
52
82
|
];
|
|
53
83
|
kind = "Object";
|
|
54
|
-
rdfTypeProperty;
|
|
55
84
|
recursive;
|
|
56
85
|
synthetic;
|
|
57
86
|
validationFunction = Maybe.empty();
|
|
58
|
-
constructor({ discriminantProperty, extern, identifierType, lazyProperties, rdfTypeProperty, recursive, synthetic, ...superParameters }) {
|
|
87
|
+
constructor({ discriminantProperty, extern, identifierProperty, identifierType, lazyProperties, rdfTypeProperty, recursive, synthetic, ...superParameters }) {
|
|
59
88
|
super(superParameters);
|
|
60
|
-
this.
|
|
89
|
+
this.discriminatedType = discriminantProperty.map((discriminantProperty) => ({
|
|
90
|
+
discriminantProperty,
|
|
91
|
+
// If discriminantProperty is Just then name must be as well.
|
|
92
|
+
expression: code `${this.name.unsafeCoerce()}.Discriminated`,
|
|
93
|
+
}));
|
|
61
94
|
this.extern = extern;
|
|
95
|
+
this.identifierProperty = identifierProperty;
|
|
62
96
|
this.identifierType = identifierType;
|
|
63
97
|
// Lazily initialize some members in getters to avoid recursive construction
|
|
64
98
|
this.lazyProperties = lazyProperties;
|
|
@@ -66,197 +100,43 @@ export class ObjectType extends AbstractType {
|
|
|
66
100
|
this.recursive = recursive;
|
|
67
101
|
this.synthetic = synthetic;
|
|
68
102
|
}
|
|
103
|
+
get _fromRdfResourceFunction() {
|
|
104
|
+
return ObjectType__fromRdfResourceFunction.call(this);
|
|
105
|
+
}
|
|
106
|
+
get _toRdfResourceFunction() {
|
|
107
|
+
return ObjectType__toRdfResourceFunction.call(this);
|
|
108
|
+
}
|
|
109
|
+
get jsonValueType() {
|
|
110
|
+
return this.jsonObjectType;
|
|
111
|
+
}
|
|
69
112
|
get conversionFunction() {
|
|
70
|
-
|
|
71
|
-
return Maybe.empty();
|
|
72
|
-
}
|
|
73
|
-
const sourceTypePropertySignatures = [];
|
|
74
|
-
for (const property of this.properties) {
|
|
75
|
-
property.constructorParameter.ifJust((propertyConstructorParameter) => {
|
|
76
|
-
sourceTypePropertySignatures.push(propertyConstructorParameter.signature);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
const sourceTypeExpression = code `{ ${joinCode(sourceTypePropertySignatures)} }`;
|
|
80
|
-
const syntheticNamePrefix = this.configuration.syntheticNamePrefix;
|
|
81
|
-
return Maybe.of({
|
|
82
|
-
code: code `(<${syntheticNamePrefix}DefaultNamespaceT extends ${this.reusables.snippets.NamespaceBuilder} = ${this.reusables.snippets.NamespaceBuilder}>(value: ${sourceTypeExpression}, ${syntheticNamePrefix}defaultNamespace?: ${syntheticNamePrefix}DefaultNamespaceT) => ${this.createFunction}({ ...value, ${syntheticNamePrefix}defaultNamespace }))`,
|
|
83
|
-
sourceTypes: [
|
|
84
|
-
{
|
|
85
|
-
expression: sourceTypeExpression,
|
|
86
|
-
jsType: {
|
|
87
|
-
instanceof: "Object",
|
|
88
|
-
typeof: "object",
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
],
|
|
92
|
-
});
|
|
113
|
+
return ObjectType_conversionFunction.call(this);
|
|
93
114
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
code `export const create = ${ObjectType_createFunctionExpression.call(this)};`;
|
|
103
|
-
staticModuleDeclarations["createUnsafe"] =
|
|
104
|
-
code `export function createUnsafe<${syntheticNamePrefix}DefaultNamespaceT extends ${this.reusables.snippets.NamespaceBuilder} = ${this.reusables.snippets.NamespaceBuilder}>(${this.constructorParameters.signature}): ${this.expression} {
|
|
105
|
-
return create(${this.constructorParameters.variable}).unsafeCoerce();
|
|
106
|
-
}`;
|
|
107
|
-
}
|
|
108
|
-
// equals
|
|
109
|
-
if (this.configuration.features.has("Object.equals")) {
|
|
110
|
-
staticModuleDeclarations["equals"] =
|
|
111
|
-
code `export const equals: (left: ${this.expression}, right: ${this.expression}) => ${this.reusables.snippets.EqualsResult} = ${ObjectType_equalsFunctionExpression.call(this)};`;
|
|
112
|
-
}
|
|
113
|
-
// Filter / filter
|
|
114
|
-
if (this.configuration.features.has("Object.filter")) {
|
|
115
|
-
staticModuleDeclarations["Filter"] =
|
|
116
|
-
code `export type Filter = ${ObjectType_filterTypeExpression.call(this)};`;
|
|
117
|
-
staticModuleDeclarations["filter"] =
|
|
118
|
-
code `export const filter: (filter: ${this.filterType}, value: ${this.expression}) => boolean = ${ObjectType_filterFunctionExpression.call(this)};`;
|
|
119
|
-
}
|
|
120
|
-
// GraphQL
|
|
121
|
-
if (this.configuration.features.has("GraphQL") && !this.synthetic) {
|
|
122
|
-
staticModuleDeclarations["GraphQL"] =
|
|
123
|
-
code `export const GraphQL = ${ObjectType_graphqlTypeExpression.call(this)};`;
|
|
124
|
-
}
|
|
125
|
-
// focusSparqlConstructTriples / focusSparqlWherePatterns
|
|
126
|
-
if (this.configuration.features.has("Object.SPARQL")) {
|
|
127
|
-
staticModuleDeclarations["focusSparqlConstructTriples"] =
|
|
128
|
-
code `export const focusSparqlConstructTriples: ${this.reusables.snippets.FocusSparqlConstructTriplesFunction}<${this.filterType}> = ${ObjectType_focusSparqlConstructTriplesFunctionExpression.call(this)};`;
|
|
129
|
-
staticModuleDeclarations["focusSparqlWherePatterns"] =
|
|
130
|
-
code `export const focusSparqlWherePatterns: ${this.reusables.snippets.FocusSparqlWherePatternsFunction}<${this.filterType}> = ${ObjectType_focusSparqlWherePatternsFunctionExpression.call(this)};`;
|
|
131
|
-
}
|
|
132
|
-
// fromJson
|
|
133
|
-
if (this.configuration.features.has("Object.fromJson")) {
|
|
134
|
-
staticModuleDeclarations["fromJson"] =
|
|
135
|
-
code `export const fromJson: (json: ${this.jsonType().expression}) => ${this.reusables.imports.Either}<Error, ${this.expression}> = ${ObjectType_fromJsonFunctionExpression.call(this)};`;
|
|
136
|
-
}
|
|
137
|
-
// fromRdfResource / fromRdfResourceValues
|
|
138
|
-
if (this.configuration.features.has("Object.fromRdf")) {
|
|
139
|
-
staticModuleDeclarations["_fromRdfResource"] =
|
|
140
|
-
code `export const _fromRdfResource: ${this.reusables.snippets._FromRdfResourceFunction}<${this.expression}> = ${ObjectType_fromRdfResourceFunctionExpression.call(this)};`;
|
|
141
|
-
staticModuleDeclarations["fromRdfResource"] =
|
|
142
|
-
code `export const fromRdfResource = ${this.reusables.snippets.wrap_FromRdfResourceFunction}(_fromRdfResource);`;
|
|
143
|
-
staticModuleDeclarations["fromRdfResourceValues"] =
|
|
144
|
-
code `export const fromRdfResourceValues: ${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.expression}, ${this.schemaType}> =
|
|
145
|
-
(values, options) => values.chainMap(value => value.toResource().chain(resource => fromRdfResource(resource, options)));`;
|
|
146
|
-
}
|
|
147
|
-
// hash
|
|
148
|
-
if (this.configuration.features.has("Object.hash")) {
|
|
149
|
-
staticModuleDeclarations["hash"] =
|
|
150
|
-
code `export const hash = ${ObjectType_hashFunctionExpression.call(this)};`;
|
|
151
|
-
}
|
|
152
|
-
// Identifier
|
|
153
|
-
if (this.configuration.features.has("Object.type")) {
|
|
154
|
-
staticModuleDeclarations = {
|
|
155
|
-
...staticModuleDeclarations,
|
|
156
|
-
...ObjectType_identifierTypeDeclarations.call(this),
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
// Type guard
|
|
160
|
-
ObjectType_typeGuardFunctionExpression.call(this).ifJust((typeGuardFunctionExpression) => {
|
|
161
|
-
staticModuleDeclarations[`is${name}`] =
|
|
162
|
-
code `export const is${name} = ${typeGuardFunctionExpression};`;
|
|
163
|
-
});
|
|
164
|
-
// type Json
|
|
165
|
-
if (this.configuration.features.has("Object.JSON.type")) {
|
|
166
|
-
staticModuleDeclarations["JsonType"] =
|
|
167
|
-
code `export type Json = ${ObjectType_jsonTypeExpression.call(this)}`;
|
|
168
|
-
}
|
|
169
|
-
// namespace Json
|
|
170
|
-
{
|
|
171
|
-
const jsonModuleDeclarations = [];
|
|
172
|
-
if (this.configuration.features.has("Object.JSON.parse")) {
|
|
173
|
-
jsonModuleDeclarations.push(ObjectType_jsonParseFunctionDeclaration.call(this));
|
|
174
|
-
}
|
|
175
|
-
if (this.configuration.features.has("Object.JSON.schema")) {
|
|
176
|
-
jsonModuleDeclarations.push(code `export function schema() { return ${ObjectType_jsonSchemaExpression.call(this)} satisfies ${this.reusables.imports.z}.ZodType<Json>; }`);
|
|
177
|
-
}
|
|
178
|
-
if (this.configuration.features.has("Object.JSON.uiSchema")) {
|
|
179
|
-
jsonModuleDeclarations.push(code `export const uiSchema = ${ObjectType_jsonUiSchemaFunctionExpression.call(this)};`);
|
|
180
|
-
}
|
|
181
|
-
if (jsonModuleDeclarations.length > 0) {
|
|
182
|
-
staticModuleDeclarations["JsonNamespace"] =
|
|
183
|
-
code `export namespace Json { ${joinCode(jsonModuleDeclarations, { on: "\n\n" })} }`;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
// schema / Schema
|
|
187
|
-
if (this.configuration.features.has("Object.schema")) {
|
|
188
|
-
staticModuleDeclarations["schema"] =
|
|
189
|
-
code `export const schema = ${ObjectType_schemaExpression.call(this)};`;
|
|
190
|
-
staticModuleDeclarations["Schema"] =
|
|
191
|
-
code `export type Schema = typeof schema;`;
|
|
192
|
-
}
|
|
193
|
-
// sparqlConstructQuery / sparqlConstructQueryString
|
|
194
|
-
if (this.configuration.features.has("Object.SPARQL")) {
|
|
195
|
-
staticModuleDeclarations["sparqlConstructQuery"] =
|
|
196
|
-
ObjectType_sparqlConstructQueryFunctionDeclaration.call({
|
|
197
|
-
name,
|
|
198
|
-
configuration: this.configuration,
|
|
199
|
-
filterType: this.filterType,
|
|
200
|
-
reusables: this.reusables,
|
|
201
|
-
});
|
|
202
|
-
staticModuleDeclarations["sparqlConstructQueryString"] =
|
|
203
|
-
ObjectType_sparqlConstructQueryStringFunctionDeclaration.call({
|
|
204
|
-
name,
|
|
205
|
-
configuration: this.configuration,
|
|
206
|
-
filterType: this.filterType,
|
|
207
|
-
reusables: this.reusables,
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
// toJson
|
|
211
|
-
if (this.configuration.features.has("Object.toJson")) {
|
|
212
|
-
staticModuleDeclarations["toJson"] =
|
|
213
|
-
code `export const toJson: (${this.thisVariable}: ${this.expression}) => ${this.jsonType().expression} = ${ObjectType_toJsonFunctionExpression.call(this)};`;
|
|
214
|
-
}
|
|
215
|
-
// toRdfResource
|
|
216
|
-
if (this.configuration.features.has("Object.toRdf")) {
|
|
217
|
-
staticModuleDeclarations["_toRdfResource"] =
|
|
218
|
-
code `export const _toRdfResource: ${this.reusables.snippets._ToRdfResourceFunction}<${this.identifierTypeAlias}, ${this.expression}> = ${ObjectType_toRdfResourceFunctionExpression.call(this)};`;
|
|
219
|
-
staticModuleDeclarations["toRdfResource"] =
|
|
220
|
-
code `export const toRdfResource = ${this.reusables.snippets.wrap_ToRdfResourceFunction}(_toRdfResource);`;
|
|
221
|
-
}
|
|
222
|
-
// toString / toStringRecord
|
|
223
|
-
if (this.configuration.features.has("Object.toString")) {
|
|
224
|
-
staticModuleDeclarations[`${syntheticNamePrefix}toString`] =
|
|
225
|
-
code `export const ${syntheticNamePrefix}toString: (${this.thisVariable}: ${this.expression}) => string = ${ObjectType_toStringFunctionExpression.call(this)};`;
|
|
226
|
-
staticModuleDeclarations["toStringRecord"] =
|
|
227
|
-
code `export const toStringRecord: (${this.thisVariable}: ${this.expression}) => Record<string, string> = ${ObjectType_toStringRecordFunctionExpression.call(this)};`;
|
|
228
|
-
}
|
|
229
|
-
// valueSparqlConstructTriples / valueSparqlWherePatterns
|
|
230
|
-
if (this.configuration.features.has("Object.SPARQL")) {
|
|
231
|
-
staticModuleDeclarations["valueSparqlConstructTriples"] =
|
|
232
|
-
code `export const valueSparqlConstructTriples: ${this.reusables.snippets.ValueSparqlConstructTriplesFunction}<${this.filterType}, ${this.schemaType}> = ${ObjectType_valueSparqlConstructTriplesFunctionExpression.call(this)};`;
|
|
233
|
-
staticModuleDeclarations["valueSparqlWherePatterns"] =
|
|
234
|
-
code `export const valueSparqlWherePatterns: ${this.reusables.snippets.ValueSparqlWherePatternsFunction}<${this.filterType}, ${this.schemaType}> = ${ObjectType_valueSparqlWherePatternsFunctionExpression.call(this)};`;
|
|
235
|
-
}
|
|
236
|
-
return staticModuleDeclarations;
|
|
115
|
+
get createFunction() {
|
|
116
|
+
return ObjectType_createFunction.call(this);
|
|
117
|
+
}
|
|
118
|
+
get createFunctionParameters() {
|
|
119
|
+
return ObjectType_createFunctionParameters.call(this);
|
|
120
|
+
}
|
|
121
|
+
get createUnsafeFunction() {
|
|
122
|
+
return ObjectType_createUnsafeFunction.call(this);
|
|
237
123
|
}
|
|
238
124
|
get declaration() {
|
|
239
125
|
return !this.extern ? super.declaration : Maybe.empty();
|
|
240
126
|
}
|
|
241
|
-
get
|
|
242
|
-
return this.
|
|
243
|
-
.map((name) =>
|
|
244
|
-
|
|
127
|
+
get jsonObjectType() {
|
|
128
|
+
return this.jsonTypeFactory.createJsonObjectType(this.properties.flatMap((property) => property.jsonObjectMember.toList()), {
|
|
129
|
+
name: this.name.map((name) => [name, "Json"]).extract(),
|
|
130
|
+
});
|
|
245
131
|
}
|
|
246
|
-
get
|
|
247
|
-
return this
|
|
248
|
-
.map((name) => code `${name}.filter`)
|
|
249
|
-
.orDefaultLazy(() => ObjectType_filterFunctionExpression.call(this));
|
|
132
|
+
get focusSparqlConstructTriplesFunction() {
|
|
133
|
+
return ObjectType_focusSparqlConstructTriplesFunction.call(this);
|
|
250
134
|
}
|
|
251
|
-
get
|
|
252
|
-
return this
|
|
253
|
-
.map((name) => code `${name}.Filter`)
|
|
254
|
-
.orDefaultLazy(() => ObjectType_filterTypeExpression.call(this));
|
|
135
|
+
get focusSparqlWherePatternsFunction() {
|
|
136
|
+
return ObjectType_focusSparqlWherePatternsFunction.call(this);
|
|
255
137
|
}
|
|
256
|
-
get
|
|
257
|
-
return this
|
|
258
|
-
.map((name) => code `${name}.fromRdfResourceValues`)
|
|
259
|
-
.orDefaultLazy(() => code `((values, options) => values.chainMap(value => value.toResource().chain(resource => ${ObjectType_fromRdfResourceFunctionExpression.call(this)}(resource, options))))`);
|
|
138
|
+
get fromRdfResourceFunction() {
|
|
139
|
+
return ObjectType_fromRdfResourceFunction.call(this);
|
|
260
140
|
}
|
|
261
141
|
get fromRdfTypeVariable() {
|
|
262
142
|
return this.rdfTypeProperty.map((rdfTypeProperty) => this.name
|
|
@@ -264,15 +144,10 @@ export class ObjectType extends AbstractType {
|
|
|
264
144
|
.orDefaultLazy(() => this.rdfjsTermExpression(rdfTypeProperty.fromRdfType)));
|
|
265
145
|
}
|
|
266
146
|
get graphqlType() {
|
|
267
|
-
return new
|
|
147
|
+
return new AbstractStructuredType.GraphqlType(this.name
|
|
268
148
|
.map((name) => code `${name}.GraphQL`)
|
|
269
149
|
.orDefaultLazy(() => ObjectType_graphqlTypeExpression.call(this)), this.reusables);
|
|
270
150
|
}
|
|
271
|
-
get hashFunction() {
|
|
272
|
-
return this.name
|
|
273
|
-
.map((name) => code `${name}.hash`)
|
|
274
|
-
.orDefaultLazy(() => ObjectType_hashFunctionExpression.call(this));
|
|
275
|
-
}
|
|
276
151
|
get identifierTypeAlias() {
|
|
277
152
|
return code `${this.name.unsafeCoerce()}.Identifier`;
|
|
278
153
|
}
|
|
@@ -302,16 +177,28 @@ export class ObjectType extends AbstractType {
|
|
|
302
177
|
}
|
|
303
178
|
}));
|
|
304
179
|
}
|
|
305
|
-
get
|
|
306
|
-
return
|
|
180
|
+
get sparqlConstructQueryFunction() {
|
|
181
|
+
return ObjectType_sparqlConstructQueryFunction.call({
|
|
182
|
+
configuration: this.configuration,
|
|
183
|
+
filterType: this.filterType,
|
|
184
|
+
_function: this._function.bind(this),
|
|
185
|
+
focusSparqlConstructTriplesFunction: this.focusSparqlConstructTriplesFunction,
|
|
186
|
+
focusSparqlWherePatternsFunction: this.focusSparqlWherePatternsFunction,
|
|
187
|
+
name: this.name,
|
|
188
|
+
reusables: this.reusables,
|
|
189
|
+
});
|
|
307
190
|
}
|
|
308
|
-
get
|
|
309
|
-
return
|
|
191
|
+
get sparqlConstructQueryStringFunction() {
|
|
192
|
+
return ObjectType_sparqlConstructQueryStringFunction.call({
|
|
193
|
+
configuration: this.configuration,
|
|
194
|
+
filterType: this.filterType,
|
|
195
|
+
_function: this._function.bind(this),
|
|
196
|
+
sparqlConstructQueryFunction: this.sparqlConstructQueryFunction,
|
|
197
|
+
reusables: this.reusables,
|
|
198
|
+
});
|
|
310
199
|
}
|
|
311
|
-
get
|
|
312
|
-
return this
|
|
313
|
-
.map((name) => code `${name}.Schema`)
|
|
314
|
-
.orDefaultLazy(() => ObjectType_schemaTypeExpression.call(this));
|
|
200
|
+
get toRdfResourceFunction() {
|
|
201
|
+
return ObjectType_toRdfResourceFunction.call(this);
|
|
315
202
|
}
|
|
316
203
|
get toRdfResourceValueTypes() {
|
|
317
204
|
return new Set([...this.identifierType.nodeKinds].map(NodeKind.toTermType));
|
|
@@ -319,151 +206,158 @@ export class ObjectType extends AbstractType {
|
|
|
319
206
|
get toRdfjsResourceType() {
|
|
320
207
|
return code `${this.reusables.imports.Resource}${this.identifierType.kind === "Iri" ? code `<${this.reusables.imports.NamedNode}>` : ""}`;
|
|
321
208
|
}
|
|
322
|
-
get
|
|
323
|
-
return
|
|
324
|
-
}
|
|
325
|
-
get valueSparqlConstructTriplesFunction() {
|
|
326
|
-
return this.name
|
|
327
|
-
.map((name) => code `${name}.valueSparqlConstructTriples`)
|
|
328
|
-
.orDefaultLazy(() => ObjectType_valueSparqlConstructTriplesFunctionExpression.call(this));
|
|
209
|
+
get toStringRecordFunction() {
|
|
210
|
+
return ObjectType_toStringRecordFunction.call(this);
|
|
329
211
|
}
|
|
330
|
-
get
|
|
331
|
-
return this
|
|
332
|
-
.map((name) => code `${name}.valueSparqlWherePatterns`)
|
|
333
|
-
.orDefaultLazy(() => ObjectType_valueSparqlWherePatternsFunctionExpression.call(this));
|
|
334
|
-
}
|
|
335
|
-
get constructorParameters() {
|
|
336
|
-
let hasQuestionToken = true;
|
|
337
|
-
const syntheticNamePrefix = this.configuration.syntheticNamePrefix;
|
|
338
|
-
const propertySignatures = [
|
|
339
|
-
code `readonly ${syntheticNamePrefix}defaultNamespace?: ${syntheticNamePrefix}DefaultNamespaceT;`,
|
|
340
|
-
];
|
|
341
|
-
for (const property of this.properties) {
|
|
342
|
-
property.constructorParameter.ifJust((propertyConstructorParameter) => {
|
|
343
|
-
hasQuestionToken =
|
|
344
|
-
hasQuestionToken && propertyConstructorParameter.hasQuestionToken;
|
|
345
|
-
propertySignatures.push(propertyConstructorParameter.signature);
|
|
346
|
-
});
|
|
347
|
-
}
|
|
348
|
-
const typeExpression = code `{ ${joinCode(propertySignatures)} }`;
|
|
349
|
-
return {
|
|
350
|
-
hasQuestionToken,
|
|
351
|
-
signature: code `parameters${hasQuestionToken ? "?" : ""}: ${typeExpression}`,
|
|
352
|
-
type: {
|
|
353
|
-
expression: typeExpression,
|
|
354
|
-
},
|
|
355
|
-
variable: code `parameters`,
|
|
356
|
-
};
|
|
212
|
+
get typeGuardFunction() {
|
|
213
|
+
return ObjectType_typeGuardFunction.call(this);
|
|
357
214
|
}
|
|
358
|
-
get
|
|
359
|
-
return this.
|
|
360
|
-
.map((name) => code `${name}.create`)
|
|
361
|
-
.orDefaultLazy(() => ObjectType_createFunctionExpression.call(this));
|
|
215
|
+
get inlineExpression() {
|
|
216
|
+
return code `{ ${joinCode(this.properties.flatMap((property) => property.declaration.toList()), { on: "\n\n" })} }`;
|
|
362
217
|
}
|
|
363
218
|
get thisVariable() {
|
|
364
219
|
return this.name
|
|
365
220
|
.map((name) => code `_${camelCase(name)}`)
|
|
366
221
|
.orDefault(code `_object`);
|
|
367
222
|
}
|
|
368
|
-
|
|
369
|
-
return this.name
|
|
370
|
-
.map((name) => code `${name}.toJson`)
|
|
371
|
-
.orDefaultLazy(() => ObjectType_toJsonFunctionExpression.call(this));
|
|
372
|
-
}
|
|
373
|
-
get toRdfTypesVariable() {
|
|
374
|
-
return this.rdfTypeProperty.map((rdfTypeProperty) => this.schemaVariable
|
|
375
|
-
.map((schemaVariable) => code `${schemaVariable}.properties.${rdfTypeProperty.name}.toRdfTypes`)
|
|
376
|
-
.orDefaultLazy(() => code `${arrayOf(...rdfTypeProperty.toRdfTypes.map((toRdfType) => this.rdfjsTermExpression(toRdfType)))}`));
|
|
377
|
-
}
|
|
378
|
-
get toStringFunction() {
|
|
379
|
-
return this.name
|
|
380
|
-
.map((name) => code `${name}.${this.configuration.syntheticNamePrefix}toString`)
|
|
381
|
-
.orDefaultLazy(() => ObjectType_toStringFunctionExpression.call(this));
|
|
382
|
-
}
|
|
383
|
-
get inlineExpression() {
|
|
384
|
-
return code `{ ${joinCode(this.properties.flatMap((property) => property.declaration.toList()), { on: "\n\n" })} }`;
|
|
385
|
-
}
|
|
386
|
-
fromJsonExpression({ variables, }) {
|
|
387
|
-
// Assumes the JSON object has been recursively validated already.
|
|
388
|
-
return code `${this.name.map((name) => code `${name}.fromJson`).orDefaultLazy(() => ObjectType_fromJsonFunctionExpression.call(this))}(${variables.value})`;
|
|
389
|
-
}
|
|
390
|
-
graphqlResolveExpression({ variables, }) {
|
|
391
|
-
return variables.value;
|
|
392
|
-
}
|
|
393
|
-
jsonSchema({ context, }) {
|
|
223
|
+
propertySubsetExpression(propertyFilter) {
|
|
394
224
|
return this.name
|
|
395
225
|
.map((name) => {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
226
|
+
const declaredProperties = [];
|
|
227
|
+
const omitDeclaredProperties = [];
|
|
228
|
+
const pickDeclaredProperties = [];
|
|
229
|
+
for (const property of this.properties) {
|
|
230
|
+
if (property.declaration.isNothing()) {
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
declaredProperties.push(property);
|
|
234
|
+
if (propertyFilter(property)) {
|
|
235
|
+
pickDeclaredProperties.push(property);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
omitDeclaredProperties.push(property);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if (pickDeclaredProperties.length === 0) {
|
|
242
|
+
return code `object`;
|
|
243
|
+
}
|
|
244
|
+
if (pickDeclaredProperties.length === declaredProperties.length) {
|
|
245
|
+
return this.expression;
|
|
246
|
+
}
|
|
247
|
+
if (pickDeclaredProperties.length <= declaredProperties.length / 2) {
|
|
248
|
+
const pickPropertyNames = pickDeclaredProperties.map((property) => code `${literalOf(property.name)}`);
|
|
249
|
+
if (pickPropertyNames.length === 0) {
|
|
250
|
+
return code `object`;
|
|
251
|
+
}
|
|
252
|
+
return code `Pick<${name}, ${joinCode(pickPropertyNames, {
|
|
253
|
+
on: " | ",
|
|
254
|
+
})}>`;
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
const omitPropertyNames = omitDeclaredProperties.flatMap((property) => code `${literalOf(property.name)}`);
|
|
258
|
+
if (omitPropertyNames.length === 0) {
|
|
259
|
+
return this.expression;
|
|
260
|
+
}
|
|
261
|
+
return code `Omit<${name}, ${joinCode(omitPropertyNames, {
|
|
262
|
+
on: " | ",
|
|
263
|
+
})}>`;
|
|
400
264
|
}
|
|
401
|
-
return expression;
|
|
402
265
|
})
|
|
403
|
-
.orDefaultLazy(() =>
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
jsonUiSchemaElement({ variables, }) {
|
|
411
|
-
return Maybe.of(code `${this.name
|
|
412
|
-
.map((name) => code `${name}.Json.uiSchema`)
|
|
413
|
-
.orDefaultLazy(() => ObjectType_jsonUiSchemaFunctionExpression.call(this))}({ scopePrefix: ${variables.scopePrefix} })`);
|
|
414
|
-
}
|
|
415
|
-
toJsonExpression({ variables, }) {
|
|
416
|
-
const toJsonFunction = this.name
|
|
417
|
-
.map((name) => code `${name}.toJson`)
|
|
418
|
-
.orDefaultLazy(() => ObjectType_toJsonFunctionExpression.call(this));
|
|
419
|
-
return code `${toJsonFunction}(${variables.value})`;
|
|
420
|
-
}
|
|
421
|
-
toRdfResourceValuesExpression({ variables, }) {
|
|
422
|
-
const toRdfResourceFunction = this.name
|
|
423
|
-
.map((name) => code `${name}.toRdfResource`)
|
|
424
|
-
.orDefaultLazy(() => code `${this.reusables.snippets.wrap_ToRdfResourceFunction}<${this.identifierType.expression}, ${this.expression}>(${ObjectType_toRdfResourceFunctionExpression.call(this)})`);
|
|
425
|
-
return code `[${toRdfResourceFunction}(${variables.value}, { graph: ${variables.graph}, resourceSet: ${variables.resourceSet} }).identifier]`;
|
|
426
|
-
}
|
|
427
|
-
toStringExpression({ variables, }) {
|
|
428
|
-
return this.name
|
|
429
|
-
.map((name) => code `${name}.${this.configuration.syntheticNamePrefix}toString(${variables.value})`)
|
|
430
|
-
.orDefaultLazy(() => code `JSON.stringify(${this.toStringRecordExpression({ variables })})`);
|
|
266
|
+
.orDefaultLazy(() => {
|
|
267
|
+
const propertyDeclarations = this.properties.flatMap((property) => propertyFilter(property) ? property.declaration.toList() : []);
|
|
268
|
+
if (propertyDeclarations.length === 0) {
|
|
269
|
+
return code `object`;
|
|
270
|
+
}
|
|
271
|
+
return code `{ ${joinCode(propertyDeclarations, { on: "\n\n" })} }`;
|
|
272
|
+
});
|
|
431
273
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
274
|
+
staticModuleDeclarations(name) {
|
|
275
|
+
let staticModuleDeclarations = {
|
|
276
|
+
...super.staticModuleDeclarations(name),
|
|
277
|
+
};
|
|
278
|
+
function addFunctionDeclaration(function_) {
|
|
279
|
+
invariant(function_ instanceof DeclaredCallable);
|
|
280
|
+
staticModuleDeclarations[function_.unqualifiedName] =
|
|
281
|
+
code `export ${function_.declaration}`;
|
|
282
|
+
}
|
|
283
|
+
if (this.configuration.features.has("Object.create")) {
|
|
284
|
+
staticModuleDeclarations["CreateParameters"] =
|
|
285
|
+
code `export type CreateParameters<${this.configuration.syntheticNamePrefix}DefaultNamespaceT extends ${this.reusables.snippets.NamespaceBuilder} = ${this.reusables.snippets.NamespaceBuilder}> = ${this.createFunctionParameters.type.inlineExpression};`;
|
|
286
|
+
addFunctionDeclaration(this.createFunction);
|
|
287
|
+
addFunctionDeclaration(this.createUnsafeFunction);
|
|
288
|
+
}
|
|
289
|
+
if (this.configuration.features.has("GraphQL") && !this.synthetic) {
|
|
290
|
+
staticModuleDeclarations["GraphQL"] =
|
|
291
|
+
code `export const GraphQL = ${ObjectType_graphqlTypeExpression.call(this)};`;
|
|
292
|
+
}
|
|
293
|
+
if (this.configuration.features.has("Object.fromRdf")) {
|
|
294
|
+
addFunctionDeclaration(this._fromRdfResourceFunction);
|
|
295
|
+
addFunctionDeclaration(this.fromRdfResourceFunction);
|
|
296
|
+
}
|
|
297
|
+
if (this.configuration.features.has("Object.SPARQL")) {
|
|
298
|
+
addFunctionDeclaration(this.focusSparqlConstructTriplesFunction);
|
|
299
|
+
addFunctionDeclaration(this.focusSparqlWherePatternsFunction);
|
|
300
|
+
addFunctionDeclaration(this.sparqlConstructQueryFunction);
|
|
301
|
+
addFunctionDeclaration(this.sparqlConstructQueryStringFunction);
|
|
302
|
+
}
|
|
303
|
+
if (this.configuration.features.has("Object.toRdf")) {
|
|
304
|
+
addFunctionDeclaration(this._toRdfResourceFunction);
|
|
305
|
+
addFunctionDeclaration(this.toRdfResourceFunction);
|
|
306
|
+
}
|
|
307
|
+
if (this.configuration.features.has("Object.toString")) {
|
|
308
|
+
addFunctionDeclaration(this.toStringRecordFunction);
|
|
309
|
+
}
|
|
310
|
+
if (this.configuration.features.has("Object.type")) {
|
|
311
|
+
staticModuleDeclarations = {
|
|
312
|
+
...staticModuleDeclarations,
|
|
313
|
+
...ObjectType_identifierTypeDeclarations.call(this),
|
|
314
|
+
};
|
|
315
|
+
this.discriminatedType.ifJust(({ discriminantProperty }) => {
|
|
316
|
+
staticModuleDeclarations["Discriminated"] =
|
|
317
|
+
code `export type Discriminated = ${name} & { readonly ${discriminantProperty.name}: ${literalOf(discriminantProperty.values[0])} };`;
|
|
318
|
+
});
|
|
319
|
+
this.typeGuardFunction.ifJust(addFunctionDeclaration);
|
|
320
|
+
}
|
|
321
|
+
return staticModuleDeclarations;
|
|
440
322
|
}
|
|
441
323
|
lazyProperties;
|
|
442
324
|
}
|
|
325
|
+
__decorate([
|
|
326
|
+
Memoize()
|
|
327
|
+
], ObjectType.prototype, "_fromRdfResourceFunction", null);
|
|
328
|
+
__decorate([
|
|
329
|
+
Memoize()
|
|
330
|
+
], ObjectType.prototype, "_toRdfResourceFunction", null);
|
|
443
331
|
__decorate([
|
|
444
332
|
Memoize()
|
|
445
333
|
], ObjectType.prototype, "conversionFunction", null);
|
|
446
334
|
__decorate([
|
|
447
335
|
Memoize()
|
|
448
|
-
], ObjectType.prototype, "
|
|
336
|
+
], ObjectType.prototype, "createFunction", null);
|
|
337
|
+
__decorate([
|
|
338
|
+
Memoize()
|
|
339
|
+
], ObjectType.prototype, "createFunctionParameters", null);
|
|
449
340
|
__decorate([
|
|
450
341
|
Memoize()
|
|
451
|
-
], ObjectType.prototype, "
|
|
342
|
+
], ObjectType.prototype, "createUnsafeFunction", null);
|
|
452
343
|
__decorate([
|
|
453
344
|
Memoize()
|
|
454
|
-
], ObjectType.prototype, "
|
|
345
|
+
], ObjectType.prototype, "jsonObjectType", null);
|
|
455
346
|
__decorate([
|
|
456
347
|
Memoize()
|
|
457
|
-
], ObjectType.prototype, "
|
|
348
|
+
], ObjectType.prototype, "focusSparqlConstructTriplesFunction", null);
|
|
458
349
|
__decorate([
|
|
459
350
|
Memoize()
|
|
460
|
-
], ObjectType.prototype, "
|
|
351
|
+
], ObjectType.prototype, "focusSparqlWherePatternsFunction", null);
|
|
461
352
|
__decorate([
|
|
462
353
|
Memoize()
|
|
463
|
-
], ObjectType.prototype, "
|
|
354
|
+
], ObjectType.prototype, "fromRdfResourceFunction", null);
|
|
464
355
|
__decorate([
|
|
465
356
|
Memoize()
|
|
466
|
-
], ObjectType.prototype, "
|
|
357
|
+
], ObjectType.prototype, "fromRdfTypeVariable", null);
|
|
358
|
+
__decorate([
|
|
359
|
+
Memoize()
|
|
360
|
+
], ObjectType.prototype, "graphqlType", null);
|
|
467
361
|
__decorate([
|
|
468
362
|
Memoize()
|
|
469
363
|
], ObjectType.prototype, "identifierTypeAlias", null);
|
|
@@ -481,13 +375,13 @@ __decorate([
|
|
|
481
375
|
], ObjectType.prototype, "referencesNamedType", null);
|
|
482
376
|
__decorate([
|
|
483
377
|
Memoize()
|
|
484
|
-
], ObjectType.prototype, "
|
|
378
|
+
], ObjectType.prototype, "sparqlConstructQueryFunction", null);
|
|
485
379
|
__decorate([
|
|
486
380
|
Memoize()
|
|
487
|
-
], ObjectType.prototype, "
|
|
381
|
+
], ObjectType.prototype, "sparqlConstructQueryStringFunction", null);
|
|
488
382
|
__decorate([
|
|
489
383
|
Memoize()
|
|
490
|
-
], ObjectType.prototype, "
|
|
384
|
+
], ObjectType.prototype, "toRdfResourceFunction", null);
|
|
491
385
|
__decorate([
|
|
492
386
|
Memoize()
|
|
493
387
|
], ObjectType.prototype, "toRdfResourceValueTypes", null);
|
|
@@ -496,34 +390,13 @@ __decorate([
|
|
|
496
390
|
], ObjectType.prototype, "toRdfjsResourceType", null);
|
|
497
391
|
__decorate([
|
|
498
392
|
Memoize()
|
|
499
|
-
], ObjectType.prototype, "
|
|
500
|
-
__decorate([
|
|
501
|
-
Memoize()
|
|
502
|
-
], ObjectType.prototype, "valueSparqlConstructTriplesFunction", null);
|
|
503
|
-
__decorate([
|
|
504
|
-
Memoize()
|
|
505
|
-
], ObjectType.prototype, "valueSparqlWherePatternsFunction", null);
|
|
506
|
-
__decorate([
|
|
507
|
-
Memoize()
|
|
508
|
-
], ObjectType.prototype, "constructorParameters", null);
|
|
393
|
+
], ObjectType.prototype, "toStringRecordFunction", null);
|
|
509
394
|
__decorate([
|
|
510
395
|
Memoize()
|
|
511
|
-
], ObjectType.prototype, "
|
|
396
|
+
], ObjectType.prototype, "typeGuardFunction", null);
|
|
512
397
|
__decorate([
|
|
513
398
|
Memoize()
|
|
514
399
|
], ObjectType.prototype, "thisVariable", null);
|
|
515
|
-
__decorate([
|
|
516
|
-
Memoize()
|
|
517
|
-
], ObjectType.prototype, "toJsonFunction", null);
|
|
518
|
-
__decorate([
|
|
519
|
-
Memoize()
|
|
520
|
-
], ObjectType.prototype, "toRdfTypesVariable", null);
|
|
521
|
-
__decorate([
|
|
522
|
-
Memoize()
|
|
523
|
-
], ObjectType.prototype, "toStringFunction", null);
|
|
524
|
-
__decorate([
|
|
525
|
-
Memoize()
|
|
526
|
-
], ObjectType.prototype, "jsonType", null);
|
|
527
400
|
(function (ObjectType) {
|
|
528
401
|
ObjectType.IdentifierProperty = ObjectType_IdentifierProperty;
|
|
529
402
|
ObjectType.ShaclProperty = ObjectType_ShaclProperty;
|