@shaclmate/compiler 4.0.41 → 4.0.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ShapesGraphToAstTransformer.d.ts +1 -0
- package/dist/ShapesGraphToAstTransformer.js +10 -45
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +17 -0
- package/dist/_ShapesGraphToAstTransformer/{transformPropertyShapeToAstObjectTypeProperty.js → transformPropertyShapeToAstStructTypeField.js} +71 -48
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +29 -20
- package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.d.ts → transformShapeToAstStructType.d.ts} +2 -2
- package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.js → transformShapeToAstStructType.js} +35 -29
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +2 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
- package/dist/ast/AbstractCompoundType.d.ts +2 -2
- package/dist/ast/AbstractCompoundType.js +4 -4
- package/dist/ast/AbstractContainerType.d.ts +2 -2
- package/dist/ast/AbstractContainerType.js +4 -4
- package/dist/ast/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +10 -10
- package/dist/ast/{AbstractLazyObjectType.js → AbstractLazyType.js} +3 -3
- package/dist/ast/AbstractType.d.ts +1 -1
- package/dist/ast/AbstractType.js +3 -0
- package/dist/ast/Ast.d.ts +2 -4
- package/dist/ast/DefaultValueType.js +2 -1
- package/dist/ast/IntersectionType.d.ts +2 -2
- package/dist/ast/IntersectionType.js +3 -3
- package/dist/ast/LazyOptionType.d.ts +6 -0
- package/dist/ast/LazyOptionType.js +5 -0
- package/dist/ast/LazySetType.d.ts +6 -0
- package/dist/ast/LazySetType.js +5 -0
- package/dist/ast/LazyType.d.ts +5 -0
- package/dist/ast/LazyType.js +5 -0
- package/dist/ast/ListType.d.ts +2 -2
- package/dist/ast/ListType.js +4 -4
- package/dist/ast/OptionType.js +2 -1
- package/dist/ast/SetType.js +2 -1
- package/dist/ast/StructCompoundType.d.ts +12 -0
- package/dist/ast/{ObjectCompoundType.js → StructCompoundType.js} +18 -18
- package/dist/ast/StructIntersectionType.d.ts +4 -0
- package/dist/ast/StructIntersectionType.js +2 -0
- package/dist/ast/{ObjectType.d.ts → StructType.d.ts} +28 -27
- package/dist/ast/{ObjectType.js → StructType.js} +81 -78
- package/dist/ast/StructUnionType.d.ts +4 -0
- package/dist/ast/StructUnionType.js +2 -0
- package/dist/ast/Type.d.ts +5 -5
- package/dist/ast/Type.js +4 -4
- package/dist/ast/UnionType.d.ts +2 -2
- package/dist/ast/UnionType.js +3 -3
- package/dist/ast/index.d.ts +7 -7
- package/dist/ast/index.js +7 -7
- package/dist/generators/AstJsonGenerator.js +2 -2
- package/dist/generators/transformAstToLabeledPropertyGraph.js +8 -8
- package/dist/generators/ts/AbstractContainerType.d.ts +1 -1
- package/dist/generators/ts/AbstractContainerType.js +6 -6
- package/dist/generators/ts/AbstractDateType.d.ts +1 -7
- package/dist/generators/ts/AbstractDateType.js +1 -11
- package/dist/generators/ts/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +7 -7
- package/dist/generators/ts/{AbstractLazyObjectType.js → AbstractLazyType.js} +19 -17
- package/dist/generators/ts/AbstractLiteralType.d.ts +2 -5
- package/dist/generators/ts/AbstractLiteralType.js +0 -21
- package/dist/generators/ts/AbstractNumericType.d.ts +1 -7
- package/dist/generators/ts/AbstractNumericType.js +15 -25
- package/dist/generators/ts/AbstractObjectSetType.d.ts +1 -1
- package/dist/generators/ts/AbstractObjectSetType.js +2 -2
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -1
- package/dist/generators/ts/AbstractPrimitiveType.js +1 -1
- package/dist/generators/ts/AbstractTermType.d.ts +6 -21
- package/dist/generators/ts/AbstractTermType.js +26 -55
- package/dist/generators/ts/AbstractType.d.ts +40 -47
- package/dist/generators/ts/AbstractType.js +17 -6
- package/dist/generators/ts/BigDecimalType.d.ts +3 -3
- package/dist/generators/ts/BigDecimalType.js +3 -8
- package/dist/generators/ts/BigIntType.d.ts +2 -2
- package/dist/generators/ts/BigIntType.js +7 -4
- package/dist/generators/ts/BlankNodeType.d.ts +2 -7
- package/dist/generators/ts/BlankNodeType.js +2 -7
- package/dist/generators/ts/BooleanType.d.ts +3 -3
- package/dist/generators/ts/BooleanType.js +12 -14
- package/dist/generators/ts/DateTimeType.d.ts +2 -2
- package/dist/generators/ts/DateTimeType.js +14 -4
- package/dist/generators/ts/DateType.d.ts +2 -2
- package/dist/generators/ts/DateType.js +14 -4
- package/dist/generators/ts/DefaultValueType.d.ts +8 -8
- package/dist/generators/ts/DefaultValueType.js +10 -12
- package/dist/generators/ts/FloatType.d.ts +2 -2
- package/dist/generators/ts/FloatType.js +7 -4
- package/dist/generators/ts/IdentifierType.d.ts +2 -2
- package/dist/generators/ts/IdentifierType.js +2 -7
- package/dist/generators/ts/IntType.d.ts +2 -2
- package/dist/generators/ts/IntType.js +7 -4
- package/dist/generators/ts/IriType.d.ts +2 -2
- package/dist/generators/ts/IriType.js +12 -14
- package/dist/generators/ts/{LazyObjectOptionType.d.ts → LazyOptionType.d.ts} +12 -11
- package/dist/generators/ts/{LazyObjectOptionType.js → LazyOptionType.js} +23 -14
- package/dist/generators/ts/LazySetType.d.ts +20 -0
- package/dist/generators/ts/{LazyObjectSetType.js → LazySetType.js} +22 -13
- package/dist/generators/ts/LazyType.d.ts +19 -0
- package/dist/generators/ts/{LazyObjectType.js → LazyType.js} +22 -13
- package/dist/generators/ts/ListType.d.ts +1 -1
- package/dist/generators/ts/ListType.js +9 -19
- package/dist/generators/ts/LiteralType.d.ts +3 -2
- package/dist/generators/ts/LiteralType.js +6 -2
- package/dist/generators/ts/ObjectType.d.ts +16 -3
- package/dist/generators/ts/ObjectType.js +301 -91
- package/dist/generators/ts/ObjectUnionType.js +40 -40
- package/dist/generators/ts/OptionType.d.ts +2 -2
- package/dist/generators/ts/OptionType.js +7 -5
- package/dist/generators/ts/SetType.d.ts +3 -3
- package/dist/generators/ts/SetType.js +8 -10
- package/dist/generators/ts/Snippets.d.ts +26 -8
- package/dist/generators/ts/Snippets.js +161 -35
- package/dist/generators/ts/StringType.d.ts +4 -3
- package/dist/generators/ts/StringType.js +18 -11
- package/dist/generators/ts/TermType.d.ts +7 -5
- package/dist/generators/ts/TermType.js +28 -9
- package/dist/generators/ts/TsGenerator.js +11 -6
- package/dist/generators/ts/Type.d.ts +4 -4
- package/dist/generators/ts/TypeFactory.d.ts +5 -5
- package/dist/generators/ts/TypeFactory.js +79 -58
- package/dist/generators/ts/UnionType.d.ts +23 -18
- package/dist/generators/ts/UnionType.js +227 -221
- package/dist/generators/ts/ZodGenerator.js +15 -7
- package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +24 -15
- package/dist/generators/ts/_ObjectType/AbstractProperty.js +1 -24
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.d.ts +8 -6
- package/dist/generators/ts/_ObjectType/DiscriminantProperty.js +11 -24
- package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +8 -2
- package/dist/generators/ts/_ObjectType/IdentifierProperty.js +44 -16
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +28 -0
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionDeclaration.js → ObjectType_equalsFunctionExpression.js} +6 -10
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_filterTypeDeclaration.js → ObjectType_filterTypeExpression.js} +6 -8
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionExpression.js} +5 -9
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.js → ObjectType_focusSparqlWherePatternsFunctionExpression.js} +5 -9
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfResourceFunctionDeclaration.js → ObjectType_fromRdfResourceFunctionExpression.js} +8 -16
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_graphqlTypeVariableStatement.js → ObjectType_graphqlTypeExpression.js} +6 -13
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.js +30 -0
- package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{identifierTypeDeclarations.js → ObjectType_identifierTypeDeclarations.js} +2 -5
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +1 -2
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +2 -6
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_jsonSchemaFunctionDeclaration.js → ObjectType_jsonSchemaExpression.js} +3 -10
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +17 -0
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.js +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +5 -9
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +4 -8
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.js +14 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_toRdfResourceFunctionDeclaration.js → ObjectType_toRdfResourceFunctionExpression.js} +6 -12
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.js +7 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.js +5 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +8 -0
- package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts} +2 -3
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +10 -0
- package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +9 -2
- package/dist/generators/ts/_ObjectType/ShaclProperty.js +65 -33
- package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +4 -3
- package/dist/generators/ts/_snippets/snippets_DateSchema.js +4 -3
- package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +3 -3
- package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +6 -5
- package/dist/generators/ts/_snippets/snippets_IdentifierSchema.js +2 -1
- package/dist/generators/ts/_snippets/snippets_IriSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_Lazy.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_Lazy.js +22 -0
- package/dist/generators/ts/_snippets/snippets_LazyOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LazyOption.js +25 -0
- package/dist/generators/ts/_snippets/snippets_LazySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LazySet.js +40 -0
- package/dist/generators/ts/_snippets/snippets_LiteralFilter.js +1 -3
- package/dist/generators/ts/_snippets/snippets_LiteralSchema.js +1 -0
- package/dist/generators/ts/_snippets/snippets_NumericSchema.js +2 -1
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +6 -8
- package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +32 -32
- package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
- package/dist/generators/ts/_snippets/snippets_StringSchema.js +5 -3
- package/dist/generators/ts/_snippets/snippets_TermFilter.js +3 -3
- package/dist/generators/ts/_snippets/snippets_TermSchema.js +4 -2
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazy.js +15 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +33 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +27 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.js +10 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterNumeric.js +1 -1
- package/dist/generators/ts/_snippets/snippets_filterTerm.js +1 -2
- package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.js +15 -0
- package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.js +11 -0
- package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.js +8 -0
- package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.js +8 -0
- package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.js +9 -0
- package/dist/generators/ts/_snippets/snippets_shaclPropertyFromRdf.js +13 -7
- package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.js +6 -0
- package/dist/generators/ts/_snippets/snippets_termFilterSparqlPatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.js +17 -0
- package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.js +60 -0
- package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
- package/dist/input/generated.d.ts +464 -389
- package/dist/input/generated.js +1748 -2294
- package/package.json +2 -2
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.d.ts +0 -9
- package/dist/ast/LazyObjectOptionType.d.ts +0 -6
- package/dist/ast/LazyObjectOptionType.js +0 -5
- package/dist/ast/LazyObjectSetType.d.ts +0 -6
- package/dist/ast/LazyObjectSetType.js +0 -5
- package/dist/ast/LazyObjectType.d.ts +0 -5
- package/dist/ast/LazyObjectType.js +0 -5
- package/dist/ast/ObjectCompoundType.d.ts +0 -12
- package/dist/ast/ObjectIntersectionType.d.ts +0 -4
- package/dist/ast/ObjectIntersectionType.js +0 -2
- package/dist/ast/ObjectUnionType.d.ts +0 -4
- package/dist/ast/ObjectUnionType.js +0 -2
- package/dist/generators/ts/LazyObjectSetType.d.ts +0 -20
- package/dist/generators/ts/LazyObjectType.d.ts +0 -19
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +0 -44
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.js +0 -21
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +0 -18
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.js +0 -10
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +0 -41
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +0 -12
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +0 -9
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +0 -12
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +0 -20
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.js +0 -29
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +0 -11
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +0 -13
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/_snippets/snippets_LazyObject.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObject.js +0 -22
- package/dist/generators/ts/_snippets/snippets_LazyObjectOption.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObjectOption.js +0 -25
- package/dist/generators/ts/_snippets/snippets_LazyObjectSet.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_LazyObjectSet.js +0 -40
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.js +0 -15
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.js +0 -31
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.js +0 -25
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +0 -15
- package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.js +0 -23
|
@@ -3,10 +3,11 @@ import { Maybe } from "purify-ts";
|
|
|
3
3
|
import { AbstractLiteralType } from "./AbstractLiteralType.js";
|
|
4
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export declare class LiteralType extends AbstractLiteralType {
|
|
6
|
-
readonly
|
|
6
|
+
protected readonly inlineExpression: Code;
|
|
7
7
|
readonly conversionFunction: Maybe<AbstractLiteralType.ConversionFunction>;
|
|
8
8
|
readonly filterFunction: Code;
|
|
9
9
|
readonly filterType: Code;
|
|
10
|
+
readonly fromRdfResourceValuesFunction: Code;
|
|
10
11
|
readonly jsTypes: readonly [{
|
|
11
12
|
readonly instanceof: "Object";
|
|
12
13
|
readonly typeof: "object";
|
|
@@ -20,7 +21,7 @@ export declare class LiteralType extends AbstractLiteralType {
|
|
|
20
21
|
graphqlResolveExpression(_parameters: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
|
|
21
22
|
jsonSchema({ includeDiscriminantProperty, }: Parameters<AbstractLiteralType["jsonSchema"]>[0]): Code;
|
|
22
23
|
jsonType(parameters?: Parameters<AbstractLiteralType["jsonType"]>[0]): AbstractLiteralType.JsonType;
|
|
23
|
-
|
|
24
|
+
literalValueExpression(literal: Literal): Code;
|
|
24
25
|
toJsonExpression({ includeDiscriminantProperty, variables, }: Parameters<AbstractLiteralType["toJsonExpression"]>[0]): Code;
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=LiteralType.d.ts.map
|
|
@@ -3,7 +3,7 @@ import { Maybe } from "purify-ts";
|
|
|
3
3
|
import { AbstractLiteralType } from "./AbstractLiteralType.js";
|
|
4
4
|
import { arrayOf, code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export class LiteralType extends AbstractLiteralType {
|
|
6
|
-
|
|
6
|
+
inlineExpression = code `${this.reusables.imports.Literal}`;
|
|
7
7
|
conversionFunction = Maybe.of({
|
|
8
8
|
code: code `${this.reusables.snippets.convertToLiteral}`,
|
|
9
9
|
sourceTypes: [
|
|
@@ -23,6 +23,7 @@ export class LiteralType extends AbstractLiteralType {
|
|
|
23
23
|
});
|
|
24
24
|
filterFunction = code `${this.reusables.snippets.filterLiteral}`;
|
|
25
25
|
filterType = code `${this.reusables.snippets.LiteralFilter}`;
|
|
26
|
+
fromRdfResourceValuesFunction = code `${this.reusables.snippets.literalFromRdfResourceValues}`;
|
|
26
27
|
jsTypes = [
|
|
27
28
|
{ instanceof: "Object", typeof: "object" },
|
|
28
29
|
];
|
|
@@ -37,6 +38,9 @@ export class LiteralType extends AbstractLiteralType {
|
|
|
37
38
|
if (this.in_.length > 0) {
|
|
38
39
|
initializers = initializers.concat(code `in: ${arrayOf(...this.in_.map((in_) => this.rdfjsTermExpression(in_)))}`);
|
|
39
40
|
}
|
|
41
|
+
if (this.languageIn.length > 0) {
|
|
42
|
+
initializers = initializers.concat(code `languageIn: ${arrayOf(...this.languageIn)}`);
|
|
43
|
+
}
|
|
40
44
|
return initializers;
|
|
41
45
|
}
|
|
42
46
|
fromJsonExpression({ variables, }) {
|
|
@@ -57,7 +61,7 @@ export class LiteralType extends AbstractLiteralType {
|
|
|
57
61
|
: "";
|
|
58
62
|
return new AbstractLiteralType.JsonType(code `{ readonly "@language"?: string${discriminantProperty}, readonly "@type"?: string, readonly "@value": string }`);
|
|
59
63
|
}
|
|
60
|
-
|
|
64
|
+
literalValueExpression(literal) {
|
|
61
65
|
return this.rdfjsTermExpression(literal);
|
|
62
66
|
}
|
|
63
67
|
toJsonExpression({ includeDiscriminantProperty, variables, }) {
|
|
@@ -12,7 +12,6 @@ import type { Type } from "./Type.js";
|
|
|
12
12
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
13
13
|
export declare class ObjectType extends AbstractType {
|
|
14
14
|
protected readonly toRdfTypes: readonly NamedNode[];
|
|
15
|
-
readonly conversionFunction: Maybe<AbstractType.ConversionFunction>;
|
|
16
15
|
readonly discriminantProperty: Maybe<ObjectType.DiscriminantProperty>;
|
|
17
16
|
readonly extern: boolean;
|
|
18
17
|
readonly fromRdfType: Maybe<NamedNode>;
|
|
@@ -24,7 +23,6 @@ export declare class ObjectType extends AbstractType {
|
|
|
24
23
|
}];
|
|
25
24
|
readonly kind = "Object";
|
|
26
25
|
readonly recursive: boolean;
|
|
27
|
-
readonly referencesObjectType = true;
|
|
28
26
|
readonly synthetic: boolean;
|
|
29
27
|
readonly validationFunction: Maybe<Code>;
|
|
30
28
|
constructor({ discriminantProperty, extern, fromRdfType, identifierType, lazyProperties, recursive, synthetic, toRdfTypes, ...superParameters }: {
|
|
@@ -39,11 +37,13 @@ export declare class ObjectType extends AbstractType {
|
|
|
39
37
|
synthetic: boolean;
|
|
40
38
|
toRdfTypes: readonly NamedNode[];
|
|
41
39
|
} & ConstructorParameters<typeof AbstractType>[0]);
|
|
40
|
+
get conversionFunction(): Maybe<AbstractType.ConversionFunction>;
|
|
42
41
|
get declaration(): Maybe<Code>;
|
|
43
42
|
get equalsFunction(): Code;
|
|
44
43
|
get expression(): Code;
|
|
45
44
|
get filterFunction(): Code;
|
|
46
45
|
get filterType(): Code;
|
|
46
|
+
get fromRdfResourceValuesFunction(): Code;
|
|
47
47
|
get fromRdfTypeVariable(): Maybe<Code>;
|
|
48
48
|
get graphqlType(): AbstractType.GraphqlType;
|
|
49
49
|
get hashFunction(): Code;
|
|
@@ -51,15 +51,27 @@ export declare class ObjectType extends AbstractType {
|
|
|
51
51
|
get mutable(): boolean;
|
|
52
52
|
get objectSetMethodNames(): ObjectType.ObjectSetMethodNames;
|
|
53
53
|
get properties(): readonly ObjectType.Property[];
|
|
54
|
+
get referencesNamedType(): boolean;
|
|
54
55
|
get schema(): Code;
|
|
55
56
|
get schemaType(): Code;
|
|
56
57
|
get toRdfResourceValueTypes(): AbstractType["toRdfResourceValueTypes"];
|
|
57
58
|
get toRdfjsResourceType(): Code;
|
|
58
59
|
get valueSparqlConstructTriplesFunction(): Code;
|
|
59
60
|
get valueSparqlWherePatternsFunction(): Code;
|
|
61
|
+
protected get constructorParameters(): {
|
|
62
|
+
hasQuestionToken: boolean;
|
|
63
|
+
signature: Code;
|
|
64
|
+
type: {
|
|
65
|
+
expression: Code;
|
|
66
|
+
};
|
|
67
|
+
variable: string;
|
|
68
|
+
};
|
|
69
|
+
protected get createFunction(): Code;
|
|
60
70
|
protected get thisVariable(): Code;
|
|
71
|
+
protected get toJsonFunction(): Code;
|
|
72
|
+
protected get toStringFunction(): Code;
|
|
73
|
+
private get inlineExpression();
|
|
61
74
|
fromJsonExpression({ variables, }: Parameters<AbstractType["fromJsonExpression"]>[0]): Code;
|
|
62
|
-
fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["fromRdfResourceValuesExpression"]>[0]): Code;
|
|
63
75
|
graphqlResolveExpression({ variables, }: {
|
|
64
76
|
variables: {
|
|
65
77
|
value: Code;
|
|
@@ -71,6 +83,7 @@ export declare class ObjectType extends AbstractType {
|
|
|
71
83
|
toJsonExpression({ variables, }: Parameters<AbstractType["toJsonExpression"]>[0]): Code;
|
|
72
84
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["toRdfResourceValuesExpression"]>[0]): Code;
|
|
73
85
|
toStringExpression({ variables, }: Parameters<AbstractType["toStringExpression"]>[0]): Code;
|
|
86
|
+
protected toStringRecordExpression({ variables, }: Parameters<AbstractType["toStringExpression"]>[0]): Code;
|
|
74
87
|
private readonly lazyProperties;
|
|
75
88
|
}
|
|
76
89
|
export declare namespace ObjectType {
|
|
@@ -7,43 +7,43 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { NodeKind } from "@shaclmate/shacl-ast";
|
|
8
8
|
import { camelCase } from "change-case";
|
|
9
9
|
import { Maybe } from "purify-ts";
|
|
10
|
+
import { invariant } from "ts-invariant";
|
|
10
11
|
import { Memoize } from "typescript-memoize";
|
|
11
12
|
import { DiscriminantProperty as _DiscriminantProperty } from "./_ObjectType/DiscriminantProperty.js";
|
|
12
13
|
import { IdentifierProperty as _IdentifierProperty } from "./_ObjectType/IdentifierProperty.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { ObjectType_graphqlTypeVariableStatement } from "./_ObjectType/ObjectType_graphqlTypeVariableStatement.js";
|
|
25
|
-
import { ObjectType_hashFunctionDeclarations } from "./_ObjectType/ObjectType_hashFunctionDeclarations.js";
|
|
26
|
-
import { ObjectType_interfaceDeclaration } from "./_ObjectType/ObjectType_interfaceDeclaration.js";
|
|
14
|
+
import { ObjectType_createFunctionExpression } from "./_ObjectType/ObjectType_createFunctionExpression.js";
|
|
15
|
+
import { ObjectType_equalsFunctionExpression } from "./_ObjectType/ObjectType_equalsFunctionExpression.js";
|
|
16
|
+
import { ObjectType_filterFunctionExpression } from "./_ObjectType/ObjectType_filterFunctionExpression.js";
|
|
17
|
+
import { ObjectType_filterTypeExpression } from "./_ObjectType/ObjectType_filterTypeExpression.js";
|
|
18
|
+
import { ObjectType_focusSparqlConstructTriplesFunctionExpression } from "./_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionExpression.js";
|
|
19
|
+
import { ObjectType_focusSparqlWherePatternsFunctionExpression } from "./_ObjectType/ObjectType_focusSparqlWherePatternsFunctionExpression.js";
|
|
20
|
+
import { ObjectType_fromJsonFunctionExpression } from "./_ObjectType/ObjectType_fromJsonFunctionExpression.js";
|
|
21
|
+
import { ObjectType_fromRdfResourceFunctionExpression } from "./_ObjectType/ObjectType_fromRdfResourceFunctionExpression.js";
|
|
22
|
+
import { ObjectType_graphqlTypeExpression } from "./_ObjectType/ObjectType_graphqlTypeExpression.js";
|
|
23
|
+
import { ObjectType_hashFunctionExpression } from "./_ObjectType/ObjectType_hashFunctionExpression.js";
|
|
24
|
+
import { ObjectType_identifierTypeDeclarations } from "./_ObjectType/ObjectType_identifierTypeDeclarations.js";
|
|
27
25
|
import { ObjectType_isTypeFunctionDeclaration } from "./_ObjectType/ObjectType_isTypeFunctionDeclaration.js";
|
|
28
26
|
import { ObjectType_jsonParseFunctionDeclaration } from "./_ObjectType/ObjectType_jsonParseFunctionDeclaration.js";
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
27
|
+
import { ObjectType_jsonSchemaExpression } from "./_ObjectType/ObjectType_jsonSchemaExpression.js";
|
|
28
|
+
import { ObjectType_jsonTypeExpression } from "./_ObjectType/ObjectType_jsonTypeExpression.js";
|
|
29
|
+
import { ObjectType_jsonUiSchemaFunctionExpression } from "./_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js";
|
|
32
30
|
import { ObjectType_objectSetMethodNames } from "./_ObjectType/ObjectType_objectSetMethodNames.js";
|
|
33
|
-
import {
|
|
31
|
+
import { ObjectType_schemaExpression } from "./_ObjectType/ObjectType_schemaExpression.js";
|
|
32
|
+
import { ObjectType_schemaTypeExpression } from "./_ObjectType/ObjectType_schemaTypeExpression.js";
|
|
34
33
|
import { ObjectType_sparqlConstructQueryFunctionDeclaration } from "./_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js";
|
|
35
34
|
import { ObjectType_sparqlConstructQueryStringFunctionDeclaration } from "./_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js";
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
35
|
+
import { ObjectType_toJsonFunctionExpression } from "./_ObjectType/ObjectType_toJsonFunctionExpression.js";
|
|
36
|
+
import { ObjectType_toRdfResourceFunctionExpression } from "./_ObjectType/ObjectType_toRdfResourceFunctionExpression.js";
|
|
37
|
+
import { ObjectType_toStringFunctionExpression } from "./_ObjectType/ObjectType_toStringFunctionExpression.js";
|
|
38
|
+
import { ObjectType_toStringRecordFunctionExpression } from "./_ObjectType/ObjectType_toStringRecordFunctionExpression.js";
|
|
39
|
+
import { ObjectType_valueSparqlConstructTriplesFunctionExpression } from "./_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js";
|
|
40
|
+
import { ObjectType_valueSparqlWherePatternsFunctionExpression } from "./_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js";
|
|
41
41
|
import { ShaclProperty as _ShaclProperty } from "./_ObjectType/ShaclProperty.js";
|
|
42
42
|
import { AbstractType } from "./AbstractType.js";
|
|
43
43
|
import { code, def, joinCode } from "./ts-poet-wrapper.js";
|
|
44
|
+
import { tsComment } from "./tsComment.js";
|
|
44
45
|
export class ObjectType extends AbstractType {
|
|
45
46
|
toRdfTypes;
|
|
46
|
-
conversionFunction = Maybe.empty();
|
|
47
47
|
discriminantProperty;
|
|
48
48
|
extern;
|
|
49
49
|
fromRdfType;
|
|
@@ -54,7 +54,6 @@ export class ObjectType extends AbstractType {
|
|
|
54
54
|
];
|
|
55
55
|
kind = "Object";
|
|
56
56
|
recursive;
|
|
57
|
-
referencesObjectType = true;
|
|
58
57
|
synthetic;
|
|
59
58
|
validationFunction = Maybe.empty();
|
|
60
59
|
constructor({ discriminantProperty, extern, fromRdfType, identifierType, lazyProperties, recursive, synthetic, toRdfTypes, ...superParameters }) {
|
|
@@ -69,41 +68,137 @@ export class ObjectType extends AbstractType {
|
|
|
69
68
|
this.synthetic = synthetic;
|
|
70
69
|
this.toRdfTypes = toRdfTypes;
|
|
71
70
|
}
|
|
71
|
+
get conversionFunction() {
|
|
72
|
+
if (this.name.isJust()) {
|
|
73
|
+
return Maybe.empty();
|
|
74
|
+
}
|
|
75
|
+
return Maybe.of({
|
|
76
|
+
code: this.createFunction,
|
|
77
|
+
sourceTypes: [
|
|
78
|
+
{
|
|
79
|
+
expression: this.constructorParameters.type.expression,
|
|
80
|
+
jsType: {
|
|
81
|
+
instanceof: "Object",
|
|
82
|
+
typeof: "object",
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
});
|
|
87
|
+
}
|
|
72
88
|
get declaration() {
|
|
73
|
-
const
|
|
74
|
-
if (!
|
|
89
|
+
const name = this.name.extract();
|
|
90
|
+
if (!name) {
|
|
75
91
|
return Maybe.empty();
|
|
76
92
|
}
|
|
77
93
|
const declarations = [];
|
|
78
94
|
if (!this.extern) {
|
|
79
|
-
const staticModuleDeclarations = [];
|
|
80
95
|
if (this.configuration.features.has("Object.type")) {
|
|
81
|
-
declarations.push(
|
|
96
|
+
declarations.push(code `\
|
|
97
|
+
${this.comment
|
|
98
|
+
.alt(this.label)
|
|
99
|
+
.map(tsComment)
|
|
100
|
+
.orDefault("")}export type ${name} = ${this.inlineExpression};`);
|
|
101
|
+
}
|
|
102
|
+
let staticModuleDeclarations = [];
|
|
103
|
+
// create
|
|
104
|
+
if (this.configuration.features.has("Object.create")) {
|
|
105
|
+
staticModuleDeclarations.push(code `export const create: (${this.constructorParameters.signature}) => ${this.reusables.imports.Either}<Error, ${this.expression}> = ${ObjectType_createFunctionExpression.call(this)};`, code `export function createUnsafe(${this.constructorParameters.signature}): ${this.expression} {
|
|
106
|
+
return create(parameters).unsafeCoerce();
|
|
107
|
+
}`);
|
|
108
|
+
}
|
|
109
|
+
// equals
|
|
110
|
+
if (this.configuration.features.has("Object.equals")) {
|
|
111
|
+
staticModuleDeclarations.push(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.push(code `export type Filter = ${ObjectType_filterTypeExpression.call(this)};`);
|
|
116
|
+
staticModuleDeclarations.push(code `export const filter: (filter: ${this.filterType}, value: ${this.expression}) => boolean = ${ObjectType_filterFunctionExpression.call(this)};`);
|
|
117
|
+
}
|
|
118
|
+
// GraphQL
|
|
119
|
+
if (this.configuration.features.has("GraphQL") && !this.synthetic) {
|
|
120
|
+
staticModuleDeclarations.push(code `export const GraphQL = ${ObjectType_graphqlTypeExpression.call(this)};`);
|
|
121
|
+
}
|
|
122
|
+
// focusSparqlConstructTriples / focusSparqlWherePatterns
|
|
123
|
+
if (this.configuration.features.has("Object.SPARQL")) {
|
|
124
|
+
staticModuleDeclarations.push(code `export const focusSparqlConstructTriples: ${this.reusables.snippets.FocusSparqlConstructTriplesFunction}<${this.filterType}> = ${ObjectType_focusSparqlConstructTriplesFunctionExpression.call(this)};`, code `export const focusSparqlWherePatterns: ${this.reusables.snippets.FocusSparqlWherePatternsFunction}<${this.filterType}> = ${ObjectType_focusSparqlWherePatternsFunctionExpression.call(this)};`);
|
|
125
|
+
}
|
|
126
|
+
// fromJson
|
|
127
|
+
if (this.configuration.features.has("Object.fromJson")) {
|
|
128
|
+
staticModuleDeclarations.push(code `export const fromJson: (json: ${this.jsonType().expression}) => ${this.reusables.imports.Either}<Error, ${this.expression}> = ${ObjectType_fromJsonFunctionExpression.call(this)};`);
|
|
129
|
+
}
|
|
130
|
+
// fromRdfResource / fromRdfResourceValues
|
|
131
|
+
if (this.configuration.features.has("Object.fromRdf")) {
|
|
132
|
+
staticModuleDeclarations.push(code `export const _fromRdfResource: ${this.reusables.snippets._FromRdfResourceFunction}<${this.expression}> = ${ObjectType_fromRdfResourceFunctionExpression.call(this)};`, code `export const fromRdfResource = ${this.reusables.snippets.wrap_FromRdfResourceFunction}(_fromRdfResource);`, code `export const fromRdfResourceValues: ${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.expression}, ${this.schemaType}> =
|
|
133
|
+
(values, options) => values.chainMap(value => value.toResource().chain(resource => fromRdfResource(resource, options)));`);
|
|
134
|
+
}
|
|
135
|
+
// hash
|
|
136
|
+
if (this.configuration.features.has("Object.hash")) {
|
|
137
|
+
staticModuleDeclarations.push(code `export const hash = ${ObjectType_hashFunctionExpression.call(this)};`);
|
|
138
|
+
}
|
|
139
|
+
// Identifier
|
|
140
|
+
if (this.configuration.features.has("Object.type")) {
|
|
141
|
+
staticModuleDeclarations = staticModuleDeclarations.concat(ObjectType_identifierTypeDeclarations.call(this));
|
|
142
|
+
}
|
|
143
|
+
// isType
|
|
144
|
+
staticModuleDeclarations = staticModuleDeclarations.concat(ObjectType_isTypeFunctionDeclaration.call(this).toList());
|
|
145
|
+
// type Json
|
|
146
|
+
if (this.configuration.features.has("Object.JSON.type")) {
|
|
147
|
+
staticModuleDeclarations.push(code `export type Json = ${ObjectType_jsonTypeExpression.call(this)}`);
|
|
148
|
+
}
|
|
149
|
+
// namespace Json
|
|
150
|
+
{
|
|
151
|
+
const jsonModuleDeclarations = [];
|
|
152
|
+
if (this.configuration.features.has("Object.JSON.parse")) {
|
|
153
|
+
jsonModuleDeclarations.push(ObjectType_jsonParseFunctionDeclaration.call(this));
|
|
154
|
+
}
|
|
155
|
+
if (this.configuration.features.has("Object.JSON.schema")) {
|
|
156
|
+
jsonModuleDeclarations.push(code `export function schema() { return ${ObjectType_jsonSchemaExpression.call(this)} satisfies ${this.reusables.imports.z}.ZodType<Json>; }`);
|
|
157
|
+
}
|
|
158
|
+
if (this.configuration.features.has("Object.JSON.uiSchema")) {
|
|
159
|
+
jsonModuleDeclarations.push(code `export const uiSchema = ${ObjectType_jsonUiSchemaFunctionExpression.call(this)};`);
|
|
160
|
+
}
|
|
161
|
+
if (jsonModuleDeclarations.length > 0) {
|
|
162
|
+
staticModuleDeclarations.push(code `export namespace Json { ${joinCode(jsonModuleDeclarations, { on: "\n\n" })} }`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// schema / Schema
|
|
166
|
+
if (this.configuration.features.has("Object.schema")) {
|
|
167
|
+
staticModuleDeclarations.push(code `export const schema = ${ObjectType_schemaExpression.call(this)};`, code `export type Schema = typeof schema;`);
|
|
168
|
+
}
|
|
169
|
+
// sparqlConstructQuery / sparqlConstructQueryString
|
|
170
|
+
if (this.configuration.features.has("Object.SPARQL")) {
|
|
171
|
+
staticModuleDeclarations.push(ObjectType_sparqlConstructQueryFunctionDeclaration.call({
|
|
172
|
+
name,
|
|
173
|
+
configuration: this.configuration,
|
|
174
|
+
filterType: this.filterType,
|
|
175
|
+
reusables: this.reusables,
|
|
176
|
+
}), ObjectType_sparqlConstructQueryStringFunctionDeclaration.call({
|
|
177
|
+
name,
|
|
178
|
+
configuration: this.configuration,
|
|
179
|
+
filterType: this.filterType,
|
|
180
|
+
reusables: this.reusables,
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
// toJson
|
|
184
|
+
if (this.configuration.features.has("Object.toJson")) {
|
|
185
|
+
staticModuleDeclarations.push(code `export const toJson: (${this.thisVariable}: ${this.expression}) => ${this.jsonType().expression} = ${ObjectType_toJsonFunctionExpression.call(this)};`);
|
|
186
|
+
}
|
|
187
|
+
// toRdfResource
|
|
188
|
+
if (this.configuration.features.has("Object.toRdf")) {
|
|
189
|
+
staticModuleDeclarations.push(code `export const _toRdfResource: ${this.reusables.snippets._ToRdfResourceFunction}<${this.identifierTypeAlias}, ${this.expression}> = ${ObjectType_toRdfResourceFunctionExpression.call(this)};`, code `export const toRdfResource = ${this.reusables.snippets.wrap_ToRdfResourceFunction}(_toRdfResource);`);
|
|
190
|
+
}
|
|
191
|
+
// toString / toStringRecord
|
|
192
|
+
if (this.configuration.features.has("Object.toString")) {
|
|
193
|
+
staticModuleDeclarations.push(code `export const ${this.configuration.syntheticNamePrefix}toString: (${this.thisVariable}: ${this.expression}) => string = ${ObjectType_toStringFunctionExpression.call(this)};`, code `export const toStringRecord: (${this.thisVariable}: ${this.expression}) => Record<string, string> = ${ObjectType_toStringRecordFunctionExpression.call(this)};`);
|
|
194
|
+
}
|
|
195
|
+
// valueSparqlConstructTriples / valueSparqlWherePatterns
|
|
196
|
+
if (this.configuration.features.has("Object.SPARQL")) {
|
|
197
|
+
staticModuleDeclarations.push(code `export const valueSparqlConstructTriples: ${this.reusables.snippets.ValueSparqlConstructTriplesFunction}<${this.filterType}, ${this.schemaType}> = ${ObjectType_valueSparqlConstructTriplesFunctionExpression.call(this)};`, code `export const valueSparqlWherePatterns: ${this.reusables.snippets.ValueSparqlWherePatternsFunction}<${this.filterType}, ${this.schemaType}> = ${ObjectType_valueSparqlWherePatternsFunctionExpression.call(this)};`);
|
|
82
198
|
}
|
|
83
|
-
staticModuleDeclarations.push(...ObjectType_createFunctionDeclaration.call(this).toList(), ...ObjectType_equalsFunctionDeclaration.call(this).toList(), ...ObjectType_hashFunctionDeclarations.call(this));
|
|
84
|
-
const jsonModuleDeclarations = [
|
|
85
|
-
...ObjectType_jsonParseFunctionDeclaration.call(this).toList(),
|
|
86
|
-
...ObjectType_jsonSchemaFunctionDeclaration.call(this).toList(),
|
|
87
|
-
...ObjectType_jsonUiSchemaFunctionDeclaration.call(this).toList(),
|
|
88
|
-
];
|
|
89
|
-
staticModuleDeclarations.push(...ObjectType_graphqlTypeVariableStatement.call(this).toList(), ...identifierTypeDeclarations.call(this), ...ObjectType_jsonTypeAliasDeclaration.call(this).toList(), ...(jsonModuleDeclarations.length > 0
|
|
90
|
-
? [
|
|
91
|
-
code `export namespace Json { ${joinCode(jsonModuleDeclarations, { on: "\n\n" })} }`,
|
|
92
|
-
]
|
|
93
|
-
: []), ...ObjectType_filterFunctionDeclaration.call(this).toList(), ...ObjectType_filterTypeDeclaration.call(this).toList(), ...ObjectType_focusSparqlConstructTriplesFunctionDeclaration.call(this).toList(), ...ObjectType_focusSparqlWherePatternsFunctionDeclaration.call(this).toList(), ...ObjectType_fromJsonFunctionDeclaration.call(this).toList(), ...ObjectType_fromRdfResourceFunctionDeclaration.call(this).toList(), ...ObjectType_fromRdfResourceValuesFunctionDeclaration.call(this).toList(), ...ObjectType_fromRdfTypeVariableStatement.call(this).toList(), ...ObjectType_isTypeFunctionDeclaration.call(this).toList(), ...ObjectType_schemaVariableStatement.call(this).toList(), ...ObjectType_sparqlConstructQueryFunctionDeclaration.call({
|
|
94
|
-
alias,
|
|
95
|
-
configuration: this.configuration,
|
|
96
|
-
filterType: this.filterType,
|
|
97
|
-
reusables: this.reusables,
|
|
98
|
-
}).toList(), ...ObjectType_sparqlConstructQueryStringFunctionDeclaration.call({
|
|
99
|
-
alias,
|
|
100
|
-
configuration: this.configuration,
|
|
101
|
-
filterType: this.filterType,
|
|
102
|
-
reusables: this.reusables,
|
|
103
|
-
}).toList(), ...ObjectType_toJsonFunctionDeclaration.call(this).toList(), ...ObjectType_toRdfResourceFunctionDeclaration.call(this).toList(), ...ObjectType_toStringFunctionDeclarations.call(this), ...ObjectType_valueSparqlConstructTriplesFunctionDeclaration.call(this).toList(), ...ObjectType_valueSparqlWherePatternsFunctionDeclaration.call(this).toList());
|
|
104
199
|
if (staticModuleDeclarations.length > 0) {
|
|
105
200
|
declarations.push(code `\
|
|
106
|
-
export namespace ${def(
|
|
201
|
+
export namespace ${def(name)} {
|
|
107
202
|
${joinCode(staticModuleDeclarations, { on: "\n\n" })}
|
|
108
203
|
}`);
|
|
109
204
|
}
|
|
@@ -114,53 +209,83 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
|
|
|
114
209
|
return Maybe.of(joinCode(declarations, { on: "\n\n" }));
|
|
115
210
|
}
|
|
116
211
|
get equalsFunction() {
|
|
117
|
-
return
|
|
212
|
+
return this.name
|
|
213
|
+
.map((name) => code `${name}.equals`)
|
|
214
|
+
.orDefaultLazy(() => ObjectType_equalsFunctionExpression.call(this));
|
|
118
215
|
}
|
|
119
216
|
get expression() {
|
|
120
|
-
return
|
|
217
|
+
return this.name
|
|
218
|
+
.map((name) => code `${name}`)
|
|
219
|
+
.orDefaultLazy(() => this.inlineExpression);
|
|
121
220
|
}
|
|
122
221
|
get filterFunction() {
|
|
123
|
-
return
|
|
222
|
+
return this.name
|
|
223
|
+
.map((name) => code `${name}.filter`)
|
|
224
|
+
.orDefaultLazy(() => ObjectType_filterFunctionExpression.call(this));
|
|
124
225
|
}
|
|
125
226
|
get filterType() {
|
|
126
|
-
return
|
|
227
|
+
return this.name
|
|
228
|
+
.map((name) => code `${name}.Filter`)
|
|
229
|
+
.orDefaultLazy(() => ObjectType_filterTypeExpression.call(this));
|
|
230
|
+
}
|
|
231
|
+
get fromRdfResourceValuesFunction() {
|
|
232
|
+
return this.name
|
|
233
|
+
.map((name) => code `${name}.fromRdfResourceValues`)
|
|
234
|
+
.orDefaultLazy(() => code `((values, options) => values.chainMap(value => value.toResource().chain(resource => ${ObjectType_fromRdfResourceFunctionExpression.call(this)}(resource, options))))`);
|
|
127
235
|
}
|
|
128
236
|
get fromRdfTypeVariable() {
|
|
129
|
-
return this.fromRdfType.map(() =>
|
|
237
|
+
return this.fromRdfType.map((fromRdfType) => this.name
|
|
238
|
+
.map((name) => code `${name}.schema.fromRdfType`)
|
|
239
|
+
.orDefaultLazy(() => this.rdfjsTermExpression(fromRdfType)));
|
|
130
240
|
}
|
|
131
241
|
get graphqlType() {
|
|
132
|
-
return new AbstractType.GraphqlType(
|
|
242
|
+
return new AbstractType.GraphqlType(this.name
|
|
243
|
+
.map((name) => code `${name}.GraphQL`)
|
|
244
|
+
.orDefaultLazy(() => ObjectType_graphqlTypeExpression.call(this)), this.reusables);
|
|
133
245
|
}
|
|
134
246
|
get hashFunction() {
|
|
135
|
-
return
|
|
247
|
+
return this.name
|
|
248
|
+
.map((name) => code `${name}.hash`)
|
|
249
|
+
.orDefaultLazy(() => ObjectType_hashFunctionExpression.call(this));
|
|
136
250
|
}
|
|
137
251
|
get identifierTypeAlias() {
|
|
138
|
-
return code `${this.
|
|
252
|
+
return code `${this.name.unsafeCoerce()}.Identifier`;
|
|
139
253
|
}
|
|
140
254
|
get mutable() {
|
|
141
255
|
return this.properties.some((property) => property.mutable);
|
|
142
256
|
}
|
|
143
257
|
get objectSetMethodNames() {
|
|
144
258
|
return ObjectType_objectSetMethodNames.call({
|
|
145
|
-
|
|
259
|
+
name: this.name.unsafeCoerce(),
|
|
146
260
|
configuration: this.configuration,
|
|
147
261
|
});
|
|
148
262
|
}
|
|
149
263
|
get properties() {
|
|
150
264
|
const properties = this.lazyProperties(this);
|
|
151
|
-
|
|
152
|
-
for (const property of properties) {
|
|
153
|
-
if (propertyNames.has(property.name)) {
|
|
154
|
-
throw new Error(`duplicate property '${property.name}'`);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
265
|
+
invariant(properties.length > 0, `${this.name.extract()}: empty properties`);
|
|
157
266
|
return properties;
|
|
158
267
|
}
|
|
268
|
+
get referencesNamedType() {
|
|
269
|
+
return (this.name.isJust() ||
|
|
270
|
+
this.properties.some((property) => {
|
|
271
|
+
switch (property.kind) {
|
|
272
|
+
case "Identifier":
|
|
273
|
+
case "Shacl":
|
|
274
|
+
return property.type.referencesNamedType;
|
|
275
|
+
default:
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
}));
|
|
279
|
+
}
|
|
159
280
|
get schema() {
|
|
160
|
-
return
|
|
281
|
+
return this.name
|
|
282
|
+
.map((name) => code `${name}.schema`)
|
|
283
|
+
.orDefaultLazy(() => ObjectType_schemaExpression.call(this));
|
|
161
284
|
}
|
|
162
285
|
get schemaType() {
|
|
163
|
-
return
|
|
286
|
+
return this.name
|
|
287
|
+
.map((name) => code `${name}.Schema`)
|
|
288
|
+
.orDefaultLazy(() => ObjectType_schemaTypeExpression.call(this));
|
|
164
289
|
}
|
|
165
290
|
get toRdfResourceValueTypes() {
|
|
166
291
|
return new Set([...this.identifierType.nodeKinds].map(NodeKind.toTermType));
|
|
@@ -169,54 +294,121 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
|
|
|
169
294
|
return code `${this.reusables.imports.Resource}${this.identifierType.kind === "Iri" ? code `<${this.reusables.imports.NamedNode}>` : ""}`;
|
|
170
295
|
}
|
|
171
296
|
get valueSparqlConstructTriplesFunction() {
|
|
172
|
-
return
|
|
297
|
+
return this.name
|
|
298
|
+
.map((name) => code `${name}.valueSparqlConstructTriples`)
|
|
299
|
+
.orDefaultLazy(() => ObjectType_valueSparqlConstructTriplesFunctionExpression.call(this));
|
|
173
300
|
}
|
|
174
301
|
get valueSparqlWherePatternsFunction() {
|
|
175
|
-
return
|
|
302
|
+
return this.name
|
|
303
|
+
.map((name) => code `${name}.valueSparqlWherePatterns`)
|
|
304
|
+
.orDefaultLazy(() => ObjectType_valueSparqlWherePatternsFunctionExpression.call(this));
|
|
305
|
+
}
|
|
306
|
+
get constructorParameters() {
|
|
307
|
+
let hasQuestionToken = true;
|
|
308
|
+
const propertySignatures = [];
|
|
309
|
+
for (const property of this.properties) {
|
|
310
|
+
property.constructorParameter.ifJust((propertyConstructorParameter) => {
|
|
311
|
+
hasQuestionToken =
|
|
312
|
+
hasQuestionToken && propertyConstructorParameter.hasQuestionToken;
|
|
313
|
+
propertySignatures.push(propertyConstructorParameter.signature);
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
invariant(propertySignatures.length > 0);
|
|
317
|
+
const typeExpression = code `{ ${joinCode(propertySignatures)} }`;
|
|
318
|
+
return {
|
|
319
|
+
hasQuestionToken,
|
|
320
|
+
signature: code `parameters${hasQuestionToken ? "?" : ""}: ${typeExpression}`,
|
|
321
|
+
type: {
|
|
322
|
+
expression: typeExpression,
|
|
323
|
+
},
|
|
324
|
+
variable: "parameters",
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
get createFunction() {
|
|
328
|
+
return this.name
|
|
329
|
+
.map((name) => code `${name}.create`)
|
|
330
|
+
.orDefaultLazy(() => ObjectType_createFunctionExpression.call(this));
|
|
176
331
|
}
|
|
177
332
|
get thisVariable() {
|
|
178
|
-
return
|
|
333
|
+
return this.name
|
|
334
|
+
.map((name) => code `_${camelCase(name)}`)
|
|
335
|
+
.orDefault(code `_object`);
|
|
336
|
+
}
|
|
337
|
+
get toJsonFunction() {
|
|
338
|
+
return this.name
|
|
339
|
+
.map((name) => code `${name}.toJson`)
|
|
340
|
+
.orDefaultLazy(() => ObjectType_toJsonFunctionExpression.call(this));
|
|
341
|
+
}
|
|
342
|
+
get toStringFunction() {
|
|
343
|
+
return this.name
|
|
344
|
+
.map((name) => code `${name}.${this.configuration.syntheticNamePrefix}toString`)
|
|
345
|
+
.orDefaultLazy(() => ObjectType_toStringFunctionExpression.call(this));
|
|
346
|
+
}
|
|
347
|
+
get inlineExpression() {
|
|
348
|
+
return code `{ ${joinCode(this.properties.map((property) => property.declaration), { on: "\n\n" })} }`;
|
|
179
349
|
}
|
|
180
350
|
fromJsonExpression({ variables, }) {
|
|
181
351
|
// Assumes the JSON object has been recursively validated already.
|
|
182
|
-
return code `${this.
|
|
183
|
-
}
|
|
184
|
-
fromRdfResourceValuesExpression({ variables, }) {
|
|
185
|
-
const { resourceValues: resourceValuesVariable, ...fromRdfResourceValuesOptionsTemp } = variables;
|
|
186
|
-
const fromRdfResourceValuesOptions = fromRdfResourceValuesOptionsTemp;
|
|
187
|
-
if (!this.configuration.features.has("ObjectSet")) {
|
|
188
|
-
delete fromRdfResourceValuesOptions["objectSet"];
|
|
189
|
-
}
|
|
190
|
-
return code `${this.alias.unsafeCoerce()}.fromRdfResourceValues(${resourceValuesVariable}, ${fromRdfResourceValuesOptions})`;
|
|
352
|
+
return code `${this.name.map((name) => code `${name}.fromJson`).orDefaultLazy(() => ObjectType_fromJsonFunctionExpression.call(this))}(${variables.value})`;
|
|
191
353
|
}
|
|
192
354
|
graphqlResolveExpression({ variables, }) {
|
|
193
355
|
return variables.value;
|
|
194
356
|
}
|
|
195
357
|
jsonSchema({ context, }) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
358
|
+
return this.name
|
|
359
|
+
.map((name) => {
|
|
360
|
+
let expression = code `${name}.Json.schema()`;
|
|
361
|
+
if (context === "property" &&
|
|
362
|
+
this.properties.some((property) => property.recursive)) {
|
|
363
|
+
expression = code `${this.reusables.imports.z}.lazy((): ${this.reusables.imports.z}.ZodType<${name}.Json> => ${expression})`;
|
|
364
|
+
}
|
|
365
|
+
return expression;
|
|
366
|
+
})
|
|
367
|
+
.orDefaultLazy(() => ObjectType_jsonSchemaExpression.call(this));
|
|
202
368
|
}
|
|
203
369
|
jsonType() {
|
|
204
|
-
return new AbstractType.JsonType(
|
|
370
|
+
return new AbstractType.JsonType(this.name
|
|
371
|
+
.map((name) => code `${name}.Json`)
|
|
372
|
+
.orDefaultLazy(() => ObjectType_jsonTypeExpression.call(this)));
|
|
205
373
|
}
|
|
206
374
|
jsonUiSchemaElement({ variables, }) {
|
|
207
|
-
return Maybe.of(code `${this.
|
|
375
|
+
return Maybe.of(code `${this.name
|
|
376
|
+
.map((name) => code `${name}.Json.uiSchema`)
|
|
377
|
+
.orDefaultLazy(() => ObjectType_jsonUiSchemaFunctionExpression.call(this))}({ scopePrefix: ${variables.scopePrefix} })`);
|
|
208
378
|
}
|
|
209
379
|
toJsonExpression({ variables, }) {
|
|
210
|
-
|
|
380
|
+
const toJsonFunction = this.name
|
|
381
|
+
.map((name) => code `${name}.toJson`)
|
|
382
|
+
.orDefaultLazy(() => ObjectType_toJsonFunctionExpression.call(this));
|
|
383
|
+
return code `${toJsonFunction}(${variables.value})`;
|
|
211
384
|
}
|
|
212
385
|
toRdfResourceValuesExpression({ variables, }) {
|
|
213
|
-
|
|
386
|
+
const toRdfResourceFunction = this.name
|
|
387
|
+
.map((name) => code `${name}.toRdfResource`)
|
|
388
|
+
.orDefaultLazy(() => code `${this.reusables.snippets.wrap_ToRdfResourceFunction}<${this.identifierType.expression}, ${this.expression}>(${ObjectType_toRdfResourceFunctionExpression.call(this)})`);
|
|
389
|
+
return code `[${toRdfResourceFunction}(${variables.value}, { graph: ${variables.graph}, resourceSet: ${variables.resourceSet} }).identifier]`;
|
|
214
390
|
}
|
|
215
391
|
toStringExpression({ variables, }) {
|
|
216
|
-
return
|
|
392
|
+
return this.name
|
|
393
|
+
.map((name) => code `${name}.${this.configuration.syntheticNamePrefix}toString(${variables.value})`)
|
|
394
|
+
.orDefaultLazy(() => code `JSON.stringify(${this.toStringRecordExpression({ variables })})`);
|
|
395
|
+
}
|
|
396
|
+
toStringRecordExpression({ variables, }) {
|
|
397
|
+
return code `${this.reusables.snippets.compactRecord}({${joinCode(this.properties.flatMap((property) => property
|
|
398
|
+
.toStringInitializer({
|
|
399
|
+
variables: {
|
|
400
|
+
value: property.accessExpression({
|
|
401
|
+
variables: { object: variables.value },
|
|
402
|
+
}),
|
|
403
|
+
},
|
|
404
|
+
})
|
|
405
|
+
.toList()), { on: "," })}})`;
|
|
217
406
|
}
|
|
218
407
|
lazyProperties;
|
|
219
408
|
}
|
|
409
|
+
__decorate([
|
|
410
|
+
Memoize()
|
|
411
|
+
], ObjectType.prototype, "conversionFunction", null);
|
|
220
412
|
__decorate([
|
|
221
413
|
Memoize()
|
|
222
414
|
], ObjectType.prototype, "equalsFunction", null);
|
|
@@ -229,6 +421,9 @@ __decorate([
|
|
|
229
421
|
__decorate([
|
|
230
422
|
Memoize()
|
|
231
423
|
], ObjectType.prototype, "filterType", null);
|
|
424
|
+
__decorate([
|
|
425
|
+
Memoize()
|
|
426
|
+
], ObjectType.prototype, "fromRdfResourceValuesFunction", null);
|
|
232
427
|
__decorate([
|
|
233
428
|
Memoize()
|
|
234
429
|
], ObjectType.prototype, "fromRdfTypeVariable", null);
|
|
@@ -250,6 +445,9 @@ __decorate([
|
|
|
250
445
|
__decorate([
|
|
251
446
|
Memoize()
|
|
252
447
|
], ObjectType.prototype, "properties", null);
|
|
448
|
+
__decorate([
|
|
449
|
+
Memoize()
|
|
450
|
+
], ObjectType.prototype, "referencesNamedType", null);
|
|
253
451
|
__decorate([
|
|
254
452
|
Memoize()
|
|
255
453
|
], ObjectType.prototype, "schema", null);
|
|
@@ -268,9 +466,21 @@ __decorate([
|
|
|
268
466
|
__decorate([
|
|
269
467
|
Memoize()
|
|
270
468
|
], ObjectType.prototype, "valueSparqlWherePatternsFunction", null);
|
|
469
|
+
__decorate([
|
|
470
|
+
Memoize()
|
|
471
|
+
], ObjectType.prototype, "constructorParameters", null);
|
|
472
|
+
__decorate([
|
|
473
|
+
Memoize()
|
|
474
|
+
], ObjectType.prototype, "createFunction", null);
|
|
271
475
|
__decorate([
|
|
272
476
|
Memoize()
|
|
273
477
|
], ObjectType.prototype, "thisVariable", null);
|
|
478
|
+
__decorate([
|
|
479
|
+
Memoize()
|
|
480
|
+
], ObjectType.prototype, "toJsonFunction", null);
|
|
481
|
+
__decorate([
|
|
482
|
+
Memoize()
|
|
483
|
+
], ObjectType.prototype, "toStringFunction", null);
|
|
274
484
|
__decorate([
|
|
275
485
|
Memoize()
|
|
276
486
|
], ObjectType.prototype, "jsonType", null);
|