@shaclmate/compiler 4.0.41 → 4.0.43
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 +11 -43
- 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 +9 -4
- 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 +511 -386
- package/dist/input/generated.js +1780 -2293
- 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BlankNode, NamedNode } from "@rdfjs/types";
|
|
1
2
|
import type { Maybe } from "purify-ts";
|
|
2
3
|
import type { Logger } from "ts-log";
|
|
3
4
|
import type { Reusables } from "./Reusables.js";
|
|
@@ -11,10 +12,6 @@ export declare abstract class AbstractType {
|
|
|
11
12
|
protected readonly configuration: TsGenerator.Configuration;
|
|
12
13
|
protected readonly logger: Logger;
|
|
13
14
|
protected readonly reusables: Reusables;
|
|
14
|
-
/**
|
|
15
|
-
* Alias for this type.
|
|
16
|
-
*/
|
|
17
|
-
readonly alias: Maybe<string>;
|
|
18
15
|
/**
|
|
19
16
|
* Comment from rdfs:comment.
|
|
20
17
|
*/
|
|
@@ -38,7 +35,7 @@ export declare abstract class AbstractType {
|
|
|
38
35
|
*/
|
|
39
36
|
abstract readonly discriminantProperty: Maybe<AbstractType.DiscriminantProperty>;
|
|
40
37
|
/**
|
|
41
|
-
* A function (reference or
|
|
38
|
+
* A function (reference or literal) that compares two property values of this type, returning a
|
|
42
39
|
* $EqualsResult.
|
|
43
40
|
*/
|
|
44
41
|
abstract readonly equalsFunction: Code;
|
|
@@ -47,7 +44,7 @@ export declare abstract class AbstractType {
|
|
|
47
44
|
*/
|
|
48
45
|
abstract readonly expression: Code;
|
|
49
46
|
/**
|
|
50
|
-
* A function (reference or
|
|
47
|
+
* A function (reference or literal) that takes a filter of filterType (below) and a value of this type
|
|
51
48
|
* and returns true if the value passes the filter.
|
|
52
49
|
*/
|
|
53
50
|
abstract readonly filterFunction: Code;
|
|
@@ -55,6 +52,27 @@ export declare abstract class AbstractType {
|
|
|
55
52
|
* Composite type for filtering instances of this type e.g., SomeObject.Filter with filters for each property.
|
|
56
53
|
*/
|
|
57
54
|
abstract readonly filterType: Code;
|
|
55
|
+
/**
|
|
56
|
+
* A FromRdfResourceValuesFunction (reference or literal) that converts a Either<Error, rdfjsResource.Resource.Values> to a
|
|
57
|
+
* Either<Error, rdfjsResource.Resource.Values<this type>>.
|
|
58
|
+
*
|
|
59
|
+
* These functions are used to deserialize property values in an ObjectType, either directly (a property with this type) or indirectly (a property with a type like OptionType
|
|
60
|
+
* that has a type parameter of this type).
|
|
61
|
+
*
|
|
62
|
+
* Some types need to filter on the set of all objects/values of a (subject, predicate). For example, all sh:hasValue values must be present in the set for any values
|
|
63
|
+
* to be considered valid. Similarly, values may also need to be sorted. For example, specifying preferredLanguages should sort the values in the order of the specified languages so that the first value
|
|
64
|
+
* (if it exists) is always of the first preferred language.
|
|
65
|
+
*
|
|
66
|
+
* The function takes two parameters, a rdfjsResource.Resource.Values and a parameters object with the following parameters:
|
|
67
|
+
* context: unanticipated properties (...) passed to Object.fromRdf
|
|
68
|
+
* focusResource: the Resource passed to Object.fromRdf
|
|
69
|
+
* graph: DefaultGraph | NamedNode | undefined to match (subject, predicate, object) triples in; if undefined, match triples in all graphs
|
|
70
|
+
* ignoreRdfType: whether the RDF type of objects/object unions should be ignored
|
|
71
|
+
* objectSet: the ObjectSet passed to Object.fromRdf
|
|
72
|
+
* preferredLanguages: the preferred languages array (e.g., ["en"]) passed to Object.fromRdf
|
|
73
|
+
* propertyPath: the PropertyPath of the object's property
|
|
74
|
+
*/
|
|
75
|
+
abstract readonly fromRdfResourceValuesFunction: Code;
|
|
58
76
|
/**
|
|
59
77
|
* Declarations for GraphQL arguments to pass to this the graphqlResolveExpression.
|
|
60
78
|
*/
|
|
@@ -66,7 +84,7 @@ export declare abstract class AbstractType {
|
|
|
66
84
|
*/
|
|
67
85
|
abstract readonly graphqlType: AbstractType.GraphqlType;
|
|
68
86
|
/**
|
|
69
|
-
* A function (reference or
|
|
87
|
+
* A function (reference or literal) that takes a Hasher and a value of this type, calls hasher.update on the value, and returns the Hasher.
|
|
70
88
|
*/
|
|
71
89
|
abstract readonly hashFunction: Code;
|
|
72
90
|
/**
|
|
@@ -85,6 +103,10 @@ export declare abstract class AbstractType {
|
|
|
85
103
|
* Is a value of this type mutable?
|
|
86
104
|
*/
|
|
87
105
|
abstract readonly mutable: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Name for this type.
|
|
108
|
+
*/
|
|
109
|
+
readonly name: Maybe<string>;
|
|
88
110
|
/**
|
|
89
111
|
* Does this type directly or indirectly reference itself?
|
|
90
112
|
*/
|
|
@@ -92,11 +114,15 @@ export declare abstract class AbstractType {
|
|
|
92
114
|
/**
|
|
93
115
|
* Is this type an ObjectType or does it reference an object type?
|
|
94
116
|
*/
|
|
95
|
-
abstract readonly
|
|
117
|
+
abstract readonly referencesNamedType: boolean;
|
|
96
118
|
/**
|
|
97
119
|
* TypeScript type describing .schema.
|
|
98
120
|
*/
|
|
99
121
|
abstract readonly schemaType: Code;
|
|
122
|
+
/**
|
|
123
|
+
* Identifier of the shape this type was derived from.
|
|
124
|
+
*/
|
|
125
|
+
readonly shapeIdentifier: BlankNode | NamedNode;
|
|
100
126
|
/**
|
|
101
127
|
* The type(s) of the array elements produced by the toRdfResourceValuesExpression.
|
|
102
128
|
*/
|
|
@@ -114,7 +140,7 @@ export declare abstract class AbstractType {
|
|
|
114
140
|
*/
|
|
115
141
|
abstract readonly validationFunction: Maybe<Code>;
|
|
116
142
|
/**
|
|
117
|
-
* A ValueSparqlConstructTriplesFunction (reference or
|
|
143
|
+
* A ValueSparqlConstructTriplesFunction (reference or literal) that returns an array of sparqljs.Triple's for a property value of this type.
|
|
118
144
|
*
|
|
119
145
|
* The function takes a parameters object with the following parameters:
|
|
120
146
|
* - filter: an instance of filterType | undefined
|
|
@@ -125,7 +151,7 @@ export declare abstract class AbstractType {
|
|
|
125
151
|
*/
|
|
126
152
|
abstract readonly valueSparqlConstructTriplesFunction: Code;
|
|
127
153
|
/**
|
|
128
|
-
* A ValueSparqlWherePatternsFunction (reference or
|
|
154
|
+
* A ValueSparqlWherePatternsFunction (reference or literal) that returns an array of SparqlPattern's for a property value of this type.
|
|
129
155
|
*
|
|
130
156
|
* The function takes a parameters object with the following parameters:
|
|
131
157
|
* - filter: an instance of filterType | undefined
|
|
@@ -136,18 +162,20 @@ export declare abstract class AbstractType {
|
|
|
136
162
|
* - variablePrefix: string prefix to use for new variables
|
|
137
163
|
*/
|
|
138
164
|
abstract readonly valueSparqlWherePatternsFunction: Code;
|
|
139
|
-
constructor({
|
|
140
|
-
|
|
165
|
+
constructor({ comment, configuration, label, logger, name, reusables, shapeIdentifier, }: {
|
|
166
|
+
name: Maybe<string>;
|
|
141
167
|
comment: Maybe<string>;
|
|
142
168
|
configuration: TsGenerator.Configuration;
|
|
143
169
|
label: Maybe<string>;
|
|
144
170
|
logger: Logger;
|
|
145
171
|
reusables: Reusables;
|
|
172
|
+
shapeIdentifier: BlankNode | NamedNode;
|
|
146
173
|
});
|
|
147
174
|
/**
|
|
148
175
|
* TypeScript object describing this type, for runtime use.
|
|
149
176
|
*/
|
|
150
177
|
get schema(): Code;
|
|
178
|
+
protected get schemaExpression(): Code;
|
|
151
179
|
/**
|
|
152
180
|
* Helper to compose the result of schema along the type hierarchy.
|
|
153
181
|
*/
|
|
@@ -160,41 +188,6 @@ export declare abstract class AbstractType {
|
|
|
160
188
|
value: Code;
|
|
161
189
|
};
|
|
162
190
|
}): Code;
|
|
163
|
-
/**
|
|
164
|
-
* An expression that converts a Either<Error, rdfjsResource.Resource.Values> to a
|
|
165
|
-
* Either<Error, rdfjsResource.Resource.Values<this type>>.
|
|
166
|
-
*
|
|
167
|
-
* These expressions are used to deserialize property values in an ObjectType, either directly (a property with this Type) or indirectly (a property with a Type like OptionType
|
|
168
|
-
* that has a type parameter of this Type).
|
|
169
|
-
*
|
|
170
|
-
* Some types need to filter on the set of all objects/values of a (subject, predicate). For example, all sh:hasValue values must be present in the set for any values
|
|
171
|
-
* to be considered valid. Similar
|
|
172
|
-
*
|
|
173
|
-
* Values may also need to be sorted. For example, specifying preferredLanguages should sort the values in the order of the specified languages so that the first value
|
|
174
|
-
* (if it exists) is always of the first preferred language.
|
|
175
|
-
*
|
|
176
|
-
* variables are runtime variables, most derived from the parameters of the ObjectType's fromRdf function:
|
|
177
|
-
* context: unanticipated properties (...) passed to Object.fromRdf
|
|
178
|
-
* graph: DefaultGraph | NamedNode | undefined to match (subject, predicate, object) triples in; if undefined, match triples in all graphs
|
|
179
|
-
* ignoreRdfType: whether the RDF type of objects/object unions should be ignored
|
|
180
|
-
* objectSet: the ObjectSet passed to Object.fromRdf
|
|
181
|
-
* preferredLanguages: the preferred languages array (e.g., ["en"]) passed to Object.fromRdf
|
|
182
|
-
* propertyPath: the PropertyPath of the object's property
|
|
183
|
-
* resource: the Resource passed to Object.fromRdf
|
|
184
|
-
* resourceValues: the Either<Error, rdfjsResource.Resource.Values> to be converted to values of this type
|
|
185
|
-
*/
|
|
186
|
-
abstract fromRdfResourceValuesExpression(parameters: {
|
|
187
|
-
variables: {
|
|
188
|
-
context: Code;
|
|
189
|
-
graph: Code;
|
|
190
|
-
ignoreRdfType?: boolean;
|
|
191
|
-
objectSet: Code;
|
|
192
|
-
preferredLanguages: Code;
|
|
193
|
-
propertyPath: Code;
|
|
194
|
-
resource: Code;
|
|
195
|
-
resourceValues: Code;
|
|
196
|
-
};
|
|
197
|
-
}): Code;
|
|
198
191
|
/**
|
|
199
192
|
* An expression that resolves a value of this type in the GraphQL server.
|
|
200
193
|
*/
|
|
@@ -14,10 +14,6 @@ export class AbstractType {
|
|
|
14
14
|
configuration;
|
|
15
15
|
logger;
|
|
16
16
|
reusables;
|
|
17
|
-
/**
|
|
18
|
-
* Alias for this type.
|
|
19
|
-
*/
|
|
20
|
-
alias;
|
|
21
17
|
/**
|
|
22
18
|
* Comment from rdfs:comment.
|
|
23
19
|
*/
|
|
@@ -26,23 +22,35 @@ export class AbstractType {
|
|
|
26
22
|
* Label from rdfs:label.
|
|
27
23
|
*/
|
|
28
24
|
label;
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Name for this type.
|
|
27
|
+
*/
|
|
28
|
+
name;
|
|
29
|
+
/**
|
|
30
|
+
* Identifier of the shape this type was derived from.
|
|
31
|
+
*/
|
|
32
|
+
shapeIdentifier;
|
|
33
|
+
constructor({ comment, configuration, label, logger, name, reusables, shapeIdentifier, }) {
|
|
31
34
|
this.comment = comment;
|
|
32
35
|
this.configuration = configuration;
|
|
33
36
|
this.label = label;
|
|
34
37
|
this.logger = logger;
|
|
38
|
+
this.name = name;
|
|
35
39
|
this.reusables = reusables;
|
|
36
40
|
this.rdfjsTermExpression = rdfjsTermExpression.bind({
|
|
37
41
|
imports: this.reusables.imports,
|
|
38
42
|
logger: this.logger,
|
|
39
43
|
snippets: this.reusables.snippets,
|
|
40
44
|
});
|
|
45
|
+
this.shapeIdentifier = shapeIdentifier;
|
|
41
46
|
}
|
|
42
47
|
/**
|
|
43
48
|
* TypeScript object describing this type, for runtime use.
|
|
44
49
|
*/
|
|
45
50
|
get schema() {
|
|
51
|
+
return this.schemaExpression;
|
|
52
|
+
}
|
|
53
|
+
get schemaExpression() {
|
|
46
54
|
return code `{ ${joinCode(this.schemaInitializers.concat(), { on: ", " })} }`;
|
|
47
55
|
}
|
|
48
56
|
/**
|
|
@@ -56,6 +64,9 @@ export class AbstractType {
|
|
|
56
64
|
__decorate([
|
|
57
65
|
Memoize()
|
|
58
66
|
], AbstractType.prototype, "schema", null);
|
|
67
|
+
__decorate([
|
|
68
|
+
Memoize()
|
|
69
|
+
], AbstractType.prototype, "schemaExpression", null);
|
|
59
70
|
(function (AbstractType) {
|
|
60
71
|
class GraphqlType {
|
|
61
72
|
/**
|
|
@@ -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 BigDecimalType extends AbstractLiteralType {
|
|
6
|
+
protected readonly inlineExpression: Code;
|
|
6
7
|
readonly conversionFunction: Maybe<AbstractLiteralType.ConversionFunction>;
|
|
7
|
-
readonly expression: Code;
|
|
8
8
|
readonly filterFunction: Code;
|
|
9
9
|
readonly filterType: Code;
|
|
10
|
+
readonly fromRdfResourceValuesFunction: Code;
|
|
10
11
|
readonly hashFunction: Code;
|
|
11
12
|
readonly jsTypes: readonly [{
|
|
12
13
|
readonly instanceof: "Object";
|
|
@@ -20,9 +21,8 @@ export declare class BigDecimalType extends AbstractLiteralType {
|
|
|
20
21
|
graphqlResolveExpression({ variables, }: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
|
|
21
22
|
jsonSchema(): Code;
|
|
22
23
|
jsonType(): AbstractLiteralType.JsonType;
|
|
23
|
-
|
|
24
|
+
literalValueExpression(literal: Literal): Code;
|
|
24
25
|
toJsonExpression({ variables, }: Parameters<AbstractLiteralType["toJsonExpression"]>[0]): Code;
|
|
25
26
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractLiteralType["toRdfResourceValuesExpression"]>[0]): Code;
|
|
26
|
-
protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractLiteralType["fromRdfResourceValuesExpressionChain"]>[0]): ReturnType<AbstractLiteralType["fromRdfResourceValuesExpressionChain"]>;
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=BigDecimalType.d.ts.map
|
|
@@ -9,10 +9,11 @@ import { Memoize } from "typescript-memoize";
|
|
|
9
9
|
import { AbstractLiteralType } from "./AbstractLiteralType.js";
|
|
10
10
|
import { code, literalOf } from "./ts-poet-wrapper.js";
|
|
11
11
|
export class BigDecimalType extends AbstractLiteralType {
|
|
12
|
+
inlineExpression = code `${this.reusables.imports.BigDecimal}`;
|
|
12
13
|
conversionFunction = Maybe.empty();
|
|
13
|
-
expression = code `${this.reusables.imports.BigDecimal}`;
|
|
14
14
|
filterFunction = code `${this.reusables.snippets.filterBigDecimal}`;
|
|
15
15
|
filterType = code `${this.reusables.snippets.NumericFilter}<${this.reusables.imports.BigDecimal}>`;
|
|
16
|
+
fromRdfResourceValuesFunction = code `${this.reusables.snippets.bigDecimalFromRdfResourceValues}`;
|
|
16
17
|
hashFunction = code `${this.reusables.snippets.hashBigDecimal}`;
|
|
17
18
|
jsTypes = [
|
|
18
19
|
{ instanceof: "Object", typeof: "object" },
|
|
@@ -35,7 +36,7 @@ export class BigDecimalType extends AbstractLiteralType {
|
|
|
35
36
|
jsonType() {
|
|
36
37
|
return new AbstractLiteralType.JsonType(code `string`);
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
literalValueExpression(literal) {
|
|
39
40
|
return code `new ${this.reusables.imports.BigDecimal}(${literalOf(literal.value)})`;
|
|
40
41
|
}
|
|
41
42
|
toJsonExpression({ variables, }) {
|
|
@@ -44,12 +45,6 @@ export class BigDecimalType extends AbstractLiteralType {
|
|
|
44
45
|
toRdfResourceValuesExpression({ variables, }) {
|
|
45
46
|
return code `[${this.reusables.snippets.bigDecimalLiteral}(${variables.value})]`;
|
|
46
47
|
}
|
|
47
|
-
fromRdfResourceValuesExpressionChain({ variables, }) {
|
|
48
|
-
return {
|
|
49
|
-
...super.fromRdfResourceValuesExpressionChain({ variables }),
|
|
50
|
-
valueTo: code `chain(values => values.chainMap(value => value.toLiteral().chain(${this.reusables.snippets.decodeBigDecimalLiteral})))`,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
48
|
}
|
|
54
49
|
__decorate([
|
|
55
50
|
Memoize()
|
|
@@ -6,12 +6,12 @@ export declare class BigIntType extends AbstractNumericType<bigint> {
|
|
|
6
6
|
readonly typeof: "bigint";
|
|
7
7
|
}[];
|
|
8
8
|
readonly kind = "BigInt";
|
|
9
|
+
get fromRdfResourceValuesFunction(): Code;
|
|
9
10
|
get graphqlType(): import("./AbstractType.js").AbstractType.GraphqlType;
|
|
10
11
|
fromJsonExpression({ variables, }: Parameters<AbstractNumericType<bigint>["fromJsonExpression"]>[0]): Code;
|
|
11
12
|
jsonSchema(_parameters: Parameters<AbstractNumericType<bigint>["jsonSchema"]>[0]): Code;
|
|
12
13
|
jsonType(): AbstractNumericType.JsonType;
|
|
13
|
-
|
|
14
|
+
literalValueExpression(literal: bigint | Literal): Code;
|
|
14
15
|
toJsonExpression({ variables, }: Parameters<AbstractNumericType<bigint>["toJsonExpression"]>[0]): Code;
|
|
15
|
-
protected fromRdfResourceValueExpression({ variables, }: Parameters<AbstractNumericType<bigint>["fromRdfResourceValueExpression"]>[0]): Code;
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=BigIntType.d.ts.map
|
|
@@ -11,6 +11,9 @@ import { code, joinCode, literalOf } from "./ts-poet-wrapper.js";
|
|
|
11
11
|
export class BigIntType extends AbstractNumericType {
|
|
12
12
|
jsTypes = [{ typeof: "bigint" }];
|
|
13
13
|
kind = "BigInt";
|
|
14
|
+
get fromRdfResourceValuesFunction() {
|
|
15
|
+
return code `${this.reusables.snippets.bigIntFromRdfResourceValues}<${this.expression}>`;
|
|
16
|
+
}
|
|
14
17
|
get graphqlType() {
|
|
15
18
|
return new AbstractNumericType.GraphqlType(code `${this.reusables.imports.GraphQLBigInt}`, this.reusables);
|
|
16
19
|
}
|
|
@@ -34,16 +37,16 @@ export class BigIntType extends AbstractNumericType {
|
|
|
34
37
|
jsonType() {
|
|
35
38
|
return new AbstractNumericType.JsonType(code `string`);
|
|
36
39
|
}
|
|
37
|
-
|
|
40
|
+
literalValueExpression(literal) {
|
|
38
41
|
return code `${typeof literal === "bigint" ? literal : LiteralDecoder.decodeBigIntLiteral(literal).unsafeCoerce()}n`;
|
|
39
42
|
}
|
|
40
43
|
toJsonExpression({ variables, }) {
|
|
41
44
|
return code `${variables.value}.toString()`;
|
|
42
45
|
}
|
|
43
|
-
fromRdfResourceValueExpression({ variables, }) {
|
|
44
|
-
return code `${variables.value}.toBigInt(${this.primitiveIn.length > 0 ? `[${this.primitiveIn.map((_) => `${_}n`).join(", ")}] as const` : ""})`;
|
|
45
|
-
}
|
|
46
46
|
}
|
|
47
|
+
__decorate([
|
|
48
|
+
Memoize()
|
|
49
|
+
], BigIntType.prototype, "fromRdfResourceValuesFunction", null);
|
|
47
50
|
__decorate([
|
|
48
51
|
Memoize()
|
|
49
52
|
], BigIntType.prototype, "graphqlType", null);
|
|
@@ -3,10 +3,11 @@ import { Maybe } from "purify-ts";
|
|
|
3
3
|
import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
|
|
4
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export declare class BlankNodeType extends AbstractIdentifierType<BlankNode> {
|
|
6
|
-
readonly
|
|
6
|
+
protected readonly inlineExpression: Code;
|
|
7
7
|
readonly conversionFunction: Maybe<AbstractIdentifierType.ConversionFunction>;
|
|
8
8
|
readonly filterFunction: Code;
|
|
9
9
|
readonly filterType: Code;
|
|
10
|
+
readonly fromRdfResourceValuesFunction: Code;
|
|
10
11
|
readonly kind = "BlankNode";
|
|
11
12
|
readonly nodeKinds: ReadonlySet<"BlankNode">;
|
|
12
13
|
readonly parseFunction: Code;
|
|
@@ -17,11 +18,5 @@ export declare class BlankNodeType extends AbstractIdentifierType<BlankNode> {
|
|
|
17
18
|
jsonSchema({ includeDiscriminantProperty, }: Parameters<AbstractIdentifierType<BlankNode>["jsonSchema"]>[0]): Code;
|
|
18
19
|
jsonType(parameters?: Parameters<AbstractIdentifierType<BlankNode>["jsonType"]>[0]): AbstractIdentifierType.JsonType;
|
|
19
20
|
toJsonExpression({ includeDiscriminantProperty, variables, }: Parameters<AbstractIdentifierType<BlankNode>["toJsonExpression"]>[0]): Code;
|
|
20
|
-
protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractIdentifierType<BlankNode>["fromRdfResourceValuesExpressionChain"]>[0]): {
|
|
21
|
-
valueTo: Code;
|
|
22
|
-
hasValues?: Code;
|
|
23
|
-
languageIn?: Code;
|
|
24
|
-
preferredLanguages?: Code;
|
|
25
|
-
};
|
|
26
21
|
}
|
|
27
22
|
//# sourceMappingURL=BlankNodeType.d.ts.map
|
|
@@ -9,7 +9,7 @@ import { Memoize } from "typescript-memoize";
|
|
|
9
9
|
import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
|
|
10
10
|
import { code } from "./ts-poet-wrapper.js";
|
|
11
11
|
export class BlankNodeType extends AbstractIdentifierType {
|
|
12
|
-
|
|
12
|
+
inlineExpression = code `${this.reusables.imports.BlankNode}`;
|
|
13
13
|
conversionFunction = Maybe.of({
|
|
14
14
|
code: code `${this.reusables.snippets.convertToBlankNode}`,
|
|
15
15
|
sourceTypes: [
|
|
@@ -25,6 +25,7 @@ export class BlankNodeType extends AbstractIdentifierType {
|
|
|
25
25
|
});
|
|
26
26
|
filterFunction = code `${this.reusables.snippets.filterBlankNode}`;
|
|
27
27
|
filterType = code `${this.reusables.snippets.BlankNodeFilter}`;
|
|
28
|
+
fromRdfResourceValuesFunction = code `${this.reusables.snippets.blankNodeFromRdfResourceValues}`;
|
|
28
29
|
kind = "BlankNode";
|
|
29
30
|
nodeKinds = nodeKinds;
|
|
30
31
|
parseFunction = code `${this.reusables.snippets.parseBlankNode};`;
|
|
@@ -58,12 +59,6 @@ export class BlankNodeType extends AbstractIdentifierType {
|
|
|
58
59
|
: "";
|
|
59
60
|
return code `{ "@id": \`_:\${${variables.value}.value}\`${discriminantProperty} }`;
|
|
60
61
|
}
|
|
61
|
-
fromRdfResourceValuesExpressionChain({ variables, }) {
|
|
62
|
-
return {
|
|
63
|
-
...super.fromRdfResourceValuesExpressionChain({ variables }),
|
|
64
|
-
valueTo: code `chain(values => values.chainMap(value => value.toBlankNode()))`,
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
62
|
}
|
|
68
63
|
__decorate([
|
|
69
64
|
Memoize()
|
|
@@ -11,11 +11,11 @@ export declare class BooleanType extends AbstractPrimitiveType<boolean> {
|
|
|
11
11
|
}];
|
|
12
12
|
readonly kind = "Boolean";
|
|
13
13
|
readonly valueSparqlWherePatternsFunction: Code;
|
|
14
|
-
get
|
|
14
|
+
get fromRdfResourceValuesFunction(): Code;
|
|
15
15
|
get schemaType(): Code;
|
|
16
|
+
protected get inlineExpression(): Code;
|
|
16
17
|
jsonSchema(_parameters: Parameters<AbstractPrimitiveType<number>["jsonSchema"]>[0]): Code;
|
|
17
|
-
|
|
18
|
+
literalValueExpression(literal: boolean | Literal): Code;
|
|
18
19
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractPrimitiveType<boolean>["toRdfResourceValuesExpression"]>[0]): Code;
|
|
19
|
-
protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractPrimitiveType<boolean>["fromRdfResourceValuesExpressionChain"]>[0]): ReturnType<AbstractPrimitiveType<boolean>["fromRdfResourceValuesExpressionChain"]>;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=BooleanType.d.ts.map
|
|
@@ -16,40 +16,38 @@ export class BooleanType extends AbstractPrimitiveType {
|
|
|
16
16
|
jsTypes = [{ typeof: "boolean" }];
|
|
17
17
|
kind = "Boolean";
|
|
18
18
|
valueSparqlWherePatternsFunction = code `${this.reusables.snippets.booleanSparqlWherePatterns}`;
|
|
19
|
-
get
|
|
19
|
+
get fromRdfResourceValuesFunction() {
|
|
20
|
+
return code `${this.reusables.snippets.booleanFromRdfResourceValues}<${this.expression}>`;
|
|
21
|
+
}
|
|
22
|
+
get schemaType() {
|
|
23
|
+
return code `${this.reusables.snippets.BooleanSchema}<${this.expression}>`;
|
|
24
|
+
}
|
|
25
|
+
get inlineExpression() {
|
|
20
26
|
if (this.primitiveIn.length > 0) {
|
|
21
27
|
return code `${this.primitiveIn.map((value) => value.toString()).join(" | ")}`;
|
|
22
28
|
}
|
|
23
29
|
return code `boolean`;
|
|
24
30
|
}
|
|
25
|
-
get schemaType() {
|
|
26
|
-
return code `${this.reusables.snippets.BooleanSchema}<${this.expression}>`;
|
|
27
|
-
}
|
|
28
31
|
jsonSchema(_parameters) {
|
|
29
32
|
if (this.primitiveIn.length === 1) {
|
|
30
33
|
return code `${this.reusables.imports.z}.literal(${this.primitiveIn[0]})`;
|
|
31
34
|
}
|
|
32
35
|
return code `${this.reusables.imports.z}.boolean()`;
|
|
33
36
|
}
|
|
34
|
-
|
|
37
|
+
literalValueExpression(literal) {
|
|
35
38
|
return code `${typeof literal === "boolean" ? literal : LiteralDecoder.decodeBooleanLiteral(literal).unsafeCoerce()}`;
|
|
36
39
|
}
|
|
37
40
|
toRdfResourceValuesExpression({ variables, }) {
|
|
38
41
|
return code `[${this.reusables.snippets.literalFactory}.boolean(${variables.value}, ${this.rdfjsTermExpression(this.datatype)})]`;
|
|
39
42
|
}
|
|
40
|
-
fromRdfResourceValuesExpressionChain({ variables, }) {
|
|
41
|
-
return {
|
|
42
|
-
...super.fromRdfResourceValuesExpressionChain({ variables }),
|
|
43
|
-
languageIn: undefined,
|
|
44
|
-
preferredLanguages: undefined,
|
|
45
|
-
valueTo: code `chain(values => values.chainMap(value => value.toBoolean(${this.primitiveIn.length === 1 ? `[${this.primitiveIn[0]}] as const` : ""})))`,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
43
|
}
|
|
49
44
|
__decorate([
|
|
50
45
|
Memoize()
|
|
51
|
-
], BooleanType.prototype, "
|
|
46
|
+
], BooleanType.prototype, "fromRdfResourceValuesFunction", null);
|
|
52
47
|
__decorate([
|
|
53
48
|
Memoize()
|
|
54
49
|
], BooleanType.prototype, "schemaType", null);
|
|
50
|
+
__decorate([
|
|
51
|
+
Memoize()
|
|
52
|
+
], BooleanType.prototype, "inlineExpression", null);
|
|
55
53
|
//# sourceMappingURL=BooleanType.js.map
|
|
@@ -5,9 +5,9 @@ export declare class DateTimeType extends AbstractDateType {
|
|
|
5
5
|
readonly graphqlType: import("./AbstractType.js").AbstractType.GraphqlType;
|
|
6
6
|
readonly hashFunction: Code;
|
|
7
7
|
readonly kind = "DateTime";
|
|
8
|
+
get fromRdfResourceValuesFunction(): Code;
|
|
8
9
|
jsonSchema(_parameters: Parameters<AbstractDateType["jsonSchema"]>[0]): Code;
|
|
9
|
-
|
|
10
|
+
literalValueExpression(literal: Date | Literal): Code;
|
|
10
11
|
toJsonExpression({ variables, }: Parameters<AbstractDateType["toJsonExpression"]>[0]): Code;
|
|
11
|
-
protected fromRdfResourceValueExpression({ variables, }: Parameters<AbstractDateType["fromRdfResourceValueExpression"]>[0]): Code;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=DateTimeType.d.ts.map
|
|
@@ -1,21 +1,31 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
1
7
|
import { LiteralDecoder } from "@rdfx/literal";
|
|
8
|
+
import { Memoize } from "typescript-memoize";
|
|
2
9
|
import { AbstractDateType } from "./AbstractDateType.js";
|
|
3
10
|
import { code } from "./ts-poet-wrapper.js";
|
|
4
11
|
export class DateTimeType extends AbstractDateType {
|
|
5
12
|
graphqlType = new DateTimeType.GraphqlType(code `${this.reusables.imports.GraphQLDateTime}`, this.reusables);
|
|
6
13
|
hashFunction = code `${this.reusables.snippets.hashDateTime}`;
|
|
7
14
|
kind = "DateTime";
|
|
15
|
+
get fromRdfResourceValuesFunction() {
|
|
16
|
+
return code `${this.reusables.snippets.dateTimeFromRdfResourceValues}`;
|
|
17
|
+
}
|
|
8
18
|
jsonSchema(_parameters) {
|
|
9
19
|
return code `${this.reusables.imports.z}.iso.datetime()`;
|
|
10
20
|
}
|
|
11
|
-
|
|
21
|
+
literalValueExpression(literal) {
|
|
12
22
|
return code `new Date("${(literal instanceof Date ? literal : LiteralDecoder.decodeDateTimeLiteral(literal).unsafeCoerce()).toISOString()}")`;
|
|
13
23
|
}
|
|
14
24
|
toJsonExpression({ variables, }) {
|
|
15
25
|
return code `${variables.value}.toISOString()`;
|
|
16
26
|
}
|
|
17
|
-
fromRdfResourceValueExpression({ variables, }) {
|
|
18
|
-
return code `${variables.value}.toDateTime(${this.primitiveIn.length > 0 ? `[${this.primitiveIn.map((_) => `new Date(${_.getTime()})`).join(", ")}]` : ""})`;
|
|
19
|
-
}
|
|
20
27
|
}
|
|
28
|
+
__decorate([
|
|
29
|
+
Memoize()
|
|
30
|
+
], DateTimeType.prototype, "fromRdfResourceValuesFunction", null);
|
|
21
31
|
//# sourceMappingURL=DateTimeType.js.map
|
|
@@ -6,9 +6,9 @@ export declare class DateType extends AbstractDateType {
|
|
|
6
6
|
readonly graphqlType: import("./AbstractType.js").AbstractType.GraphqlType;
|
|
7
7
|
readonly hashFunction: Code;
|
|
8
8
|
readonly kind = "Date";
|
|
9
|
+
get fromRdfResourceValuesFunction(): Code;
|
|
9
10
|
jsonSchema(_parameters: Parameters<DateTimeType["jsonSchema"]>[0]): Code;
|
|
10
|
-
|
|
11
|
+
literalValueExpression(literal: Date | Literal): Code;
|
|
11
12
|
toJsonExpression({ variables, }: Parameters<AbstractDateType["toJsonExpression"]>[0]): Code;
|
|
12
|
-
protected fromRdfResourceValueExpression({ variables, }: Parameters<AbstractDateType["fromRdfResourceValueExpression"]>[0]): Code;
|
|
13
13
|
}
|
|
14
14
|
//# sourceMappingURL=DateType.d.ts.map
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
1
7
|
import { LiteralDecoder } from "@rdfx/literal";
|
|
8
|
+
import { Memoize } from "typescript-memoize";
|
|
2
9
|
import { AbstractDateType } from "./AbstractDateType.js";
|
|
3
10
|
import { DateTimeType } from "./DateTimeType.js";
|
|
4
11
|
import { code } from "./ts-poet-wrapper.js";
|
|
@@ -6,17 +13,20 @@ export class DateType extends AbstractDateType {
|
|
|
6
13
|
graphqlType = new DateTimeType.GraphqlType(code `${this.reusables.imports.GraphQLDate}`, this.reusables);
|
|
7
14
|
hashFunction = code `${this.reusables.snippets.hashDate}`;
|
|
8
15
|
kind = "Date";
|
|
16
|
+
get fromRdfResourceValuesFunction() {
|
|
17
|
+
return code `${this.reusables.snippets.dateFromRdfResourceValues}`;
|
|
18
|
+
}
|
|
9
19
|
jsonSchema(_parameters) {
|
|
10
20
|
return code `${this.reusables.imports.z}.iso.date()`;
|
|
11
21
|
}
|
|
12
|
-
|
|
22
|
+
literalValueExpression(literal) {
|
|
13
23
|
return code `new Date("${(literal instanceof Date ? literal : LiteralDecoder.decodeDateLiteral(literal).unsafeCoerce()).toISOString()}")`;
|
|
14
24
|
}
|
|
15
25
|
toJsonExpression({ variables, }) {
|
|
16
26
|
return code `${this.reusables.snippets.toIsoDateString}(${variables.value})`;
|
|
17
27
|
}
|
|
18
|
-
fromRdfResourceValueExpression({ variables, }) {
|
|
19
|
-
return code `${variables.value}.toDate(${this.primitiveIn.length > 0 ? `[${this.primitiveIn.map((_) => `new Date(${_.getTime()})`).join(", ")}]` : ""})`;
|
|
20
|
-
}
|
|
21
28
|
}
|
|
29
|
+
__decorate([
|
|
30
|
+
Memoize()
|
|
31
|
+
], DateType.prototype, "fromRdfResourceValuesFunction", null);
|
|
22
32
|
//# sourceMappingURL=DateType.js.map
|
|
@@ -9,10 +9,15 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
9
9
|
readonly defaultValue: Literal | NamedNode;
|
|
10
10
|
readonly discriminantProperty: Maybe<AbstractType.DiscriminantProperty>;
|
|
11
11
|
readonly graphqlArgs: AbstractType["graphqlArgs"];
|
|
12
|
-
readonly kind = "DefaultValue";
|
|
13
12
|
readonly jsTypes: readonly AbstractType.JsType[] | readonly [{
|
|
14
13
|
readonly instanceof: "Object";
|
|
15
14
|
readonly typeof: "object";
|
|
15
|
+
}] | readonly [{
|
|
16
|
+
readonly instanceof: "Object";
|
|
17
|
+
readonly typeof: "object";
|
|
18
|
+
}] | readonly [{
|
|
19
|
+
readonly instanceof: "Object";
|
|
20
|
+
readonly typeof: "object";
|
|
16
21
|
}] | {
|
|
17
22
|
readonly typeof: "bigint";
|
|
18
23
|
}[] | readonly [{
|
|
@@ -25,9 +30,6 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
25
30
|
readonly typeof: "object";
|
|
26
31
|
}] | readonly [{
|
|
27
32
|
readonly typeof: "number";
|
|
28
|
-
}] | readonly [{
|
|
29
|
-
readonly instanceof: "Object";
|
|
30
|
-
readonly typeof: "object";
|
|
31
33
|
}] | readonly [{
|
|
32
34
|
readonly typeof: "number";
|
|
33
35
|
}] | readonly [{
|
|
@@ -36,9 +38,6 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
36
38
|
}] | readonly [{
|
|
37
39
|
readonly instanceof: "Object";
|
|
38
40
|
readonly typeof: "object";
|
|
39
|
-
}] | readonly [{
|
|
40
|
-
readonly instanceof: "Object";
|
|
41
|
-
readonly typeof: "object";
|
|
42
41
|
}] | readonly [{
|
|
43
42
|
readonly typeof: "string";
|
|
44
43
|
}] | readonly [{
|
|
@@ -48,6 +47,7 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
48
47
|
readonly instanceof: "Object";
|
|
49
48
|
readonly typeof: "object";
|
|
50
49
|
}];
|
|
50
|
+
readonly kind = "DefaultValue";
|
|
51
51
|
readonly validationFunction: Maybe<Code>;
|
|
52
52
|
constructor({ defaultValue, ...superParameters }: {
|
|
53
53
|
defaultValue: Literal | NamedNode;
|
|
@@ -57,6 +57,7 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
57
57
|
get expression(): Code;
|
|
58
58
|
get filterFunction(): Code;
|
|
59
59
|
get filterType(): Code;
|
|
60
|
+
get fromRdfResourceValuesFunction(): Code;
|
|
60
61
|
get graphqlType(): AbstractContainerType.GraphqlType;
|
|
61
62
|
get hashFunction(): Code;
|
|
62
63
|
get mutable(): boolean;
|
|
@@ -67,7 +68,6 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
67
68
|
protected get schemaInitializers(): Code[];
|
|
68
69
|
private get defaultValueExpression();
|
|
69
70
|
fromJsonExpression(parameters: Parameters<AbstractType["fromJsonExpression"]>[0]): Code;
|
|
70
|
-
fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["fromRdfResourceValuesExpression"]>[0]): Code;
|
|
71
71
|
graphqlResolveExpression(parameters: Parameters<AbstractContainerType<ItemTypeT>["graphqlResolveExpression"]>[0]): Code;
|
|
72
72
|
jsonSchema(parameters: Parameters<AbstractContainerType<ItemTypeT>["jsonSchema"]>[0]): Code;
|
|
73
73
|
jsonType(parameters?: Parameters<AbstractContainerType<ItemTypeT>["jsonType"]>[0]): AbstractType.JsonType;
|