@shaclmate/compiler 4.0.38 → 4.0.40
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.js +12 -12
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +24 -24
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +4 -4
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +16 -16
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
- package/dist/ast/AbstractCollectionType.d.ts +1 -1
- package/dist/ast/AbstractCompoundType.d.ts +1 -1
- package/dist/ast/AbstractCompoundType.js +15 -15
- package/dist/ast/AbstractContainerType.d.ts +1 -1
- package/dist/ast/AbstractContainerType.js +15 -15
- package/dist/ast/AbstractLazyObjectType.d.ts +1 -1
- package/dist/ast/AbstractTermType.d.ts +1 -1
- package/dist/ast/BlankNodeType.d.ts +1 -1
- package/dist/ast/BlankNodeType.js +1 -1
- package/dist/ast/DefaultValueType.d.ts +1 -1
- package/dist/ast/DefaultValueType.js +2 -2
- package/dist/ast/IdentifierType.d.ts +1 -1
- package/dist/ast/IdentifierType.js +1 -1
- package/dist/ast/IntersectionType.d.ts +1 -1
- package/dist/ast/IntersectionType.js +3 -3
- package/dist/ast/IriType.d.ts +1 -1
- package/dist/ast/IriType.js +1 -1
- package/dist/ast/LazyObjectOptionType.d.ts +1 -1
- package/dist/ast/LazyObjectOptionType.js +1 -1
- package/dist/ast/LazyObjectSetType.d.ts +1 -1
- package/dist/ast/LazyObjectSetType.js +1 -1
- package/dist/ast/LazyObjectType.d.ts +1 -1
- package/dist/ast/LazyObjectType.js +1 -1
- package/dist/ast/ListType.d.ts +1 -1
- package/dist/ast/ListType.js +16 -16
- package/dist/ast/LiteralType.d.ts +1 -1
- package/dist/ast/LiteralType.js +1 -1
- package/dist/ast/ObjectCompoundType.js +3 -3
- package/dist/ast/ObjectType.d.ts +1 -1
- package/dist/ast/ObjectType.js +16 -16
- package/dist/ast/OptionType.d.ts +1 -1
- package/dist/ast/OptionType.js +1 -1
- package/dist/ast/SetType.d.ts +1 -1
- package/dist/ast/SetType.js +1 -1
- package/dist/ast/TermType.d.ts +1 -1
- package/dist/ast/TermType.js +1 -1
- package/dist/ast/Type.js +15 -15
- package/dist/ast/UnionType.d.ts +1 -1
- package/dist/ast/UnionType.js +3 -3
- package/dist/generators/transformAstToLabeledPropertyGraph.js +10 -10
- package/dist/generators/ts/AbstractCollectionType.d.ts +2 -6
- package/dist/generators/ts/AbstractCollectionType.js +16 -15
- package/dist/generators/ts/AbstractContainerType.d.ts +7 -11
- package/dist/generators/ts/AbstractContainerType.js +35 -36
- package/dist/generators/ts/AbstractDateType.d.ts +4 -4
- package/dist/generators/ts/AbstractDateType.js +2 -2
- package/dist/generators/ts/AbstractIdentifierType.d.ts +1 -1
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +14 -17
- package/dist/generators/ts/AbstractLazyObjectType.js +26 -38
- package/dist/generators/ts/AbstractLiteralType.d.ts +1 -5
- package/dist/generators/ts/AbstractLiteralType.js +7 -6
- package/dist/generators/ts/AbstractNumericType.d.ts +2 -2
- package/dist/generators/ts/AbstractNumericType.js +3 -3
- package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
- package/dist/generators/ts/AbstractObjectSetType.js +2 -2
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -6
- package/dist/generators/ts/AbstractPrimitiveType.js +9 -10
- package/dist/generators/ts/AbstractTermType.d.ts +1 -5
- package/dist/generators/ts/AbstractTermType.js +3 -17
- package/dist/generators/ts/AbstractType.d.ts +22 -15
- package/dist/generators/ts/AbstractType.js +18 -8
- package/dist/generators/ts/BigDecimalType.d.ts +2 -2
- package/dist/generators/ts/BigDecimalType.js +3 -3
- package/dist/generators/ts/BigIntType.d.ts +1 -1
- package/dist/generators/ts/BigIntType.js +3 -3
- package/dist/generators/ts/BlankNodeType.d.ts +4 -4
- package/dist/generators/ts/BlankNodeType.js +12 -12
- package/dist/generators/ts/BooleanType.d.ts +3 -3
- package/dist/generators/ts/BooleanType.js +11 -6
- package/dist/generators/ts/DateTimeType.d.ts +1 -1
- package/dist/generators/ts/DateTimeType.js +1 -1
- package/dist/generators/ts/DateType.d.ts +1 -1
- package/dist/generators/ts/DateType.js +1 -1
- package/dist/generators/ts/DefaultValueType.d.ts +3 -7
- package/dist/generators/ts/DefaultValueType.js +17 -21
- package/dist/generators/ts/FloatType.d.ts +1 -1
- package/dist/generators/ts/FloatType.js +1 -1
- package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
- package/dist/generators/ts/GraphqlSchema.js +4 -4
- package/dist/generators/ts/IdentifierType.d.ts +4 -4
- package/dist/generators/ts/IdentifierType.js +14 -14
- package/dist/generators/ts/IntType.d.ts +1 -1
- package/dist/generators/ts/IntType.js +1 -1
- package/dist/generators/ts/IriType.d.ts +4 -2
- package/dist/generators/ts/IriType.js +27 -22
- package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -1
- package/dist/generators/ts/LazyObjectOptionType.js +7 -7
- package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectSetType.js +6 -6
- package/dist/generators/ts/LazyObjectType.d.ts +1 -1
- package/dist/generators/ts/LazyObjectType.js +5 -5
- package/dist/generators/ts/ListType.d.ts +5 -6
- package/dist/generators/ts/ListType.js +24 -25
- package/dist/generators/ts/LiteralType.d.ts +3 -2
- package/dist/generators/ts/LiteralType.js +14 -7
- package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +24 -24
- package/dist/generators/ts/ObjectType.js +350 -0
- package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
- package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +54 -64
- package/dist/generators/ts/OptionType.d.ts +2 -6
- package/dist/generators/ts/OptionType.js +12 -18
- package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -8
- package/dist/generators/ts/SetType.d.ts +1 -1
- package/dist/generators/ts/SetType.js +1 -1
- package/dist/generators/ts/Snippets.d.ts +1 -0
- package/dist/generators/ts/Snippets.js +7 -0
- package/dist/generators/ts/SparqlObjectSetType.js +2 -2
- package/dist/generators/ts/StringType.d.ts +3 -3
- package/dist/generators/ts/StringType.js +11 -6
- package/dist/generators/ts/TermType.d.ts +3 -3
- package/dist/generators/ts/TermType.js +13 -13
- package/dist/generators/ts/TsGenerator.js +12 -9
- package/dist/generators/ts/Type.d.ts +4 -5
- package/dist/generators/ts/TypeFactory.d.ts +7 -8
- package/dist/generators/ts/TypeFactory.js +79 -80
- package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +40 -15
- package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +328 -135
- package/dist/generators/ts/ZodGenerator.js +7 -9
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +13 -13
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +11 -14
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +3 -2
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +24 -15
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +3 -6
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +20 -12
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_createFunctionDeclaration.js → _ObjectType/ObjectType_createFunctionDeclaration.js} +6 -6
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js → _ObjectType/ObjectType_fromJsonFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js} +7 -31
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +15 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js → _ObjectType/ObjectType_fromRdfTypeVariableStatement.js} +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js → _ObjectType/ObjectType_graphqlTypeVariableStatement.js} +4 -4
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +4 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js → _ObjectType/ObjectType_hashFunctionDeclarations.js} +8 -8
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_interfaceDeclaration.js → _ObjectType/ObjectType_interfaceDeclaration.js} +5 -5
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js → _ObjectType/ObjectType_isTypeFunctionDeclaration.js} +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js → _ObjectType/ObjectType_jsonParseFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js → _ObjectType/ObjectType_jsonTypeAliasDeclaration.js} +2 -2
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts → _ObjectType/ObjectType_objectSetMethodNames.d.ts} +3 -3
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.js → _ObjectType/ObjectType_objectSetMethodNames.js} +4 -4
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +14 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +3 -3
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js → _ObjectType/ObjectType_toJsonFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_toRdfResourceFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +4 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js → _ObjectType/ObjectType_toStringFunctionDeclarations.js} +6 -6
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +3 -3
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +3 -3
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +2 -6
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.js +24 -28
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/identifierTypeDeclarations.js +4 -2
- package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +2 -2
- package/dist/generators/ts/_snippets/snippets_CollectionSchema.js +1 -1
- package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +1 -1
- package/dist/generators/ts/_snippets/snippets_IriSchema.js +2 -2
- package/dist/generators/ts/_snippets/snippets_MaybeSchema.js +2 -2
- package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
- package/dist/generators/ts/_snippets/snippets_StringSchema.js +2 -2
- package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_convertToIri.js +1 -1
- package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.js +16 -0
- package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +2 -2
- package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +2 -2
- package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +1 -1
- package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +3 -3
- package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +1 -1
- package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +1 -1
- package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +1 -1
- package/dist/generators/ts/_snippets/snippets_validateArray.js +1 -1
- package/dist/generators/ts/_snippets/snippets_validateMaybe.js +1 -1
- package/dist/generators/ts/tsComment.js +1 -1
- package/dist/input/generated.d.ts +1399 -1468
- package/dist/input/generated.js +518 -655
- package/package.json +4 -4
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +0 -30
- package/dist/generators/ts/AbstractNamedUnionType.js +0 -190
- package/dist/generators/ts/AnonymousUnionType.d.ts +0 -27
- package/dist/generators/ts/AnonymousUnionType.js +0 -59
- package/dist/generators/ts/NamedObjectType.js +0 -341
- package/dist/generators/ts/NamedObjectUnionType.d.ts +0 -37
- package/dist/generators/ts/NamedUnionType.d.ts +0 -11
- package/dist/generators/ts/NamedUnionType.js +0 -13
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +0 -12
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -12
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +0 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +0 -4
- package/dist/generators/ts/removeUndefined.d.ts +0 -2
- package/dist/generators/ts/removeUndefined.js +0 -17
- /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
- /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
|
@@ -7,48 +7,55 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { Maybe } from "purify-ts";
|
|
8
8
|
import { Memoize } from "typescript-memoize";
|
|
9
9
|
import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
|
|
10
|
-
import { arrayOf, code, joinCode
|
|
10
|
+
import { arrayOf, code, joinCode } from "./ts-poet-wrapper.js";
|
|
11
11
|
export class IriType extends AbstractIdentifierType {
|
|
12
12
|
filterFunction = code `${this.reusables.snippets.filterIri}`;
|
|
13
13
|
filterType = code `${this.reusables.snippets.IriFilter}`;
|
|
14
|
-
kind = "
|
|
14
|
+
kind = "Iri";
|
|
15
15
|
nodeKinds = nodeKinds;
|
|
16
|
-
schemaType = code `${this.reusables.snippets.IriSchema}
|
|
16
|
+
schemaType = code `${this.reusables.snippets.IriSchema}<${this.valueTypeExpression}>`;
|
|
17
17
|
valueSparqlWherePatternsFunction = code `${this.reusables.snippets.iriSparqlWherePatterns}`;
|
|
18
18
|
get conversionFunction() {
|
|
19
|
-
const IriT = this.in_.length > 0
|
|
20
|
-
? code `${joinCode(this.in_.map((iri) => code `${literalOf(iri.value)}`), { on: "| " })}`
|
|
21
|
-
: code `string`;
|
|
22
19
|
return Maybe.of({
|
|
23
|
-
code: code `${this.reusables.snippets.convertToIri}<${
|
|
20
|
+
code: code `${this.reusables.snippets.convertToIri}<${this.valueTypeExpression}>`,
|
|
24
21
|
sourceTypes: [
|
|
25
22
|
{
|
|
26
|
-
|
|
23
|
+
expression: this.valueTypeExpression,
|
|
27
24
|
typeof: "string",
|
|
28
25
|
},
|
|
29
26
|
{
|
|
30
|
-
|
|
27
|
+
expression: this.expression,
|
|
31
28
|
typeof: "object",
|
|
32
29
|
},
|
|
33
30
|
],
|
|
34
31
|
});
|
|
35
32
|
}
|
|
36
|
-
get
|
|
33
|
+
get expression() {
|
|
37
34
|
if (this.in_.length > 0) {
|
|
38
|
-
|
|
39
|
-
// rdfjs.NamedNode<"http://example.com/1" | "http://example.com/2">
|
|
40
|
-
return code `${this.reusables.imports.NamedNode}<${joinCode(this.in_.map((iri) => code `${literalOf(iri.value)}`), { on: "| " })}>`;
|
|
35
|
+
return code `${this.reusables.imports.NamedNode}<${this.valueTypeExpression}>`;
|
|
41
36
|
}
|
|
42
37
|
return code `${this.reusables.imports.NamedNode}`;
|
|
43
38
|
}
|
|
44
39
|
get parseFunction() {
|
|
45
40
|
if (this.in_.length > 0) {
|
|
46
|
-
return code `(identifier: string) => ${this.reusables.snippets.parseIri}(identifier).chain((identifier) => { switch (identifier.value) { ${joinCode(this.in_.map((iri) => code `case "${iri.value}": return ${this.reusables.imports.Right}(identifier as ${this.
|
|
41
|
+
return code `(identifier: string) => ${this.reusables.snippets.parseIri}(identifier).chain((identifier) => { switch (identifier.value) { ${joinCode(this.in_.map((iri) => code `case "${iri.value}": return ${this.reusables.imports.Right}(identifier as ${this.expression});`))} default: return ${this.reusables.imports.Left}(new Error("expected NamedNode identifier to be one of ${this.in_.map((iri) => iri.value).join(" ")}")); } })`;
|
|
47
42
|
}
|
|
48
43
|
return code `${this.reusables.snippets.parseIri}`;
|
|
49
44
|
}
|
|
45
|
+
get schemaInitializers() {
|
|
46
|
+
let initializers = super.schemaInitializers;
|
|
47
|
+
if (this.in_.length > 0) {
|
|
48
|
+
initializers = initializers.concat(code `in: ${arrayOf(...this.in_.map((in_) => this.rdfjsTermExpression(in_)))}`);
|
|
49
|
+
}
|
|
50
|
+
return initializers;
|
|
51
|
+
}
|
|
52
|
+
get valueTypeExpression() {
|
|
53
|
+
return this.in_.length > 0
|
|
54
|
+
? code `(${this.in_.map((in_) => `"${in_.value}"`).join(" | ")})`
|
|
55
|
+
: code `string`;
|
|
56
|
+
}
|
|
50
57
|
fromJsonExpression({ variables, }) {
|
|
51
|
-
return code `${this.reusables.imports.Either}.of<Error, ${this.
|
|
58
|
+
return code `${this.reusables.imports.Either}.of<Error, ${this.expression}>(${this.reusables.imports.dataFactory}.namedNode(${variables.value}["@id"]))`;
|
|
52
59
|
}
|
|
53
60
|
jsonSchema({ includeDiscriminantProperty, }) {
|
|
54
61
|
let idSchema;
|
|
@@ -69,12 +76,7 @@ export class IriType extends AbstractIdentifierType {
|
|
|
69
76
|
const discriminantProperty = parameters?.includeDiscriminantProperty
|
|
70
77
|
? `, readonly termType: "NamedNode"`
|
|
71
78
|
: "";
|
|
72
|
-
|
|
73
|
-
// Treat sh:in as a union of the IRIs
|
|
74
|
-
// rdfjs.NamedNode<"http://example.com/1" | "http://example.com/2">
|
|
75
|
-
return new AbstractIdentifierType.JsonType(code `{ readonly "@id": ${this.in_.map((iri) => `"${iri.value}"`).join(" | ")}${discriminantProperty} }`);
|
|
76
|
-
}
|
|
77
|
-
return new AbstractIdentifierType.JsonType(code `{ readonly "@id": string${discriminantProperty} }`);
|
|
79
|
+
return new AbstractIdentifierType.JsonType(code `{ readonly "@id": ${this.valueTypeExpression}${discriminantProperty} }`);
|
|
78
80
|
}
|
|
79
81
|
toJsonExpression({ includeDiscriminantProperty, variables, }) {
|
|
80
82
|
const discriminantProperty = includeDiscriminantProperty
|
|
@@ -96,10 +98,13 @@ __decorate([
|
|
|
96
98
|
], IriType.prototype, "conversionFunction", null);
|
|
97
99
|
__decorate([
|
|
98
100
|
Memoize()
|
|
99
|
-
], IriType.prototype, "
|
|
101
|
+
], IriType.prototype, "expression", null);
|
|
100
102
|
__decorate([
|
|
101
103
|
Memoize()
|
|
102
104
|
], IriType.prototype, "parseFunction", null);
|
|
105
|
+
__decorate([
|
|
106
|
+
Memoize()
|
|
107
|
+
], IriType.prototype, "valueTypeExpression", null);
|
|
103
108
|
__decorate([
|
|
104
109
|
Memoize()
|
|
105
110
|
], IriType.prototype, "jsonType", null);
|
|
@@ -7,6 +7,7 @@ declare const Super: (abstract new ({ partialType, resolveType, ...superParamete
|
|
|
7
7
|
partialType: OptionType<AbstractLazyObjectType.ObjectTypeConstraint>;
|
|
8
8
|
resolveType: OptionType<AbstractLazyObjectType.ObjectTypeConstraint>;
|
|
9
9
|
} & {
|
|
10
|
+
alias: Maybe<string>;
|
|
10
11
|
comment: Maybe<string>;
|
|
11
12
|
configuration: import("./TsGenerator.js").TsGenerator.Configuration;
|
|
12
13
|
label: Maybe<string>;
|
|
@@ -18,7 +19,7 @@ declare const Super: (abstract new ({ partialType, resolveType, ...superParamete
|
|
|
18
19
|
};
|
|
19
20
|
export declare class LazyObjectOptionType extends Super {
|
|
20
21
|
readonly graphqlArgs: Super["graphqlArgs"];
|
|
21
|
-
readonly kind = "
|
|
22
|
+
readonly kind = "LazyObjectOption";
|
|
22
23
|
get conversionFunction(): Maybe<AbstractLazyObjectType.ConversionFunction>;
|
|
23
24
|
protected get runtimeClass(): {
|
|
24
25
|
name: Code;
|
|
@@ -11,25 +11,25 @@ import { code } from "./ts-poet-wrapper.js";
|
|
|
11
11
|
const Super = (AbstractLazyObjectType);
|
|
12
12
|
export class LazyObjectOptionType extends Super {
|
|
13
13
|
graphqlArgs = Maybe.empty();
|
|
14
|
-
kind = "
|
|
14
|
+
kind = "LazyObjectOption";
|
|
15
15
|
get conversionFunction() {
|
|
16
16
|
return Maybe.of({
|
|
17
|
-
code: code `${this.reusables.snippets.convertToLazyObjectOption}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.
|
|
17
|
+
code: code `${this.reusables.snippets.convertToLazyObjectOption}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType.itemType, resolveType: this.resolveType.itemType })})`,
|
|
18
18
|
sourceTypes: [
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
expression: this.expression,
|
|
21
21
|
typeof: "object",
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
|
|
24
|
+
expression: this.resolveType.expression,
|
|
25
25
|
typeof: "object",
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
|
|
28
|
+
expression: this.resolveType.itemType.expression,
|
|
29
29
|
typeof: "object",
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
|
|
32
|
+
expression: code `undefined`,
|
|
33
33
|
typeof: "undefined",
|
|
34
34
|
},
|
|
35
35
|
],
|
|
@@ -37,7 +37,7 @@ export class LazyObjectOptionType extends Super {
|
|
|
37
37
|
}
|
|
38
38
|
get runtimeClass() {
|
|
39
39
|
return {
|
|
40
|
-
name: code `${this.reusables.snippets.LazyObjectOption}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.
|
|
40
|
+
name: code `${this.reusables.snippets.LazyObjectOption}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>`,
|
|
41
41
|
partialPropertyName: "partial",
|
|
42
42
|
rawName: code `${this.reusables.snippets.LazyObjectOption}`,
|
|
43
43
|
};
|
|
@@ -4,7 +4,7 @@ import type { SetType } from "./SetType.js";
|
|
|
4
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export declare class LazyObjectSetType extends AbstractLazyObjectType<SetType<AbstractLazyObjectType.ObjectTypeConstraint>, SetType<AbstractLazyObjectType.ObjectTypeConstraint>> {
|
|
6
6
|
readonly graphqlArgs: Super["graphqlArgs"];
|
|
7
|
-
readonly kind = "
|
|
7
|
+
readonly kind = "LazyObjectSet";
|
|
8
8
|
get conversionFunction(): Maybe<AbstractLazyObjectType.ConversionFunction>;
|
|
9
9
|
protected get runtimeClass(): {
|
|
10
10
|
name: Code;
|
|
@@ -17,21 +17,21 @@ export class LazyObjectSetType extends AbstractLazyObjectType {
|
|
|
17
17
|
type: code `${this.reusables.imports.GraphQLInt}`,
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
|
-
kind = "
|
|
20
|
+
kind = "LazyObjectSet";
|
|
21
21
|
get conversionFunction() {
|
|
22
22
|
return Maybe.of({
|
|
23
|
-
code: code `${this.reusables.snippets.convertToLazyObjectSet}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.
|
|
23
|
+
code: code `${this.reusables.snippets.convertToLazyObjectSet}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType.itemType, resolveType: this.resolveType.itemType })})`,
|
|
24
24
|
sourceTypes: [
|
|
25
25
|
{
|
|
26
|
-
|
|
26
|
+
expression: this.expression,
|
|
27
27
|
typeof: "object",
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
|
|
30
|
+
expression: this.resolveType.expression,
|
|
31
31
|
typeof: "object",
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
|
|
34
|
+
expression: code `undefined`,
|
|
35
35
|
typeof: "undefined",
|
|
36
36
|
},
|
|
37
37
|
],
|
|
@@ -39,7 +39,7 @@ export class LazyObjectSetType extends AbstractLazyObjectType {
|
|
|
39
39
|
}
|
|
40
40
|
get runtimeClass() {
|
|
41
41
|
return {
|
|
42
|
-
name: code `${this.reusables.snippets.LazyObjectSet}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.
|
|
42
|
+
name: code `${this.reusables.snippets.LazyObjectSet}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>`,
|
|
43
43
|
partialPropertyName: "partials",
|
|
44
44
|
rawName: code `${this.reusables.snippets.LazyObjectSet}`,
|
|
45
45
|
};
|
|
@@ -3,7 +3,7 @@ import { AbstractLazyObjectType } from "./AbstractLazyObjectType.js";
|
|
|
3
3
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
4
4
|
export declare class LazyObjectType extends AbstractLazyObjectType<AbstractLazyObjectType.ObjectTypeConstraint, AbstractLazyObjectType.ObjectTypeConstraint> {
|
|
5
5
|
readonly graphqlArgs: Super["graphqlArgs"];
|
|
6
|
-
readonly kind = "
|
|
6
|
+
readonly kind = "LazyObject";
|
|
7
7
|
get conversionFunction(): Maybe<AbstractLazyObjectType.ConversionFunction>;
|
|
8
8
|
protected get runtimeClass(): {
|
|
9
9
|
name: Code;
|
|
@@ -10,17 +10,17 @@ import { AbstractLazyObjectType } from "./AbstractLazyObjectType.js";
|
|
|
10
10
|
import { code } from "./ts-poet-wrapper.js";
|
|
11
11
|
export class LazyObjectType extends AbstractLazyObjectType {
|
|
12
12
|
graphqlArgs = Maybe.empty();
|
|
13
|
-
kind = "
|
|
13
|
+
kind = "LazyObject";
|
|
14
14
|
get conversionFunction() {
|
|
15
15
|
return Maybe.of({
|
|
16
|
-
code: code `${this.reusables.snippets.convertToLazyObject}<${this.resolveType.identifierTypeAlias}, ${this.partialType.
|
|
16
|
+
code: code `${this.reusables.snippets.convertToLazyObject}<${this.resolveType.identifierTypeAlias}, ${this.partialType.expression}, ${this.resolveType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType, resolveType: this.resolveType })})`,
|
|
17
17
|
sourceTypes: [
|
|
18
18
|
{
|
|
19
|
-
|
|
19
|
+
expression: this.expression,
|
|
20
20
|
typeof: "object",
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
|
|
23
|
+
expression: this.resolveType.expression,
|
|
24
24
|
typeof: "object",
|
|
25
25
|
},
|
|
26
26
|
],
|
|
@@ -28,7 +28,7 @@ export class LazyObjectType extends AbstractLazyObjectType {
|
|
|
28
28
|
}
|
|
29
29
|
get runtimeClass() {
|
|
30
30
|
return {
|
|
31
|
-
name: code `${this.reusables.snippets.LazyObject}<${this.resolveType.identifierTypeAlias}, ${this.partialType.
|
|
31
|
+
name: code `${this.reusables.snippets.LazyObject}<${this.resolveType.identifierTypeAlias}, ${this.partialType.expression}, ${this.resolveType.expression}>`,
|
|
32
32
|
partialPropertyName: "partial",
|
|
33
33
|
rawName: code `${this.reusables.snippets.LazyObject}`,
|
|
34
34
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { NamedNode } from "@rdfjs/types";
|
|
2
2
|
import { AbstractCollectionType } from "./AbstractCollectionType.js";
|
|
3
|
-
import type { AnonymousUnionType } from "./AnonymousUnionType.js";
|
|
4
3
|
import type { BigDecimalType } from "./BigDecimalType.js";
|
|
5
4
|
import type { BigIntType } from "./BigIntType.js";
|
|
6
5
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
@@ -12,17 +11,17 @@ import type { IdentifierType } from "./IdentifierType.js";
|
|
|
12
11
|
import type { IntType } from "./IntType.js";
|
|
13
12
|
import type { IriType } from "./IriType.js";
|
|
14
13
|
import type { LiteralType } from "./LiteralType.js";
|
|
15
|
-
import type {
|
|
16
|
-
import type {
|
|
17
|
-
import type { NamedUnionType } from "./NamedUnionType.js";
|
|
14
|
+
import type { ObjectType } from "./ObjectType.js";
|
|
15
|
+
import type { ObjectUnionType } from "./ObjectUnionType.js";
|
|
18
16
|
import type { StringType } from "./StringType.js";
|
|
19
17
|
import type { TermType } from "./TermType.js";
|
|
20
18
|
import type { Type } from "./Type.js";
|
|
21
19
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
20
|
+
import type { UnionType } from "./UnionType.js";
|
|
22
21
|
export declare class ListType<ItemTypeT extends ListType.ItemType> extends AbstractCollectionType<ItemTypeT> {
|
|
23
22
|
private readonly identifierNodeKind;
|
|
24
23
|
private readonly toRdfTypes;
|
|
25
|
-
readonly kind = "
|
|
24
|
+
readonly kind = "List";
|
|
26
25
|
constructor({ identifierNodeKind, toRdfTypes, ...superParameters }: {
|
|
27
26
|
identifierNodeKind: ListType<ItemTypeT>["identifierNodeKind"];
|
|
28
27
|
toRdfTypes: readonly NamedNode[];
|
|
@@ -35,7 +34,7 @@ export declare class ListType<ItemTypeT extends ListType.ItemType> extends Abstr
|
|
|
35
34
|
toStringExpression({ variables, }: Parameters<AbstractCollectionType<ItemTypeT>["toStringExpression"]>[0]): Code;
|
|
36
35
|
}
|
|
37
36
|
export declare namespace ListType {
|
|
38
|
-
type ItemType =
|
|
37
|
+
type ItemType = BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | FloatType | IdentifierType | IntType | IriType | LiteralType | ObjectUnionType | ObjectType | StringType | TermType | UnionType<Type>;
|
|
39
38
|
function isItemType(type: Type): type is ItemType;
|
|
40
39
|
}
|
|
41
40
|
//# sourceMappingURL=ListType.d.ts.map
|
|
@@ -11,7 +11,7 @@ import { code, joinCode } from "./ts-poet-wrapper.js";
|
|
|
11
11
|
export class ListType extends AbstractCollectionType {
|
|
12
12
|
identifierNodeKind;
|
|
13
13
|
toRdfTypes;
|
|
14
|
-
kind = "
|
|
14
|
+
kind = "List";
|
|
15
15
|
constructor({ identifierNodeKind, toRdfTypes, ...superParameters }) {
|
|
16
16
|
super(superParameters);
|
|
17
17
|
this.identifierNodeKind = identifierNodeKind;
|
|
@@ -102,31 +102,30 @@ __decorate([
|
|
|
102
102
|
(function (ListType) {
|
|
103
103
|
function isItemType(type) {
|
|
104
104
|
switch (type.kind) {
|
|
105
|
-
case "
|
|
106
|
-
case "
|
|
107
|
-
case "
|
|
108
|
-
case "
|
|
109
|
-
case "
|
|
110
|
-
case "
|
|
111
|
-
case "
|
|
112
|
-
case "
|
|
113
|
-
case "
|
|
114
|
-
case "
|
|
115
|
-
case "
|
|
116
|
-
case "
|
|
117
|
-
case "
|
|
118
|
-
case "
|
|
119
|
-
case "
|
|
120
|
-
case "
|
|
121
|
-
case "TermType":
|
|
105
|
+
case "BigDecimal":
|
|
106
|
+
case "BigInt":
|
|
107
|
+
case "BlankNode":
|
|
108
|
+
case "Boolean":
|
|
109
|
+
case "DateTime":
|
|
110
|
+
case "Date":
|
|
111
|
+
case "Float":
|
|
112
|
+
case "Identifier":
|
|
113
|
+
case "Iri":
|
|
114
|
+
case "Int":
|
|
115
|
+
case "Literal":
|
|
116
|
+
case "ObjectUnion":
|
|
117
|
+
case "Object":
|
|
118
|
+
case "String":
|
|
119
|
+
case "Term":
|
|
120
|
+
case "Union":
|
|
122
121
|
return true;
|
|
123
|
-
case "
|
|
124
|
-
case "
|
|
125
|
-
case "
|
|
126
|
-
case "
|
|
127
|
-
case "
|
|
128
|
-
case "
|
|
129
|
-
case "
|
|
122
|
+
case "DefaultValue":
|
|
123
|
+
case "LazyObjectOption":
|
|
124
|
+
case "LazyObjectSet":
|
|
125
|
+
case "LazyObject":
|
|
126
|
+
case "List":
|
|
127
|
+
case "Option":
|
|
128
|
+
case "Set":
|
|
130
129
|
return false;
|
|
131
130
|
}
|
|
132
131
|
}
|
|
@@ -3,14 +3,15 @@ import { Maybe } from "purify-ts";
|
|
|
3
3
|
import { AbstractLiteralType } from "./AbstractLiteralType.js";
|
|
4
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export declare class LiteralType extends AbstractLiteralType {
|
|
6
|
-
readonly
|
|
6
|
+
readonly expression: Code;
|
|
7
7
|
readonly conversionFunction: Maybe<AbstractLiteralType.ConversionFunction>;
|
|
8
8
|
readonly filterFunction: Code;
|
|
9
9
|
readonly filterType: Code;
|
|
10
|
-
readonly kind = "
|
|
10
|
+
readonly kind = "Literal";
|
|
11
11
|
readonly schemaType: Code;
|
|
12
12
|
readonly valueSparqlWherePatternsFunction: Code;
|
|
13
13
|
get graphqlType(): AbstractLiteralType.GraphqlType;
|
|
14
|
+
protected get schemaInitializers(): readonly Code[];
|
|
14
15
|
fromJsonExpression({ variables, }: Parameters<AbstractLiteralType["fromJsonExpression"]>[0]): Code;
|
|
15
16
|
graphqlResolveExpression(_parameters: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
|
|
16
17
|
jsonSchema({ includeDiscriminantProperty, }: Parameters<AbstractLiteralType["jsonSchema"]>[0]): Code;
|
|
@@ -1,36 +1,43 @@
|
|
|
1
1
|
import { xsd } from "@tpluscode/rdf-ns-builders";
|
|
2
2
|
import { Maybe } from "purify-ts";
|
|
3
3
|
import { AbstractLiteralType } from "./AbstractLiteralType.js";
|
|
4
|
-
import { code } from "./ts-poet-wrapper.js";
|
|
4
|
+
import { arrayOf, code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export class LiteralType extends AbstractLiteralType {
|
|
6
|
-
|
|
6
|
+
expression = code `${this.reusables.imports.Literal}`;
|
|
7
7
|
conversionFunction = Maybe.of({
|
|
8
8
|
code: code `${this.reusables.snippets.convertToLiteral}`,
|
|
9
9
|
sourceTypes: [
|
|
10
10
|
...["bigint", "boolean", "number", "string"].map((typeof_) => ({
|
|
11
|
-
|
|
11
|
+
expression: code `${typeof_}`,
|
|
12
12
|
typeof: typeof_,
|
|
13
13
|
})),
|
|
14
14
|
{
|
|
15
|
-
|
|
15
|
+
expression: code `Date`,
|
|
16
16
|
typeof: "object",
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
|
|
19
|
+
expression: code `${this.reusables.imports.Literal}`,
|
|
20
20
|
typeof: "object",
|
|
21
21
|
},
|
|
22
22
|
],
|
|
23
23
|
});
|
|
24
24
|
filterFunction = code `${this.reusables.snippets.filterLiteral}`;
|
|
25
25
|
filterType = code `${this.reusables.snippets.LiteralFilter}`;
|
|
26
|
-
kind = "
|
|
26
|
+
kind = "Literal";
|
|
27
27
|
schemaType = code `${this.reusables.snippets.LiteralSchema}`;
|
|
28
28
|
valueSparqlWherePatternsFunction = code `${this.reusables.snippets.literalSparqlWherePatterns}`;
|
|
29
29
|
get graphqlType() {
|
|
30
30
|
throw new Error("not implemented");
|
|
31
31
|
}
|
|
32
|
+
get schemaInitializers() {
|
|
33
|
+
let initializers = super.schemaInitializers;
|
|
34
|
+
if (this.in_.length > 0) {
|
|
35
|
+
initializers = initializers.concat(code `in: ${arrayOf(...this.in_.map((in_) => this.rdfjsTermExpression(in_)))}`);
|
|
36
|
+
}
|
|
37
|
+
return initializers;
|
|
38
|
+
}
|
|
32
39
|
fromJsonExpression({ variables, }) {
|
|
33
|
-
return code `${this.reusables.imports.Either}.of<Error, ${this.
|
|
40
|
+
return code `${this.reusables.imports.Either}.of<Error, ${this.expression}>(${this.reusables.imports.dataFactory}.literal(${variables.value}["@value"], ${variables.value}["@language"] !== undefined ? ${variables.value}["@language"] : (${variables.value}["@type"] !== undefined ? ${this.reusables.imports.dataFactory}.namedNode(${variables.value}["@type"]!) : undefined)))`;
|
|
34
41
|
}
|
|
35
42
|
graphqlResolveExpression(_parameters) {
|
|
36
43
|
throw new Error("not implemented");
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
import type { NamedNode } from "@rdfjs/types";
|
|
2
2
|
import { Maybe } from "purify-ts";
|
|
3
|
-
import { DiscriminantProperty as _DiscriminantProperty } from "./
|
|
4
|
-
import { IdentifierProperty as _IdentifierProperty } from "./
|
|
5
|
-
import type { Property as _Property } from "./
|
|
6
|
-
import { ShaclProperty as _ShaclProperty } from "./
|
|
3
|
+
import { DiscriminantProperty as _DiscriminantProperty } from "./_ObjectType/DiscriminantProperty.js";
|
|
4
|
+
import { IdentifierProperty as _IdentifierProperty } from "./_ObjectType/IdentifierProperty.js";
|
|
5
|
+
import type { Property as _Property } from "./_ObjectType/Property.js";
|
|
6
|
+
import { ShaclProperty as _ShaclProperty } from "./_ObjectType/ShaclProperty.js";
|
|
7
7
|
import { AbstractType } from "./AbstractType.js";
|
|
8
8
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
9
9
|
import type { IdentifierType } from "./IdentifierType.js";
|
|
10
10
|
import type { IriType } from "./IriType.js";
|
|
11
11
|
import type { Type } from "./Type.js";
|
|
12
12
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
13
|
-
export declare class
|
|
13
|
+
export declare class ObjectType extends AbstractType {
|
|
14
14
|
protected readonly toRdfTypes: readonly NamedNode[];
|
|
15
15
|
readonly conversionFunction: Maybe<AbstractType.ConversionFunction>;
|
|
16
16
|
readonly extern: boolean;
|
|
17
17
|
readonly fromRdfType: Maybe<NamedNode>;
|
|
18
18
|
readonly graphqlArgs: AbstractType["graphqlArgs"];
|
|
19
19
|
readonly identifierType: BlankNodeType | IdentifierType | IriType;
|
|
20
|
-
readonly kind = "
|
|
21
|
-
readonly name: string;
|
|
20
|
+
readonly kind = "Object";
|
|
22
21
|
readonly recursive: boolean;
|
|
22
|
+
readonly referencesObjectType = true;
|
|
23
23
|
readonly synthetic: boolean;
|
|
24
24
|
readonly typeofs: "object"[];
|
|
25
25
|
readonly validationFunction: Maybe<Code>;
|
|
26
|
-
constructor({ extern, fromRdfType, identifierType, lazyAncestorObjectTypes, lazyChildObjectTypes, lazyDescendantObjectTypes, lazyDiscriminantProperty, lazyParentObjectTypes, lazyProperties,
|
|
26
|
+
constructor({ extern, fromRdfType, identifierType, lazyAncestorObjectTypes, lazyChildObjectTypes, lazyDescendantObjectTypes, lazyDiscriminantProperty, lazyParentObjectTypes, lazyProperties, recursive, synthetic, toRdfTypes, ...superParameters }: {
|
|
27
27
|
comment: Maybe<string>;
|
|
28
28
|
extern: boolean;
|
|
29
29
|
fromRdfType: Maybe<NamedNode>;
|
|
30
30
|
identifierType: BlankNodeType | IdentifierType | IriType;
|
|
31
31
|
label: Maybe<string>;
|
|
32
|
-
lazyAncestorObjectTypes: () => readonly
|
|
33
|
-
lazyChildObjectTypes: () => readonly
|
|
34
|
-
lazyDiscriminantProperty: (namedObjectType:
|
|
35
|
-
lazyDescendantObjectTypes: () => readonly
|
|
36
|
-
lazyParentObjectTypes: () => readonly
|
|
37
|
-
lazyProperties: (namedObjectType:
|
|
38
|
-
name: string;
|
|
32
|
+
lazyAncestorObjectTypes: () => readonly ObjectType[];
|
|
33
|
+
lazyChildObjectTypes: () => readonly ObjectType[];
|
|
34
|
+
lazyDiscriminantProperty: (namedObjectType: ObjectType) => ObjectType.DiscriminantProperty;
|
|
35
|
+
lazyDescendantObjectTypes: () => readonly ObjectType[];
|
|
36
|
+
lazyParentObjectTypes: () => readonly ObjectType[];
|
|
37
|
+
lazyProperties: (namedObjectType: ObjectType) => readonly ObjectType.Property[];
|
|
39
38
|
recursive: boolean;
|
|
40
39
|
synthetic: boolean;
|
|
41
40
|
toRdfTypes: readonly NamedNode[];
|
|
42
41
|
} & ConstructorParameters<typeof AbstractType>[0]);
|
|
43
|
-
get _discriminantProperty():
|
|
44
|
-
get ancestorObjectTypes(): readonly
|
|
45
|
-
get childObjectTypes(): readonly
|
|
42
|
+
get _discriminantProperty(): ObjectType.DiscriminantProperty;
|
|
43
|
+
get ancestorObjectTypes(): readonly ObjectType[];
|
|
44
|
+
get childObjectTypes(): readonly ObjectType[];
|
|
46
45
|
get declaration(): Maybe<Code>;
|
|
47
46
|
get descendantFromRdfTypeVariables(): readonly Code[];
|
|
48
47
|
get descendantFromRdfTypes(): readonly NamedNode[];
|
|
49
|
-
get descendantObjectTypes(): readonly
|
|
48
|
+
get descendantObjectTypes(): readonly ObjectType[];
|
|
50
49
|
get discriminantProperty(): Maybe<AbstractType.DiscriminantProperty>;
|
|
51
50
|
get discriminantValue(): string;
|
|
52
51
|
get equalsFunction(): Code;
|
|
52
|
+
get expression(): Code;
|
|
53
53
|
get filterFunction(): Code;
|
|
54
54
|
get filterType(): Code;
|
|
55
55
|
get fromRdfTypeVariable(): Maybe<Code>;
|
|
@@ -57,9 +57,9 @@ export declare class NamedObjectType extends AbstractType {
|
|
|
57
57
|
get hashFunction(): Code;
|
|
58
58
|
get identifierTypeAlias(): Code;
|
|
59
59
|
get mutable(): boolean;
|
|
60
|
-
get objectSetMethodNames():
|
|
61
|
-
get parentObjectTypes(): readonly
|
|
62
|
-
get properties(): readonly
|
|
60
|
+
get objectSetMethodNames(): ObjectType.ObjectSetMethodNames;
|
|
61
|
+
get parentObjectTypes(): readonly ObjectType[];
|
|
62
|
+
get properties(): readonly ObjectType.Property[];
|
|
63
63
|
get schema(): Code;
|
|
64
64
|
get schemaType(): Code;
|
|
65
65
|
get toRdfResourceValueTypes(): AbstractType["toRdfResourceValueTypes"];
|
|
@@ -87,7 +87,7 @@ export declare class NamedObjectType extends AbstractType {
|
|
|
87
87
|
private readonly lazyParentObjectTypes;
|
|
88
88
|
private readonly lazyProperties;
|
|
89
89
|
}
|
|
90
|
-
export declare namespace
|
|
90
|
+
export declare namespace ObjectType {
|
|
91
91
|
const IdentifierProperty: typeof _IdentifierProperty;
|
|
92
92
|
type IdentifierProperty = _IdentifierProperty;
|
|
93
93
|
type ObjectSetMethodNames = {
|
|
@@ -102,4 +102,4 @@ export declare namespace NamedObjectType {
|
|
|
102
102
|
const DiscriminantProperty: typeof _DiscriminantProperty;
|
|
103
103
|
type DiscriminantProperty = _DiscriminantProperty;
|
|
104
104
|
}
|
|
105
|
-
//# sourceMappingURL=
|
|
105
|
+
//# sourceMappingURL=ObjectType.d.ts.map
|