@shaclmate/compiler 4.0.98 → 4.0.100
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/generators/ts/AbstractBuiltinType.d.ts +23 -0
- package/dist/generators/ts/AbstractBuiltinType.js +18 -0
- package/dist/generators/ts/AbstractCollectionType.d.ts +2 -1
- package/dist/generators/ts/AbstractCollectionType.js +10 -5
- package/dist/generators/ts/AbstractCompoundType.d.ts +11 -8
- package/dist/generators/ts/AbstractCompoundType.js +5 -2
- package/dist/generators/ts/AbstractContainerType.d.ts +11 -11
- package/dist/generators/ts/AbstractContainerType.js +21 -15
- package/dist/generators/ts/AbstractDateType.d.ts +7 -6
- package/dist/generators/ts/AbstractDateType.js +16 -6
- package/dist/generators/ts/AbstractDiscriminatedUnionType.d.ts +2 -3
- package/dist/generators/ts/AbstractDiscriminatedUnionType.js +25 -7
- package/dist/generators/ts/AbstractIntersectionType.d.ts +2 -2
- package/dist/generators/ts/AbstractIntersectionType.js +19 -8
- package/dist/generators/ts/AbstractLazyType.d.ts +23 -23
- package/dist/generators/ts/AbstractLazyType.js +21 -19
- package/dist/generators/ts/AbstractNumericType.d.ts +4 -3
- package/dist/generators/ts/AbstractNumericType.js +12 -7
- package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -2
- package/dist/generators/ts/AbstractPrimitiveType.js +4 -4
- package/dist/generators/ts/AbstractTermType.d.ts +17 -16
- package/dist/generators/ts/AbstractTermType.js +21 -11
- package/dist/generators/ts/AbstractType.d.ts +6 -15
- package/dist/generators/ts/AbstractType.js +14 -33
- package/dist/generators/ts/AbstractTypedLiteralType.d.ts +2 -1
- package/dist/generators/ts/AbstractTypedLiteralType.js +20 -2
- package/dist/generators/ts/{AbstractStructuredType.d.ts → AbstractUserDefinedType.d.ts} +6 -6
- package/dist/generators/ts/{AbstractStructuredType.js → AbstractUserDefinedType.js} +38 -26
- package/dist/generators/ts/BigDecimalType.d.ts +12 -11
- package/dist/generators/ts/BigDecimalType.js +28 -11
- package/dist/generators/ts/BigIntType.js +6 -6
- package/dist/generators/ts/BlankNodeType.d.ts +11 -10
- package/dist/generators/ts/BlankNodeType.js +27 -10
- package/dist/generators/ts/BooleanType.d.ts +6 -5
- package/dist/generators/ts/BooleanType.js +18 -8
- package/dist/generators/ts/{ReferenceCallable.d.ts → BuiltinCallable.d.ts} +3 -3
- package/dist/generators/ts/{ReferenceCallable.js → BuiltinCallable.js} +3 -3
- package/dist/generators/ts/Callable.d.ts +2 -2
- package/dist/generators/ts/DateTimeType.d.ts +6 -6
- package/dist/generators/ts/DateTimeType.js +6 -6
- package/dist/generators/ts/DateType.d.ts +6 -6
- package/dist/generators/ts/DateType.js +6 -6
- package/dist/generators/ts/DefaultValueType.d.ts +2 -2
- package/dist/generators/ts/DefaultValueType.js +18 -8
- package/dist/generators/ts/FloatType.js +4 -4
- package/dist/generators/ts/IdentifierType.d.ts +11 -10
- package/dist/generators/ts/IdentifierType.js +27 -10
- package/dist/generators/ts/IntType.js +4 -4
- package/dist/generators/ts/IriType.d.ts +5 -5
- package/dist/generators/ts/IriType.js +27 -22
- package/dist/generators/ts/LangStringType.d.ts +10 -10
- package/dist/generators/ts/LangStringType.js +21 -13
- package/dist/generators/ts/ListType.js +7 -7
- package/dist/generators/ts/LiteralType.d.ts +10 -10
- package/dist/generators/ts/LiteralType.js +21 -13
- package/dist/generators/ts/ObjectType.d.ts +13 -15
- package/dist/generators/ts/ObjectType.js +32 -9
- package/dist/generators/ts/OptionType.d.ts +2 -1
- package/dist/generators/ts/OptionType.js +16 -11
- package/dist/generators/ts/SchemaObject.d.ts +98 -0
- package/dist/generators/ts/SchemaObject.js +143 -0
- package/dist/generators/ts/SetType.d.ts +2 -1
- package/dist/generators/ts/SetType.js +22 -10
- package/dist/generators/ts/Snippets.d.ts +1 -0
- package/dist/generators/ts/Snippets.js +7 -0
- package/dist/generators/ts/StringType.d.ts +6 -6
- package/dist/generators/ts/StringType.js +20 -17
- package/dist/generators/ts/TermType.d.ts +7 -7
- package/dist/generators/ts/TermType.js +18 -13
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.js +1 -1
- package/dist/generators/ts/_AbstractType/AbstractType_JsonType.d.ts +39 -16
- package/dist/generators/ts/_AbstractType/AbstractType_JsonType.js +49 -33
- package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.js +1 -1
- package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.js +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.d.ts +4 -7
- package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.js +1 -3
- package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.d.ts +0 -1
- package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.js +0 -1
- package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.d.ts +3 -2
- package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.js +30 -10
- package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.d.ts +3 -2
- package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.js +26 -10
- package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.d.ts +3 -2
- package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.js +46 -22
- package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.js +1 -1
- package/dist/generators/ts/_ObjectType/ObjectType_jsonObjectType.d.ts +4 -0
- package/dist/generators/ts/_ObjectType/ObjectType_jsonObjectType.js +26 -0
- package/dist/generators/ts/_snippets/snippets_LazySchema.d.ts +3 -0
- package/dist/generators/ts/_snippets/snippets_LazySchema.js +7 -0
- package/package.json +14 -12
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.d.ts +0 -5
- package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.js +0 -11
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +0 -15
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +0 -4
- package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +0 -15
|
@@ -9,11 +9,12 @@ import { Memoize } from "typescript-memoize";
|
|
|
9
9
|
import { AbstractType } from "./AbstractType.js";
|
|
10
10
|
import { DeclaredCallable } from "./DeclaredCallable.js";
|
|
11
11
|
import { InlineCallable } from "./InlineCallable.js";
|
|
12
|
-
import {
|
|
12
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
13
|
+
import { code, joinCode, literalOf } from "./ts-poet-wrapper.js";
|
|
13
14
|
/**
|
|
14
|
-
* Abstract base class for
|
|
15
|
+
* Abstract base class for user-defined types (compound types, object types).
|
|
15
16
|
*/
|
|
16
|
-
export class
|
|
17
|
+
export class AbstractUserDefinedType extends AbstractType {
|
|
17
18
|
get equalsFunction() {
|
|
18
19
|
return this._function({
|
|
19
20
|
type: () => this.equalsFunctionType(),
|
|
@@ -28,6 +29,16 @@ export class AbstractStructuredType extends AbstractType {
|
|
|
28
29
|
unqualifiedName: "filter",
|
|
29
30
|
});
|
|
30
31
|
}
|
|
32
|
+
get schema() {
|
|
33
|
+
return new SchemaObject({
|
|
34
|
+
properties: super.schema.properties,
|
|
35
|
+
type: new SchemaObject.UserDefinedType({
|
|
36
|
+
members: { kind: code `kind: ${literalOf(this.kind)}` },
|
|
37
|
+
name: this.name.map((name) => code `${name}.Schema`),
|
|
38
|
+
}),
|
|
39
|
+
variable: this.name.map((name) => code `${name}.schema`),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
31
42
|
get filterType() {
|
|
32
43
|
return this.name
|
|
33
44
|
.map((name) => code `${name}.Filter`)
|
|
@@ -57,11 +68,6 @@ export class AbstractStructuredType extends AbstractType {
|
|
|
57
68
|
unqualifiedName: "hash",
|
|
58
69
|
});
|
|
59
70
|
}
|
|
60
|
-
get schemaType() {
|
|
61
|
-
return this.name
|
|
62
|
-
.map((name) => code `${name}.Schema`)
|
|
63
|
-
.orDefaultLazy(() => this.schemaTypeExpression());
|
|
64
|
-
}
|
|
65
71
|
get toJsonValueFunction() {
|
|
66
72
|
return this.toJsonObjectFunction;
|
|
67
73
|
}
|
|
@@ -154,7 +160,7 @@ export class AbstractStructuredType extends AbstractType {
|
|
|
154
160
|
return code `${this.reusables.snippets.FromJsonFunction}<${this.jsonObjectType.expression}, ${this.expression}, undefined>`;
|
|
155
161
|
}
|
|
156
162
|
fromRdfResourceValuesFunctionType() {
|
|
157
|
-
return code `${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.expression}, ${this.
|
|
163
|
+
return code `${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.expression}, ${this.schema.type.expression}>`;
|
|
158
164
|
}
|
|
159
165
|
hashFunctionType() {
|
|
160
166
|
return code `${this.reusables.snippets.HashFunction}<${this.expression}>`;
|
|
@@ -191,6 +197,12 @@ export class AbstractStructuredType extends AbstractType {
|
|
|
191
197
|
if (this.configuration.features.has("Object.fromRdf")) {
|
|
192
198
|
addFunctionDeclaration(this.fromRdfResourceValuesFunction);
|
|
193
199
|
}
|
|
200
|
+
if (this.configuration.features.has("Object.schema")) {
|
|
201
|
+
staticModuleDeclarations["schema"] =
|
|
202
|
+
code `export const schema = ${this.schema.literalExpression};`;
|
|
203
|
+
staticModuleDeclarations["Schema"] =
|
|
204
|
+
code `export type Schema = typeof schema;`;
|
|
205
|
+
}
|
|
194
206
|
if (this.configuration.features.has("Object.SPARQL")) {
|
|
195
207
|
addFunctionDeclaration(this.valueSparqlConstructTriplesFunction);
|
|
196
208
|
addFunctionDeclaration(this.valueSparqlWherePatternsFunction);
|
|
@@ -222,52 +234,52 @@ export class AbstractStructuredType extends AbstractType {
|
|
|
222
234
|
return code `${this.reusables.snippets.ToStringFunction}<${this.expression}>`;
|
|
223
235
|
}
|
|
224
236
|
valueSparqlConstructTriplesType() {
|
|
225
|
-
return code `${this.reusables.snippets.ValueSparqlConstructTriplesFunction}<${this.filterType}, ${this.
|
|
237
|
+
return code `${this.reusables.snippets.ValueSparqlConstructTriplesFunction}<${this.filterType}, ${this.schema.type.expression}>`;
|
|
226
238
|
}
|
|
227
239
|
valueSparqlWherePatternsFunctionType() {
|
|
228
|
-
return code `${this.reusables.snippets.ValueSparqlWherePatternsFunction}<${this.filterType}, ${this.
|
|
240
|
+
return code `${this.reusables.snippets.ValueSparqlWherePatternsFunction}<${this.filterType}, ${this.schema.type.expression}>`;
|
|
229
241
|
}
|
|
230
242
|
}
|
|
231
243
|
__decorate([
|
|
232
244
|
Memoize()
|
|
233
|
-
],
|
|
245
|
+
], AbstractUserDefinedType.prototype, "equalsFunction", null);
|
|
234
246
|
__decorate([
|
|
235
247
|
Memoize()
|
|
236
|
-
],
|
|
248
|
+
], AbstractUserDefinedType.prototype, "filterFunction", null);
|
|
237
249
|
__decorate([
|
|
238
250
|
Memoize()
|
|
239
|
-
],
|
|
251
|
+
], AbstractUserDefinedType.prototype, "schema", null);
|
|
240
252
|
__decorate([
|
|
241
253
|
Memoize()
|
|
242
|
-
],
|
|
254
|
+
], AbstractUserDefinedType.prototype, "filterType", null);
|
|
243
255
|
__decorate([
|
|
244
256
|
Memoize()
|
|
245
|
-
],
|
|
257
|
+
], AbstractUserDefinedType.prototype, "fromJsonObjectFunction", null);
|
|
246
258
|
__decorate([
|
|
247
259
|
Memoize()
|
|
248
|
-
],
|
|
260
|
+
], AbstractUserDefinedType.prototype, "fromRdfResourceValuesFunction", null);
|
|
249
261
|
__decorate([
|
|
250
262
|
Memoize()
|
|
251
|
-
],
|
|
263
|
+
], AbstractUserDefinedType.prototype, "hashFunction", null);
|
|
252
264
|
__decorate([
|
|
253
265
|
Memoize()
|
|
254
|
-
],
|
|
266
|
+
], AbstractUserDefinedType.prototype, "toJsonObjectFunction", null);
|
|
255
267
|
__decorate([
|
|
256
268
|
Memoize()
|
|
257
|
-
],
|
|
269
|
+
], AbstractUserDefinedType.prototype, "toLoggableFunction", null);
|
|
258
270
|
__decorate([
|
|
259
271
|
Memoize()
|
|
260
|
-
],
|
|
272
|
+
], AbstractUserDefinedType.prototype, "toRdfResourceValuesFunction", null);
|
|
261
273
|
__decorate([
|
|
262
274
|
Memoize()
|
|
263
|
-
],
|
|
275
|
+
], AbstractUserDefinedType.prototype, "toStringFunction", null);
|
|
264
276
|
__decorate([
|
|
265
277
|
Memoize()
|
|
266
|
-
],
|
|
278
|
+
], AbstractUserDefinedType.prototype, "valueSparqlConstructTriplesFunction", null);
|
|
267
279
|
__decorate([
|
|
268
280
|
Memoize()
|
|
269
|
-
],
|
|
281
|
+
], AbstractUserDefinedType.prototype, "valueSparqlWherePatternsFunction", null);
|
|
270
282
|
__decorate([
|
|
271
283
|
Memoize()
|
|
272
|
-
],
|
|
273
|
-
//# sourceMappingURL=
|
|
284
|
+
], AbstractUserDefinedType.prototype, "toRdfResourceValueTypesExpression", null);
|
|
285
|
+
//# sourceMappingURL=AbstractUserDefinedType.js.map
|
|
@@ -2,29 +2,30 @@ import type { Literal } from "@rdfjs/types";
|
|
|
2
2
|
import type { Decimal } from "decimal.js";
|
|
3
3
|
import { Maybe } from "purify-ts";
|
|
4
4
|
import { AbstractTypedLiteralType } from "./AbstractTypedLiteralType.js";
|
|
5
|
-
import {
|
|
5
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
6
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
6
7
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
7
8
|
export declare class BigDecimalType extends AbstractTypedLiteralType<Decimal> {
|
|
8
9
|
protected readonly inlineExpression: Code;
|
|
9
|
-
readonly jsonValueType: AbstractTypedLiteralType.JsonType;
|
|
10
10
|
readonly jsTypes: readonly [{
|
|
11
11
|
readonly className: Code;
|
|
12
12
|
readonly instanceof: "class";
|
|
13
13
|
readonly typeof: "object";
|
|
14
14
|
}];
|
|
15
15
|
readonly conversionFunction: Maybe<AbstractTypedLiteralType.ConversionFunction>;
|
|
16
|
-
readonly filterFunction:
|
|
16
|
+
readonly filterFunction: BuiltinCallable;
|
|
17
17
|
readonly filterType: Code;
|
|
18
|
-
readonly
|
|
19
|
-
readonly
|
|
20
|
-
readonly fromRdfResourceValuesFunction:
|
|
18
|
+
readonly fromJsonObjectFunction: BuiltinCallable;
|
|
19
|
+
readonly fromJsonValueFunction: BuiltinCallable;
|
|
20
|
+
readonly fromRdfResourceValuesFunction: BuiltinCallable;
|
|
21
21
|
readonly graphqlType: import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
|
|
22
|
-
readonly hashFunction:
|
|
22
|
+
readonly hashFunction: BuiltinCallable;
|
|
23
|
+
readonly jsonValueType: AbstractTypedLiteralType.JsonType;
|
|
23
24
|
readonly kind = "BigDecimal";
|
|
24
|
-
readonly
|
|
25
|
-
readonly toJsonValueFunction:
|
|
26
|
-
readonly
|
|
27
|
-
|
|
25
|
+
readonly toJsonObjectFunction: BuiltinCallable;
|
|
26
|
+
readonly toJsonValueFunction: BuiltinCallable;
|
|
27
|
+
readonly valueSparqlWherePatternsFunction: BuiltinCallable;
|
|
28
|
+
get schema(): SchemaObject<SchemaObject.BuiltinType>;
|
|
28
29
|
graphqlResolveExpression({ variables, }: Parameters<AbstractTypedLiteralType<Decimal>["graphqlResolveExpression"]>[0]): Code;
|
|
29
30
|
toLoggableExpression({ variables, }: Parameters<AbstractTypedLiteralType<Decimal>["toLoggableExpression"]>[0]): Code;
|
|
30
31
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractTypedLiteralType<Decimal>["toRdfResourceValuesExpression"]>[0]): Code;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
1
7
|
import { Maybe } from "purify-ts";
|
|
8
|
+
import { Memoize } from "typescript-memoize";
|
|
2
9
|
import { AbstractTypedLiteralType } from "./AbstractTypedLiteralType.js";
|
|
3
|
-
import {
|
|
10
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
11
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
4
12
|
import { code, literalOf } from "./ts-poet-wrapper.js";
|
|
5
13
|
export class BigDecimalType extends AbstractTypedLiteralType {
|
|
6
14
|
inlineExpression = code `${this.reusables.imports.BigDecimal}`;
|
|
7
|
-
jsonValueType = this.jsonTypeFactory.createJsonStringType();
|
|
8
15
|
jsTypes = [
|
|
9
16
|
{
|
|
10
17
|
className: code `${this.reusables.imports.BigDecimal}`,
|
|
@@ -29,18 +36,25 @@ export class BigDecimalType extends AbstractTypedLiteralType {
|
|
|
29
36
|
},
|
|
30
37
|
],
|
|
31
38
|
});
|
|
32
|
-
filterFunction = new
|
|
39
|
+
filterFunction = new BuiltinCallable(this.reusables.snippets.filterBigDecimal);
|
|
33
40
|
filterType = code `${this.reusables.snippets.NumericFilter}<${this.reusables.imports.BigDecimal}>`;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
fromRdfResourceValuesFunction = new
|
|
41
|
+
fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.bigDecimalFromJsonObject);
|
|
42
|
+
fromJsonValueFunction = new BuiltinCallable(this.reusables.snippets.bigDecimalFromJsonString);
|
|
43
|
+
fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.bigDecimalFromRdfResourceValues);
|
|
37
44
|
graphqlType = new AbstractTypedLiteralType.GraphqlType(code `${this.reusables.imports.GraphQLString}`, this.reusables);
|
|
38
|
-
hashFunction = new
|
|
45
|
+
hashFunction = new BuiltinCallable(this.reusables.snippets.hashBigDecimal);
|
|
46
|
+
jsonValueType = this.jsonTypeFactory.createJsonStringType();
|
|
39
47
|
kind = "BigDecimal";
|
|
40
|
-
|
|
41
|
-
toJsonValueFunction = new
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
toJsonObjectFunction = new BuiltinCallable(code `${this.reusables.snippets.bigDecimalToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
|
|
49
|
+
toJsonValueFunction = new BuiltinCallable(this.reusables.snippets.bigDecimalToJsonString);
|
|
50
|
+
valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.bigDecimalSparqlWherePatterns);
|
|
51
|
+
get schema() {
|
|
52
|
+
return new SchemaObject({
|
|
53
|
+
properties: super.schema.properties,
|
|
54
|
+
type: new SchemaObject.BuiltinType(code `${this.reusables.snippets.NumericSchema}<${this.reusables.imports.BigDecimal}>`),
|
|
55
|
+
variable: super.schema.variable,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
44
58
|
graphqlResolveExpression({ variables, }) {
|
|
45
59
|
return code `${variables.value}.toFixed()`;
|
|
46
60
|
}
|
|
@@ -54,4 +68,7 @@ export class BigDecimalType extends AbstractTypedLiteralType {
|
|
|
54
68
|
return code `new ${this.reusables.imports.BigDecimal}(${literalOf(literal.value)})`;
|
|
55
69
|
}
|
|
56
70
|
}
|
|
71
|
+
__decorate([
|
|
72
|
+
Memoize()
|
|
73
|
+
], BigDecimalType.prototype, "schema", null);
|
|
57
74
|
//# sourceMappingURL=BigDecimalType.js.map
|
|
@@ -8,7 +8,7 @@ import { LiteralDecoder } from "@rdfx/literal";
|
|
|
8
8
|
import { Maybe } from "purify-ts";
|
|
9
9
|
import { Memoize } from "typescript-memoize";
|
|
10
10
|
import { AbstractNumericType } from "./AbstractNumericType.js";
|
|
11
|
-
import {
|
|
11
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
12
12
|
import { code } from "./ts-poet-wrapper.js";
|
|
13
13
|
export class BigIntType extends AbstractNumericType {
|
|
14
14
|
decodedIn = this.in_.map((in_) => LiteralDecoder.decodeBigIntLiteral(in_).unsafeCoerce());
|
|
@@ -38,19 +38,19 @@ export class BigIntType extends AbstractNumericType {
|
|
|
38
38
|
});
|
|
39
39
|
kind = "BigInt";
|
|
40
40
|
get fromJsonObjectFunction() {
|
|
41
|
-
return new
|
|
41
|
+
return new BuiltinCallable(code `${this.reusables.snippets.bigIntFromJsonObject}<${this.expression}>`);
|
|
42
42
|
}
|
|
43
43
|
get fromJsonValueFunction() {
|
|
44
|
-
return new
|
|
44
|
+
return new BuiltinCallable(code `${this.reusables.snippets.bigIntFromJsonString}<${this.jsonValueType.expression}, ${this.expression}>`);
|
|
45
45
|
}
|
|
46
46
|
get fromRdfResourceValuesFunction() {
|
|
47
|
-
return new
|
|
47
|
+
return new BuiltinCallable(code `${this.reusables.snippets.bigIntFromRdfResourceValues}<${this.expression}>`);
|
|
48
48
|
}
|
|
49
49
|
get toJsonObjectFunction() {
|
|
50
|
-
return new
|
|
50
|
+
return new BuiltinCallable(code `${this.reusables.snippets.bigIntToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
|
|
51
51
|
}
|
|
52
52
|
get toJsonValueFunction() {
|
|
53
|
-
return new
|
|
53
|
+
return new BuiltinCallable(code `${this.reusables.snippets.bigIntToJsonString}`);
|
|
54
54
|
}
|
|
55
55
|
valueExpression(literal) {
|
|
56
56
|
return code `${typeof literal === "bigint" ? literal : LiteralDecoder.decodeBigIntLiteral(literal).unsafeCoerce()}n`;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import type { BlankNode } from "@rdfjs/types";
|
|
2
2
|
import { Maybe } from "purify-ts";
|
|
3
3
|
import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
|
|
4
|
-
import {
|
|
4
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
5
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
5
6
|
export declare class BlankNodeType extends AbstractIdentifierType<BlankNode> {
|
|
6
7
|
protected readonly inlineExpression: import("ts-poet/build/Code.js").Code;
|
|
7
8
|
readonly conversionFunction: Maybe<AbstractIdentifierType.ConversionFunction>;
|
|
8
|
-
readonly filterFunction:
|
|
9
|
+
readonly filterFunction: BuiltinCallable;
|
|
9
10
|
readonly filterType: import("ts-poet/build/Code.js").Code;
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly fromRdfResourceValuesFunction:
|
|
11
|
+
readonly fromJsonObjectFunction: BuiltinCallable;
|
|
12
|
+
readonly fromJsonValueFunction: BuiltinCallable;
|
|
13
|
+
readonly fromRdfResourceValuesFunction: BuiltinCallable;
|
|
13
14
|
readonly kind = "BlankNode";
|
|
14
15
|
readonly nodeKinds: ReadonlySet<"BlankNode">;
|
|
15
|
-
readonly parseFunction:
|
|
16
|
-
readonly
|
|
17
|
-
readonly toJsonValueFunction:
|
|
18
|
-
readonly
|
|
19
|
-
readonly valueSparqlWherePatternsFunction: ReferenceCallable;
|
|
16
|
+
readonly parseFunction: BuiltinCallable;
|
|
17
|
+
readonly toJsonObjectFunction: BuiltinCallable;
|
|
18
|
+
readonly toJsonValueFunction: BuiltinCallable;
|
|
19
|
+
readonly valueSparqlWherePatternsFunction: BuiltinCallable;
|
|
20
20
|
constructor(superParameters: Omit<ConstructorParameters<typeof AbstractIdentifierType<BlankNode>>[0], "hasValues" | "in_">);
|
|
21
|
+
get schema(): SchemaObject<SchemaObject.BuiltinType>;
|
|
21
22
|
}
|
|
22
23
|
//# sourceMappingURL=BlankNodeType.d.ts.map
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
1
7
|
import { Maybe } from "purify-ts";
|
|
8
|
+
import { Memoize } from "typescript-memoize";
|
|
2
9
|
import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
|
|
3
|
-
import {
|
|
10
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
11
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
4
12
|
import { code } from "./ts-poet-wrapper.js";
|
|
5
13
|
export class BlankNodeType extends AbstractIdentifierType {
|
|
6
14
|
inlineExpression = code `${this.reusables.imports.BlankNode}`;
|
|
@@ -17,18 +25,17 @@ export class BlankNodeType extends AbstractIdentifierType {
|
|
|
17
25
|
},
|
|
18
26
|
],
|
|
19
27
|
});
|
|
20
|
-
filterFunction = new
|
|
28
|
+
filterFunction = new BuiltinCallable(this.reusables.snippets.filterBlankNode);
|
|
21
29
|
filterType = code `${this.reusables.snippets.BlankNodeFilter}`;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
fromRdfResourceValuesFunction = new
|
|
30
|
+
fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.blankNodeFromJsonObject);
|
|
31
|
+
fromJsonValueFunction = new BuiltinCallable(this.reusables.snippets.blankNodeFromJsonString);
|
|
32
|
+
fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.blankNodeFromRdfResourceValues);
|
|
25
33
|
kind = "BlankNode";
|
|
26
34
|
nodeKinds = nodeKinds;
|
|
27
|
-
parseFunction = new
|
|
28
|
-
|
|
29
|
-
toJsonValueFunction = new
|
|
30
|
-
|
|
31
|
-
valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.blankNodeSparqlWherePatterns);
|
|
35
|
+
parseFunction = new BuiltinCallable(this.reusables.snippets.parseBlankNode);
|
|
36
|
+
toJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.blankNodeToJsonObject);
|
|
37
|
+
toJsonValueFunction = new BuiltinCallable(this.reusables.snippets.blankNodeToJsonString);
|
|
38
|
+
valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.blankNodeSparqlWherePatterns);
|
|
32
39
|
constructor(superParameters) {
|
|
33
40
|
super({
|
|
34
41
|
...superParameters,
|
|
@@ -36,6 +43,16 @@ export class BlankNodeType extends AbstractIdentifierType {
|
|
|
36
43
|
in_: [],
|
|
37
44
|
});
|
|
38
45
|
}
|
|
46
|
+
get schema() {
|
|
47
|
+
return new SchemaObject({
|
|
48
|
+
properties: super.schema.properties,
|
|
49
|
+
type: new SchemaObject.BuiltinType(this.reusables.snippets.BlankNodeSchema),
|
|
50
|
+
variable: super.schema.variable,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
39
53
|
}
|
|
54
|
+
__decorate([
|
|
55
|
+
Memoize()
|
|
56
|
+
], BlankNodeType.prototype, "schema", null);
|
|
40
57
|
const nodeKinds = new Set(["BlankNode"]);
|
|
41
58
|
//# sourceMappingURL=BlankNodeType.js.map
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import type { Literal } from "@rdfjs/types";
|
|
2
2
|
import { Maybe } from "purify-ts";
|
|
3
3
|
import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
|
|
4
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
4
5
|
import type { Callable } from "./Callable.js";
|
|
5
|
-
import {
|
|
6
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
6
7
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
7
8
|
export declare class BooleanType extends AbstractPrimitiveType<boolean> {
|
|
8
9
|
protected readonly decodedIn: boolean[];
|
|
9
10
|
readonly conversionFunction: Maybe<AbstractPrimitiveType.ConversionFunction>;
|
|
10
|
-
readonly filterFunction:
|
|
11
|
+
readonly filterFunction: BuiltinCallable;
|
|
11
12
|
readonly filterType: Code;
|
|
12
13
|
readonly graphqlType: import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
|
|
13
|
-
readonly hashFunction:
|
|
14
|
+
readonly hashFunction: BuiltinCallable;
|
|
14
15
|
readonly jsTypes: readonly [{
|
|
15
16
|
readonly typeof: "boolean";
|
|
16
17
|
}];
|
|
17
18
|
readonly jsonValueType: AbstractPrimitiveType.JsonType;
|
|
18
19
|
readonly kind = "Boolean";
|
|
19
|
-
readonly
|
|
20
|
-
readonly valueSparqlWherePatternsFunction: ReferenceCallable;
|
|
20
|
+
readonly valueSparqlWherePatternsFunction: BuiltinCallable;
|
|
21
21
|
get fromJsonObjectFunction(): Callable;
|
|
22
22
|
get fromJsonValueFunction(): Callable;
|
|
23
23
|
get fromRdfResourceValuesFunction(): Callable;
|
|
24
|
+
get schema(): SchemaObject<SchemaObject.BuiltinType>;
|
|
24
25
|
toRdfResourceValuesExpression({ variables, }: Parameters<AbstractPrimitiveType<boolean>["toRdfResourceValuesExpression"]>[0]): Code;
|
|
25
26
|
valueExpression(literal: boolean | Literal): Code;
|
|
26
27
|
}
|
|
@@ -8,28 +8,35 @@ import { LiteralDecoder } from "@rdfx/literal";
|
|
|
8
8
|
import { Maybe } from "purify-ts";
|
|
9
9
|
import { Memoize } from "typescript-memoize";
|
|
10
10
|
import { AbstractPrimitiveType } from "./AbstractPrimitiveType.js";
|
|
11
|
-
import {
|
|
11
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
12
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
12
13
|
import { code } from "./ts-poet-wrapper.js";
|
|
13
14
|
export class BooleanType extends AbstractPrimitiveType {
|
|
14
15
|
decodedIn = this.in_.map((in_) => LiteralDecoder.decodeBooleanLiteral(in_).unsafeCoerce());
|
|
15
16
|
conversionFunction = Maybe.empty();
|
|
16
|
-
filterFunction = new
|
|
17
|
+
filterFunction = new BuiltinCallable(this.reusables.snippets.filterBoolean);
|
|
17
18
|
filterType = code `${this.reusables.snippets.BooleanFilter}`;
|
|
18
19
|
graphqlType = new AbstractPrimitiveType.GraphqlType(code `${this.reusables.imports.GraphQLBoolean}`, this.reusables);
|
|
19
|
-
hashFunction = new
|
|
20
|
+
hashFunction = new BuiltinCallable(this.reusables.snippets.hashBoolean);
|
|
20
21
|
jsTypes = [{ typeof: "boolean" }];
|
|
21
22
|
jsonValueType = this.jsonTypeFactory.createJsonBooleanType({ in_: this.decodedIn });
|
|
22
23
|
kind = "Boolean";
|
|
23
|
-
|
|
24
|
-
valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.booleanSparqlWherePatterns);
|
|
24
|
+
valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.booleanSparqlWherePatterns);
|
|
25
25
|
get fromJsonObjectFunction() {
|
|
26
|
-
return new
|
|
26
|
+
return new BuiltinCallable(code `${this.reusables.snippets.booleanFromJsonObject}<${this.expression}>`);
|
|
27
27
|
}
|
|
28
28
|
get fromJsonValueFunction() {
|
|
29
|
-
return new
|
|
29
|
+
return new BuiltinCallable(code `${this.reusables.snippets.booleanFromJsonBoolean}<${this.expression}>`);
|
|
30
30
|
}
|
|
31
31
|
get fromRdfResourceValuesFunction() {
|
|
32
|
-
return new
|
|
32
|
+
return new BuiltinCallable(code `${this.reusables.snippets.booleanFromRdfResourceValues}<${this.expression}>`);
|
|
33
|
+
}
|
|
34
|
+
get schema() {
|
|
35
|
+
return new SchemaObject({
|
|
36
|
+
properties: super.schema.properties,
|
|
37
|
+
type: new SchemaObject.BuiltinType(code `${this.reusables.snippets.BooleanSchema}<${this.expression}>`),
|
|
38
|
+
variable: super.schema.variable,
|
|
39
|
+
});
|
|
33
40
|
}
|
|
34
41
|
toRdfResourceValuesExpression({ variables, }) {
|
|
35
42
|
return code `[${this.reusables.snippets.literalFactory}.boolean(${variables.value}, ${this.rdfjsTermExpression(this.datatype)})]`;
|
|
@@ -47,4 +54,7 @@ __decorate([
|
|
|
47
54
|
__decorate([
|
|
48
55
|
Memoize()
|
|
49
56
|
], BooleanType.prototype, "fromRdfResourceValuesFunction", null);
|
|
57
|
+
__decorate([
|
|
58
|
+
Memoize()
|
|
59
|
+
], BooleanType.prototype, "schema", null);
|
|
50
60
|
//# sourceMappingURL=BooleanType.js.map
|
|
@@ -2,13 +2,13 @@ import { AbstractCallable } from "./AbstractCallable.js";
|
|
|
2
2
|
import type { Snippet } from "./Snippet.js";
|
|
3
3
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
4
4
|
/**
|
|
5
|
-
* A callable that's a reference to a snippet, an import, or a global function.
|
|
5
|
+
* A callable that's a reference to a built-in snippet, an import, or a global function.
|
|
6
6
|
*
|
|
7
7
|
* Callers assume the referent carries its own type annotations, so there's no distinction between annotated and unannotated usage.
|
|
8
8
|
*/
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class BuiltinCallable extends AbstractCallable {
|
|
10
10
|
readonly annotatedUsage: Code;
|
|
11
11
|
readonly unannotatedUsage: Code;
|
|
12
12
|
constructor(reference: Code | Snippet);
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=BuiltinCallable.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AbstractCallable } from "./AbstractCallable.js";
|
|
2
2
|
import { code } from "./ts-poet-wrapper.js";
|
|
3
3
|
/**
|
|
4
|
-
* A callable that's a reference to a snippet, an import, or a global function.
|
|
4
|
+
* A callable that's a reference to a built-in snippet, an import, or a global function.
|
|
5
5
|
*
|
|
6
6
|
* Callers assume the referent carries its own type annotations, so there's no distinction between annotated and unannotated usage.
|
|
7
7
|
*/
|
|
8
|
-
export class
|
|
8
|
+
export class BuiltinCallable extends AbstractCallable {
|
|
9
9
|
annotatedUsage;
|
|
10
10
|
unannotatedUsage;
|
|
11
11
|
constructor(reference) {
|
|
@@ -13,4 +13,4 @@ export class ReferenceCallable extends AbstractCallable {
|
|
|
13
13
|
this.annotatedUsage = this.unannotatedUsage = code `${reference}`;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
//# sourceMappingURL=
|
|
16
|
+
//# sourceMappingURL=BuiltinCallable.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { BuiltinCallable } from "./BuiltinCallable.js";
|
|
1
2
|
import type { DeclaredCallable } from "./DeclaredCallable.js";
|
|
2
3
|
import type { InlineCallable } from "./InlineCallable.js";
|
|
3
|
-
|
|
4
|
-
export type Callable = InlineCallable | DeclaredCallable | ReferenceCallable;
|
|
4
|
+
export type Callable = InlineCallable | DeclaredCallable | BuiltinCallable;
|
|
5
5
|
//# sourceMappingURL=Callable.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { Literal } from "@rdfjs/types";
|
|
2
2
|
import { AbstractDateType } from "./AbstractDateType.js";
|
|
3
|
-
import {
|
|
3
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
4
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export declare class DateTimeType extends AbstractDateType {
|
|
6
|
-
readonly fromJsonObjectFunction:
|
|
7
|
-
readonly fromRdfResourceValuesFunction:
|
|
6
|
+
readonly fromJsonObjectFunction: BuiltinCallable;
|
|
7
|
+
readonly fromRdfResourceValuesFunction: BuiltinCallable;
|
|
8
8
|
readonly graphqlType: import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
|
|
9
9
|
protected readonly jsonStringFormat = "datetime";
|
|
10
|
-
readonly hashFunction:
|
|
10
|
+
readonly hashFunction: BuiltinCallable;
|
|
11
11
|
readonly kind = "DateTime";
|
|
12
|
-
readonly toJsonValueFunction:
|
|
13
|
-
readonly toJsonObjectFunction:
|
|
12
|
+
readonly toJsonValueFunction: BuiltinCallable;
|
|
13
|
+
readonly toJsonObjectFunction: BuiltinCallable;
|
|
14
14
|
valueExpression(literal: Date | Literal): Code;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=DateTimeType.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { LiteralDecoder } from "@rdfx/literal";
|
|
2
2
|
import { AbstractDateType } from "./AbstractDateType.js";
|
|
3
|
-
import {
|
|
3
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
4
4
|
import { code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export class DateTimeType extends AbstractDateType {
|
|
6
|
-
fromJsonObjectFunction = new
|
|
7
|
-
fromRdfResourceValuesFunction = new
|
|
6
|
+
fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.dateTimeFromJsonObject);
|
|
7
|
+
fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.dateTimeFromRdfResourceValues);
|
|
8
8
|
graphqlType = new DateTimeType.GraphqlType(code `${this.reusables.imports.GraphQLDateTime}`, this.reusables);
|
|
9
9
|
jsonStringFormat = "datetime";
|
|
10
|
-
hashFunction = new
|
|
10
|
+
hashFunction = new BuiltinCallable(this.reusables.snippets.hashDateTime);
|
|
11
11
|
kind = "DateTime";
|
|
12
|
-
toJsonValueFunction = new
|
|
13
|
-
toJsonObjectFunction = new
|
|
12
|
+
toJsonValueFunction = new BuiltinCallable(this.reusables.snippets.dateTimeToJsonString);
|
|
13
|
+
toJsonObjectFunction = new BuiltinCallable(code `${this.reusables.snippets.dateToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
|
|
14
14
|
valueExpression(literal) {
|
|
15
15
|
return code `new Date("${(literal instanceof Date ? literal : LiteralDecoder.decodeDateTimeLiteral(literal).unsafeCoerce()).toISOString()}")`;
|
|
16
16
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { Literal } from "@rdfjs/types";
|
|
2
2
|
import { AbstractDateType } from "./AbstractDateType.js";
|
|
3
|
-
import {
|
|
3
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
4
4
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
5
5
|
export declare class DateType extends AbstractDateType {
|
|
6
|
-
readonly fromJsonObjectFunction:
|
|
7
|
-
readonly fromRdfResourceValuesFunction:
|
|
6
|
+
readonly fromJsonObjectFunction: BuiltinCallable;
|
|
7
|
+
readonly fromRdfResourceValuesFunction: BuiltinCallable;
|
|
8
8
|
readonly graphqlType: import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
|
|
9
|
-
readonly hashFunction:
|
|
9
|
+
readonly hashFunction: BuiltinCallable;
|
|
10
10
|
readonly kind = "Date";
|
|
11
11
|
protected readonly jsonStringFormat = "date";
|
|
12
|
-
readonly toJsonValueFunction:
|
|
13
|
-
readonly toJsonObjectFunction:
|
|
12
|
+
readonly toJsonValueFunction: BuiltinCallable;
|
|
13
|
+
readonly toJsonObjectFunction: BuiltinCallable;
|
|
14
14
|
valueExpression(literal: Date | Literal): Code;
|
|
15
15
|
}
|
|
16
16
|
//# sourceMappingURL=DateType.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { LiteralDecoder } from "@rdfx/literal";
|
|
2
2
|
import { AbstractDateType } from "./AbstractDateType.js";
|
|
3
|
+
import { BuiltinCallable } from "./BuiltinCallable.js";
|
|
3
4
|
import { DateTimeType } from "./DateTimeType.js";
|
|
4
|
-
import { ReferenceCallable } from "./ReferenceCallable.js";
|
|
5
5
|
import { code } from "./ts-poet-wrapper.js";
|
|
6
6
|
export class DateType extends AbstractDateType {
|
|
7
|
-
fromJsonObjectFunction = new
|
|
8
|
-
fromRdfResourceValuesFunction = new
|
|
7
|
+
fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.dateFromJsonObject);
|
|
8
|
+
fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.dateFromRdfResourceValues);
|
|
9
9
|
graphqlType = new DateTimeType.GraphqlType(code `${this.reusables.imports.GraphQLDate}`, this.reusables);
|
|
10
|
-
hashFunction = new
|
|
10
|
+
hashFunction = new BuiltinCallable(this.reusables.snippets.hashDate);
|
|
11
11
|
kind = "Date";
|
|
12
12
|
jsonStringFormat = "date";
|
|
13
|
-
toJsonValueFunction = new
|
|
14
|
-
toJsonObjectFunction = new
|
|
13
|
+
toJsonValueFunction = new BuiltinCallable(this.reusables.snippets.dateToJsonString);
|
|
14
|
+
toJsonObjectFunction = new BuiltinCallable(code `${this.reusables.snippets.dateToJsonObject}(${this.rdfjsTermExpression(this.datatype)})`);
|
|
15
15
|
valueExpression(literal) {
|
|
16
16
|
return code `new Date("${(literal instanceof Date ? literal : LiteralDecoder.decodeDateLiteral(literal).unsafeCoerce()).toISOString()}")`;
|
|
17
17
|
}
|
|
@@ -3,6 +3,7 @@ import { Maybe } from "purify-ts";
|
|
|
3
3
|
import { AbstractContainerType } from "./AbstractContainerType.js";
|
|
4
4
|
import type { BlankNodeType } from "./BlankNodeType.js";
|
|
5
5
|
import { InlineCallable } from "./InlineCallable.js";
|
|
6
|
+
import { SchemaObject } from "./SchemaObject.js";
|
|
6
7
|
import type { Type } from "./Type.js";
|
|
7
8
|
import { type Code } from "./ts-poet-wrapper.js";
|
|
8
9
|
export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemType> extends AbstractContainerType<ItemTypeT> {
|
|
@@ -10,7 +11,6 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
10
11
|
readonly equalsFunction: import("./Callable.js").Callable;
|
|
11
12
|
readonly filterFunction: import("./Callable.js").Callable;
|
|
12
13
|
readonly filterType: Code;
|
|
13
|
-
readonly schemaType: Code;
|
|
14
14
|
readonly fromRdfResourceValuesFunction: InlineCallable;
|
|
15
15
|
readonly graphqlArgs: AbstractContainerType<ItemTypeT>["graphqlArgs"];
|
|
16
16
|
readonly graphqlType: import("./_AbstractType/AbstractType_GraphqlType.js").AbstractType_GraphqlType;
|
|
@@ -74,7 +74,7 @@ export declare class DefaultValueType<ItemTypeT extends DefaultValueType.ItemTyp
|
|
|
74
74
|
get conversionFunction(): Maybe<AbstractContainerType.ConversionFunction>;
|
|
75
75
|
get fromJsonObjectFunction(): AbstractContainerType<ItemTypeT>["fromJsonObjectFunction"];
|
|
76
76
|
get fromJsonValueFunction(): AbstractContainerType<ItemTypeT>["fromJsonValueFunction"];
|
|
77
|
-
|
|
77
|
+
get schema(): SchemaObject<SchemaObject.BuiltinType>;
|
|
78
78
|
private get defaultValueExpression();
|
|
79
79
|
graphqlResolveExpression(parameters: Parameters<AbstractContainerType<ItemTypeT>["graphqlResolveExpression"]>[0]): Code;
|
|
80
80
|
toLoggableExpression(parameters: Parameters<AbstractContainerType<ItemTypeT>["toLoggableExpression"]>[0]): Code;
|