@shaclmate/compiler 4.0.9 → 4.0.10
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 +1 -1
- package/dist/ast/Ast.d.ts +1 -1
- package/dist/generators/json/AstJsonGenerator.js +1 -1
- package/dist/generators/ts/AbstractCollectionType.d.ts +1 -1
- package/dist/generators/ts/AbstractCollectionType.js +2 -2
- package/dist/generators/ts/AbstractContainerType.d.ts +2 -2
- package/dist/generators/ts/AbstractContainerType.js +1 -1
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +3 -3
- package/dist/generators/ts/AbstractLazyObjectType.js +2 -2
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +2 -2
- package/dist/generators/ts/AbstractNamedUnionType.js +17 -15
- package/dist/generators/ts/AbstractNumericType.d.ts +1 -1
- package/dist/generators/ts/AbstractNumericType.js +1 -1
- package/dist/generators/ts/AbstractType.d.ts +5 -5
- package/dist/generators/ts/AbstractUnionType.d.ts +1 -1
- package/dist/generators/ts/AbstractUnionType.js +6 -6
- package/dist/generators/ts/AnonymousUnionType.d.ts +1 -1
- package/dist/generators/ts/AnonymousUnionType.js +2 -2
- package/dist/generators/ts/BigDecimalType.d.ts +1 -1
- package/dist/generators/ts/BigDecimalType.js +2 -2
- package/dist/generators/ts/BigIntType.d.ts +1 -1
- package/dist/generators/ts/BigIntType.js +1 -1
- package/dist/generators/ts/BlankNodeType.d.ts +1 -1
- package/dist/generators/ts/BlankNodeType.js +1 -1
- package/dist/generators/ts/BooleanType.d.ts +1 -1
- package/dist/generators/ts/BooleanType.js +1 -1
- 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 +1 -1
- package/dist/generators/ts/DefaultValueType.js +3 -3
- package/dist/generators/ts/IdentifierType.d.ts +1 -1
- package/dist/generators/ts/IdentifierType.js +1 -1
- package/dist/generators/ts/IriType.d.ts +1 -1
- package/dist/generators/ts/IriType.js +1 -1
- package/dist/generators/ts/LazyObjectOptionType.js +1 -1
- package/dist/generators/ts/LazyObjectSetType.js +1 -1
- package/dist/generators/ts/LazyObjectType.js +2 -2
- package/dist/generators/ts/ListType.d.ts +2 -2
- package/dist/generators/ts/ListType.js +1 -1
- package/dist/generators/ts/LiteralType.d.ts +1 -1
- package/dist/generators/ts/LiteralType.js +1 -1
- package/dist/generators/ts/{ObjectType.d.ts → NamedObjectType.d.ts} +28 -28
- package/dist/generators/ts/{ObjectType.js → NamedObjectType.js} +105 -97
- package/dist/generators/ts/NamedObjectUnionType.d.ts +4 -4
- package/dist/generators/ts/NamedObjectUnionType.js +8 -12
- package/dist/generators/ts/OptionType.d.ts +1 -1
- package/dist/generators/ts/OptionType.js +2 -2
- package/dist/generators/ts/StringType.d.ts +1 -1
- package/dist/generators/ts/StringType.js +1 -1
- package/dist/generators/ts/TermType.d.ts +1 -1
- package/dist/generators/ts/TermType.js +1 -1
- package/dist/generators/ts/TsGenerator.js +8 -8
- package/dist/generators/ts/Type.d.ts +2 -2
- package/dist/generators/ts/TypeFactory.d.ts +2 -2
- package/dist/generators/ts/TypeFactory.js +36 -36
- package/dist/generators/ts/ZodGenerator.js +14 -12
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/AbstractProperty.d.ts +6 -6
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/AbstractProperty.js +3 -3
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/DiscriminantProperty.d.ts +1 -1
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/DiscriminantProperty.js +13 -11
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierPrefixProperty.d.ts +1 -1
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierPrefixProperty.js +4 -4
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierProperty.d.ts +1 -1
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierProperty.js +24 -24
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_classDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_classDeclaration.js → _NamedObjectType/NamedObjectType_classDeclaration.js} +14 -14
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_createFunctionDeclaration.js → _NamedObjectType/NamedObjectType_createFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_filterFunctionDeclaration.js → _NamedObjectType/NamedObjectType_filterFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_filterTypeDeclaration.js → _NamedObjectType/NamedObjectType_filterTypeDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_fromJsonFunctionDeclaration.js → _NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js → _NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js → _NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfTypeVariableStatement.js → _NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_graphqlTypeVariableStatement.js → _NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.js → _NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_interfaceDeclaration.js → _NamedObjectType/NamedObjectType_interfaceDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_isTypeFunctionDeclaration.js → _NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js +19 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.js → _NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js} +5 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonTypeAliasDeclaration.js → _NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js → _NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts +9 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_objectSetMethodNames.js → _NamedObjectType/NamedObjectType_objectSetMethodNames.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.js → _NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_propertiesFromRdfResourceFunctionDeclaration.js → _NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +4 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_schemaVariableStatement.js → _NamedObjectType/NamedObjectType_schemaVariableStatement.js} +2 -2
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +2 -2
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js → _NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +2 -2
- package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js → _NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_toRdfResourceFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
- package/dist/generators/ts/{_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +2 -2
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/ShaclProperty.d.ts +1 -1
- package/dist/generators/ts/{_ObjectType → _NamedObjectType}/ShaclProperty.js +8 -8
- package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +4 -0
- package/dist/generators/ts/graphqlSchemaVariableStatement.d.ts +2 -2
- package/dist/generators/ts/graphqlSchemaVariableStatement.js +23 -23
- package/dist/generators/ts/objectSetDeclarations.d.ts +2 -2
- package/dist/generators/ts/objectSetDeclarations.js +19 -16
- package/dist/generators/ts/objectSetInterfaceDeclaration.d.ts +3 -3
- package/dist/generators/ts/objectSetInterfaceDeclaration.js +6 -4
- package/dist/generators/ts/objectSetMethodSignatures.d.ts +4 -4
- package/dist/generators/ts/objectSetMethodSignatures.js +9 -9
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.d.ts +3 -3
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +47 -45
- package/dist/generators/ts/singleEntryRecord.d.ts +2 -0
- package/dist/generators/ts/singleEntryRecord.js +6 -0
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.d.ts +3 -3
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +17 -17
- package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +2 -2
- package/dist/generators/ts/synthesizeUberObjectUnionType.js +8 -8
- package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.d.ts +5 -5
- package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.js +2 -2
- package/package.json +4 -4
- package/dist/generators/ts/_ObjectType/ObjectType_classDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js +0 -14
- package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +0 -9
- package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.js +0 -19
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
- package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
- /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/Property.d.ts +0 -0
- /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/Property.js +0 -0
- /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/identifierTypeDeclarations.js +0 -0
|
@@ -12,7 +12,7 @@ export declare class LiteralType extends AbstractLiteralType {
|
|
|
12
12
|
graphqlResolveExpression(_parameters: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
|
|
13
13
|
hashStatements({ depth, variables, }: Parameters<AbstractLiteralType["hashStatements"]>[0]): readonly Code[];
|
|
14
14
|
jsonType(parameters?: Parameters<AbstractLiteralType["jsonType"]>[0]): AbstractLiteralType.JsonType;
|
|
15
|
-
|
|
15
|
+
jsonSchema({ includeDiscriminantProperty, }: Parameters<AbstractLiteralType["jsonSchema"]>[0]): Code;
|
|
16
16
|
toJsonExpression({ includeDiscriminantProperty, variables, }: Parameters<AbstractLiteralType["toJsonExpression"]>[0]): Code;
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=LiteralType.d.ts.map
|
|
@@ -32,7 +32,7 @@ export class LiteralType extends AbstractLiteralType {
|
|
|
32
32
|
: "";
|
|
33
33
|
return new AbstractLiteralType.JsonType(code `{ readonly "@language"?: string${discriminantProperty}, readonly "@type"?: string, readonly "@value": string }`);
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
jsonSchema({ includeDiscriminantProperty, }) {
|
|
36
36
|
const discriminantProperty = includeDiscriminantProperty
|
|
37
37
|
? code `, termType: ${imports.z}.literal("Literal")`
|
|
38
38
|
: "";
|
|
@@ -2,18 +2,18 @@ import type { NamedNode } from "@rdfjs/types";
|
|
|
2
2
|
import { Maybe, NonEmptyList } from "purify-ts";
|
|
3
3
|
import type { TsFeature } from "../../enums/TsFeature.js";
|
|
4
4
|
import type { TsObjectDeclarationType } from "../../enums/TsObjectDeclarationType.js";
|
|
5
|
-
import { DiscriminantProperty as _DiscriminantProperty } from "./
|
|
6
|
-
import { IdentifierPrefixProperty as _IdentifierPrefixProperty } from "./
|
|
7
|
-
import { IdentifierProperty as _IdentifierProperty } from "./
|
|
8
|
-
import type { Property as _Property } from "./
|
|
9
|
-
import { ShaclProperty as _ShaclProperty } from "./
|
|
5
|
+
import { DiscriminantProperty as _DiscriminantProperty } from "./_NamedObjectType/DiscriminantProperty.js";
|
|
6
|
+
import { IdentifierPrefixProperty as _IdentifierPrefixProperty } from "./_NamedObjectType/IdentifierPrefixProperty.js";
|
|
7
|
+
import { IdentifierProperty as _IdentifierProperty } from "./_NamedObjectType/IdentifierProperty.js";
|
|
8
|
+
import type { Property as _Property } from "./_NamedObjectType/Property.js";
|
|
9
|
+
import { ShaclProperty as _ShaclProperty } from "./_NamedObjectType/ShaclProperty.js";
|
|
10
10
|
import { AbstractType } from "./AbstractType.js";
|
|
11
11
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
12
12
|
import type { IdentifierType } from "./IdentifierType.js";
|
|
13
13
|
import type { IriType } from "./IriType.js";
|
|
14
14
|
import type { Type } from "./Type.js";
|
|
15
15
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
16
|
-
export declare class
|
|
16
|
+
export declare class NamedObjectType extends AbstractType {
|
|
17
17
|
private readonly imports;
|
|
18
18
|
protected readonly toRdfTypes: readonly NamedNode[];
|
|
19
19
|
readonly abstract: boolean;
|
|
@@ -23,7 +23,7 @@ export declare class ObjectType extends AbstractType {
|
|
|
23
23
|
readonly fromRdfType: Maybe<NamedNode>;
|
|
24
24
|
readonly graphqlArgs: AbstractType["graphqlArgs"];
|
|
25
25
|
readonly identifierType: BlankNodeType | IdentifierType | IriType;
|
|
26
|
-
readonly kind = "
|
|
26
|
+
readonly kind = "NamedObjectType";
|
|
27
27
|
readonly name: string;
|
|
28
28
|
readonly recursive: boolean;
|
|
29
29
|
readonly staticModuleName: string;
|
|
@@ -39,26 +39,27 @@ export declare class ObjectType extends AbstractType {
|
|
|
39
39
|
identifierType: BlankNodeType | IdentifierType | IriType;
|
|
40
40
|
imports: readonly string[];
|
|
41
41
|
label: Maybe<string>;
|
|
42
|
-
lazyAncestorObjectTypes: () => readonly
|
|
43
|
-
lazyChildObjectTypes: () => readonly
|
|
44
|
-
lazyDiscriminantProperty: (
|
|
45
|
-
lazyIdentifierProperty: (
|
|
46
|
-
lazyDescendantObjectTypes: () => readonly
|
|
47
|
-
lazyParentObjectTypes: () => readonly
|
|
48
|
-
lazyProperties: (
|
|
42
|
+
lazyAncestorObjectTypes: () => readonly NamedObjectType[];
|
|
43
|
+
lazyChildObjectTypes: () => readonly NamedObjectType[];
|
|
44
|
+
lazyDiscriminantProperty: (namedObjectType: NamedObjectType) => NamedObjectType.DiscriminantProperty;
|
|
45
|
+
lazyIdentifierProperty: (namedObjectType: NamedObjectType) => NamedObjectType.IdentifierProperty;
|
|
46
|
+
lazyDescendantObjectTypes: () => readonly NamedObjectType[];
|
|
47
|
+
lazyParentObjectTypes: () => readonly NamedObjectType[];
|
|
48
|
+
lazyProperties: (namedObjectType: NamedObjectType) => readonly NamedObjectType.Property[];
|
|
49
49
|
name: string;
|
|
50
50
|
recursive: boolean;
|
|
51
51
|
staticModuleName: string;
|
|
52
52
|
synthetic: boolean;
|
|
53
53
|
toRdfTypes: readonly NamedNode[];
|
|
54
54
|
} & ConstructorParameters<typeof AbstractType>[0]);
|
|
55
|
-
get
|
|
56
|
-
get
|
|
55
|
+
get _discriminantProperty(): NamedObjectType.DiscriminantProperty;
|
|
56
|
+
get ancestorObjectTypes(): readonly NamedObjectType[];
|
|
57
|
+
get childObjectTypes(): readonly NamedObjectType[];
|
|
57
58
|
get conversions(): readonly AbstractType.Conversion[];
|
|
58
59
|
get declaration(): Maybe<Code>;
|
|
59
60
|
get descendantFromRdfTypeVariables(): readonly Code[];
|
|
60
61
|
get descendantFromRdfTypes(): readonly NamedNode[];
|
|
61
|
-
get descendantObjectTypes(): readonly
|
|
62
|
+
get descendantObjectTypes(): readonly NamedObjectType[];
|
|
62
63
|
get discriminantProperty(): Maybe<AbstractType.DiscriminantProperty>;
|
|
63
64
|
get discriminantValue(): string;
|
|
64
65
|
get equalsFunction(): Code;
|
|
@@ -66,20 +67,19 @@ export declare class ObjectType extends AbstractType {
|
|
|
66
67
|
get filterType(): Code;
|
|
67
68
|
get fromRdfTypeVariable(): Maybe<Code>;
|
|
68
69
|
get graphqlType(): AbstractType.GraphqlType;
|
|
69
|
-
get identifierProperty():
|
|
70
|
+
get identifierProperty(): NamedObjectType.IdentifierProperty;
|
|
70
71
|
get identifierTypeAlias(): Code;
|
|
71
72
|
get mutable(): boolean;
|
|
72
|
-
get objectSetMethodNames():
|
|
73
|
-
get ownProperties(): readonly
|
|
74
|
-
get ownShaclProperties(): readonly
|
|
75
|
-
get parentObjectTypes(): readonly
|
|
76
|
-
get properties(): readonly
|
|
73
|
+
get objectSetMethodNames(): NamedObjectType.ObjectSetMethodNames;
|
|
74
|
+
get ownProperties(): readonly NamedObjectType.Property[];
|
|
75
|
+
get ownShaclProperties(): readonly NamedObjectType.ShaclProperty<Type>[];
|
|
76
|
+
get parentObjectTypes(): readonly NamedObjectType[];
|
|
77
|
+
get properties(): readonly NamedObjectType.Property[];
|
|
77
78
|
get schema(): Code;
|
|
78
79
|
get schemaType(): Code;
|
|
80
|
+
get toRdfjsResourceType(): Code;
|
|
79
81
|
get valueSparqlConstructTriplesFunction(): Code;
|
|
80
82
|
get valueSparqlWherePatternsFunction(): Code;
|
|
81
|
-
get toRdfjsResourceType(): Code;
|
|
82
|
-
get _discriminantProperty(): ObjectType.DiscriminantProperty;
|
|
83
83
|
protected get thisVariable(): Code;
|
|
84
84
|
fromJsonExpression({ variables, }: Parameters<AbstractType["fromJsonExpression"]>[0]): Code;
|
|
85
85
|
fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["fromRdfResourceValuesExpression"]>[0]): Code;
|
|
@@ -89,9 +89,9 @@ export declare class ObjectType extends AbstractType {
|
|
|
89
89
|
};
|
|
90
90
|
}): Code;
|
|
91
91
|
hashStatements({ variables, }: Parameters<AbstractType["hashStatements"]>[0]): readonly Code[];
|
|
92
|
+
jsonSchema({ context, }: Parameters<AbstractType["jsonSchema"]>[0]): Code;
|
|
92
93
|
jsonType(): AbstractType.JsonType;
|
|
93
94
|
jsonUiSchemaElement({ variables, }: Parameters<AbstractType["jsonUiSchemaElement"]>[0]): Maybe<Code>;
|
|
94
|
-
jsonZodSchema({ context, }: Parameters<AbstractType["jsonZodSchema"]>[0]): Code;
|
|
95
95
|
newExpression({ parameters }: {
|
|
96
96
|
parameters: Code;
|
|
97
97
|
}): Code;
|
|
@@ -106,7 +106,7 @@ export declare class ObjectType extends AbstractType {
|
|
|
106
106
|
private readonly lazyParentObjectTypes;
|
|
107
107
|
private readonly lazyProperties;
|
|
108
108
|
}
|
|
109
|
-
export declare namespace
|
|
109
|
+
export declare namespace NamedObjectType {
|
|
110
110
|
const IdentifierPrefixProperty: typeof _IdentifierPrefixProperty;
|
|
111
111
|
type IdentifierPrefixProperty = _IdentifierPrefixProperty;
|
|
112
112
|
const IdentifierProperty: typeof _IdentifierProperty;
|
|
@@ -123,4 +123,4 @@ export declare namespace ObjectType {
|
|
|
123
123
|
const DiscriminantProperty: typeof _DiscriminantProperty;
|
|
124
124
|
type DiscriminantProperty = _DiscriminantProperty;
|
|
125
125
|
}
|
|
126
|
-
//# sourceMappingURL=
|
|
126
|
+
//# sourceMappingURL=NamedObjectType.d.ts.map
|
|
@@ -7,46 +7,45 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
import { camelCase } from "change-case";
|
|
8
8
|
import { Maybe, NonEmptyList } from "purify-ts";
|
|
9
9
|
import { Memoize } from "typescript-memoize";
|
|
10
|
-
import { DiscriminantProperty as _DiscriminantProperty } from "./
|
|
11
|
-
import { IdentifierPrefixProperty as _IdentifierPrefixProperty } from "./
|
|
12
|
-
import { IdentifierProperty as _IdentifierProperty } from "./
|
|
13
|
-
import { identifierTypeDeclarations } from "./
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import { ShaclProperty as _ShaclProperty } from "./_ObjectType/ShaclProperty.js";
|
|
10
|
+
import { DiscriminantProperty as _DiscriminantProperty } from "./_NamedObjectType/DiscriminantProperty.js";
|
|
11
|
+
import { IdentifierPrefixProperty as _IdentifierPrefixProperty } from "./_NamedObjectType/IdentifierPrefixProperty.js";
|
|
12
|
+
import { IdentifierProperty as _IdentifierProperty } from "./_NamedObjectType/IdentifierProperty.js";
|
|
13
|
+
import { identifierTypeDeclarations } from "./_NamedObjectType/identifierTypeDeclarations.js";
|
|
14
|
+
import { NamedObjectType_classDeclaration } from "./_NamedObjectType/NamedObjectType_classDeclaration.js";
|
|
15
|
+
import { NamedObjectType_createFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_createFunctionDeclaration.js";
|
|
16
|
+
import { NamedObjectType_equalsFunctionOrMethodDeclaration } from "./_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.js";
|
|
17
|
+
import { NamedObjectType_filterFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js";
|
|
18
|
+
import { NamedObjectType_filterTypeDeclaration } from "./_NamedObjectType/NamedObjectType_filterTypeDeclaration.js";
|
|
19
|
+
import { NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js";
|
|
20
|
+
import { NamedObjectType_focusSparqlWherePatternsFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js";
|
|
21
|
+
import { NamedObjectType_fromJsonFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js";
|
|
22
|
+
import { NamedObjectType_fromRdfResourceFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js";
|
|
23
|
+
import { NamedObjectType_fromRdfResourceValuesFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js";
|
|
24
|
+
import { NamedObjectType_fromRdfTypeVariableStatement } from "./_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js";
|
|
25
|
+
import { NamedObjectType_graphqlTypeVariableStatement } from "./_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js";
|
|
26
|
+
import { NamedObjectType_hashFunctionOrMethodDeclarations } from "./_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.js";
|
|
27
|
+
import { NamedObjectType_interfaceDeclaration } from "./_NamedObjectType/NamedObjectType_interfaceDeclaration.js";
|
|
28
|
+
import { NamedObjectType_isTypeFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js";
|
|
29
|
+
import { NamedObjectType_jsonParseFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js";
|
|
30
|
+
import { NamedObjectType_jsonSchemaFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js";
|
|
31
|
+
import { NamedObjectType_jsonTypeAliasDeclaration } from "./_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js";
|
|
32
|
+
import { NamedObjectType_jsonUiSchemaFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js";
|
|
33
|
+
import { NamedObjectType_objectSetMethodNames } from "./_NamedObjectType/NamedObjectType_objectSetMethodNames.js";
|
|
34
|
+
import { NamedObjectType_propertiesFromJsonFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.js";
|
|
35
|
+
import { NamedObjectType_propertiesFromRdfResourceFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js";
|
|
36
|
+
import { NamedObjectType_schemaVariableStatement } from "./_NamedObjectType/NamedObjectType_schemaVariableStatement.js";
|
|
37
|
+
import { NamedObjectType_sparqlConstructQueryFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js";
|
|
38
|
+
import { NamedObjectType_sparqlConstructQueryStringFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js";
|
|
39
|
+
import { NamedObjectType_toJsonFunctionOrMethodDeclaration } from "./_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.js";
|
|
40
|
+
import { NamedObjectType_toRdfResourceFunctionOrMethodDeclaration } from "./_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js";
|
|
41
|
+
import { NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js";
|
|
42
|
+
import { NamedObjectType_valueSparqlWherePatternsFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js";
|
|
43
|
+
import { ShaclProperty as _ShaclProperty } from "./_NamedObjectType/ShaclProperty.js";
|
|
45
44
|
import { AbstractType } from "./AbstractType.js";
|
|
46
45
|
import { imports } from "./imports.js";
|
|
47
46
|
import { syntheticNamePrefix } from "./syntheticNamePrefix.js";
|
|
48
47
|
import { code, def, joinCode } from "./ts-poet-wrapper.js";
|
|
49
|
-
export class
|
|
48
|
+
export class NamedObjectType extends AbstractType {
|
|
50
49
|
imports;
|
|
51
50
|
toRdfTypes;
|
|
52
51
|
abstract;
|
|
@@ -56,7 +55,7 @@ export class ObjectType extends AbstractType {
|
|
|
56
55
|
fromRdfType;
|
|
57
56
|
graphqlArgs = Maybe.empty();
|
|
58
57
|
identifierType;
|
|
59
|
-
kind = "
|
|
58
|
+
kind = "NamedObjectType";
|
|
60
59
|
name;
|
|
61
60
|
recursive;
|
|
62
61
|
staticModuleName;
|
|
@@ -85,6 +84,9 @@ export class ObjectType extends AbstractType {
|
|
|
85
84
|
this.synthetic = synthetic;
|
|
86
85
|
this.toRdfTypes = toRdfTypes;
|
|
87
86
|
}
|
|
87
|
+
get _discriminantProperty() {
|
|
88
|
+
return this.lazyDiscriminantProperty(this);
|
|
89
|
+
}
|
|
88
90
|
get ancestorObjectTypes() {
|
|
89
91
|
return this.lazyAncestorObjectTypes();
|
|
90
92
|
}
|
|
@@ -110,20 +112,29 @@ export class ObjectType extends AbstractType {
|
|
|
110
112
|
const staticModuleDeclarations = [];
|
|
111
113
|
switch (this.declarationType) {
|
|
112
114
|
case "class": {
|
|
113
|
-
declarations.push(
|
|
115
|
+
declarations.push(NamedObjectType_classDeclaration.call(this));
|
|
114
116
|
break;
|
|
115
117
|
}
|
|
116
118
|
case "interface": {
|
|
117
|
-
declarations.push(
|
|
118
|
-
staticModuleDeclarations.push(...
|
|
119
|
+
declarations.push(NamedObjectType_interfaceDeclaration.call(this));
|
|
120
|
+
staticModuleDeclarations.push(...NamedObjectType_createFunctionDeclaration.call(this).toList(), ...NamedObjectType_equalsFunctionOrMethodDeclaration.bind(this)().toList(), ...NamedObjectType_hashFunctionOrMethodDeclarations.call(this));
|
|
119
121
|
break;
|
|
120
122
|
}
|
|
121
123
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
const jsonModuleDeclarations = [
|
|
125
|
+
...NamedObjectType_jsonParseFunctionDeclaration.call(this).toList(),
|
|
126
|
+
...NamedObjectType_jsonSchemaFunctionDeclaration.call(this).toList(),
|
|
127
|
+
...NamedObjectType_jsonUiSchemaFunctionDeclaration.call(this).toList(),
|
|
128
|
+
];
|
|
129
|
+
staticModuleDeclarations.push(...NamedObjectType_graphqlTypeVariableStatement.call(this).toList(), ...identifierTypeDeclarations.call(this), ...NamedObjectType_jsonTypeAliasDeclaration.call(this).toList(), ...(jsonModuleDeclarations.length > 0
|
|
130
|
+
? [
|
|
131
|
+
code `export namespace ${syntheticNamePrefix}Json { ${joinCode(jsonModuleDeclarations, { on: "\n\n" })} }`,
|
|
132
|
+
]
|
|
133
|
+
: []), NamedObjectType_filterFunctionDeclaration.call(this), NamedObjectType_filterTypeDeclaration.call(this), ...NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.bind(this)().toList(), ...NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.bind(this)().toList(), ...NamedObjectType_fromJsonFunctionDeclaration.call(this).toList(), ...NamedObjectType_fromRdfResourceFunctionDeclaration.call(this).toList(), ...NamedObjectType_fromRdfResourceValuesFunctionDeclaration.call(this).toList(), ...NamedObjectType_fromRdfTypeVariableStatement.call(this).toList(), NamedObjectType_isTypeFunctionDeclaration.call(this), ...NamedObjectType_propertiesFromJsonFunctionDeclaration.bind(this)().toList(), ...NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.bind(this)().toList(), NamedObjectType_schemaVariableStatement.call(this), ...NamedObjectType_sparqlConstructQueryFunctionDeclaration.bind(this)().toList(), ...NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.bind(this)().toList(), ...(this.declarationType === "interface"
|
|
134
|
+
? NamedObjectType_toJsonFunctionOrMethodDeclaration.call(this).toList()
|
|
124
135
|
: []), ...(this.declarationType === "interface"
|
|
125
|
-
?
|
|
126
|
-
: []), ...
|
|
136
|
+
? NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.call(this).toList()
|
|
137
|
+
: []), ...NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.bind(this)().toList(), ...NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.bind(this)().toList());
|
|
127
138
|
if (staticModuleDeclarations.length > 0) {
|
|
128
139
|
declarations.push(code `\
|
|
129
140
|
export namespace ${def(this.staticModuleName)} {
|
|
@@ -184,7 +195,7 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
|
|
|
184
195
|
return this.properties.some((property) => property.mutable);
|
|
185
196
|
}
|
|
186
197
|
get objectSetMethodNames() {
|
|
187
|
-
return
|
|
198
|
+
return NamedObjectType_objectSetMethodNames.call(this);
|
|
188
199
|
}
|
|
189
200
|
get ownProperties() {
|
|
190
201
|
if (this.parentObjectTypes.length === 0) {
|
|
@@ -217,20 +228,17 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
|
|
|
217
228
|
get schemaType() {
|
|
218
229
|
return code `typeof ${this.schema}`;
|
|
219
230
|
}
|
|
220
|
-
get valueSparqlConstructTriplesFunction() {
|
|
221
|
-
return code `${this.staticModuleName}.${syntheticNamePrefix}valueSparqlConstructTriples`;
|
|
222
|
-
}
|
|
223
|
-
get valueSparqlWherePatternsFunction() {
|
|
224
|
-
return code `${this.staticModuleName}.${syntheticNamePrefix}valueSparqlWherePatterns`;
|
|
225
|
-
}
|
|
226
231
|
get toRdfjsResourceType() {
|
|
227
232
|
if (this.parentObjectTypes.length > 0) {
|
|
228
233
|
return this.parentObjectTypes[0].toRdfjsResourceType;
|
|
229
234
|
}
|
|
230
235
|
return code `${imports.Resource}${this.identifierType.kind === "IriType" ? code `<${imports.NamedNode}>` : ""}`;
|
|
231
236
|
}
|
|
232
|
-
get
|
|
233
|
-
return this.
|
|
237
|
+
get valueSparqlConstructTriplesFunction() {
|
|
238
|
+
return code `${this.staticModuleName}.${syntheticNamePrefix}valueSparqlConstructTriples`;
|
|
239
|
+
}
|
|
240
|
+
get valueSparqlWherePatternsFunction() {
|
|
241
|
+
return code `${this.staticModuleName}.${syntheticNamePrefix}valueSparqlWherePatterns`;
|
|
234
242
|
}
|
|
235
243
|
get thisVariable() {
|
|
236
244
|
switch (this.declarationType) {
|
|
@@ -265,20 +273,20 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
|
|
|
265
273
|
];
|
|
266
274
|
}
|
|
267
275
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
}
|
|
271
|
-
jsonUiSchemaElement({ variables, }) {
|
|
272
|
-
return Maybe.of(code `${this.staticModuleName}.${syntheticNamePrefix}jsonUiSchema({ scopePrefix: ${variables.scopePrefix} })`);
|
|
273
|
-
}
|
|
274
|
-
jsonZodSchema({ context, }) {
|
|
275
|
-
let expression = code `${this.staticModuleName}.${syntheticNamePrefix}jsonZodSchema()`;
|
|
276
|
+
jsonSchema({ context, }) {
|
|
277
|
+
let expression = code `${this.staticModuleName}.${syntheticNamePrefix}Json.schema()`;
|
|
276
278
|
if (context === "property" &&
|
|
277
279
|
this.properties.some((property) => property.recursive)) {
|
|
278
280
|
expression = code `${imports.z}.lazy((): ${imports.z}.ZodType<${this.staticModuleName}.${syntheticNamePrefix}Json> => ${expression})`;
|
|
279
281
|
}
|
|
280
282
|
return expression;
|
|
281
283
|
}
|
|
284
|
+
jsonType() {
|
|
285
|
+
return new AbstractType.JsonType(code `${this.staticModuleName}.${syntheticNamePrefix}Json`);
|
|
286
|
+
}
|
|
287
|
+
jsonUiSchemaElement({ variables, }) {
|
|
288
|
+
return Maybe.of(code `${this.staticModuleName}.${syntheticNamePrefix}Json.uiSchema({ scopePrefix: ${variables.scopePrefix} })`);
|
|
289
|
+
}
|
|
282
290
|
newExpression({ parameters }) {
|
|
283
291
|
switch (this.declarationType) {
|
|
284
292
|
case "class":
|
|
@@ -318,95 +326,95 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
|
|
|
318
326
|
}
|
|
319
327
|
__decorate([
|
|
320
328
|
Memoize()
|
|
321
|
-
],
|
|
329
|
+
], NamedObjectType.prototype, "_discriminantProperty", null);
|
|
322
330
|
__decorate([
|
|
323
331
|
Memoize()
|
|
324
|
-
],
|
|
332
|
+
], NamedObjectType.prototype, "ancestorObjectTypes", null);
|
|
325
333
|
__decorate([
|
|
326
334
|
Memoize()
|
|
327
|
-
],
|
|
335
|
+
], NamedObjectType.prototype, "childObjectTypes", null);
|
|
328
336
|
__decorate([
|
|
329
337
|
Memoize()
|
|
330
|
-
],
|
|
338
|
+
], NamedObjectType.prototype, "conversions", null);
|
|
331
339
|
__decorate([
|
|
332
340
|
Memoize()
|
|
333
|
-
],
|
|
341
|
+
], NamedObjectType.prototype, "descendantFromRdfTypeVariables", null);
|
|
334
342
|
__decorate([
|
|
335
343
|
Memoize()
|
|
336
|
-
],
|
|
344
|
+
], NamedObjectType.prototype, "descendantFromRdfTypes", null);
|
|
337
345
|
__decorate([
|
|
338
346
|
Memoize()
|
|
339
|
-
],
|
|
347
|
+
], NamedObjectType.prototype, "descendantObjectTypes", null);
|
|
340
348
|
__decorate([
|
|
341
349
|
Memoize()
|
|
342
|
-
],
|
|
350
|
+
], NamedObjectType.prototype, "discriminantProperty", null);
|
|
343
351
|
__decorate([
|
|
344
352
|
Memoize()
|
|
345
|
-
],
|
|
353
|
+
], NamedObjectType.prototype, "discriminantValue", null);
|
|
346
354
|
__decorate([
|
|
347
355
|
Memoize()
|
|
348
|
-
],
|
|
356
|
+
], NamedObjectType.prototype, "equalsFunction", null);
|
|
349
357
|
__decorate([
|
|
350
358
|
Memoize()
|
|
351
|
-
],
|
|
359
|
+
], NamedObjectType.prototype, "filterFunction", null);
|
|
352
360
|
__decorate([
|
|
353
361
|
Memoize()
|
|
354
|
-
],
|
|
362
|
+
], NamedObjectType.prototype, "filterType", null);
|
|
355
363
|
__decorate([
|
|
356
364
|
Memoize()
|
|
357
|
-
],
|
|
365
|
+
], NamedObjectType.prototype, "fromRdfTypeVariable", null);
|
|
358
366
|
__decorate([
|
|
359
367
|
Memoize()
|
|
360
|
-
],
|
|
368
|
+
], NamedObjectType.prototype, "graphqlType", null);
|
|
361
369
|
__decorate([
|
|
362
370
|
Memoize()
|
|
363
|
-
],
|
|
371
|
+
], NamedObjectType.prototype, "identifierProperty", null);
|
|
364
372
|
__decorate([
|
|
365
373
|
Memoize()
|
|
366
|
-
],
|
|
374
|
+
], NamedObjectType.prototype, "identifierTypeAlias", null);
|
|
367
375
|
__decorate([
|
|
368
376
|
Memoize()
|
|
369
|
-
],
|
|
377
|
+
], NamedObjectType.prototype, "mutable", null);
|
|
370
378
|
__decorate([
|
|
371
379
|
Memoize()
|
|
372
|
-
],
|
|
380
|
+
], NamedObjectType.prototype, "objectSetMethodNames", null);
|
|
373
381
|
__decorate([
|
|
374
382
|
Memoize()
|
|
375
|
-
],
|
|
383
|
+
], NamedObjectType.prototype, "ownProperties", null);
|
|
376
384
|
__decorate([
|
|
377
385
|
Memoize()
|
|
378
|
-
],
|
|
386
|
+
], NamedObjectType.prototype, "ownShaclProperties", null);
|
|
379
387
|
__decorate([
|
|
380
388
|
Memoize()
|
|
381
|
-
],
|
|
389
|
+
], NamedObjectType.prototype, "parentObjectTypes", null);
|
|
382
390
|
__decorate([
|
|
383
391
|
Memoize()
|
|
384
|
-
],
|
|
392
|
+
], NamedObjectType.prototype, "properties", null);
|
|
385
393
|
__decorate([
|
|
386
394
|
Memoize()
|
|
387
|
-
],
|
|
395
|
+
], NamedObjectType.prototype, "schema", null);
|
|
388
396
|
__decorate([
|
|
389
397
|
Memoize()
|
|
390
|
-
],
|
|
398
|
+
], NamedObjectType.prototype, "schemaType", null);
|
|
391
399
|
__decorate([
|
|
392
400
|
Memoize()
|
|
393
|
-
],
|
|
401
|
+
], NamedObjectType.prototype, "toRdfjsResourceType", null);
|
|
394
402
|
__decorate([
|
|
395
403
|
Memoize()
|
|
396
|
-
],
|
|
404
|
+
], NamedObjectType.prototype, "valueSparqlConstructTriplesFunction", null);
|
|
397
405
|
__decorate([
|
|
398
406
|
Memoize()
|
|
399
|
-
],
|
|
407
|
+
], NamedObjectType.prototype, "valueSparqlWherePatternsFunction", null);
|
|
400
408
|
__decorate([
|
|
401
409
|
Memoize()
|
|
402
|
-
],
|
|
410
|
+
], NamedObjectType.prototype, "thisVariable", null);
|
|
403
411
|
__decorate([
|
|
404
412
|
Memoize()
|
|
405
|
-
],
|
|
406
|
-
(function (
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
})(
|
|
412
|
-
//# sourceMappingURL=
|
|
413
|
+
], NamedObjectType.prototype, "jsonType", null);
|
|
414
|
+
(function (NamedObjectType) {
|
|
415
|
+
NamedObjectType.IdentifierPrefixProperty = _IdentifierPrefixProperty;
|
|
416
|
+
NamedObjectType.IdentifierProperty = _IdentifierProperty;
|
|
417
|
+
NamedObjectType.ShaclProperty = _ShaclProperty;
|
|
418
|
+
NamedObjectType.DiscriminantProperty = _DiscriminantProperty;
|
|
419
|
+
})(NamedObjectType || (NamedObjectType = {}));
|
|
420
|
+
//# sourceMappingURL=NamedObjectType.js.map
|
|
@@ -3,18 +3,18 @@ import { AbstractType } from "./AbstractType.js";
|
|
|
3
3
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
4
4
|
import type { IdentifierType } from "./IdentifierType.js";
|
|
5
5
|
import type { IriType } from "./IriType.js";
|
|
6
|
-
import type {
|
|
6
|
+
import type { NamedObjectType } from "./NamedObjectType.js";
|
|
7
7
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
8
|
-
export declare class NamedObjectUnionType extends AbstractNamedUnionType<
|
|
8
|
+
export declare class NamedObjectUnionType extends AbstractNamedUnionType<NamedObjectType> {
|
|
9
9
|
#private;
|
|
10
10
|
readonly graphqlArgs: AbstractType["graphqlArgs"];
|
|
11
11
|
readonly kind = "NamedObjectUnionType";
|
|
12
12
|
constructor({ identifierType, ...superParameters }: {
|
|
13
13
|
identifierType: BlankNodeType | IdentifierType | IriType;
|
|
14
|
-
} & Omit<ConstructorParameters<typeof AbstractNamedUnionType<
|
|
14
|
+
} & Omit<ConstructorParameters<typeof AbstractNamedUnionType<NamedObjectType>>[0], "identifierType">);
|
|
15
15
|
get graphqlType(): AbstractType.GraphqlType;
|
|
16
16
|
get identifierTypeAlias(): Code;
|
|
17
|
-
get objectSetMethodNames():
|
|
17
|
+
get objectSetMethodNames(): NamedObjectType.ObjectSetMethodNames;
|
|
18
18
|
get schema(): Code;
|
|
19
19
|
get schemaType(): Code;
|
|
20
20
|
protected get staticModuleDeclarations(): Record<string, Code>;
|
|
@@ -8,20 +8,16 @@ import { pascalCase } from "change-case";
|
|
|
8
8
|
import { Maybe } from "purify-ts";
|
|
9
9
|
import { PropertyPath } from "rdfjs-resource";
|
|
10
10
|
import { Memoize } from "typescript-memoize";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
11
|
+
import { NamedObjectType_objectSetMethodNames } from "./_NamedObjectType/NamedObjectType_objectSetMethodNames.js";
|
|
12
|
+
import { NamedObjectType_sparqlConstructQueryFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js";
|
|
13
|
+
import { NamedObjectType_sparqlConstructQueryStringFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js";
|
|
14
14
|
import { AbstractNamedUnionType } from "./AbstractNamedUnionType.js";
|
|
15
15
|
import { AbstractType } from "./AbstractType.js";
|
|
16
16
|
import { imports } from "./imports.js";
|
|
17
|
+
import { singleEntryRecord } from "./singleEntryRecord.js";
|
|
17
18
|
import { snippets } from "./snippets.js";
|
|
18
19
|
import { syntheticNamePrefix } from "./syntheticNamePrefix.js";
|
|
19
20
|
import { code, joinCode, literalOf } from "./ts-poet-wrapper.js";
|
|
20
|
-
function singleEntryRecord(key, value) {
|
|
21
|
-
const record = {};
|
|
22
|
-
record[key] = value;
|
|
23
|
-
return record;
|
|
24
|
-
}
|
|
25
21
|
export class NamedObjectUnionType extends AbstractNamedUnionType {
|
|
26
22
|
#identifierType;
|
|
27
23
|
graphqlArgs = Maybe.empty();
|
|
@@ -37,7 +33,7 @@ export class NamedObjectUnionType extends AbstractNamedUnionType {
|
|
|
37
33
|
return code `${this.staticModuleName}.${syntheticNamePrefix}Identifier`;
|
|
38
34
|
}
|
|
39
35
|
get objectSetMethodNames() {
|
|
40
|
-
return
|
|
36
|
+
return NamedObjectType_objectSetMethodNames.call(this);
|
|
41
37
|
}
|
|
42
38
|
get schema() {
|
|
43
39
|
return code `${this.staticModuleName}.${syntheticNamePrefix}schema`;
|
|
@@ -55,10 +51,10 @@ export class NamedObjectUnionType extends AbstractNamedUnionType {
|
|
|
55
51
|
...this.graphqlTypeVariableStatement,
|
|
56
52
|
...this.isTypeFunctionDeclaration,
|
|
57
53
|
...this.schemaVariableStatement,
|
|
58
|
-
...
|
|
54
|
+
...NamedObjectType_sparqlConstructQueryFunctionDeclaration.call(this)
|
|
59
55
|
.map((code_) => singleEntryRecord(`${syntheticNamePrefix}sparqlConstructQuery`, code_))
|
|
60
56
|
.orDefault({}),
|
|
61
|
-
...
|
|
57
|
+
...NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.call(this)
|
|
62
58
|
.map((code_) => singleEntryRecord(`${syntheticNamePrefix}sparqlConstructQueryString`, code_))
|
|
63
59
|
.orDefault({}),
|
|
64
60
|
...this.toRdfResourceFunctionDeclaration,
|
|
@@ -181,7 +177,7 @@ ${{
|
|
|
181
177
|
if (!this.features.has("rdf")) {
|
|
182
178
|
return {};
|
|
183
179
|
}
|
|
184
|
-
return singleEntryRecord(
|
|
180
|
+
return singleEntryRecord(`${syntheticNamePrefix}toRdfResource`, code `\
|
|
185
181
|
export const ${syntheticNamePrefix}toRdfResource: ${snippets.ToRdfResourceFunction}<${this.name}> = (value, options) => {
|
|
186
182
|
${joinCode(this.concreteMembers
|
|
187
183
|
.map((member) => {
|
|
@@ -26,7 +26,7 @@ export declare class OptionType<ItemTypeT extends OptionType.ItemType> extends A
|
|
|
26
26
|
hashStatements({ depth, variables, }: Parameters<AbstractContainerType<ItemTypeT>["hashStatements"]>[0]): readonly Code[];
|
|
27
27
|
jsonType(parameters?: Parameters<AbstractContainerType<ItemTypeT>["jsonType"]>[0]): AbstractContainerType.JsonType;
|
|
28
28
|
jsonUiSchemaElement(parameters: Parameters<AbstractContainerType<ItemTypeT>["jsonUiSchemaElement"]>[0]): Maybe<Code>;
|
|
29
|
-
|
|
29
|
+
jsonSchema(parameters: Parameters<AbstractContainerType<ItemTypeT>["jsonSchema"]>[0]): Code;
|
|
30
30
|
toJsonExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["toJsonExpression"]>[0]): Code;
|
|
31
31
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractContainerType<ItemTypeT>["toRdfResourceValuesExpression"]>[0]): Code;
|
|
32
32
|
}
|
|
@@ -122,8 +122,8 @@ export class OptionType extends AbstractContainerType {
|
|
|
122
122
|
jsonUiSchemaElement(parameters) {
|
|
123
123
|
return this.itemType.jsonUiSchemaElement(parameters);
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
return code `${this.itemType.
|
|
125
|
+
jsonSchema(parameters) {
|
|
126
|
+
return code `${this.itemType.jsonSchema(parameters)}.optional()`;
|
|
127
127
|
}
|
|
128
128
|
toJsonExpression({ variables, }) {
|
|
129
129
|
return code `${variables.value}.map(item => (${this.itemType.toJsonExpression({ variables: { value: code `item` } })})).extract()`;
|
|
@@ -16,7 +16,7 @@ export declare class StringType extends AbstractPrimitiveType<string> {
|
|
|
16
16
|
kind: Code;
|
|
17
17
|
};
|
|
18
18
|
hashStatements({ variables, }: Parameters<AbstractPrimitiveType<string>["hashStatements"]>[0]): readonly Code[];
|
|
19
|
-
|
|
19
|
+
jsonSchema(_parameters: Parameters<AbstractPrimitiveType<string>["jsonSchema"]>[0]): Code;
|
|
20
20
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractPrimitiveType<string>["toRdfResourceValuesExpression"]>[0]): Code;
|
|
21
21
|
protected fromRdfExpressionChain({ variables, }: Parameters<AbstractPrimitiveType<string>["fromRdfExpressionChain"]>[0]): ReturnType<AbstractPrimitiveType<string>["fromRdfExpressionChain"]>;
|
|
22
22
|
}
|
|
@@ -37,7 +37,7 @@ export class StringType extends AbstractPrimitiveType {
|
|
|
37
37
|
hashStatements({ variables, }) {
|
|
38
38
|
return [code `${variables.hasher}.update(${variables.value});`];
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
jsonSchema(_parameters) {
|
|
41
41
|
switch (this.primitiveIn.length) {
|
|
42
42
|
case 0:
|
|
43
43
|
return code `${imports.z}.string()`;
|