@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.
Files changed (96) hide show
  1. package/dist/generators/ts/AbstractBuiltinType.d.ts +23 -0
  2. package/dist/generators/ts/AbstractBuiltinType.js +18 -0
  3. package/dist/generators/ts/AbstractCollectionType.d.ts +2 -1
  4. package/dist/generators/ts/AbstractCollectionType.js +10 -5
  5. package/dist/generators/ts/AbstractCompoundType.d.ts +11 -8
  6. package/dist/generators/ts/AbstractCompoundType.js +5 -2
  7. package/dist/generators/ts/AbstractContainerType.d.ts +11 -11
  8. package/dist/generators/ts/AbstractContainerType.js +21 -15
  9. package/dist/generators/ts/AbstractDateType.d.ts +7 -6
  10. package/dist/generators/ts/AbstractDateType.js +16 -6
  11. package/dist/generators/ts/AbstractDiscriminatedUnionType.d.ts +2 -3
  12. package/dist/generators/ts/AbstractDiscriminatedUnionType.js +25 -7
  13. package/dist/generators/ts/AbstractIntersectionType.d.ts +2 -2
  14. package/dist/generators/ts/AbstractIntersectionType.js +19 -8
  15. package/dist/generators/ts/AbstractLazyType.d.ts +23 -23
  16. package/dist/generators/ts/AbstractLazyType.js +21 -19
  17. package/dist/generators/ts/AbstractNumericType.d.ts +4 -3
  18. package/dist/generators/ts/AbstractNumericType.js +12 -7
  19. package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -2
  20. package/dist/generators/ts/AbstractPrimitiveType.js +4 -4
  21. package/dist/generators/ts/AbstractTermType.d.ts +17 -16
  22. package/dist/generators/ts/AbstractTermType.js +21 -11
  23. package/dist/generators/ts/AbstractType.d.ts +6 -15
  24. package/dist/generators/ts/AbstractType.js +14 -33
  25. package/dist/generators/ts/AbstractTypedLiteralType.d.ts +2 -1
  26. package/dist/generators/ts/AbstractTypedLiteralType.js +20 -2
  27. package/dist/generators/ts/{AbstractStructuredType.d.ts → AbstractUserDefinedType.d.ts} +6 -6
  28. package/dist/generators/ts/{AbstractStructuredType.js → AbstractUserDefinedType.js} +38 -26
  29. package/dist/generators/ts/BigDecimalType.d.ts +12 -11
  30. package/dist/generators/ts/BigDecimalType.js +28 -11
  31. package/dist/generators/ts/BigIntType.js +6 -6
  32. package/dist/generators/ts/BlankNodeType.d.ts +11 -10
  33. package/dist/generators/ts/BlankNodeType.js +27 -10
  34. package/dist/generators/ts/BooleanType.d.ts +6 -5
  35. package/dist/generators/ts/BooleanType.js +18 -8
  36. package/dist/generators/ts/{ReferenceCallable.d.ts → BuiltinCallable.d.ts} +3 -3
  37. package/dist/generators/ts/{ReferenceCallable.js → BuiltinCallable.js} +3 -3
  38. package/dist/generators/ts/Callable.d.ts +2 -2
  39. package/dist/generators/ts/DateTimeType.d.ts +6 -6
  40. package/dist/generators/ts/DateTimeType.js +6 -6
  41. package/dist/generators/ts/DateType.d.ts +6 -6
  42. package/dist/generators/ts/DateType.js +6 -6
  43. package/dist/generators/ts/DefaultValueType.d.ts +2 -2
  44. package/dist/generators/ts/DefaultValueType.js +18 -8
  45. package/dist/generators/ts/FloatType.js +4 -4
  46. package/dist/generators/ts/IdentifierType.d.ts +11 -10
  47. package/dist/generators/ts/IdentifierType.js +27 -10
  48. package/dist/generators/ts/IntType.js +4 -4
  49. package/dist/generators/ts/IriType.d.ts +5 -5
  50. package/dist/generators/ts/IriType.js +27 -22
  51. package/dist/generators/ts/LangStringType.d.ts +10 -10
  52. package/dist/generators/ts/LangStringType.js +21 -13
  53. package/dist/generators/ts/ListType.js +7 -7
  54. package/dist/generators/ts/LiteralType.d.ts +10 -10
  55. package/dist/generators/ts/LiteralType.js +21 -13
  56. package/dist/generators/ts/ObjectType.d.ts +13 -15
  57. package/dist/generators/ts/ObjectType.js +32 -9
  58. package/dist/generators/ts/OptionType.d.ts +2 -1
  59. package/dist/generators/ts/OptionType.js +16 -11
  60. package/dist/generators/ts/SchemaObject.d.ts +98 -0
  61. package/dist/generators/ts/SchemaObject.js +143 -0
  62. package/dist/generators/ts/SetType.d.ts +2 -1
  63. package/dist/generators/ts/SetType.js +22 -10
  64. package/dist/generators/ts/Snippets.d.ts +1 -0
  65. package/dist/generators/ts/Snippets.js +7 -0
  66. package/dist/generators/ts/StringType.d.ts +6 -6
  67. package/dist/generators/ts/StringType.js +20 -17
  68. package/dist/generators/ts/TermType.d.ts +7 -7
  69. package/dist/generators/ts/TermType.js +18 -13
  70. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_fromJsonObjectFunction.js +1 -1
  71. package/dist/generators/ts/_AbstractType/AbstractType_JsonType.d.ts +39 -16
  72. package/dist/generators/ts/_AbstractType/AbstractType_JsonType.js +49 -33
  73. package/dist/generators/ts/_ObjectDiscriminatedUnionType/ObjectDiscriminatedUnionType_focusSparqlWherePatternsFunction.js +1 -1
  74. package/dist/generators/ts/_ObjectIntersectionType/ObjectIntersectionType_fromRdfResourceValuesFunction.js +1 -1
  75. package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.d.ts +4 -7
  76. package/dist/generators/ts/_ObjectType/ObjectType_AbstractProperty.js +1 -3
  77. package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.d.ts +0 -1
  78. package/dist/generators/ts/_ObjectType/ObjectType_DiscriminantProperty.js +0 -1
  79. package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.d.ts +3 -2
  80. package/dist/generators/ts/_ObjectType/ObjectType_IdentifierProperty.js +30 -10
  81. package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.d.ts +3 -2
  82. package/dist/generators/ts/_ObjectType/ObjectType_RdfTypeProperty.js +26 -10
  83. package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.d.ts +3 -2
  84. package/dist/generators/ts/_ObjectType/ObjectType_ShaclProperty.js +46 -22
  85. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunction.js +1 -1
  86. package/dist/generators/ts/_ObjectType/ObjectType_jsonObjectType.d.ts +4 -0
  87. package/dist/generators/ts/_ObjectType/ObjectType_jsonObjectType.js +26 -0
  88. package/dist/generators/ts/_snippets/snippets_LazySchema.d.ts +3 -0
  89. package/dist/generators/ts/_snippets/snippets_LazySchema.js +7 -0
  90. package/package.json +14 -12
  91. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.d.ts +0 -5
  92. package/dist/generators/ts/_AbstractDiscriminatedUnionType/AbstractDiscriminatedUnionType_schemaTypeExpression.js +0 -11
  93. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +0 -4
  94. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +0 -15
  95. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +0 -4
  96. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +0 -15
