@shaclmate/compiler 4.0.22 → 4.0.24
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 +16 -16
- package/dist/_ShapesGraphToAstTransformer/shapeAstTypeName.js +6 -5
- package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +1 -1
- package/dist/_ShapesGraphToAstTransformer/shapeOntology.js +4 -3
- package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +12 -11
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +3 -3
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +6 -9
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +11 -12
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
- package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +3 -3
- package/dist/ast/AbstractLazyObjectType.d.ts +0 -2
- package/dist/ast/ListType.d.ts +1 -8
- package/dist/ast/ListType.js +1 -6
- package/dist/ast/ObjectType.d.ts +7 -9
- package/dist/ast/ObjectType.js +7 -8
- package/dist/generators/ts/AbstractLazyObjectType.d.ts +1 -0
- package/dist/generators/ts/AbstractLazyObjectType.js +7 -0
- package/dist/generators/ts/AbstractNamedUnionType.d.ts +3 -2
- package/dist/generators/ts/AbstractNamedUnionType.js +23 -9
- package/dist/generators/ts/AbstractTermType.d.ts +1 -0
- package/dist/generators/ts/AbstractTermType.js +3 -0
- package/dist/generators/ts/AbstractType.d.ts +12 -4
- package/dist/generators/ts/AbstractUnionType.d.ts +1 -0
- package/dist/generators/ts/AbstractUnionType.js +11 -1
- package/dist/generators/ts/AnonymousUnionType.d.ts +2 -1
- package/dist/generators/ts/AnonymousUnionType.js +6 -3
- package/dist/generators/ts/DefaultValueType.d.ts +2 -1
- package/dist/generators/ts/DefaultValueType.js +6 -3
- package/dist/generators/ts/ListType.d.ts +2 -5
- package/dist/generators/ts/ListType.js +11 -27
- package/dist/generators/ts/NamedObjectType.d.ts +2 -9
- package/dist/generators/ts/NamedObjectType.js +12 -29
- package/dist/generators/ts/NamedObjectUnionType.js +1 -1
- package/dist/generators/ts/OptionType.d.ts +1 -0
- package/dist/generators/ts/OptionType.js +3 -0
- package/dist/generators/ts/SetType.d.ts +1 -0
- package/dist/generators/ts/SetType.js +3 -0
- package/dist/generators/ts/TypeFactory.js +9 -46
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.d.ts +23 -15
- package/dist/generators/ts/_NamedObjectType/AbstractProperty.js +6 -0
- package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.d.ts +3 -4
- package/dist/generators/ts/_NamedObjectType/DiscriminantProperty.js +26 -11
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.d.ts +5 -14
- package/dist/generators/ts/_NamedObjectType/IdentifierProperty.js +34 -201
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_classDeclaration.js +3 -11
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.js +10 -9
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js +4 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +1 -5
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +5 -10
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.js +13 -9
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js +11 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js +2 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +1 -1
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.js +8 -4
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js +4 -2
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionOrMethodDeclaration.d.ts +4 -0
- package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionOrMethodDeclaration.js +66 -0
- package/dist/generators/ts/_NamedObjectType/Property.d.ts +1 -2
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.d.ts +6 -5
- package/dist/generators/ts/_NamedObjectType/ShaclProperty.js +26 -20
- package/dist/generators/ts/_snippets/snippets_LazyObject.js +2 -2
- package/dist/generators/ts/_snippets/snippets_LazyObjectOption.js +2 -2
- package/dist/generators/ts/_snippets/snippets_LazyObjectSet.js +2 -2
- package/dist/generators/ts/_snippets/snippets_PropertyPath.js +5 -3
- package/dist/generators/ts/_snippets/snippets_compactRecord.d.ts +2 -0
- package/dist/generators/ts/_snippets/snippets_compactRecord.js +16 -0
- package/dist/generators/ts/_snippets/{parseIri.d.ts → snippets_parseIri.d.ts} +1 -1
- package/dist/generators/ts/_snippets/{parseIri.js → snippets_parseIri.js} +1 -1
- package/dist/generators/ts/imports.d.ts +1 -3
- package/dist/generators/ts/imports.js +1 -3
- package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +2 -2
- package/dist/generators/ts/snippets.d.ts +1 -0
- package/dist/generators/ts/snippets.js +3 -1
- package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +1 -1
- package/dist/input/generated.d.ts +104 -50
- package/dist/input/generated.js +284 -171
- package/package.json +2 -2
- package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.d.ts +0 -6
- package/dist/_ShapesGraphToAstTransformer/nodeShapeIdentifierMintingStrategy.js +0 -32
- package/dist/enums/IdentifierMintingStrategy.d.ts +0 -9
- package/dist/enums/IdentifierMintingStrategy.js +0 -18
- package/dist/generators/ts/_NamedObjectType/IdentifierPrefixProperty.d.ts +0 -32
- package/dist/generators/ts/_NamedObjectType/IdentifierPrefixProperty.js +0 -89
|
@@ -2,7 +2,7 @@ import TermMap from "@rdfjs/term-map";
|
|
|
2
2
|
import TermSet from "@rdfjs/term-set";
|
|
3
3
|
import { LiteralDecoder, literalDatatypeDefinitions } from "@rdfx/literal";
|
|
4
4
|
import base62 from "@sindresorhus/base62";
|
|
5
|
-
import { rdf
|
|
5
|
+
import { rdf } from "@tpluscode/rdf-ns-builders";
|
|
6
6
|
import { Maybe } from "purify-ts";
|
|
7
7
|
import reservedTsIdentifiers_ from "reserved-identifiers";
|
|
8
8
|
import { invariant } from "ts-invariant";
|
|
@@ -112,16 +112,6 @@ export class TypeFactory {
|
|
|
112
112
|
visibility: "public",
|
|
113
113
|
});
|
|
114
114
|
},
|
|
115
|
-
lazyIdentifierProperty: (namedObjectType) => new NamedObjectType.IdentifierProperty({
|
|
116
|
-
identifierMintingStrategy: astType.identifierMintingStrategy,
|
|
117
|
-
identifierPrefixPropertyName: `${syntheticNamePrefix}identifierPrefix`,
|
|
118
|
-
logger: this.logger,
|
|
119
|
-
name: `${syntheticNamePrefix}identifier`,
|
|
120
|
-
namedObjectType,
|
|
121
|
-
type: identifierType,
|
|
122
|
-
typeAlias: code `${staticModuleName}.${syntheticNamePrefix}Identifier`,
|
|
123
|
-
visibility: "public",
|
|
124
|
-
}),
|
|
125
115
|
lazyParentObjectTypes: () => astType.parentObjectTypes.map((astType) => this.createNamedObjectType(astType)),
|
|
126
116
|
lazyProperties: (namedObjectType) => {
|
|
127
117
|
const properties = astType.properties
|
|
@@ -142,28 +132,17 @@ export class TypeFactory {
|
|
|
142
132
|
namedObjectType._discriminantProperty.type.descendantValues.length > 0) {
|
|
143
133
|
properties.splice(0, 0, namedObjectType._discriminantProperty);
|
|
144
134
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
properties.splice(0, 0, new NamedObjectType.
|
|
135
|
+
if (namedObjectType.declarationType === "interface" ||
|
|
136
|
+
namedObjectType.parentObjectTypes.length === 0) {
|
|
137
|
+
properties.splice(0, 0, new NamedObjectType.IdentifierProperty({
|
|
148
138
|
logger: this.logger,
|
|
149
|
-
name: `${syntheticNamePrefix}
|
|
139
|
+
name: `${syntheticNamePrefix}identifier`,
|
|
150
140
|
namedObjectType,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
datatype: xsd.string,
|
|
155
|
-
hasValues: [],
|
|
156
|
-
in_: [],
|
|
157
|
-
label: astType.label,
|
|
158
|
-
logger: this.logger,
|
|
159
|
-
languageIn: [],
|
|
160
|
-
primitiveIn: [],
|
|
161
|
-
}),
|
|
162
|
-
visibility: "protected",
|
|
141
|
+
type: identifierType,
|
|
142
|
+
typeAlias: code `${staticModuleName}.${syntheticNamePrefix}Identifier`,
|
|
143
|
+
visibility: "public",
|
|
163
144
|
}));
|
|
164
145
|
}
|
|
165
|
-
// Every NamedObjectType has an identifier property. Some are abstract.
|
|
166
|
-
properties.splice(0, 0, namedObjectType.identifierProperty);
|
|
167
146
|
return properties;
|
|
168
147
|
},
|
|
169
148
|
logger: this.logger,
|
|
@@ -321,7 +300,6 @@ export class TypeFactory {
|
|
|
321
300
|
logger: this.logger,
|
|
322
301
|
minCount: 0,
|
|
323
302
|
mutable: astType.mutable,
|
|
324
|
-
identifierMintingStrategy: astType.identifierMintingStrategy,
|
|
325
303
|
toRdfTypes: astType.toRdfTypes,
|
|
326
304
|
});
|
|
327
305
|
}
|
|
@@ -455,6 +433,7 @@ export class TypeFactory {
|
|
|
455
433
|
const property = new NamedObjectType.ShaclProperty({
|
|
456
434
|
comment: astObjectTypeProperty.comment,
|
|
457
435
|
description: astObjectTypeProperty.description,
|
|
436
|
+
display: astObjectTypeProperty.display,
|
|
458
437
|
label: astObjectTypeProperty.label,
|
|
459
438
|
logger: this.logger,
|
|
460
439
|
mutable: astObjectTypeProperty.mutable,
|
|
@@ -501,22 +480,6 @@ export class TypeFactory {
|
|
|
501
480
|
});
|
|
502
481
|
}
|
|
503
482
|
}
|
|
504
|
-
function namedObjectTypeNeedsIdentifierPrefixProperty(namedObjectType) {
|
|
505
|
-
return namedObjectType.identifierMintingStrategy
|
|
506
|
-
.map((identifierMintingStrategy) => {
|
|
507
|
-
switch (identifierMintingStrategy) {
|
|
508
|
-
case "blankNode":
|
|
509
|
-
return false;
|
|
510
|
-
case "sha256":
|
|
511
|
-
case "uuidv4":
|
|
512
|
-
return true;
|
|
513
|
-
default:
|
|
514
|
-
identifierMintingStrategy;
|
|
515
|
-
throw new RangeError(identifierMintingStrategy);
|
|
516
|
-
}
|
|
517
|
-
})
|
|
518
|
-
.orDefault(false);
|
|
519
|
-
}
|
|
520
483
|
function tsName(name, options) {
|
|
521
484
|
if (name[0] === "$") {
|
|
522
485
|
return name;
|
|
@@ -12,13 +12,9 @@ export declare abstract class AbstractProperty<TypeT extends Pick<Type, "filterF
|
|
|
12
12
|
*/
|
|
13
13
|
abstract readonly constructorParametersSignature: Maybe<Code>;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Property declaration to include in a class or interface declaration of the object type.
|
|
16
16
|
*/
|
|
17
|
-
abstract readonly declaration:
|
|
18
|
-
/**
|
|
19
|
-
* Function declaration that takes two values of the property and compares them, returning an $EqualsResult.
|
|
20
|
-
*/
|
|
21
|
-
abstract readonly equalsFunction: Maybe<Code>;
|
|
17
|
+
abstract readonly declaration: Code;
|
|
22
18
|
/**
|
|
23
19
|
* Optional property in the object type's filter.
|
|
24
20
|
*/
|
|
@@ -26,10 +22,6 @@ export declare abstract class AbstractProperty<TypeT extends Pick<Type, "filterF
|
|
|
26
22
|
readonly name: string;
|
|
27
23
|
readonly type: Code;
|
|
28
24
|
}>;
|
|
29
|
-
/**
|
|
30
|
-
* Optional get accessor to include in a class declaration of the object type.
|
|
31
|
-
*/
|
|
32
|
-
abstract readonly getAccessorDeclaration: Maybe<Code>;
|
|
33
25
|
/**
|
|
34
26
|
* GraphQL.js field definition.
|
|
35
27
|
*/
|
|
@@ -42,17 +34,17 @@ export declare abstract class AbstractProperty<TypeT extends Pick<Type, "filterF
|
|
|
42
34
|
resolve: Code;
|
|
43
35
|
type: Code;
|
|
44
36
|
}>;
|
|
45
|
-
/**
|
|
46
|
-
* Signature of the property when serialized to JSON (the type of toJsonObjectMember).
|
|
47
|
-
*/
|
|
48
|
-
abstract readonly jsonSignature: Maybe<Code>;
|
|
49
37
|
/**
|
|
50
38
|
* zod Object key: schema pair on the property serialized by toJsonObjectMember.
|
|
51
39
|
*/
|
|
52
|
-
abstract readonly
|
|
40
|
+
abstract readonly jsonSchema: Maybe<{
|
|
53
41
|
readonly key: string;
|
|
54
42
|
readonly schema: Code;
|
|
55
43
|
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Signature of the property when serialized to JSON (the type of toJsonObjectMember).
|
|
46
|
+
*/
|
|
47
|
+
abstract readonly jsonSignature: Maybe<Code>;
|
|
56
48
|
/**
|
|
57
49
|
* Property type discriminator e.g., "ShaclProperty".
|
|
58
50
|
*/
|
|
@@ -92,6 +84,14 @@ export declare abstract class AbstractProperty<TypeT extends Pick<Type, "filterF
|
|
|
92
84
|
kind: Code;
|
|
93
85
|
type: Code;
|
|
94
86
|
};
|
|
87
|
+
/**
|
|
88
|
+
* Expression to access the value of this property on an object instance. May evaluate a thunk.
|
|
89
|
+
*/
|
|
90
|
+
accessExpression({ variables }: {
|
|
91
|
+
variables: {
|
|
92
|
+
object: Code;
|
|
93
|
+
};
|
|
94
|
+
}): Code;
|
|
95
95
|
/**
|
|
96
96
|
* Statements to assign the parameter of described by constructorParametersSignature to a class or interface member.
|
|
97
97
|
*/
|
|
@@ -190,5 +190,13 @@ export declare abstract class AbstractProperty<TypeT extends Pick<Type, "filterF
|
|
|
190
190
|
abstract toRdfRdfResourceValuesStatements(parameters: {
|
|
191
191
|
variables: Omit<Parameters<Type["toRdfResourceValuesExpression"]>[0]["variables"], "propertyPath">;
|
|
192
192
|
}): readonly Code[];
|
|
193
|
+
/**
|
|
194
|
+
* Expression to serialize this property to a human-readable string (toString).
|
|
195
|
+
*/
|
|
196
|
+
abstract toStringExpression(parameters: {
|
|
197
|
+
variables: {
|
|
198
|
+
value: Code;
|
|
199
|
+
};
|
|
200
|
+
}): Maybe<Code>;
|
|
193
201
|
}
|
|
194
202
|
//# sourceMappingURL=AbstractProperty.d.ts.map
|
|
@@ -44,6 +44,12 @@ export class AbstractProperty {
|
|
|
44
44
|
type: code `() => (${this.type.schema})`,
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Expression to access the value of this property on an object instance. May evaluate a thunk.
|
|
49
|
+
*/
|
|
50
|
+
accessExpression({ variables }) {
|
|
51
|
+
return code `${variables.object}.${this.name}`;
|
|
52
|
+
}
|
|
47
53
|
}
|
|
48
54
|
__decorate([
|
|
49
55
|
Memoize()
|
|
@@ -3,9 +3,7 @@ import { type Code } from "../ts-poet-wrapper.js";
|
|
|
3
3
|
import { AbstractProperty } from "./AbstractProperty.js";
|
|
4
4
|
export declare class DiscriminantProperty extends AbstractProperty<DiscriminantProperty.Type> {
|
|
5
5
|
readonly constructorParametersSignature: Maybe<Code>;
|
|
6
|
-
readonly equalsFunction: Maybe<Code>;
|
|
7
6
|
readonly filterProperty: AbstractProperty<DiscriminantProperty.Type>["filterProperty"];
|
|
8
|
-
readonly getAccessorDeclaration: Maybe<Code>;
|
|
9
7
|
readonly graphqlField: AbstractProperty<DiscriminantProperty.Type>["graphqlField"];
|
|
10
8
|
readonly kind = "DiscriminantProperty";
|
|
11
9
|
readonly mutable = false;
|
|
@@ -13,9 +11,9 @@ export declare class DiscriminantProperty extends AbstractProperty<DiscriminantP
|
|
|
13
11
|
constructor({ type, ...superParameters }: {
|
|
14
12
|
type: DiscriminantProperty.Type;
|
|
15
13
|
} & ConstructorParameters<typeof AbstractProperty>[0]);
|
|
16
|
-
get declaration():
|
|
14
|
+
get declaration(): Code;
|
|
15
|
+
get jsonSchema(): AbstractProperty<DiscriminantProperty.Type>["jsonSchema"];
|
|
17
16
|
get jsonSignature(): Maybe<Code>;
|
|
18
|
-
get jsonZchema(): AbstractProperty<DiscriminantProperty.Type>["jsonZchema"];
|
|
19
17
|
private get abstract();
|
|
20
18
|
private get initializer();
|
|
21
19
|
private get override();
|
|
@@ -28,6 +26,7 @@ export declare class DiscriminantProperty extends AbstractProperty<DiscriminantP
|
|
|
28
26
|
sparqlWherePatternsExpression(): ReturnType<AbstractProperty<DiscriminantProperty.Type>["sparqlWherePatternsExpression"]>;
|
|
29
27
|
toJsonObjectMemberExpression({ variables, }: Parameters<AbstractProperty<DiscriminantProperty.Type>["toJsonObjectMemberExpression"]>[0]): Maybe<Code>;
|
|
30
28
|
toRdfRdfResourceValuesStatements(): readonly Code[];
|
|
29
|
+
toStringExpression(): Maybe<Code>;
|
|
31
30
|
}
|
|
32
31
|
export declare namespace DiscriminantProperty {
|
|
33
32
|
class Type {
|
|
@@ -9,14 +9,11 @@ import { invariant } from "ts-invariant";
|
|
|
9
9
|
import { Memoize } from "typescript-memoize";
|
|
10
10
|
import { imports } from "../imports.js";
|
|
11
11
|
import { removeUndefined } from "../removeUndefined.js";
|
|
12
|
-
import { snippets } from "../snippets.js";
|
|
13
12
|
import { arrayOf, code, literalOf } from "../ts-poet-wrapper.js";
|
|
14
13
|
import { AbstractProperty } from "./AbstractProperty.js";
|
|
15
14
|
export class DiscriminantProperty extends AbstractProperty {
|
|
16
15
|
constructorParametersSignature = Maybe.empty();
|
|
17
|
-
equalsFunction = Maybe.of(code `${snippets.strictEquals}`);
|
|
18
16
|
filterProperty = Maybe.empty();
|
|
19
|
-
getAccessorDeclaration = Maybe.empty();
|
|
20
17
|
graphqlField = Maybe.empty();
|
|
21
18
|
kind = "DiscriminantProperty";
|
|
22
19
|
mutable = false;
|
|
@@ -28,18 +25,18 @@ export class DiscriminantProperty extends AbstractProperty {
|
|
|
28
25
|
get declaration() {
|
|
29
26
|
switch (this.namedObjectType.declarationType) {
|
|
30
27
|
case "class":
|
|
31
|
-
return
|
|
28
|
+
return code `${this.abstract ? "abstract " : ""}${this.override ? "override " : ""}readonly ${this.name}: ${this.type.name}${!this.abstract ? code ` = ${this.initializer};` : ";"}`;
|
|
32
29
|
case "interface":
|
|
33
|
-
return
|
|
30
|
+
return code `readonly ${this.name}: ${this.type.name};`;
|
|
34
31
|
default:
|
|
35
32
|
this.namedObjectType.declarationType;
|
|
36
33
|
throw new Error("should never reach this point");
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
|
-
get
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
get jsonSchema() {
|
|
37
|
+
if (this.override) {
|
|
38
|
+
return Maybe.empty();
|
|
39
|
+
}
|
|
43
40
|
return Maybe.of({
|
|
44
41
|
key: this.name,
|
|
45
42
|
schema: this.type.values.length > 1
|
|
@@ -47,6 +44,12 @@ export class DiscriminantProperty extends AbstractProperty {
|
|
|
47
44
|
: code `${imports.z}.literal(${literalOf(this.type.values[0])})`,
|
|
48
45
|
});
|
|
49
46
|
}
|
|
47
|
+
get jsonSignature() {
|
|
48
|
+
if (this.override) {
|
|
49
|
+
return Maybe.empty();
|
|
50
|
+
}
|
|
51
|
+
return Maybe.of(code `readonly ${this.name}: ${this.type.name}`);
|
|
52
|
+
}
|
|
50
53
|
get abstract() {
|
|
51
54
|
return this.namedObjectType.abstract;
|
|
52
55
|
}
|
|
@@ -80,9 +83,15 @@ export class DiscriminantProperty extends AbstractProperty {
|
|
|
80
83
|
: Maybe.empty();
|
|
81
84
|
}
|
|
82
85
|
hashStatements({ variables, }) {
|
|
86
|
+
if (this.override) {
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
83
89
|
return [code `${variables.hasher}.update(${variables.value});`];
|
|
84
90
|
}
|
|
85
91
|
jsonUiSchemaElement({ variables, }) {
|
|
92
|
+
if (this.override) {
|
|
93
|
+
return Maybe.empty();
|
|
94
|
+
}
|
|
86
95
|
const scope = code `\`\${${variables.scopePrefix}}/properties/${this.name}\``;
|
|
87
96
|
return Maybe.of(code `{ rule: { condition: { schema: { const: ${this.initializer} }, scope: ${scope} }, effect: "HIDE" }, scope: ${scope}, type: "Control" }`);
|
|
88
97
|
}
|
|
@@ -93,18 +102,24 @@ export class DiscriminantProperty extends AbstractProperty {
|
|
|
93
102
|
return Maybe.empty();
|
|
94
103
|
}
|
|
95
104
|
toJsonObjectMemberExpression({ variables, }) {
|
|
105
|
+
if (this.override) {
|
|
106
|
+
return Maybe.empty();
|
|
107
|
+
}
|
|
96
108
|
return Maybe.of(code `${this.name}: ${variables.value}`);
|
|
97
109
|
}
|
|
98
110
|
toRdfRdfResourceValuesStatements() {
|
|
99
111
|
return [];
|
|
100
112
|
}
|
|
113
|
+
toStringExpression() {
|
|
114
|
+
return Maybe.empty();
|
|
115
|
+
}
|
|
101
116
|
}
|
|
102
117
|
__decorate([
|
|
103
118
|
Memoize()
|
|
104
|
-
], DiscriminantProperty.prototype, "
|
|
119
|
+
], DiscriminantProperty.prototype, "jsonSchema", null);
|
|
105
120
|
__decorate([
|
|
106
121
|
Memoize()
|
|
107
|
-
], DiscriminantProperty.prototype, "
|
|
122
|
+
], DiscriminantProperty.prototype, "jsonSignature", null);
|
|
108
123
|
(function (DiscriminantProperty) {
|
|
109
124
|
class Type {
|
|
110
125
|
filterFunction = code `nonextant`;
|
|
@@ -1,38 +1,28 @@
|
|
|
1
1
|
import { Maybe } from "purify-ts";
|
|
2
|
-
import type { IdentifierMintingStrategy } from "../../../enums/IdentifierMintingStrategy.js";
|
|
3
2
|
import type { BlankNodeType } from "../BlankNodeType.js";
|
|
4
3
|
import type { IdentifierType } from "../IdentifierType.js";
|
|
5
4
|
import type { IriType } from "../IriType.js";
|
|
6
5
|
import { type Code } from "../ts-poet-wrapper.js";
|
|
7
6
|
import { AbstractProperty } from "./AbstractProperty.js";
|
|
8
7
|
export declare class IdentifierProperty extends AbstractProperty<BlankNodeType | IdentifierType | IriType> {
|
|
9
|
-
private readonly identifierMintingStrategy;
|
|
10
|
-
private readonly identifierPrefixPropertyName;
|
|
11
8
|
private readonly typeAlias;
|
|
12
9
|
readonly kind = "IdentifierProperty";
|
|
13
10
|
readonly mutable = false;
|
|
14
11
|
readonly recursive = false;
|
|
15
|
-
constructor({
|
|
16
|
-
identifierMintingStrategy: Maybe<IdentifierMintingStrategy>;
|
|
17
|
-
identifierPrefixPropertyName: string;
|
|
12
|
+
constructor({ typeAlias, ...superParameters }: {
|
|
18
13
|
type: BlankNodeType | IdentifierType | IriType;
|
|
19
14
|
typeAlias: Code;
|
|
20
15
|
} & ConstructorParameters<typeof AbstractProperty>[0]);
|
|
21
16
|
get constructorParametersSignature(): Maybe<Code>;
|
|
22
|
-
get declaration():
|
|
23
|
-
get equalsFunction(): Maybe<Code>;
|
|
17
|
+
get declaration(): Code;
|
|
24
18
|
get filterProperty(): Maybe<{
|
|
25
19
|
name: string;
|
|
26
20
|
type: Code;
|
|
27
21
|
}>;
|
|
28
|
-
get getAccessorDeclaration(): Maybe<Code>;
|
|
29
22
|
get graphqlField(): AbstractProperty<IdentifierType>["graphqlField"];
|
|
23
|
+
get jsonSchema(): AbstractProperty<IdentifierType>["jsonSchema"];
|
|
30
24
|
get jsonSignature(): Maybe<Code>;
|
|
31
|
-
|
|
32
|
-
private get abstract();
|
|
33
|
-
private get declarationModifiers();
|
|
34
|
-
private get declarationName();
|
|
35
|
-
private get override();
|
|
25
|
+
accessExpression({ variables, }: Parameters<AbstractProperty<BlankNodeType | IdentifierType | IriType>["accessExpression"]>[0]): Code;
|
|
36
26
|
constructorStatements({ variables, }: Parameters<AbstractProperty<IdentifierType>["constructorStatements"]>[0]): readonly Code[];
|
|
37
27
|
fromJsonStatements({ variables, }: Parameters<AbstractProperty<IdentifierType>["fromJsonStatements"]>[0]): readonly Code[];
|
|
38
28
|
fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractProperty<IdentifierType>["fromRdfResourceValuesExpression"]>[0]): Maybe<Code>;
|
|
@@ -45,5 +35,6 @@ export declare class IdentifierProperty extends AbstractProperty<BlankNodeType |
|
|
|
45
35
|
}>;
|
|
46
36
|
toJsonObjectMemberExpression({ variables, }: Parameters<AbstractProperty<IdentifierType>["toJsonObjectMemberExpression"]>[0]): Maybe<Code>;
|
|
47
37
|
toRdfRdfResourceValuesStatements(): readonly Code[];
|
|
38
|
+
toStringExpression(parameters: Parameters<AbstractProperty<IdentifierType>["toStringExpression"]>[0]): Maybe<Code>;
|
|
48
39
|
}
|
|
49
40
|
//# sourceMappingURL=IdentifierProperty.d.ts.map
|