@shaclmate/compiler 4.0.33 → 4.0.35
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/Compiler.d.ts +0 -3
- package/dist/Compiler.js +0 -2
- package/dist/ShapesGraphToAstTransformer.d.ts +1 -4
- package/dist/ShapesGraphToAstTransformer.js +1 -5
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +1 -3
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +4 -7
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +0 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +1 -3
- package/dist/ast/AbstractCompoundType.d.ts +6 -4
- package/dist/ast/AbstractCompoundType.js +4 -37
- package/dist/ast/ObjectType.d.ts +1 -7
- package/dist/ast/ObjectType.js +1 -6
- package/dist/generators/ts/AbstractCollectionType.d.ts +9 -8
- package/dist/generators/ts/AbstractCollectionType.js +38 -120
- package/dist/generators/ts/AbstractContainerType.d.ts +3 -1
- package/dist/generators/ts/AbstractContainerType.js +20 -0
- package/dist/generators/ts/AbstractDateType.d.ts +5 -10
- package/dist/generators/ts/AbstractDateType.js +5 -32
- package/dist/generators/ts/AbstractIdentifierType.d.ts +4 -1
- package/dist/generators/ts/AbstractIdentifierType.js +0 -17
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +9 -5
- package/dist/generators/ts/AbstractLazyObjectType.js +22 -21
- package/dist/generators/ts/AbstractLiteralType.d.ts +12 -4
- package/dist/generators/ts/AbstractLiteralType.js +3 -3
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +2 -5
- package/dist/generators/ts/AbstractNamedUnionType.js +27 -58
- package/dist/generators/ts/AbstractNumericType.d.ts +3 -9
- package/dist/generators/ts/AbstractNumericType.js +6 -13
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +9 -4
- package/dist/generators/ts/AbstractPrimitiveType.js +11 -18
- package/dist/generators/ts/AbstractTermType.d.ts +10 -5
- package/dist/generators/ts/AbstractTermType.js +14 -53
- package/dist/generators/ts/AbstractType.d.ts +39 -24
- package/dist/generators/ts/AbstractType.js +4 -2
- package/dist/generators/ts/AbstractUnionType.d.ts +3 -2
- package/dist/generators/ts/AbstractUnionType.js +29 -39
- package/dist/generators/ts/AnonymousUnionType.d.ts +1 -1
- package/dist/generators/ts/AnonymousUnionType.js +3 -3
- package/dist/generators/ts/BigDecimalType.d.ts +7 -4
- package/dist/generators/ts/BigDecimalType.js +11 -45
- package/dist/generators/ts/BigIntType.d.ts +3 -4
- package/dist/generators/ts/BigIntType.js +6 -17
- package/dist/generators/ts/BlankNodeType.d.ts +8 -7
- package/dist/generators/ts/BlankNodeType.js +18 -5
- package/dist/generators/ts/BooleanType.d.ts +6 -9
- package/dist/generators/ts/BooleanType.js +9 -16
- package/dist/generators/ts/DateTimeType.d.ts +4 -1
- package/dist/generators/ts/DateTimeType.js +6 -13
- package/dist/generators/ts/DateType.d.ts +4 -1
- package/dist/generators/ts/DateType.js +7 -14
- package/dist/generators/ts/DefaultValueType.d.ts +6 -6
- package/dist/generators/ts/DefaultValueType.js +30 -63
- package/dist/generators/ts/FloatType.d.ts +3 -3
- package/dist/generators/ts/FloatType.js +5 -5
- package/dist/generators/ts/IdentifierType.d.ts +7 -6
- package/dist/generators/ts/IdentifierType.js +26 -5
- package/dist/generators/ts/IntType.d.ts +3 -3
- package/dist/generators/ts/IntType.js +5 -5
- package/dist/generators/ts/IriType.d.ts +9 -12
- package/dist/generators/ts/IriType.js +43 -32
- package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -1
- package/dist/generators/ts/LazyObjectOptionType.js +23 -44
- package/dist/generators/ts/LazyObjectSetType.d.ts +2 -1
- package/dist/generators/ts/LazyObjectSetType.js +19 -29
- package/dist/generators/ts/LazyObjectType.d.ts +2 -1
- package/dist/generators/ts/LazyObjectType.js +18 -26
- package/dist/generators/ts/LiteralType.d.ts +6 -3
- package/dist/generators/ts/LiteralType.js +27 -13
- package/dist/generators/ts/NamedObjectType.d.ts +7 -9
- package/dist/generators/ts/NamedObjectType.js +24 -32
- package/dist/generators/ts/NamedObjectUnionType.d.ts +3 -1
- package/dist/generators/ts/NamedObjectUnionType.js +21 -14
- package/dist/generators/ts/OptionType.d.ts +6 -5
- package/dist/generators/ts/OptionType.js +31 -51
- package/dist/generators/ts/Reusables.d.ts +3 -1
- package/dist/generators/ts/Reusables.js +2 -1
- package/dist/generators/ts/SetType.d.ts +0 -1
- package/dist/generators/ts/SetType.js +4 -22
- package/dist/generators/ts/SnippetFactory.d.ts +2 -0
- package/dist/generators/ts/Snippets.d.ts +36 -8
- package/dist/generators/ts/Snippets.js +207 -30
- package/dist/generators/ts/StringType.d.ts +6 -10
- package/dist/generators/ts/StringType.js +8 -21
- package/dist/generators/ts/TermType.d.ts +2 -4
- package/dist/generators/ts/TermType.js +6 -10
- package/dist/generators/ts/TsGenerator.d.ts +14 -1
- package/dist/generators/ts/TsGenerator.js +41 -12
- package/dist/generators/ts/TypeFactory.d.ts +8 -4
- package/dist/generators/ts/TypeFactory.js +73 -49
- package/dist/generators/ts/ZodGenerator.js +6 -3
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +27 -20
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.js +4 -2
- package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.d.ts +7 -7
- package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.js +9 -9
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.d.ts +6 -6
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.js +36 -39
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.js +34 -31
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +31 -19
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +30 -36
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js +2 -3
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js +6 -8
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js +1 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts +2 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_objectSetMethodNames.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js +14 -18
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.d.ts +7 -7
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.js +41 -29
- package/dist/generators/ts/_snippets/snippets_ConversionFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ConversionFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +3 -3
- package/dist/generators/ts/_snippets/snippets_HashFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_HashFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +34 -24
- package/dist/generators/ts/_snippets/snippets_ValidationFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ValidationFunction.js +4 -0
- package/dist/generators/ts/_snippets/snippets_convertToArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToArray.js +8 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNode.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNode.js +11 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNodeIdentifierProperty.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToBlankNodeIdentifierProperty.js +17 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifier.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifier.js +13 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifierProperty.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIdentifierProperty.js +21 -0
- package/dist/generators/ts/_snippets/snippets_convertToIri.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIri.js +11 -0
- package/dist/generators/ts/_snippets/snippets_convertToIriIdentifierProperty.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToIriIdentifierProperty.js +17 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObject.js +15 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.js +31 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.js +25 -0
- package/dist/generators/ts/_snippets/snippets_convertToLiteral.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToLiteral.js +13 -0
- package/dist/generators/ts/_snippets/snippets_convertToMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToMaybe.js +19 -0
- package/dist/generators/ts/_snippets/snippets_convertWithDefaultValue.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertWithDefaultValue.js +11 -0
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_hashArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashArray.js +11 -0
- package/dist/generators/ts/_snippets/snippets_hashBigDecimal.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashBigDecimal.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashBoolean.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashBoolean.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashDate.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashDate.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashDateTime.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashDateTime.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashMaybe.js +11 -0
- package/dist/generators/ts/_snippets/snippets_hashNumeric.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashNumeric.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashString.js +7 -0
- package/dist/generators/ts/_snippets/snippets_hashTerm.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_hashTerm.js +12 -0
- package/dist/generators/ts/_snippets/snippets_identityConversionFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identityConversionFunction.js +6 -0
- package/dist/generators/ts/_snippets/snippets_identityValidationFunction.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_identityValidationFunction.js +6 -0
- package/dist/generators/ts/_snippets/snippets_toIsoDateString.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_toIsoDateString.js +6 -0
- package/dist/generators/ts/_snippets/snippets_validateArray.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_validateArray.js +13 -0
- package/dist/generators/ts/_snippets/snippets_validateMaybe.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_validateMaybe.js +7 -0
- package/dist/generators/ts/graphqlSchemaVariableStatement.d.ts +1 -1
- package/dist/generators/ts/graphqlSchemaVariableStatement.js +7 -4
- package/dist/generators/ts/objectSetDeclarations.js +4 -34
- package/dist/generators/ts/objectSetInterfaceDeclaration.js +1 -1
- package/dist/generators/ts/objectSetMethodSignatures.js +2 -2
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +2 -2
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +2 -2
- package/dist/input/ShapesGraph.d.ts +5 -8
- package/dist/input/ShapesGraph.js +5 -6
- package/dist/input/generated.d.ts +175 -230
- package/dist/input/generated.js +226 -1748
- package/package.json +2 -2
- package/dist/_ShapesGraphToAstTransformer/nodeShapeTsFeatures.d.ts +0 -6
- package/dist/_ShapesGraphToAstTransformer/nodeShapeTsFeatures.js +0 -67
- package/dist/generators/ts/_snippets/snippets_isReadonlyBigIntArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_isReadonlyBigIntArray.js +0 -6
- package/dist/generators/ts/_snippets/snippets_isReadonlyBooleanArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_isReadonlyBooleanArray.js +0 -6
- package/dist/generators/ts/_snippets/snippets_isReadonlyNumberArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_isReadonlyNumberArray.js +0 -6
- package/dist/generators/ts/_snippets/snippets_isReadonlyObjectArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_isReadonlyObjectArray.js +0 -6
- package/dist/generators/ts/_snippets/snippets_isReadonlyStringArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_isReadonlyStringArray.js +0 -6
- package/dist/generators/ts/syntheticNamePrefix.d.ts +0 -2
- package/dist/generators/ts/syntheticNamePrefix.js +0 -2
|
@@ -21,7 +21,21 @@ import { snippets_booleanEquals } from "./_snippets/snippets_booleanEquals.js";
|
|
|
21
21
|
import { snippets_booleanSparqlWherePatterns } from "./_snippets/snippets_booleanSparqlWherePatterns.js";
|
|
22
22
|
import { snippets_CollectionFilter } from "./_snippets/snippets_CollectionFilter.js";
|
|
23
23
|
import { snippets_CollectionSchema } from "./_snippets/snippets_CollectionSchema.js";
|
|
24
|
+
import { snippets_ConversionFunction } from "./_snippets/snippets_ConversionFunction.js";
|
|
24
25
|
import { snippets_compactRecord } from "./_snippets/snippets_compactRecord.js";
|
|
26
|
+
import { snippets_convertToArray } from "./_snippets/snippets_convertToArray.js";
|
|
27
|
+
import { snippets_convertToBlankNode } from "./_snippets/snippets_convertToBlankNode.js";
|
|
28
|
+
import { snippets_convertToBlankNodeIdentifierProperty } from "./_snippets/snippets_convertToBlankNodeIdentifierProperty.js";
|
|
29
|
+
import { snippets_convertToIdentifier } from "./_snippets/snippets_convertToIdentifier.js";
|
|
30
|
+
import { snippets_convertToIdentifierProperty } from "./_snippets/snippets_convertToIdentifierProperty.js";
|
|
31
|
+
import { snippets_convertToIri } from "./_snippets/snippets_convertToIri.js";
|
|
32
|
+
import { snippets_convertToIriIdentifierProperty } from "./_snippets/snippets_convertToIriIdentifierProperty.js";
|
|
33
|
+
import { snippets_convertToLazyObject } from "./_snippets/snippets_convertToLazyObject.js";
|
|
34
|
+
import { snippets_convertToLazyObjectOption } from "./_snippets/snippets_convertToLazyObjectOption.js";
|
|
35
|
+
import { snippets_convertToLazyObjectSet } from "./_snippets/snippets_convertToLazyObjectSet.js";
|
|
36
|
+
import { snippets_convertToLiteral } from "./_snippets/snippets_convertToLiteral.js";
|
|
37
|
+
import { snippets_convertToMaybe } from "./_snippets/snippets_convertToMaybe.js";
|
|
38
|
+
import { snippets_convertWithDefaultValue } from "./_snippets/snippets_convertWithDefaultValue.js";
|
|
25
39
|
import { snippets_DateFilter } from "./_snippets/snippets_DateFilter.js";
|
|
26
40
|
import { snippets_DateSchema } from "./_snippets/snippets_DateSchema.js";
|
|
27
41
|
import { snippets_DefaultValueSchema } from "./_snippets/snippets_DefaultValueSchema.js";
|
|
@@ -50,18 +64,25 @@ import { snippets_filterTerm } from "./_snippets/snippets_filterTerm.js";
|
|
|
50
64
|
import { snippets_fromRdfLanguageIn } from "./_snippets/snippets_fromRdfLanguageIn.js";
|
|
51
65
|
import { snippets_fromRdfPreferredLanguages } from "./_snippets/snippets_fromRdfPreferredLanguages.js";
|
|
52
66
|
import { snippets_Hasher } from "./_snippets/snippets_Hasher.js";
|
|
67
|
+
import { snippets_HashFunction } from "./_snippets/snippets_HashFunction.js";
|
|
68
|
+
import { snippets_hashArray } from "./_snippets/snippets_hashArray.js";
|
|
69
|
+
import { snippets_hashBigDecimal } from "./_snippets/snippets_hashBigDecimal.js";
|
|
70
|
+
import { snippets_hashBoolean } from "./_snippets/snippets_hashBoolean.js";
|
|
71
|
+
import { snippets_hashDate } from "./_snippets/snippets_hashDate.js";
|
|
72
|
+
import { snippets_hashDateTime } from "./_snippets/snippets_hashDateTime.js";
|
|
73
|
+
import { snippets_hashMaybe } from "./_snippets/snippets_hashMaybe.js";
|
|
74
|
+
import { snippets_hashNumeric } from "./_snippets/snippets_hashNumeric.js";
|
|
75
|
+
import { snippets_hashString } from "./_snippets/snippets_hashString.js";
|
|
76
|
+
import { snippets_hashTerm } from "./_snippets/snippets_hashTerm.js";
|
|
53
77
|
import { snippets_IdentifierFilter } from "./_snippets/snippets_IdentifierFilter.js";
|
|
54
78
|
import { snippets_IdentifierSchema } from "./_snippets/snippets_IdentifierSchema.js";
|
|
55
79
|
import { snippets_IdentifierSet } from "./_snippets/snippets_IdentifierSet.js";
|
|
56
80
|
import { snippets_IriFilter } from "./_snippets/snippets_IriFilter.js";
|
|
57
81
|
import { snippets_IriSchema } from "./_snippets/snippets_IriSchema.js";
|
|
58
82
|
import { snippets_identifierSparqlWherePatterns } from "./_snippets/snippets_identifierSparqlWherePatterns.js";
|
|
83
|
+
import { snippets_identityConversionFunction } from "./_snippets/snippets_identityConversionFunction.js";
|
|
84
|
+
import { snippets_identityValidationFunction } from "./_snippets/snippets_identityValidationFunction.js";
|
|
59
85
|
import { snippets_iriSparqlWherePatterns } from "./_snippets/snippets_iriSparqlWherePatterns.js";
|
|
60
|
-
import { snippets_isReadonlyBigIntArray } from "./_snippets/snippets_isReadonlyBigIntArray.js";
|
|
61
|
-
import { snippets_isReadonlyBooleanArray } from "./_snippets/snippets_isReadonlyBooleanArray.js";
|
|
62
|
-
import { snippets_isReadonlyNumberArray } from "./_snippets/snippets_isReadonlyNumberArray.js";
|
|
63
|
-
import { snippets_isReadonlyObjectArray } from "./_snippets/snippets_isReadonlyObjectArray.js";
|
|
64
|
-
import { snippets_isReadonlyStringArray } from "./_snippets/snippets_isReadonlyStringArray.js";
|
|
65
86
|
import { snippets_LazyObject } from "./_snippets/snippets_LazyObject.js";
|
|
66
87
|
import { snippets_LazyObjectOption } from "./_snippets/snippets_LazyObjectOption.js";
|
|
67
88
|
import { snippets_LazyObjectSet } from "./_snippets/snippets_LazyObjectSet.js";
|
|
@@ -112,18 +133,23 @@ import { snippets_ToRdfResourceValuesFunction } from "./_snippets/snippets_ToRdf
|
|
|
112
133
|
import { snippets_termFilterSparqlPatterns } from "./_snippets/snippets_termFilterSparqlPatterns.js";
|
|
113
134
|
import { snippets_termSchemaSparqlPatterns } from "./_snippets/snippets_termSchemaSparqlPatterns.js";
|
|
114
135
|
import { snippets_termSparqlWherePatterns } from "./_snippets/snippets_termSparqlWherePatterns.js";
|
|
136
|
+
import { snippets_toIsoDateString } from "./_snippets/snippets_toIsoDateString.js";
|
|
115
137
|
import { snippets_UnwrapR } from "./_snippets/snippets_UnwrapR.js";
|
|
138
|
+
import { snippets_ValidationFunction } from "./_snippets/snippets_ValidationFunction.js";
|
|
116
139
|
import { snippets_ValueSparqlConstructTriplesFunction } from "./_snippets/snippets_ValueSparqlConstructTriplesFunction.js";
|
|
117
140
|
import { snippets_ValueSparqlWherePatternsFunction } from "./_snippets/snippets_ValueSparqlWherePatternsFunction.js";
|
|
141
|
+
import { snippets_validateArray } from "./_snippets/snippets_validateArray.js";
|
|
142
|
+
import { snippets_validateMaybe } from "./_snippets/snippets_validateMaybe.js";
|
|
118
143
|
import { snippets_wrap_FromRdfResourceFunction } from "./_snippets/snippets_wrap_FromRdfResourceFunction.js";
|
|
119
144
|
import { snippets_wrap_ToRdfResourceFunction } from "./_snippets/snippets_wrap_ToRdfResourceFunction.js";
|
|
120
145
|
import { rdfjsTermExpression } from "./rdfjsTermExpression.js";
|
|
121
|
-
import { syntheticNamePrefix } from "./syntheticNamePrefix.js";
|
|
122
146
|
import { code } from "./ts-poet-wrapper.js";
|
|
123
147
|
export class Snippets {
|
|
148
|
+
configuration;
|
|
124
149
|
imports;
|
|
125
150
|
logger;
|
|
126
|
-
constructor({ imports, logger }) {
|
|
151
|
+
constructor({ configuration, imports, logger, }) {
|
|
152
|
+
this.configuration = configuration;
|
|
127
153
|
this.imports = imports;
|
|
128
154
|
this.logger = logger;
|
|
129
155
|
}
|
|
@@ -145,6 +171,9 @@ export class Snippets {
|
|
|
145
171
|
get CollectionSchema() {
|
|
146
172
|
return this.snippet(snippets_CollectionSchema);
|
|
147
173
|
}
|
|
174
|
+
get ConversionFunction() {
|
|
175
|
+
return this.snippet(snippets_ConversionFunction);
|
|
176
|
+
}
|
|
148
177
|
get DateFilter() {
|
|
149
178
|
return this.snippet(snippets_DateFilter);
|
|
150
179
|
}
|
|
@@ -169,6 +198,9 @@ export class Snippets {
|
|
|
169
198
|
get FromRdfResourceValuesFunction() {
|
|
170
199
|
return this.snippet(snippets_FromRdfResourceValuesFunction);
|
|
171
200
|
}
|
|
201
|
+
get HashFunction() {
|
|
202
|
+
return this.snippet(snippets_HashFunction);
|
|
203
|
+
}
|
|
172
204
|
get Hasher() {
|
|
173
205
|
return this.snippet(snippets_Hasher);
|
|
174
206
|
}
|
|
@@ -253,6 +285,9 @@ export class Snippets {
|
|
|
253
285
|
get UnwrapR() {
|
|
254
286
|
return this.snippet(snippets_UnwrapR);
|
|
255
287
|
}
|
|
288
|
+
get ValidationFunction() {
|
|
289
|
+
return this.snippet(snippets_ValidationFunction);
|
|
290
|
+
}
|
|
256
291
|
get ValueSparqlConstructTriplesFunction() {
|
|
257
292
|
return this.snippet(snippets_ValueSparqlConstructTriplesFunction);
|
|
258
293
|
}
|
|
@@ -289,6 +324,45 @@ export class Snippets {
|
|
|
289
324
|
get compactRecord() {
|
|
290
325
|
return this.snippet(snippets_compactRecord);
|
|
291
326
|
}
|
|
327
|
+
get convertToArray() {
|
|
328
|
+
return this.snippet(snippets_convertToArray);
|
|
329
|
+
}
|
|
330
|
+
get convertToBlankNode() {
|
|
331
|
+
return this.snippet(snippets_convertToBlankNode);
|
|
332
|
+
}
|
|
333
|
+
get convertToBlankNodeIdentifierProperty() {
|
|
334
|
+
return this.snippet(snippets_convertToBlankNodeIdentifierProperty);
|
|
335
|
+
}
|
|
336
|
+
get convertToIdentifier() {
|
|
337
|
+
return this.snippet(snippets_convertToIdentifier);
|
|
338
|
+
}
|
|
339
|
+
get convertToIdentifierProperty() {
|
|
340
|
+
return this.snippet(snippets_convertToIdentifierProperty);
|
|
341
|
+
}
|
|
342
|
+
get convertToIri() {
|
|
343
|
+
return this.snippet(snippets_convertToIri);
|
|
344
|
+
}
|
|
345
|
+
get convertToIriIdentifierProperty() {
|
|
346
|
+
return this.snippet(snippets_convertToIriIdentifierProperty);
|
|
347
|
+
}
|
|
348
|
+
get convertToLazyObject() {
|
|
349
|
+
return this.snippet(snippets_convertToLazyObject);
|
|
350
|
+
}
|
|
351
|
+
get convertToLazyObjectOption() {
|
|
352
|
+
return this.snippet(snippets_convertToLazyObjectOption);
|
|
353
|
+
}
|
|
354
|
+
get convertToLazyObjectSet() {
|
|
355
|
+
return this.snippet(snippets_convertToLazyObjectSet);
|
|
356
|
+
}
|
|
357
|
+
get convertToLiteral() {
|
|
358
|
+
return this.snippet(snippets_convertToLiteral);
|
|
359
|
+
}
|
|
360
|
+
get convertToMaybe() {
|
|
361
|
+
return this.snippet(snippets_convertToMaybe);
|
|
362
|
+
}
|
|
363
|
+
get convertWithDefaultValue() {
|
|
364
|
+
return this.snippet(snippets_convertWithDefaultValue);
|
|
365
|
+
}
|
|
292
366
|
get dateEquals() {
|
|
293
367
|
return this.snippet(snippets_dateEquals);
|
|
294
368
|
}
|
|
@@ -346,9 +420,42 @@ export class Snippets {
|
|
|
346
420
|
get fromRdfPreferredLanguages() {
|
|
347
421
|
return this.snippet(snippets_fromRdfPreferredLanguages);
|
|
348
422
|
}
|
|
423
|
+
get hashArray() {
|
|
424
|
+
return this.snippet(snippets_hashArray);
|
|
425
|
+
}
|
|
426
|
+
get hashBigDecimal() {
|
|
427
|
+
return this.snippet(snippets_hashBigDecimal);
|
|
428
|
+
}
|
|
429
|
+
get hashBoolean() {
|
|
430
|
+
return this.snippet(snippets_hashBoolean);
|
|
431
|
+
}
|
|
432
|
+
get hashDate() {
|
|
433
|
+
return this.snippet(snippets_hashDate);
|
|
434
|
+
}
|
|
435
|
+
get hashDateTime() {
|
|
436
|
+
return this.snippet(snippets_hashDateTime);
|
|
437
|
+
}
|
|
438
|
+
get hashMaybe() {
|
|
439
|
+
return this.snippet(snippets_hashMaybe);
|
|
440
|
+
}
|
|
441
|
+
get hashNumeric() {
|
|
442
|
+
return this.snippet(snippets_hashNumeric);
|
|
443
|
+
}
|
|
444
|
+
get hashString() {
|
|
445
|
+
return this.snippet(snippets_hashString);
|
|
446
|
+
}
|
|
447
|
+
get hashTerm() {
|
|
448
|
+
return this.snippet(snippets_hashTerm);
|
|
449
|
+
}
|
|
349
450
|
get identifierSparqlWherePatterns() {
|
|
350
451
|
return this.snippet(snippets_identifierSparqlWherePatterns);
|
|
351
452
|
}
|
|
453
|
+
get identityConversionFunction() {
|
|
454
|
+
return this.snippet(snippets_identityConversionFunction);
|
|
455
|
+
}
|
|
456
|
+
get identityValidationFunction() {
|
|
457
|
+
return this.snippet(snippets_identityValidationFunction);
|
|
458
|
+
}
|
|
352
459
|
get ifUsed() {
|
|
353
460
|
return Object.entries(Object.getOwnPropertyDescriptors(Object.getPrototypeOf(this)))
|
|
354
461
|
.flatMap(([key, descriptor]) => {
|
|
@@ -371,21 +478,6 @@ export class Snippets {
|
|
|
371
478
|
get iriSparqlWherePatterns() {
|
|
372
479
|
return this.snippet(snippets_iriSparqlWherePatterns);
|
|
373
480
|
}
|
|
374
|
-
get isReadonlyBigIntArray() {
|
|
375
|
-
return this.snippet(snippets_isReadonlyBigIntArray);
|
|
376
|
-
}
|
|
377
|
-
get isReadonlyBooleanArray() {
|
|
378
|
-
return this.snippet(snippets_isReadonlyBooleanArray);
|
|
379
|
-
}
|
|
380
|
-
get isReadonlyNumberArray() {
|
|
381
|
-
return this.snippet(snippets_isReadonlyNumberArray);
|
|
382
|
-
}
|
|
383
|
-
get isReadonlyObjectArray() {
|
|
384
|
-
return this.snippet(snippets_isReadonlyObjectArray);
|
|
385
|
-
}
|
|
386
|
-
get isReadonlyStringArray() {
|
|
387
|
-
return this.snippet(snippets_isReadonlyStringArray);
|
|
388
|
-
}
|
|
389
481
|
get liftSparqlPatterns() {
|
|
390
482
|
return this.snippet(snippets_liftSparqlPatterns);
|
|
391
483
|
}
|
|
@@ -473,6 +565,15 @@ export class Snippets {
|
|
|
473
565
|
get termSparqlWherePatterns() {
|
|
474
566
|
return this.snippet(snippets_termSparqlWherePatterns);
|
|
475
567
|
}
|
|
568
|
+
get toIsoDateString() {
|
|
569
|
+
return this.snippet(snippets_toIsoDateString);
|
|
570
|
+
}
|
|
571
|
+
get validateArray() {
|
|
572
|
+
return this.snippet(snippets_validateArray);
|
|
573
|
+
}
|
|
574
|
+
get validateMaybe() {
|
|
575
|
+
return this.snippet(snippets_validateMaybe);
|
|
576
|
+
}
|
|
476
577
|
get wrap_FromRdfResourceFunction() {
|
|
477
578
|
return this.snippet(snippets_wrap_FromRdfResourceFunction);
|
|
478
579
|
}
|
|
@@ -484,6 +585,7 @@ export class Snippets {
|
|
|
484
585
|
}
|
|
485
586
|
snippet(snippetFactory) {
|
|
486
587
|
return snippetFactory({
|
|
588
|
+
configuration: this.configuration,
|
|
487
589
|
imports: this.imports,
|
|
488
590
|
logger: this.logger,
|
|
489
591
|
rdfjsTermExpression: rdfjsTermExpression.bind({
|
|
@@ -492,7 +594,7 @@ export class Snippets {
|
|
|
492
594
|
snippets: this,
|
|
493
595
|
}),
|
|
494
596
|
snippets: this,
|
|
495
|
-
syntheticNamePrefix,
|
|
597
|
+
syntheticNamePrefix: this.configuration.syntheticNamePrefix,
|
|
496
598
|
});
|
|
497
599
|
}
|
|
498
600
|
}
|
|
@@ -514,6 +616,9 @@ __decorate([
|
|
|
514
616
|
__decorate([
|
|
515
617
|
Memoize()
|
|
516
618
|
], Snippets.prototype, "CollectionSchema", null);
|
|
619
|
+
__decorate([
|
|
620
|
+
Memoize()
|
|
621
|
+
], Snippets.prototype, "ConversionFunction", null);
|
|
517
622
|
__decorate([
|
|
518
623
|
Memoize()
|
|
519
624
|
], Snippets.prototype, "DateFilter", null);
|
|
@@ -538,6 +643,9 @@ __decorate([
|
|
|
538
643
|
__decorate([
|
|
539
644
|
Memoize()
|
|
540
645
|
], Snippets.prototype, "FromRdfResourceValuesFunction", null);
|
|
646
|
+
__decorate([
|
|
647
|
+
Memoize()
|
|
648
|
+
], Snippets.prototype, "HashFunction", null);
|
|
541
649
|
__decorate([
|
|
542
650
|
Memoize()
|
|
543
651
|
], Snippets.prototype, "Hasher", null);
|
|
@@ -622,6 +730,9 @@ __decorate([
|
|
|
622
730
|
__decorate([
|
|
623
731
|
Memoize()
|
|
624
732
|
], Snippets.prototype, "UnwrapR", null);
|
|
733
|
+
__decorate([
|
|
734
|
+
Memoize()
|
|
735
|
+
], Snippets.prototype, "ValidationFunction", null);
|
|
625
736
|
__decorate([
|
|
626
737
|
Memoize()
|
|
627
738
|
], Snippets.prototype, "ValueSparqlConstructTriplesFunction", null);
|
|
@@ -658,6 +769,45 @@ __decorate([
|
|
|
658
769
|
__decorate([
|
|
659
770
|
Memoize()
|
|
660
771
|
], Snippets.prototype, "compactRecord", null);
|
|
772
|
+
__decorate([
|
|
773
|
+
Memoize()
|
|
774
|
+
], Snippets.prototype, "convertToArray", null);
|
|
775
|
+
__decorate([
|
|
776
|
+
Memoize()
|
|
777
|
+
], Snippets.prototype, "convertToBlankNode", null);
|
|
778
|
+
__decorate([
|
|
779
|
+
Memoize()
|
|
780
|
+
], Snippets.prototype, "convertToBlankNodeIdentifierProperty", null);
|
|
781
|
+
__decorate([
|
|
782
|
+
Memoize()
|
|
783
|
+
], Snippets.prototype, "convertToIdentifier", null);
|
|
784
|
+
__decorate([
|
|
785
|
+
Memoize()
|
|
786
|
+
], Snippets.prototype, "convertToIdentifierProperty", null);
|
|
787
|
+
__decorate([
|
|
788
|
+
Memoize()
|
|
789
|
+
], Snippets.prototype, "convertToIri", null);
|
|
790
|
+
__decorate([
|
|
791
|
+
Memoize()
|
|
792
|
+
], Snippets.prototype, "convertToIriIdentifierProperty", null);
|
|
793
|
+
__decorate([
|
|
794
|
+
Memoize()
|
|
795
|
+
], Snippets.prototype, "convertToLazyObject", null);
|
|
796
|
+
__decorate([
|
|
797
|
+
Memoize()
|
|
798
|
+
], Snippets.prototype, "convertToLazyObjectOption", null);
|
|
799
|
+
__decorate([
|
|
800
|
+
Memoize()
|
|
801
|
+
], Snippets.prototype, "convertToLazyObjectSet", null);
|
|
802
|
+
__decorate([
|
|
803
|
+
Memoize()
|
|
804
|
+
], Snippets.prototype, "convertToLiteral", null);
|
|
805
|
+
__decorate([
|
|
806
|
+
Memoize()
|
|
807
|
+
], Snippets.prototype, "convertToMaybe", null);
|
|
808
|
+
__decorate([
|
|
809
|
+
Memoize()
|
|
810
|
+
], Snippets.prototype, "convertWithDefaultValue", null);
|
|
661
811
|
__decorate([
|
|
662
812
|
Memoize()
|
|
663
813
|
], Snippets.prototype, "dateEquals", null);
|
|
@@ -717,25 +867,43 @@ __decorate([
|
|
|
717
867
|
], Snippets.prototype, "fromRdfPreferredLanguages", null);
|
|
718
868
|
__decorate([
|
|
719
869
|
Memoize()
|
|
720
|
-
], Snippets.prototype, "
|
|
870
|
+
], Snippets.prototype, "hashArray", null);
|
|
721
871
|
__decorate([
|
|
722
872
|
Memoize()
|
|
723
|
-
], Snippets.prototype, "
|
|
873
|
+
], Snippets.prototype, "hashBigDecimal", null);
|
|
874
|
+
__decorate([
|
|
875
|
+
Memoize()
|
|
876
|
+
], Snippets.prototype, "hashBoolean", null);
|
|
877
|
+
__decorate([
|
|
878
|
+
Memoize()
|
|
879
|
+
], Snippets.prototype, "hashDate", null);
|
|
880
|
+
__decorate([
|
|
881
|
+
Memoize()
|
|
882
|
+
], Snippets.prototype, "hashDateTime", null);
|
|
883
|
+
__decorate([
|
|
884
|
+
Memoize()
|
|
885
|
+
], Snippets.prototype, "hashMaybe", null);
|
|
886
|
+
__decorate([
|
|
887
|
+
Memoize()
|
|
888
|
+
], Snippets.prototype, "hashNumeric", null);
|
|
889
|
+
__decorate([
|
|
890
|
+
Memoize()
|
|
891
|
+
], Snippets.prototype, "hashString", null);
|
|
724
892
|
__decorate([
|
|
725
893
|
Memoize()
|
|
726
|
-
], Snippets.prototype, "
|
|
894
|
+
], Snippets.prototype, "hashTerm", null);
|
|
727
895
|
__decorate([
|
|
728
896
|
Memoize()
|
|
729
|
-
], Snippets.prototype, "
|
|
897
|
+
], Snippets.prototype, "identifierSparqlWherePatterns", null);
|
|
730
898
|
__decorate([
|
|
731
899
|
Memoize()
|
|
732
|
-
], Snippets.prototype, "
|
|
900
|
+
], Snippets.prototype, "identityConversionFunction", null);
|
|
733
901
|
__decorate([
|
|
734
902
|
Memoize()
|
|
735
|
-
], Snippets.prototype, "
|
|
903
|
+
], Snippets.prototype, "identityValidationFunction", null);
|
|
736
904
|
__decorate([
|
|
737
905
|
Memoize()
|
|
738
|
-
], Snippets.prototype, "
|
|
906
|
+
], Snippets.prototype, "iriSparqlWherePatterns", null);
|
|
739
907
|
__decorate([
|
|
740
908
|
Memoize()
|
|
741
909
|
], Snippets.prototype, "liftSparqlPatterns", null);
|
|
@@ -823,6 +991,15 @@ __decorate([
|
|
|
823
991
|
__decorate([
|
|
824
992
|
Memoize()
|
|
825
993
|
], Snippets.prototype, "termSparqlWherePatterns", null);
|
|
994
|
+
__decorate([
|
|
995
|
+
Memoize()
|
|
996
|
+
], Snippets.prototype, "toIsoDateString", null);
|
|
997
|
+
__decorate([
|
|
998
|
+
Memoize()
|
|
999
|
+
], Snippets.prototype, "validateArray", null);
|
|
1000
|
+
__decorate([
|
|
1001
|
+
Memoize()
|
|
1002
|
+
], Snippets.prototype, "validateMaybe", null);
|
|
826
1003
|
__decorate([
|
|
827
1004
|
Memoize()
|
|
828
1005
|
], Snippets.prototype, "wrap_FromRdfResourceFunction", null);
|
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Literal } from "@rdfjs/types";
|
|
2
2
|
import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
|
|
3
3
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
4
4
|
export declare class StringType extends AbstractPrimitiveType<string> {
|
|
5
5
|
readonly filterFunction: Code;
|
|
6
6
|
readonly filterType: Code;
|
|
7
|
+
readonly graphqlType: import("./AbstractType.js").AbstractType.GraphqlType;
|
|
8
|
+
readonly hashFunction: Code;
|
|
7
9
|
readonly kind = "StringType";
|
|
8
10
|
readonly schemaType: Code;
|
|
9
|
-
readonly typeofs:
|
|
11
|
+
readonly typeofs: "string"[];
|
|
10
12
|
readonly valueSparqlWherePatternsFunction: Code;
|
|
11
|
-
get graphqlType(): import("./AbstractType.js").AbstractType.GraphqlType;
|
|
12
13
|
get name(): string;
|
|
13
|
-
protected get schemaObject(): {
|
|
14
|
-
in: import("ts-poet/build/Node.js").Node[] | undefined;
|
|
15
|
-
languageIn: import("ts-poet/build/Node.js").Node[] | undefined;
|
|
16
|
-
kind: Code;
|
|
17
|
-
};
|
|
18
|
-
hashStatements({ variables, }: Parameters<AbstractPrimitiveType<string>["hashStatements"]>[0]): readonly Code[];
|
|
19
14
|
jsonSchema(_parameters: Parameters<AbstractPrimitiveType<string>["jsonSchema"]>[0]): Code;
|
|
15
|
+
literalExpression(literal: Literal | string): Code;
|
|
20
16
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractPrimitiveType<string>["toRdfResourceValuesExpression"]>[0]): Code;
|
|
21
|
-
protected
|
|
17
|
+
protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractPrimitiveType<string>["fromRdfResourceValuesExpressionChain"]>[0]): ReturnType<AbstractPrimitiveType<string>["fromRdfResourceValuesExpressionChain"]>;
|
|
22
18
|
}
|
|
23
19
|
//# sourceMappingURL=StringType.d.ts.map
|
|
@@ -5,37 +5,24 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { xsd } from "@tpluscode/rdf-ns-builders";
|
|
8
|
-
import { NonEmptyList } from "purify-ts";
|
|
9
8
|
import { Memoize } from "typescript-memoize";
|
|
10
9
|
import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
|
|
11
10
|
import { arrayOf, code, literalOf } from "./ts-poet-wrapper.js";
|
|
12
11
|
export class StringType extends AbstractPrimitiveType {
|
|
13
12
|
filterFunction = code `${this.reusables.snippets.filterString}`;
|
|
14
13
|
filterType = code `${this.reusables.snippets.StringFilter}`;
|
|
14
|
+
graphqlType = new AbstractPrimitiveType.GraphqlType(code `${this.reusables.imports.GraphQLString}`, this.reusables);
|
|
15
|
+
hashFunction = code `${this.reusables.snippets.hashString}`;
|
|
15
16
|
kind = "StringType";
|
|
16
17
|
schemaType = code `${this.reusables.snippets.StringSchema}`;
|
|
17
|
-
typeofs =
|
|
18
|
+
typeofs = ["string"];
|
|
18
19
|
valueSparqlWherePatternsFunction = code `${this.reusables.snippets.stringSparqlWherePatterns}`;
|
|
19
|
-
get graphqlType() {
|
|
20
|
-
return new AbstractPrimitiveType.GraphqlType(code `${this.reusables.imports.GraphQLString}`, this.reusables);
|
|
21
|
-
}
|
|
22
20
|
get name() {
|
|
23
21
|
if (this.primitiveIn.length > 0) {
|
|
24
22
|
return `${this.primitiveIn.map((value) => `"${value}"`).join(" | ")}`;
|
|
25
23
|
}
|
|
26
24
|
return `string`;
|
|
27
25
|
}
|
|
28
|
-
get schemaObject() {
|
|
29
|
-
return {
|
|
30
|
-
...super.schemaObject,
|
|
31
|
-
in: this.primitiveIn.length > 0
|
|
32
|
-
? this.primitiveIn.map(literalOf).concat()
|
|
33
|
-
: undefined,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
hashStatements({ variables, }) {
|
|
37
|
-
return [code `${variables.hasher}.update(${variables.value});`];
|
|
38
|
-
}
|
|
39
26
|
jsonSchema(_parameters) {
|
|
40
27
|
switch (this.primitiveIn.length) {
|
|
41
28
|
case 0:
|
|
@@ -46,19 +33,19 @@ export class StringType extends AbstractPrimitiveType {
|
|
|
46
33
|
return code `${this.reusables.imports.z}.enum(${arrayOf(...this.primitiveIn)})`;
|
|
47
34
|
}
|
|
48
35
|
}
|
|
36
|
+
literalExpression(literal) {
|
|
37
|
+
return code `${literalOf(typeof literal === "string" ? literal : literal.value)}`;
|
|
38
|
+
}
|
|
49
39
|
toRdfResourceValuesExpression({ variables, }) {
|
|
50
40
|
return code `[${this.reusables.snippets.literalFactory}.string(${variables.value}${!this.datatype.equals(xsd.string) ? `, ${this.rdfjsTermExpression(this.datatype)}` : ""})]`;
|
|
51
41
|
}
|
|
52
|
-
|
|
42
|
+
fromRdfResourceValuesExpressionChain({ variables, }) {
|
|
53
43
|
return {
|
|
54
|
-
...super.
|
|
44
|
+
...super.fromRdfResourceValuesExpressionChain({ variables }),
|
|
55
45
|
valueTo: code `chain(values => values.chainMap(value => value.toString(${this.primitiveIn.length > 0 ? `${JSON.stringify(this.primitiveIn)} as const` : ""})))`,
|
|
56
46
|
};
|
|
57
47
|
}
|
|
58
48
|
}
|
|
59
|
-
__decorate([
|
|
60
|
-
Memoize()
|
|
61
|
-
], StringType.prototype, "graphqlType", null);
|
|
62
49
|
__decorate([
|
|
63
50
|
Memoize()
|
|
64
51
|
], StringType.prototype, "name", null);
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { BlankNode, Literal, NamedNode } from "@rdfjs/types";
|
|
2
2
|
import { NodeKind } from "@shaclmate/shacl-ast";
|
|
3
|
+
import { Maybe } from "purify-ts";
|
|
3
4
|
import { AbstractTermType } from "./AbstractTermType.js";
|
|
4
5
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
6
|
export declare class TermType<ConstantTermT extends Literal | NamedNode = Literal | NamedNode, RuntimeTermT extends BlankNode | Literal | NamedNode = BlankNode | Literal | NamedNode> extends AbstractTermType {
|
|
7
|
+
readonly conversionFunction: Maybe<AbstractTermType.ConversionFunction>;
|
|
6
8
|
readonly filterFunction: Code;
|
|
7
9
|
readonly filterType: Code;
|
|
8
10
|
readonly kind = "TermType";
|
|
@@ -14,10 +16,6 @@ export declare class TermType<ConstantTermT extends Literal | NamedNode = Litera
|
|
|
14
16
|
});
|
|
15
17
|
get graphqlType(): AbstractTermType.GraphqlType;
|
|
16
18
|
get name(): Code;
|
|
17
|
-
protected get schemaObject(): {
|
|
18
|
-
in: Code[] | undefined;
|
|
19
|
-
kind: Code;
|
|
20
|
-
};
|
|
21
19
|
fromJsonExpression({ variables, }: Parameters<AbstractTermType["fromJsonExpression"]>[0]): Code;
|
|
22
20
|
graphqlResolveExpression(_parameters: Parameters<AbstractTermType["graphqlResolveExpression"]>[0]): Code;
|
|
23
21
|
jsonType(): AbstractTermType.JsonType;
|
|
@@ -6,11 +6,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { NodeKind } from "@shaclmate/shacl-ast";
|
|
8
8
|
import { xsd } from "@tpluscode/rdf-ns-builders";
|
|
9
|
+
import { Maybe } from "purify-ts";
|
|
9
10
|
import { invariant } from "ts-invariant";
|
|
10
11
|
import { Memoize } from "typescript-memoize";
|
|
11
12
|
import { AbstractTermType } from "./AbstractTermType.js";
|
|
12
13
|
import { code, joinCode } from "./ts-poet-wrapper.js";
|
|
13
14
|
export class TermType extends AbstractTermType {
|
|
15
|
+
conversionFunction = Maybe.empty();
|
|
14
16
|
filterFunction = code `${this.reusables.snippets.filterTerm}`;
|
|
15
17
|
filterType = code `${this.reusables.snippets.TermFilter}`;
|
|
16
18
|
kind = "TermType";
|
|
@@ -43,16 +45,10 @@ export class TermType extends AbstractTermType {
|
|
|
43
45
|
})
|
|
44
46
|
.map((import_) => code `${import_}`), { on: " | " })})`;
|
|
45
47
|
}
|
|
46
|
-
get schemaObject() {
|
|
47
|
-
return {
|
|
48
|
-
...super.schemaObject,
|
|
49
|
-
in: this.in_.length > 0
|
|
50
|
-
? this.in_.map((in_) => this.rdfjsTermExpression(in_))
|
|
51
|
-
: undefined,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
48
|
fromJsonExpression({ variables, }) {
|
|
55
|
-
return
|
|
49
|
+
return code `${this.reusables.imports.Either}.of<Error, ${this.name}>(${[
|
|
50
|
+
...this.nodeKinds,
|
|
51
|
+
].reduce((expression, nodeKind) => {
|
|
56
52
|
let valueToNodeKind;
|
|
57
53
|
switch (nodeKind) {
|
|
58
54
|
case "BlankNode":
|
|
@@ -70,7 +66,7 @@ export class TermType extends AbstractTermType {
|
|
|
70
66
|
return expression == null
|
|
71
67
|
? valueToNodeKind
|
|
72
68
|
: code `((${variables.value}.termType === "${NodeKind.toTermType(nodeKind)}") ? (${valueToNodeKind}) : (${expression}))`;
|
|
73
|
-
}, null)
|
|
69
|
+
}, null)})`;
|
|
74
70
|
}
|
|
75
71
|
graphqlResolveExpression(_parameters) {
|
|
76
72
|
throw new Error("not implemented");
|
|
@@ -2,11 +2,14 @@ import type { Logger } from "ts-log";
|
|
|
2
2
|
import * as ast from "../../ast/index.js";
|
|
3
3
|
import type { Generator } from "../Generator.js";
|
|
4
4
|
import { Reusables } from "./Reusables.js";
|
|
5
|
+
import type { TsFeature } from "./TsFeature.js";
|
|
5
6
|
export declare class TsGenerator implements Generator {
|
|
6
7
|
private readonly typeFactory;
|
|
8
|
+
protected readonly configuration: TsGenerator.Configuration;
|
|
7
9
|
protected readonly logger: Logger;
|
|
8
10
|
protected readonly reusables: Reusables;
|
|
9
|
-
constructor({ logger }: {
|
|
11
|
+
constructor({ configuration, logger, }: {
|
|
12
|
+
configuration?: TsGenerator.Configuration;
|
|
10
13
|
logger: Logger;
|
|
11
14
|
});
|
|
12
15
|
generate(ast_: ast.Ast): string;
|
|
@@ -15,4 +18,14 @@ export declare class TsGenerator implements Generator {
|
|
|
15
18
|
*/
|
|
16
19
|
private synthesizeUberObjectUnionType;
|
|
17
20
|
}
|
|
21
|
+
export declare namespace TsGenerator {
|
|
22
|
+
interface Configuration {
|
|
23
|
+
readonly features: ReadonlySet<TsFeature>;
|
|
24
|
+
readonly syntheticNamePrefix: string;
|
|
25
|
+
}
|
|
26
|
+
namespace Configuration {
|
|
27
|
+
const default_: Configuration;
|
|
28
|
+
function inferFeatures(features: ReadonlySet<TsFeature>): Set<"equals" | "create" | "graphql" | "hash" | "json" | "rdf" | "sparql">;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
18
31
|
//# sourceMappingURL=TsGenerator.d.ts.map
|