@@ -8,16 +8,16 @@ import { Maybe } from "purify-ts";
8
8
  import { invariant } from "ts-invariant";
9
9
  import { Memoize } from "typescript-memoize";
10
10
  import { AbstractContainerType } from "./AbstractContainerType.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
12
  import { InlineCallable } from "./InlineCallable.js";
12
- import { ReferenceCallable } from "./ReferenceCallable.js";
13
+ import { SchemaObject } from "./SchemaObject.js";
13
14
  import { code } from "./ts-poet-wrapper.js";
14
15
  export class DefaultValueType extends AbstractContainerType {
15
16
  defaultValue;
16
17
  equalsFunction = this.itemType.equalsFunction;
17
18
  filterFunction = this.itemType.filterFunction;
18
19
  filterType = this.itemType.filterType;
19
- schemaType = code `${this.reusables.snippets.DefaultValueSchema}<${this.itemType.schemaType}>`;
20
- fromRdfResourceValuesFunction = new InlineCallable(code `${this.reusables.snippets.defaultValueFromRdfResourceValues}<${this.itemType.expression}, ${this.itemType.schemaType}>(${this.itemType.fromRdfResourceValuesFunction.unannotatedUsage})`);
20
+ fromRdfResourceValuesFunction = new InlineCallable(code `${this.reusables.snippets.defaultValueFromRdfResourceValues}<${this.itemType.expression}, ${this.itemType.schema.type.expression}>(${this.itemType.fromRdfResourceValuesFunction.unannotatedUsage})`);
21
21
  graphqlArgs = Maybe.empty();
22
22
  graphqlType = this.itemType.graphqlType;
23
23
  hashFunction = this.itemType.hashFunction;
@@ -32,7 +32,7 @@ export class DefaultValueType extends AbstractContainerType {
32
32
  toRdfResourceValueTypes = this.itemType.toRdfResourceValueTypes;
33
33
  validationFunction = this.itemType.validationFunction;
34
34
  valueSparqlConstructTriplesFunction = this.itemType.valueSparqlConstructTriplesFunction;
35
- valueSparqlWherePatternsFunction = new InlineCallable(code `${this.reusables.snippets.defaultValueSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlWherePatternsFunction.unannotatedUsage})`);
35
+ valueSparqlWherePatternsFunction = new InlineCallable(code `${this.reusables.snippets.defaultValueSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schema.type.expression}>(${this.itemType.valueSparqlWherePatternsFunction.unannotatedUsage})`);
36
36
  constructor({ defaultValue, ...superParameters }) {
37
37
  super(superParameters);
38
38
  this.defaultValue = defaultValue;
@@ -50,13 +50,20 @@ export class DefaultValueType extends AbstractContainerType {
50
50
  });
51
51
  }
52
52
  get fromJsonObjectFunction() {
53
- return new ReferenceCallable(code `${this.reusables.snippets.defaultValueFromJsonObject}(${this.itemType.fromJsonObjectFunction.annotatedUsage})`);
53
+ return new BuiltinCallable(code `${this.reusables.snippets.defaultValueFromJsonObject}(${this.itemType.fromJsonObjectFunction.annotatedUsage})`);
54
54
  }
55
55
  get fromJsonValueFunction() {
56
- return new ReferenceCallable(code `${this.reusables.snippets.defaultValueFromJsonValue}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
56
+ return new BuiltinCallable(code `${this.reusables.snippets.defaultValueFromJsonValue}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
57
57
  }
58
- get schemaInitializers() {
59
- return super.schemaInitializers.concat(code `defaultValue: ${this.rdfjsTermExpression(this.defaultValue)}`);
58
+ get schema() {
59
+ return new SchemaObject({
60
+ properties: {
61
+ ...super.schema.properties,
62
+ defaultValue: code `defaultValue: ${this.rdfjsTermExpression(this.defaultValue)}`,
63
+ },
64
+ type: new SchemaObject.BuiltinType(code `${this.reusables.snippets.DefaultValueSchema}<${this.itemType.schema.type.expression}>`),
65
+ variable: super.schema.variable,
66
+ });
60
67
  }
61
68
  get defaultValueExpression() {
62
69
  switch (this.itemType.kind) {
@@ -98,6 +105,9 @@ __decorate([
98
105
  __decorate([
99
106
  Memoize()
100
107
  ], DefaultValueType.prototype, "fromJsonValueFunction", null);
108
+ __decorate([
109
+ Memoize()
110
+ ], DefaultValueType.prototype, "schema", null);
101
111
  __decorate([
102
112
  Memoize()
103
113
  ], DefaultValueType.prototype, "defaultValueExpression", null);
@@ -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 { ReferenceCallable } from "./ReferenceCallable.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
12
12
  import { code } from "./ts-poet-wrapper.js";
13
13
  export class FloatType extends AbstractNumericType {
14
14
  decodedIn = this.in_.map((in_) => LiteralDecoder.decodeFloatLiteral(in_).unsafeCoerce());
@@ -18,13 +18,13 @@ export class FloatType extends AbstractNumericType {
18
18
  jsonValueType = this.jsonTypeFactory.createJsonNumberType({ in_: this.decodedIn });
19
19
  kind = "Float";
20
20
  get fromJsonObjectFunction() {
21
- return new ReferenceCallable(code `${this.reusables.snippets.floatFromJsonObject}<${this.expression}>`);
21
+ return new BuiltinCallable(code `${this.reusables.snippets.floatFromJsonObject}<${this.expression}>`);
22
22
  }
23
23
  get fromJsonValueFunction() {
24
- return new ReferenceCallable(code `${this.reusables.snippets.floatFromJsonNumber}<${this.expression}>`);
24
+ return new BuiltinCallable(code `${this.reusables.snippets.floatFromJsonNumber}<${this.expression}>`);
25
25
  }
26
26
  get fromRdfResourceValuesFunction() {
27
- return new ReferenceCallable(code `${this.reusables.snippets.floatFromRdfResourceValues}<${this.expression}>`);
27
+ return new BuiltinCallable(code `${this.reusables.snippets.floatFromRdfResourceValues}<${this.expression}>`);
28
28
  }
29
29
  valueExpression(literal) {
30
30
  return code `${typeof literal === "number" ? literal : LiteralDecoder.decodeFloatLiteral(literal).unsafeCoerce()}`;
@@ -2,22 +2,23 @@ import type { BlankNode, NamedNode } from "@rdfjs/types";
2
2
  import type { IdentifierNodeKind } from "@shaclmate/shacl-ast";
3
3
  import { Maybe } from "purify-ts";
4
4
  import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
5
- import { ReferenceCallable } from "./ReferenceCallable.js";
5
+ import { BuiltinCallable } from "./BuiltinCallable.js";
6
+ import { SchemaObject } from "./SchemaObject.js";
6
7
  export declare class IdentifierType extends AbstractIdentifierType<BlankNode | NamedNode> {
7
8
  protected readonly inlineExpression: import("ts-poet/build/Code.js").Code;
8
9
  readonly conversionFunction: Maybe<AbstractIdentifierType.ConversionFunction>;
9
- readonly filterFunction: ReferenceCallable;
10
- readonly fromJsonValueFunction: ReferenceCallable;
11
- readonly fromJsonObjectFunction: ReferenceCallable;
10
+ readonly filterFunction: BuiltinCallable;
11
+ readonly fromJsonValueFunction: BuiltinCallable;
12
+ readonly fromJsonObjectFunction: BuiltinCallable;
12
13
  readonly filterType: import("ts-poet/build/Code.js").Code;
13
- readonly fromRdfResourceValuesFunction: ReferenceCallable;
14
+ readonly fromRdfResourceValuesFunction: BuiltinCallable;
14
15
  readonly kind = "Identifier";
15
16
  readonly nodeKinds: ReadonlySet<IdentifierNodeKind>;
16
- readonly parseFunction: ReferenceCallable;
17
- readonly schemaType: import("ts-poet/build/Code.js").Code;
18
- readonly toJsonValueFunction: ReferenceCallable;
19
- readonly toJsonObjectFunction: ReferenceCallable;
20
- readonly valueSparqlWherePatternsFunction: ReferenceCallable;
17
+ readonly parseFunction: BuiltinCallable;
18
+ readonly toJsonValueFunction: BuiltinCallable;
19
+ readonly toJsonObjectFunction: BuiltinCallable;
20
+ readonly valueSparqlWherePatternsFunction: BuiltinCallable;
21
21
  constructor(parameters: Omit<ConstructorParameters<typeof AbstractIdentifierType<BlankNode | NamedNode>>[0], "hasValues" | "in_">);
22
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
22
23
  }
23
24
  //# sourceMappingURL=IdentifierType.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 { ReferenceCallable } from "./ReferenceCallable.js";
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 IdentifierType extends AbstractIdentifierType {
6
14
  inlineExpression = code `(${this.reusables.imports.BlankNode} | ${this.reusables.imports.NamedNode})`;
@@ -27,18 +35,17 @@ export class IdentifierType extends AbstractIdentifierType {
27
35
  },
28
36
  ],
29
37
  });
30
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterIdentifier);
31
- fromJsonValueFunction = new ReferenceCallable(this.reusables.snippets.identifierFromJsonString);
32
- fromJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.identifierFromJsonObject);
38
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterIdentifier);
39
+ fromJsonValueFunction = new BuiltinCallable(this.reusables.snippets.identifierFromJsonString);
40
+ fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.identifierFromJsonObject);
33
41
  filterType = code `${this.reusables.snippets.IdentifierFilter}`;
34
- fromRdfResourceValuesFunction = new ReferenceCallable(this.reusables.snippets.identifierFromRdfResourceValues);
42
+ fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.identifierFromRdfResourceValues);
35
43
  kind = "Identifier";
36
44
  nodeKinds = nodeKinds;
37
- parseFunction = new ReferenceCallable(this.reusables.snippets.parseIdentifier);
38
- schemaType = code `${this.reusables.snippets.IdentifierSchema}`;
39
- toJsonValueFunction = new ReferenceCallable(this.reusables.snippets.identifierToJsonString);
40
- toJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.identifierToJsonObject);
41
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.identifierSparqlWherePatterns);
45
+ parseFunction = new BuiltinCallable(this.reusables.snippets.parseIdentifier);
46
+ toJsonValueFunction = new BuiltinCallable(this.reusables.snippets.identifierToJsonString);
47
+ toJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.identifierToJsonObject);
48
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.identifierSparqlWherePatterns);
42
49
  constructor(parameters) {
43
50
  super({
44
51
  ...parameters,
@@ -46,7 +53,17 @@ export class IdentifierType extends AbstractIdentifierType {
46
53
  in_: [],
47
54
  });
48
55
  }
56
+ get schema() {
57
+ return new SchemaObject({
58
+ properties: super.schema.properties,
59
+ type: new SchemaObject.BuiltinType(this.reusables.snippets.IdentifierSchema),
60
+ variable: super.schema.variable,
61
+ });
62
+ }
49
63
  }
