@shaclmate/compiler 4.0.39 → 4.0.41
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 +0 -8
- package/dist/ShapesGraphToAstTransformer.js +5 -85
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +128 -160
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.d.ts +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +0 -16
- package/dist/ast/AbstractCompoundType.d.ts +2 -1
- package/dist/ast/AbstractCompoundType.js +1 -1
- package/dist/ast/AbstractLazyObjectType.d.ts +0 -2
- package/dist/ast/Ast.d.ts +1 -3
- package/dist/ast/ListType.d.ts +1 -1
- package/dist/ast/ListType.js +1 -1
- package/dist/ast/ObjectType.d.ts +0 -12
- package/dist/ast/ObjectType.js +0 -78
- package/dist/generators/AstJsonGenerator.js +7 -3
- package/dist/generators/transformAstToLabeledPropertyGraph.js +59 -56
- package/dist/generators/ts/AbstractCollectionType.d.ts +5 -12
- package/dist/generators/ts/AbstractCollectionType.js +9 -68
- package/dist/generators/ts/AbstractContainerType.d.ts +4 -6
- package/dist/generators/ts/AbstractContainerType.js +5 -9
- package/dist/generators/ts/AbstractDateType.d.ts +6 -3
- package/dist/generators/ts/AbstractDateType.js +7 -2
- package/dist/generators/ts/AbstractIdentifierType.d.ts +4 -0
- package/dist/generators/ts/AbstractIdentifierType.js +3 -0
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +9 -9
- package/dist/generators/ts/AbstractLazyObjectType.js +30 -19
- package/dist/generators/ts/AbstractLiteralType.d.ts +1 -0
- package/dist/generators/ts/AbstractNumericType.d.ts +1 -1
- package/dist/generators/ts/AbstractNumericType.js +9 -9
- package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
- package/dist/generators/ts/AbstractObjectSetType.js +2 -2
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -0
- package/dist/generators/ts/AbstractPrimitiveType.js +2 -2
- package/dist/generators/ts/AbstractTermType.d.ts +1 -2
- package/dist/generators/ts/AbstractTermType.js +3 -5
- package/dist/generators/ts/AbstractType.d.ts +61 -26
- package/dist/generators/ts/AbstractType.js +37 -17
- package/dist/generators/ts/BigDecimalType.d.ts +5 -1
- package/dist/generators/ts/BigDecimalType.js +6 -3
- package/dist/generators/ts/BigIntType.d.ts +3 -1
- package/dist/generators/ts/BigIntType.js +3 -3
- package/dist/generators/ts/BlankNodeType.d.ts +3 -3
- package/dist/generators/ts/BlankNodeType.js +13 -13
- package/dist/generators/ts/BooleanType.d.ts +5 -3
- package/dist/generators/ts/BooleanType.js +11 -6
- package/dist/generators/ts/DefaultValueType.d.ts +40 -2
- package/dist/generators/ts/DefaultValueType.js +14 -12
- package/dist/generators/ts/FloatType.d.ts +3 -1
- package/dist/generators/ts/FloatType.js +1 -1
- package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
- package/dist/generators/ts/GraphqlSchema.js +6 -6
- package/dist/generators/ts/IdentifierType.d.ts +3 -3
- package/dist/generators/ts/IdentifierType.js +19 -17
- package/dist/generators/ts/IntType.d.ts +3 -1
- package/dist/generators/ts/IntType.js +1 -1
- package/dist/generators/ts/IriType.d.ts +2 -2
- package/dist/generators/ts/IriType.js +21 -19
- package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -0
- package/dist/generators/ts/LazyObjectOptionType.js +14 -10
- package/dist/generators/ts/LazyObjectSetType.js +14 -8
- package/dist/generators/ts/LazyObjectType.js +9 -6
- package/dist/generators/ts/ListType.d.ts +13 -5
- package/dist/generators/ts/ListType.js +48 -12
- package/dist/generators/ts/LiteralType.d.ts +5 -1
- package/dist/generators/ts/LiteralType.js +11 -8
- package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +19 -34
- package/dist/generators/ts/ObjectType.js +282 -0
- package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
- package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +52 -60
- package/dist/generators/ts/OptionType.d.ts +6 -2
- package/dist/generators/ts/OptionType.js +20 -15
- package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -11
- package/dist/generators/ts/SetType.d.ts +16 -1
- package/dist/generators/ts/SetType.js +80 -2
- package/dist/generators/ts/Snippets.d.ts +3 -1
- package/dist/generators/ts/Snippets.js +18 -4
- package/dist/generators/ts/SparqlObjectSetType.js +2 -2
- package/dist/generators/ts/StringType.d.ts +5 -3
- package/dist/generators/ts/StringType.js +15 -6
- package/dist/generators/ts/TermType.d.ts +6 -2
- package/dist/generators/ts/TermType.js +15 -12
- package/dist/generators/ts/TsGenerator.d.ts +1 -1
- package/dist/generators/ts/TsGenerator.js +60 -32
- package/dist/generators/ts/Type.d.ts +4 -5
- package/dist/generators/ts/TypeFactory.d.ts +7 -8
- package/dist/generators/ts/TypeFactory.js +62 -76
- package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +36 -11
- package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +296 -105
- package/dist/generators/ts/ZodGenerator.d.ts +1 -1
- package/dist/generators/ts/ZodGenerator.js +21 -16
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +9 -6
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +3 -3
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +9 -13
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +22 -39
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +1 -5
- package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +18 -13
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +44 -0
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +3 -7
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -6
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +2 -5
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +2 -6
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -24
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +18 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js +51 -0
- 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/_ObjectType/ObjectType_hashFunctionDeclarations.js +41 -0
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +12 -0
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +20 -0
- 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} +5 -11
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +9 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -6
- 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 +12 -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/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +20 -0
- 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} +7 -14
- 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.js +12 -12
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.js +16 -0
- package/dist/generators/ts/_snippets/snippets_convertToArraySet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToArraySet.js +8 -0
- package/dist/generators/ts/_snippets/snippets_convertToList.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToList.js +7 -0
- package/dist/generators/ts/_snippets/snippets_convertToScalarSet.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_convertToScalarSet.js +15 -0
- package/dist/input/generated.d.ts +758 -117
- package/dist/input/generated.js +636 -128
- package/package.json +4 -6
- 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 -342
- 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_createFunctionDeclaration.js +0 -65
- 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_fromJsonFunctionDeclaration.js +0 -43
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +0 -80
- 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_hashFunctionDeclarations.js +0 -45
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.js +0 -16
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js +0 -17
- 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_jsonTypeAliasDeclaration.js +0 -16
- 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_toJsonFunctionDeclaration.js +0 -41
- 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/_NamedObjectType/identifierTypeDeclarations.js +0 -25
- package/dist/generators/ts/_snippets/snippets_convertToArray.d.ts +0 -3
- package/dist/generators/ts/_snippets/snippets_convertToArray.js +0 -8
- /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
- /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
- /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +0 -0
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function NamedObjectType_fromRdfResourceValuesFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("Object.fromRdf")) {
|
|
5
|
-
return Maybe.empty();
|
|
6
|
-
}
|
|
7
|
-
return Maybe.of(code `\
|
|
8
|
-
export const fromRdfResourceValues: ${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.name}> = (values, options) =>
|
|
9
|
-
values.chain(
|
|
10
|
-
values => values.chainMap(
|
|
11
|
-
value => value.toResource().chain(resource => ${this.name}.fromRdfResource(resource, options))
|
|
12
|
-
)
|
|
13
|
-
);`);
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_fromRdfTypeVariableStatement(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_fromRdfTypeVariableStatement.d.ts.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_graphqlTypeVariableStatement(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_graphqlTypeVariableStatement.d.ts.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function NamedObjectType_hashFunctionDeclarations(this: NamedObjectType): readonly Code[];
|
|
4
|
-
//# sourceMappingURL=NamedObjectType_hashFunctionDeclarations.d.ts.map
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
2
|
-
const hasherVariable = code `hasher`;
|
|
3
|
-
export function NamedObjectType_hashFunctionDeclarations() {
|
|
4
|
-
if (!this.configuration.features.has("Object.hash")) {
|
|
5
|
-
return [];
|
|
6
|
-
}
|
|
7
|
-
const hashOwnShaclPropertiesStatements = this.properties.flatMap((property) => property.kind === "Shacl"
|
|
8
|
-
? property.hashStatements({
|
|
9
|
-
variables: {
|
|
10
|
-
hasher: hasherVariable,
|
|
11
|
-
value: property.accessExpression({
|
|
12
|
-
variables: { object: this.thisVariable },
|
|
13
|
-
}),
|
|
14
|
-
},
|
|
15
|
-
})
|
|
16
|
-
: []);
|
|
17
|
-
const hashShaclPropertiesStatements = [];
|
|
18
|
-
const hashStatements = [];
|
|
19
|
-
for (const parentObjectType of this.parentObjectTypes) {
|
|
20
|
-
hashShaclPropertiesStatements.push(code `${parentObjectType.name}.hashShaclProperties(${hasherVariable}, ${this.thisVariable});`);
|
|
21
|
-
}
|
|
22
|
-
hashStatements.push(code `${this.name}.hashShaclProperties(${hasherVariable}, ${this.thisVariable});`);
|
|
23
|
-
hashShaclPropertiesStatements.push(...hashOwnShaclPropertiesStatements);
|
|
24
|
-
hashShaclPropertiesStatements.push(code `return ${hasherVariable};`);
|
|
25
|
-
hashStatements.push(...this.properties
|
|
26
|
-
.filter((property) => property.kind !== "Shacl")
|
|
27
|
-
.flatMap((property) => property.hashStatements({
|
|
28
|
-
variables: {
|
|
29
|
-
hasher: hasherVariable,
|
|
30
|
-
value: code `${property.accessExpression({ variables: { object: this.thisVariable } })}`,
|
|
31
|
-
},
|
|
32
|
-
})));
|
|
33
|
-
hashStatements.push(code `return ${hasherVariable};`);
|
|
34
|
-
return [
|
|
35
|
-
code `\
|
|
36
|
-
export function hash<HasherT extends ${this.reusables.snippets.Hasher}>(${hasherVariable}: HasherT, ${this.thisVariable}: ${this.name}): HasherT {
|
|
37
|
-
${joinCode(hashStatements)}
|
|
38
|
-
}`,
|
|
39
|
-
code `\
|
|
40
|
-
export function hashShaclProperties<HasherT extends ${this.reusables.snippets.Hasher}>(${hasherVariable}: HasherT, ${this.thisVariable}: ${this.name}): HasherT {
|
|
41
|
-
${joinCode(hashShaclPropertiesStatements)}
|
|
42
|
-
}`,
|
|
43
|
-
];
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=NamedObjectType_hashFunctionDeclarations.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function NamedObjectType_interfaceDeclaration(this: NamedObjectType): Code;
|
|
4
|
-
//# sourceMappingURL=NamedObjectType_interfaceDeclaration.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
2
|
-
import { tsComment } from "../tsComment.js";
|
|
3
|
-
export function NamedObjectType_interfaceDeclaration() {
|
|
4
|
-
return code `\
|
|
5
|
-
${this.comment
|
|
6
|
-
.alt(this.label)
|
|
7
|
-
.map(tsComment)
|
|
8
|
-
.orDefault("")}export interface ${this.name}${this.parentObjectTypes.length > 0
|
|
9
|
-
? ` extends ${this.parentObjectTypes
|
|
10
|
-
.map((parentObjectType) => parentObjectType.name)
|
|
11
|
-
.join(", ")}`
|
|
12
|
-
: ""} {
|
|
13
|
-
${joinCode(this.properties.map((property) => property.declaration), { on: "\n\n" })}
|
|
14
|
-
}`;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=NamedObjectType_interfaceDeclaration.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_isTypeFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function NamedObjectType_isTypeFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("Object.type")) {
|
|
5
|
-
return Maybe.empty();
|
|
6
|
-
}
|
|
7
|
-
return Maybe.of(code `\
|
|
8
|
-
export function is${this.name}(object: ${this.configuration.syntheticNamePrefix}Object): object is ${this.name} {
|
|
9
|
-
switch (object.${this._discriminantProperty.name}) {
|
|
10
|
-
${this._discriminantProperty.type.descendantValues
|
|
11
|
-
.concat(this._discriminantProperty.type.ownValues)
|
|
12
|
-
.map((value) => `case "${value}":`)
|
|
13
|
-
.join("\n")} return true; default: return false;
|
|
14
|
-
}
|
|
15
|
-
}`);
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.js.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_jsonParseFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_jsonParseFunctionDeclaration.d.ts.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_jsonSchemaFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_jsonSchemaFunctionDeclaration.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_jsonTypeAliasDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_jsonTypeAliasDeclaration.d.ts.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function NamedObjectType_jsonTypeAliasDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("Object.JSON.type")) {
|
|
5
|
-
return Maybe.empty();
|
|
6
|
-
}
|
|
7
|
-
const members = [];
|
|
8
|
-
if (this.properties.length > 0) {
|
|
9
|
-
members.push(code `{ ${joinCode(this.properties.flatMap((property) => property.jsonSignature.toList()), { on: ";" })} }`);
|
|
10
|
-
}
|
|
11
|
-
for (const parentObjectType of this.parentObjectTypes) {
|
|
12
|
-
members.push(code `${parentObjectType.jsonType().name}`);
|
|
13
|
-
}
|
|
14
|
-
return Maybe.of(code `export type Json = ${members.length > 0 ? joinCode(members, { on: " & " }) : "object"};`);
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=NamedObjectType_jsonTypeAliasDeclaration.js.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_jsonUiSchemaFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_schemaVariableStatement(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_schemaVariableStatement.d.ts.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function NamedObjectType_schemaVariableStatement() {
|
|
4
|
-
if (!this.configuration.features.has("Object.schema")) {
|
|
5
|
-
return Maybe.empty();
|
|
6
|
-
}
|
|
7
|
-
return Maybe.of(code `\
|
|
8
|
-
export const schema = { properties: { ${joinCode(this.parentObjectTypes
|
|
9
|
-
.map((parentObjectType) => code `...${parentObjectType.name}.schema.properties`)
|
|
10
|
-
.concat(this.properties.flatMap(property => property.schema.toList().map(propertySchema => code `${property.name}: ${propertySchema}`))), { on: ", " })} } } as const;`);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=NamedObjectType_schemaVariableStatement.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function NamedObjectType_sparqlConstructQueryStringFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("Object.SPARQL")) {
|
|
5
|
-
return Maybe.empty();
|
|
6
|
-
}
|
|
7
|
-
return Maybe.of(code `\
|
|
8
|
-
export function sparqlConstructQueryString(parameters: Parameters<typeof ${this.name}.sparqlConstructQuery>[0] & ${this.reusables.imports.sparqljs}.GeneratorOptions): string {
|
|
9
|
-
return new ${this.reusables.imports.sparqljs}.Generator(parameters).stringify(${this.name}.sparqlConstructQuery(parameters));
|
|
10
|
-
}`);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_toJsonFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_toJsonFunctionDeclaration.d.ts.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import { code, joinCode } from "../ts-poet-wrapper.js";
|
|
3
|
-
export function NamedObjectType_toJsonFunctionDeclaration() {
|
|
4
|
-
if (!this.configuration.features.has("Object.toJson")) {
|
|
5
|
-
return Maybe.empty();
|
|
6
|
-
}
|
|
7
|
-
const jsonObjectMembers = [];
|
|
8
|
-
for (const parentObjectType of this.parentObjectTypes) {
|
|
9
|
-
jsonObjectMembers.push(code `...${parentObjectType.name}.toJson(${this.thisVariable})`);
|
|
10
|
-
}
|
|
11
|
-
if (this.properties.length > 0) {
|
|
12
|
-
jsonObjectMembers.push(...this.properties.flatMap((property) => property
|
|
13
|
-
.toJsonInitializer({
|
|
14
|
-
variables: {
|
|
15
|
-
value: property.accessExpression({
|
|
16
|
-
variables: { object: this.thisVariable },
|
|
17
|
-
}),
|
|
18
|
-
},
|
|
19
|
-
})
|
|
20
|
-
.toList()));
|
|
21
|
-
}
|
|
22
|
-
const returnType = this.jsonType().name;
|
|
23
|
-
// 20241220: don't add @type until we're doing JSON-LD
|
|
24
|
-
// switch (this.toRdfTypes.length) {
|
|
25
|
-
// case 0:
|
|
26
|
-
// break;
|
|
27
|
-
// case 1:
|
|
28
|
-
// jsonObjectMembers.push(`"@type": "${this.toRdfTypes[0].value}"`);
|
|
29
|
-
// break;
|
|
30
|
-
// default:
|
|
31
|
-
// jsonObjectMembers.push(
|
|
32
|
-
// `"@type": ${JSON.stringify(this.toRdfTypes.map((rdfType) => rdfType.value))}`,
|
|
33
|
-
// );
|
|
34
|
-
// break;
|
|
35
|
-
// }
|
|
36
|
-
return Maybe.of(code `\
|
|
37
|
-
export function toJson(${this.thisVariable}: ${this.name}): ${returnType} {
|
|
38
|
-
return JSON.parse(JSON.stringify({ ${joinCode(jsonObjectMembers, { on: "," })} } satisfies ${this.jsonType().name}));
|
|
39
|
-
}`);
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=NamedObjectType_toJsonFunctionDeclaration.js.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_toRdfResourceFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_toRdfResourceFunctionDeclaration.d.ts.map
|
package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
2
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
3
|
-
export declare function NamedObjectType_toStringFunctionDeclarations(this: NamedObjectType): readonly Code[];
|
|
4
|
-
//# sourceMappingURL=NamedObjectType_toStringFunctionDeclarations.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { NamedObjectType } from "../NamedObjectType.js";
|
|
3
|
-
import { type Code } from "../ts-poet-wrapper.js";
|
|
4
|
-
export declare function NamedObjectType_valueSparqlWherePatternsFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
|
|
5
|
-
//# sourceMappingURL=NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { code } from "../ts-poet-wrapper.js";
|
|
2
|
-
export function identifierTypeDeclarations() {
|
|
3
|
-
if (!this.configuration.features.has("Object.type")) {
|
|
4
|
-
return [];
|
|
5
|
-
}
|
|
6
|
-
const ancestorObjectTypeWithSameIdentifierType = this.ancestorObjectTypes.find((ancestorObjectType) => ancestorObjectType.identifierType.name === this.identifierType.name);
|
|
7
|
-
if (ancestorObjectTypeWithSameIdentifierType) {
|
|
8
|
-
// This object type's identifier type has the same identifier type as an ancestor object type,
|
|
9
|
-
// so just reuse the latter.
|
|
10
|
-
return [
|
|
11
|
-
code `export type Identifier = ${ancestorObjectTypeWithSameIdentifierType.identifierTypeAlias};`,
|
|
12
|
-
code `export const Identifier = ${ancestorObjectTypeWithSameIdentifierType.identifierTypeAlias};`,
|
|
13
|
-
];
|
|
14
|
-
}
|
|
15
|
-
// Bespoke identifier type and associated functions
|
|
16
|
-
return [
|
|
17
|
-
code `export type Identifier = ${this.identifierType.name};`,
|
|
18
|
-
code `\
|
|
19
|
-
export namespace Identifier {
|
|
20
|
-
export const parse = ${this.identifierType.parseFunction};
|
|
21
|
-
export const stringify = ${this.identifierType.stringifyFunction};
|
|
22
|
-
}`,
|
|
23
|
-
];
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=identifierTypeDeclarations.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { code, conditionalOutput } from "../ts-poet-wrapper.js";
|
|
2
|
-
export const snippets_convertToArray = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}convertToArray`, code `\
|
|
3
|
-
function ${syntheticNamePrefix}convertToArray<ItemSourceT, ItemTargetT, Readonly extends boolean>(convertToItem: ${snippets.ConversionFunction}<ItemSourceT, ItemTargetT>, _readonly: Readonly) {
|
|
4
|
-
type EitherR = Readonly extends true ? ReadonlyArray<ItemTargetT> : Array<ItemTargetT>;
|
|
5
|
-
return (value: readonly ItemSourceT[] | undefined): ${imports.Either}<Error, EitherR> =>
|
|
6
|
-
(typeof value === "undefined" ? ${imports.Either}.of([]) : ${imports.Either}.sequence(value.map(convertToItem))) as ${imports.Either}<Error, EitherR>;
|
|
7
|
-
}`);
|
|
8
|
-
//# sourceMappingURL=snippets_convertToArray.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|