64
+ __decorate([
65
+ Memoize()
66
+ ], IdentifierType.prototype, "schema", null);
50
67
  const nodeKinds = new Set([
51
68
  "BlankNode",
52
69
  "IRI",
@@ -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 { ReferenceCallable } from "./ReferenceCallable.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
12
12
  import { code } from "./ts-poet-wrapper.js";
13
13
  export class IntType extends AbstractNumericType {
14
14
  decodedIn = this.in_.map((in_) => LiteralDecoder.decodeFloatLiteral(in_).unsafeCoerce());
@@ -17,13 +17,13 @@ export class IntType extends AbstractNumericType {
17
17
  jsonValueType = this.jsonTypeFactory.createJsonNumberType({ in_: this.decodedIn });
18
18
  kind = "Int";
19
19
  get fromJsonObjectFunction() {
20
- return new ReferenceCallable(code `${this.reusables.snippets.intFromJsonObject}<${this.expression}>`);
20
+ return new BuiltinCallable(code `${this.reusables.snippets.intFromJsonObject}<${this.expression}>`);
21
21
  }
22
22
  get fromJsonValueFunction() {
23
- return new ReferenceCallable(code `${this.reusables.snippets.intFromJsonNumber}<${this.expression}>`);
23
+ return new BuiltinCallable(code `${this.reusables.snippets.intFromJsonNumber}<${this.expression}>`);
24
24
  }
25
25
  get fromRdfResourceValuesFunction() {
26
- return new ReferenceCallable(code `${this.reusables.snippets.intFromRdfResourceValues}<${this.expression}>`);
26
+ return new BuiltinCallable(code `${this.reusables.snippets.intFromRdfResourceValues}<${this.expression}>`);
27
27
  }
28
28
  get graphqlType() {
29
29
  return new AbstractNumericType.GraphqlType(code `${this.reusables.imports.GraphQLInt}`, this.reusables);
@@ -1,16 +1,16 @@
1
1
  import type { NamedNode } from "@rdfjs/types";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
4
+ import { BuiltinCallable } from "./BuiltinCallable.js";
4
5
  import type { Callable } from "./Callable.js";
5
- import { ReferenceCallable } from "./ReferenceCallable.js";
6
+ import { SchemaObject } from "./SchemaObject.js";
6
7
  import { type Code } from "./ts-poet-wrapper.js";
7
8
  export declare class IriType extends AbstractIdentifierType<NamedNode> {
8
- readonly filterFunction: ReferenceCallable;
9
+ readonly filterFunction: BuiltinCallable;
9
10
  readonly filterType: Code;
10
11
  readonly kind = "Iri";
11
12
  readonly nodeKinds: ReadonlySet<"IRI">;
12
- readonly schemaType: Code;
13
- readonly valueSparqlWherePatternsFunction: ReferenceCallable;
13
+ readonly valueSparqlWherePatternsFunction: BuiltinCallable;
14
14
  get fromJsonValueFunction(): AbstractIdentifierType<NamedNode>["fromJsonValueFunction"];
15
15
  get fromJsonObjectFunction(): AbstractIdentifierType<NamedNode>["fromJsonObjectFunction"];
16
16
  get toJsonValueFunction(): AbstractIdentifierType<NamedNode>["toJsonValueFunction"];
@@ -22,7 +22,7 @@ export declare class IriType extends AbstractIdentifierType<NamedNode> {
22
22
  get parseFunction(): Callable;
23
23
  protected get inlineExpression(): Code;
24
24
  protected staticModuleDeclarations(name: string): Record<string, Code>;
25
- protected get schemaInitializers(): readonly Code[];
25
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
26
26
  protected get inlineValueTypeExpression(): Code;
27
27
  private get valueTypeExpression();
28
28
  }
@@ -8,37 +8,37 @@ import { Maybe } from "purify-ts";
8
8
  import { invariant } from "ts-invariant";
9
9
  import { Memoize } from "typescript-memoize";
10
10
  import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
12
  import { InlineCallable } from "./InlineCallable.js";
12
- import { ReferenceCallable } from "./ReferenceCallable.js";
13
- import { arrayOf, code, joinCode, literalOf, } from "./ts-poet-wrapper.js";
13
+ import { SchemaObject } from "./SchemaObject.js";
14
+ import { arrayOf, code, joinCode } from "./ts-poet-wrapper.js";
14
15
  export class IriType extends AbstractIdentifierType {
15
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterIri);
16
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterIri);
16
17
  filterType = code `${this.reusables.snippets.IriFilter}`;
17
18
  kind = "Iri";
18
19
  nodeKinds = nodeKinds;
19
- schemaType = code `${this.reusables.snippets.IriSchema}<${this.valueTypeExpression}>`;
20
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.iriSparqlWherePatterns);
20
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.iriSparqlWherePatterns);
21
21
  get fromJsonValueFunction() {
22
22
  if (this.in_.length > 0) {
23
- return new ReferenceCallable(code `${this.reusables.snippets.iriLiteralFromJsonString}<${this.valueTypeExpression}>`);
23
+ return new BuiltinCallable(code `${this.reusables.snippets.iriLiteralFromJsonString}<${this.valueTypeExpression}>`);
24
24
  }
25
25
  else {
26
- return new ReferenceCallable(this.reusables.snippets.iriFromJsonString);
26
+ return new BuiltinCallable(this.reusables.snippets.iriFromJsonString);
27
27
  }
28
28
  }
29
29
  get fromJsonObjectFunction() {
30
30
  if (this.in_.length > 0) {
31
- return new ReferenceCallable(code `${this.reusables.snippets.iriLiteralFromJsonObject}<${this.valueTypeExpression}>`);
31
+ return new BuiltinCallable(code `${this.reusables.snippets.iriLiteralFromJsonObject}<${this.valueTypeExpression}>`);
32
32
  }
33
33
  else {
34
- return new ReferenceCallable(this.reusables.snippets.iriFromJsonObject);
34
+ return new BuiltinCallable(this.reusables.snippets.iriFromJsonObject);
35
35
  }
36
36
  }
37
37
  get toJsonValueFunction() {
38
- return new ReferenceCallable(code `${this.reusables.snippets.iriToJsonString}<${this.valueTypeExpression}>`);
38
+ return new BuiltinCallable(code `${this.reusables.snippets.iriToJsonString}<${this.valueTypeExpression}>`);
39
39
  }
40
40
  get toJsonObjectFunction() {
41
- return new ReferenceCallable(code `${this.reusables.snippets.iriToJsonObject}<${this.valueTypeExpression}>`);
41
+ return new BuiltinCallable(code `${this.reusables.snippets.iriToJsonObject}<${this.valueTypeExpression}>`);
42
42
  }
43
43
  get jsonValueType() {
44
44
  if (this.in_.length === 0) {
@@ -80,13 +80,13 @@ export class IriType extends AbstractIdentifierType {
80
80
  });
81
81
  }
82
82
  get fromRdfResourceValuesFunction() {
83
- return new ReferenceCallable(code `${this.reusables.snippets.iriFromRdfResourceValues}<${this.valueTypeExpression}>`);
83
+ return new BuiltinCallable(code `${this.reusables.snippets.iriFromRdfResourceValues}<${this.valueTypeExpression}>`);
84
84
  }
85
85
  get parseFunction() {
86
86
  if (this.in_.length > 0) {
87
87
  return new InlineCallable(code `(identifier: string) => ${this.reusables.snippets.parseIri}(identifier).chain((identifier) => { switch (identifier.value) { ${joinCode(this.in_.map((iri) => code `case "${iri.value}": return ${this.reusables.imports.Right}(identifier as ${this.expression});`))} default: return ${this.reusables.imports.Left}(new Error("expected NamedNode identifier to be one of ${this.in_.map((iri) => iri.value).join(" ")}")); } })`);
88
88
  }
89
- return new ReferenceCallable(this.reusables.snippets.parseIri);
89
+ return new BuiltinCallable(this.reusables.snippets.parseIri);
90
90
  }
91
91
  get inlineExpression() {
92
92
  if (this.in_.length > 0) {
@@ -103,16 +103,18 @@ export class IriType extends AbstractIdentifierType {
103
103
  inValues: code `const inValues = ${arrayOf(...this.in_.map((in_) => in_.value))} as const;`,
104
104
  };
105
105
  }
106
- get schemaInitializers() {
107
- if (this.in_.length === 0 || this.name.isNothing()) {
108
- return super.schemaInitializers;
106
+ get schema() {
107
+ const thisProperties = {};
108
+ if (this.in_.length > 0 && this.name.isJust()) {
109
+ thisProperties["in"] =
110
+ code `in: inValues.map(inValue => ${this.reusables.imports.dataFactory}.namedNode(inValue))`;
111
+ thisProperties["inValues"] = code `inValues`;
109
112
  }
110
- let initializers = [code `kind: ${literalOf(this.kind)} as const`];
111
- if (this.hasValues.length > 0) {
112
- initializers = initializers.concat(code `hasValues: ${arrayOf(...this.hasValues.map((hasValue) => this.rdfjsTermExpression(hasValue)))}`);
113
- }
114
- initializers = initializers.concat(code `in: inValues.map(inValue => ${this.reusables.imports.dataFactory}.namedNode(inValue))`, code `inValues`);
115
- return initializers;
113
+ return new SchemaObject({
114
+ properties: { ...super.schema.properties, ...thisProperties },
115
+ type: new SchemaObject.BuiltinType(code `${this.reusables.snippets.IriSchema}<${this.valueTypeExpression}>`),
116
+ variable: super.schema.variable,
117
+ });
116
118
  }
117
119
  get inlineValueTypeExpression() {
118
120
  if (this.in_.length === 0) {
@@ -161,6 +163,9 @@ __decorate([
161
163
  __decorate([
162
164
  Memoize()
163
165
  ], IriType.prototype, "inlineExpression", null);
166
+ __decorate([
167
+ Memoize()
168
+ ], IriType.prototype, "schema", null);
164
169
  __decorate([
165
170
  Memoize()
166
171
  ], IriType.prototype, "inlineValueTypeExpression", null);
@@ -1,17 +1,18 @@
1
1
  import type { Literal } from "@rdfjs/types";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { AbstractLiteralType } from "./AbstractLiteralType.js";
4
- import { ReferenceCallable } from "./ReferenceCallable.js";
4
+ import { BuiltinCallable } from "./BuiltinCallable.js";
5
+ import { SchemaObject } from "./SchemaObject.js";
5
6
  import { type Code } from "./ts-poet-wrapper.js";
6
7
  export declare class LangStringType extends AbstractLiteralType {
7
8
  private readonly languageIn;
8
9
  protected readonly inlineExpression: Code;
9
10
  readonly conversionFunction: Maybe<AbstractLiteralType.ConversionFunction>;
10
- readonly filterFunction: ReferenceCallable;
11
+ readonly filterFunction: BuiltinCallable;
11
12
  readonly filterType: Code;
12
- readonly fromJsonObjectFunction: ReferenceCallable;
13
- readonly fromJsonValueFunction: ReferenceCallable;
14
- readonly fromRdfResourceValuesFunction: ReferenceCallable;
13
+ readonly fromJsonObjectFunction: BuiltinCallable;
14
+ readonly fromJsonValueFunction: BuiltinCallable;
15
+ readonly fromRdfResourceValuesFunction: BuiltinCallable;
15
16
  readonly jsTypes: readonly [{
16
17
  readonly instanceof: "Object";
17
18
  readonly typeof: "object";
@@ -19,16 +20,15 @@ export declare class LangStringType extends AbstractLiteralType {
19
20
  readonly jsonObjectType: AbstractLiteralType["jsonObjectType"];
20
21
  readonly jsonValueType: AbstractLiteralType["jsonValueType"];
21
22
  readonly kind = "LangString";
22
- readonly schemaType: Code;
23
- readonly toJsonObjectFunction: ReferenceCallable;
24
- readonly toJsonValueFunction: ReferenceCallable;
25
- readonly valueSparqlWherePatternsFunction: ReferenceCallable;
23
+ readonly toJsonObjectFunction: BuiltinCallable;
24
+ readonly toJsonValueFunction: BuiltinCallable;
25
+ readonly valueSparqlWherePatternsFunction: BuiltinCallable;
26
26
  constructor({ languageIn, ...superParameters }: {
27
27
  languageIn: readonly string[];
28
28
  } & ConstructorParameters<typeof AbstractLiteralType>[0]);
29
29
  get discriminatedType(): Maybe<AbstractLiteralType.DiscriminatedType>;
30
30
  get graphqlType(): AbstractLiteralType.GraphqlType;
31
- protected get schemaInitializers(): readonly Code[];
31
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
32
32
  graphqlResolveExpression(_parameters: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
33
33
  toLoggableExpression({ variables, }: Parameters<AbstractLiteralType["toLoggableExpression"]>[0]): Code;
34
34
  valueExpression(literal: Literal): Code;
@@ -7,7 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Maybe } from "purify-ts";
8
8
  import { Memoize } from "typescript-memoize";
9
9
  import { AbstractLiteralType } from "./AbstractLiteralType.js";
10
- import { ReferenceCallable } from "./ReferenceCallable.js";
10
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
+ import { SchemaObject } from "./SchemaObject.js";
11
12
  import { arrayOf, code } from "./ts-poet-wrapper.js";
12
13
  export class LangStringType extends AbstractLiteralType {
13
14
  languageIn;
@@ -21,11 +22,11 @@ export class LangStringType extends AbstractLiteralType {
21
22
  },
22
23
  ],
23
24
  });
24
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterLiteral);
25
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterLiteral);
25
26
  filterType = code `${this.reusables.snippets.LiteralFilter}`;
26
- fromJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.langStringFromJsonObject);
27
+ fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.langStringFromJsonObject);
27
28
  fromJsonValueFunction = this.fromJsonObjectFunction;
28
- fromRdfResourceValuesFunction = new ReferenceCallable(this.reusables.snippets.langStringFromRdfResourceValues);
29
+ fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.langStringFromRdfResourceValues);
29
30
  jsTypes = [
30
31
  { instanceof: "Object", typeof: "object" },
31
32
  ];
@@ -37,10 +38,9 @@ export class LangStringType extends AbstractLiteralType {
37
38
  }, { snippet: this.reusables.snippets.LangStringJsonObject });
38
39
  jsonValueType = this.jsonObjectType;
39
40
  kind = "LangString";
40
- schemaType = code `${this.reusables.snippets.LangStringSchema}`;
41
- toJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.langStringToJsonObject);
41
+ toJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.langStringToJsonObject);
42
42
  toJsonValueFunction = this.toJsonObjectFunction;
43
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.langStringSparqlWherePatterns);
43
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.langStringSparqlWherePatterns);
44
44
  constructor({ languageIn, ...superParameters }) {
45
45
  super(superParameters);
46
46
  this.languageIn = languageIn;
@@ -58,12 +58,17 @@ export class LangStringType extends AbstractLiteralType {
58
58
  get graphqlType() {
59
59
  throw new Error("not implemented");
60
60
  }
61
- get schemaInitializers() {
62
- let initializers = super.schemaInitializers;
63
- if (this.languageIn.length > 0) {
64
- initializers = initializers.concat(code `languageIn: ${arrayOf(...this.languageIn)}`);
65
- }
66
- return initializers;
61
+ get schema() {
62
+ return new SchemaObject({
63
+ properties: this.languageIn.length > 0
64
+ ? {
65
+ ...super.schema.properties,
66
+ languageIn: code `languageIn: ${arrayOf(...this.languageIn)}`,
67
+ }
68
+ : super.schema.properties,
69
+ type: new SchemaObject.BuiltinType(this.reusables.snippets.LangStringSchema),
70
+ variable: super.schema.variable,
71
+ });
67
72
  }
68
73
  graphqlResolveExpression(_parameters) {
69
74
  throw new Error("not implemented");
@@ -78,4 +83,7 @@ export class LangStringType extends AbstractLiteralType {
78
83
  __decorate([
79
84
  Memoize()
80
85
  ], LangStringType.prototype, "discriminatedType", null);
86
+ __decorate([
87
+ Memoize()
88
+ ], LangStringType.prototype, "schema", null);
81
89
  //# sourceMappingURL=LangStringType.js.map
@@ -8,8 +8,8 @@ import { rdf } from "@tpluscode/rdf-ns-builders";
8
8
  import { Maybe } from "purify-ts";
9
9
  import { Memoize } from "typescript-memoize";
10
10
  import { AbstractCollectionType } from "./AbstractCollectionType.js";
11
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
12
  import { InlineCallable } from "./InlineCallable.js";
12
- import { ReferenceCallable } from "./ReferenceCallable.js";
13
13
  import { code, joinCode } from "./ts-poet-wrapper.js";
14
14
  export class ListType extends AbstractCollectionType {
15
15
  identifierNodeKind;
@@ -44,16 +44,16 @@ export class ListType extends AbstractCollectionType {
44
44
  });
45
45
  }
46
46
  get fromJsonValueFunction() {
47
- return new ReferenceCallable(code `${this.reusables.snippets.arrayFromJsonArray}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
47
+ return new BuiltinCallable(code `${this.reusables.snippets.arrayFromJsonArray}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
48
48
  }
49
49
  get fromJsonObjectFunction() {
50
- return new ReferenceCallable(code `${this.reusables.snippets.listFromJsonObject}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
50
+ return new BuiltinCallable(code `${this.reusables.snippets.listFromJsonObject}(${this.itemType.fromJsonValueFunction.annotatedUsage})`);
51
51
  }
52
52
  get fromRdfResourceValuesFunction() {
53
- return new InlineCallable(code `${this._mutable ? this.reusables.snippets.mutableListFromRdfResourceValues : this.reusables.snippets.listFromRdfResourceValues}<${this.itemType.expression}, ${this.itemType.schemaType}>(${this.itemType.fromRdfResourceValuesFunction.unannotatedUsage})`);
53
+ return new InlineCallable(code `${this._mutable ? this.reusables.snippets.mutableListFromRdfResourceValues : this.reusables.snippets.listFromRdfResourceValues}<${this.itemType.expression}, ${this.itemType.schema.type.expression}>(${this.itemType.fromRdfResourceValuesFunction.unannotatedUsage})`);
54
54
  }
55
55
  get toJsonValueFunction() {
56
- return new ReferenceCallable(code `${this.reusables.snippets.arrayToJsonArray}(${this.itemType.toJsonValueFunction.annotatedUsage})`);
56
+ return new BuiltinCallable(code `${this.reusables.snippets.arrayToJsonArray}(${this.itemType.toJsonValueFunction.annotatedUsage})`);
57
57
  }
58
58
  get toJsonObjectFunction() {
59
59
  return new InlineCallable(code `${this.reusables.snippets.listToJsonObject}(${this.itemType.toJsonValueFunction.annotatedUsage})`);
@@ -62,10 +62,10 @@ export class ListType extends AbstractCollectionType {
62
62
  return new Set(["BlankNode", "NamedNode"]); // List or rdf:nil
63
63
  }
64
64
  get valueSparqlConstructTriplesFunction() {
65
- return new InlineCallable(code `${this.reusables.snippets.listSparqlConstructTriples}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlConstructTriplesFunction.unannotatedUsage})`);
65
+ return new InlineCallable(code `${this.reusables.snippets.listSparqlConstructTriples}<${this.itemType.filterType}, ${this.itemType.schema.type.expression}>(${this.itemType.valueSparqlConstructTriplesFunction.unannotatedUsage})`);
66
66
  }
67
67
  get valueSparqlWherePatternsFunction() {
68
- return new InlineCallable(code `${this.reusables.snippets.listSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlWherePatternsFunction.unannotatedUsage})`);
68
+ return new InlineCallable(code `${this.reusables.snippets.listSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schema.type.expression}>(${this.itemType.valueSparqlWherePatternsFunction.unannotatedUsage})`);
69
69
  }
70
70
  toRdfResourceValuesExpression({ variables, }) {
71
71
  let mintListIdentifierFunction;
@@ -1,33 +1,33 @@
1
1
  import type { Literal } from "@rdfjs/types";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { AbstractLiteralType } from "./AbstractLiteralType.js";
4
- import { ReferenceCallable } from "./ReferenceCallable.js";
4
+ import { BuiltinCallable } from "./BuiltinCallable.js";
5
+ import { SchemaObject } from "./SchemaObject.js";
5
6
  import { type Code } from "./ts-poet-wrapper.js";
6
7
  export declare class LiteralType extends AbstractLiteralType {
7
8
  private readonly languageIn;
8
9
  protected readonly inlineExpression: Code;
9
10
  readonly conversionFunction: Maybe<AbstractLiteralType.ConversionFunction>;
10
- readonly filterFunction: ReferenceCallable;
11
+ readonly filterFunction: BuiltinCallable;
11
12
  readonly filterType: Code;
12
- readonly fromJsonObjectFunction: ReferenceCallable;
13
- readonly fromJsonValueFunction: ReferenceCallable;
14
- readonly fromRdfResourceValuesFunction: ReferenceCallable;
13
+ readonly fromJsonObjectFunction: BuiltinCallable;
14
+ readonly fromJsonValueFunction: BuiltinCallable;
15
+ readonly fromRdfResourceValuesFunction: BuiltinCallable;
15
16
  readonly jsTypes: readonly [{
16
17
  readonly instanceof: "Object";
17
18
  readonly typeof: "object";
18
19
  }];
19
20
  readonly jsonValueType: AbstractLiteralType["jsonValueType"];
20
21
  readonly kind = "Literal";
21
- readonly schemaType: Code;
22
- readonly toJsonObjectFunction: ReferenceCallable;
23
- readonly toJsonValueFunction: ReferenceCallable;
24
- readonly valueSparqlWherePatternsFunction: ReferenceCallable;
22
+ readonly toJsonObjectFunction: BuiltinCallable;
23
+ readonly toJsonValueFunction: BuiltinCallable;
24
+ readonly valueSparqlWherePatternsFunction: BuiltinCallable;
25
25
  constructor({ languageIn, ...superParameters }: {
26
26
  languageIn: readonly string[];
27
27
  } & ConstructorParameters<typeof AbstractLiteralType>[0]);
28
28
  get discriminatedType(): Maybe<AbstractLiteralType.DiscriminatedType>;
29
29
  get graphqlType(): AbstractLiteralType.GraphqlType;
30
- protected get schemaInitializers(): readonly Code[];
30
+ get schema(): SchemaObject<SchemaObject.BuiltinType>;
31
31
  graphqlResolveExpression(_parameters: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
32
32
  toLoggableExpression({ variables, }: Parameters<AbstractLiteralType["toLoggableExpression"]>[0]): Code;
33
33
  valueExpression(literal: Literal): Code;
@@ -7,7 +7,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Maybe } from "purify-ts";
8
8
  import { Memoize } from "typescript-memoize";
9
9
  import { AbstractLiteralType } from "./AbstractLiteralType.js";
10
- import { ReferenceCallable } from "./ReferenceCallable.js";
10
+ import { BuiltinCallable } from "./BuiltinCallable.js";
11
+ import { SchemaObject } from "./SchemaObject.js";
11
12
  import { arrayOf, code } from "./ts-poet-wrapper.js";
12
13
  export class LiteralType extends AbstractLiteralType {
13
14
  languageIn;
@@ -29,20 +30,19 @@ export class LiteralType extends AbstractLiteralType {
29
30
  },
30
31
  ],
31
32
  });
32
- filterFunction = new ReferenceCallable(this.reusables.snippets.filterLiteral);
33
+ filterFunction = new BuiltinCallable(this.reusables.snippets.filterLiteral);
33
34
  filterType = code `${this.reusables.snippets.LiteralFilter}`;
34
- fromJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.literalFromJsonObject);
35
+ fromJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.literalFromJsonObject);
35
36
  fromJsonValueFunction = this.fromJsonObjectFunction;
36
- fromRdfResourceValuesFunction = new ReferenceCallable(this.reusables.snippets.literalFromRdfResourceValues);
37
+ fromRdfResourceValuesFunction = new BuiltinCallable(this.reusables.snippets.literalFromRdfResourceValues);
37
38
  jsTypes = [
38
39
  { instanceof: "Object", typeof: "object" },
39
40
  ];
40
41
  jsonValueType = this.jsonObjectType;
41
42
  kind = "Literal";
42
- schemaType = code `${this.reusables.snippets.LiteralSchema}`;
43
- toJsonObjectFunction = new ReferenceCallable(this.reusables.snippets.literalToJsonObject);
43
+ toJsonObjectFunction = new BuiltinCallable(this.reusables.snippets.literalToJsonObject);
44
44
  toJsonValueFunction = this.toJsonObjectFunction;
45
- valueSparqlWherePatternsFunction = new ReferenceCallable(this.reusables.snippets.literalSparqlWherePatterns);
45
+ valueSparqlWherePatternsFunction = new BuiltinCallable(this.reusables.snippets.literalSparqlWherePatterns);
46
46
  constructor({ languageIn, ...superParameters }) {
47
47
  super(superParameters);
48
48
  this.languageIn = languageIn;
@@ -60,12 +60,17 @@ export class LiteralType extends AbstractLiteralType {
60
60
  get graphqlType() {
61
61
  throw new Error("not implemented");
62
62
  }
63
- get schemaInitializers() {
64
- let initializers = super.schemaInitializers;
65
- if (this.languageIn.length > 0) {
66
- initializers = initializers.concat(code `languageIn: ${arrayOf(...this.languageIn)}`);
67
- }
68
- return initializers;
63
+ get schema() {
64
+ return new SchemaObject({
65
+ properties: this.languageIn.length > 0
66
+ ? {
67
+ ...super.schema.properties,
68
+ languageIn: code `languageIn: ${arrayOf(...this.languageIn)}`,
69
+ }
70
+ : super.schema.properties,
71
+ type: new SchemaObject.BuiltinType(this.reusables.snippets.LiteralSchema),
72
+ variable: super.schema.variable,
73
+ });
69
74
  }
70
75
  graphqlResolveExpression(_parameters) {
71
76
  throw new Error("not implemented");
@@ -80,4 +85,7 @@ export class LiteralType extends AbstractLiteralType {
80
85
  __decorate([
81
86
  Memoize()
82
87
  ], LiteralType.prototype, "discriminatedType", null);
88
+ __decorate([
89
+ Memoize()
90
+ ], LiteralType.prototype, "schema", null);
83
91
  //# sourceMappingURL=LiteralType.js.map