@shaclmate/compiler 4.0.39 → 4.0.40

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 (163) hide show
  1. package/dist/generators/ts/AbstractCollectionType.d.ts +1 -1
  2. package/dist/generators/ts/AbstractCollectionType.js +10 -10
  3. package/dist/generators/ts/AbstractContainerType.d.ts +4 -5
  4. package/dist/generators/ts/AbstractContainerType.js +4 -5
  5. package/dist/generators/ts/AbstractDateType.d.ts +3 -3
  6. package/dist/generators/ts/AbstractDateType.js +2 -2
  7. package/dist/generators/ts/AbstractLazyObjectType.d.ts +8 -8
  8. package/dist/generators/ts/AbstractLazyObjectType.js +19 -19
  9. package/dist/generators/ts/AbstractNumericType.d.ts +1 -1
  10. package/dist/generators/ts/AbstractNumericType.js +3 -3
  11. package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
  12. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  13. package/dist/generators/ts/AbstractPrimitiveType.js +2 -2
  14. package/dist/generators/ts/AbstractTermType.js +2 -2
  15. package/dist/generators/ts/AbstractType.d.ts +15 -10
  16. package/dist/generators/ts/AbstractType.js +6 -1
  17. package/dist/generators/ts/BigDecimalType.d.ts +1 -1
  18. package/dist/generators/ts/BigDecimalType.js +2 -2
  19. package/dist/generators/ts/BigIntType.js +2 -2
  20. package/dist/generators/ts/BlankNodeType.d.ts +3 -3
  21. package/dist/generators/ts/BlankNodeType.js +11 -11
  22. package/dist/generators/ts/BooleanType.d.ts +2 -2
  23. package/dist/generators/ts/BooleanType.js +10 -5
  24. package/dist/generators/ts/DefaultValueType.d.ts +1 -1
  25. package/dist/generators/ts/DefaultValueType.js +8 -9
  26. package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
  27. package/dist/generators/ts/GraphqlSchema.js +4 -4
  28. package/dist/generators/ts/IdentifierType.d.ts +3 -3
  29. package/dist/generators/ts/IdentifierType.js +13 -13
  30. package/dist/generators/ts/IriType.d.ts +2 -2
  31. package/dist/generators/ts/IriType.js +17 -17
  32. package/dist/generators/ts/LazyObjectOptionType.d.ts +1 -0
  33. package/dist/generators/ts/LazyObjectOptionType.js +6 -6
  34. package/dist/generators/ts/LazyObjectSetType.js +5 -5
  35. package/dist/generators/ts/LazyObjectType.js +4 -4
  36. package/dist/generators/ts/ListType.d.ts +4 -5
  37. package/dist/generators/ts/ListType.js +3 -4
  38. package/dist/generators/ts/LiteralType.d.ts +1 -1
  39. package/dist/generators/ts/LiteralType.js +5 -5
  40. package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +23 -24
  41. package/dist/generators/ts/ObjectType.js +350 -0
  42. package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
  43. package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +50 -58
  44. package/dist/generators/ts/OptionType.d.ts +1 -1
  45. package/dist/generators/ts/OptionType.js +10 -10
  46. package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -8
  47. package/dist/generators/ts/SparqlObjectSetType.js +2 -2
  48. package/dist/generators/ts/StringType.d.ts +2 -2
  49. package/dist/generators/ts/StringType.js +10 -5
  50. package/dist/generators/ts/TermType.d.ts +2 -2
  51. package/dist/generators/ts/TermType.js +12 -12
  52. package/dist/generators/ts/TsGenerator.js +12 -9
  53. package/dist/generators/ts/Type.d.ts +4 -5
  54. package/dist/generators/ts/TypeFactory.d.ts +7 -8
  55. package/dist/generators/ts/TypeFactory.js +61 -62
  56. package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +33 -5
  57. package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +262 -58
  58. package/dist/generators/ts/ZodGenerator.js +7 -9
  59. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +6 -6
  60. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +3 -3
  61. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +1 -1
  62. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +8 -8
  63. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +1 -5
  64. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +15 -10
  65. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
  66. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_createFunctionDeclaration.js → _ObjectType/ObjectType_createFunctionDeclaration.js} +6 -6
  67. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
  68. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +4 -4
  69. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
  70. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -3
  71. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
  72. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +3 -3
  73. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  74. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  75. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  76. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +3 -3
  77. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  78. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js → _ObjectType/ObjectType_fromJsonFunctionDeclaration.js} +4 -4
  79. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  80. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js} +4 -4
  81. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  82. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +15 -0
  83. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
  84. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js → _ObjectType/ObjectType_fromRdfTypeVariableStatement.js} +2 -2
  85. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +5 -0
  86. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js → _ObjectType/ObjectType_graphqlTypeVariableStatement.js} +4 -4
  87. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +4 -0
  88. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js → _ObjectType/ObjectType_hashFunctionDeclarations.js} +6 -6
  89. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
  90. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_interfaceDeclaration.js → _ObjectType/ObjectType_interfaceDeclaration.js} +4 -4
  91. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
  92. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js → _ObjectType/ObjectType_isTypeFunctionDeclaration.js} +3 -3
  93. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
  94. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js → _ObjectType/ObjectType_jsonParseFunctionDeclaration.js} +2 -2
  95. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
  96. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js} +2 -2
  97. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
  98. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js → _ObjectType/ObjectType_jsonTypeAliasDeclaration.js} +2 -2
  99. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
  100. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
  101. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts → _ObjectType/ObjectType_objectSetMethodNames.d.ts} +3 -3
  102. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.js → _ObjectType/ObjectType_objectSetMethodNames.js} +4 -4
  103. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +5 -0
  104. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +14 -0
  105. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +3 -3
  106. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js} +5 -5
  107. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +3 -3
  108. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +12 -0
  109. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +5 -0
  110. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js → _ObjectType/ObjectType_toJsonFunctionDeclaration.js} +4 -4
  111. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
  112. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_toRdfResourceFunctionDeclaration.js} +4 -4
  113. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +4 -0
  114. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js → _ObjectType/ObjectType_toStringFunctionDeclarations.js} +6 -6
  115. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  116. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  117. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  118. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +3 -3
  119. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.js +7 -7
  120. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
  121. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/identifierTypeDeclarations.js +4 -2
  122. package/dist/input/generated.d.ts +2 -2
  123. package/dist/input/generated.js +2 -2
  124. package/package.json +4 -4
  125. package/dist/generators/ts/AbstractNamedUnionType.d.ts +0 -30
  126. package/dist/generators/ts/AbstractNamedUnionType.js +0 -190
  127. package/dist/generators/ts/AnonymousUnionType.d.ts +0 -27
  128. package/dist/generators/ts/AnonymousUnionType.js +0 -59
  129. package/dist/generators/ts/NamedObjectType.js +0 -342
  130. package/dist/generators/ts/NamedObjectUnionType.d.ts +0 -37
  131. package/dist/generators/ts/NamedUnionType.d.ts +0 -11
  132. package/dist/generators/ts/NamedUnionType.js +0 -13
  133. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +0 -5
  134. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +0 -5
  135. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +0 -5
  136. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +0 -5
  137. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  138. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  139. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  140. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  141. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  142. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  143. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  144. package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  145. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +0 -4
  146. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
  147. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
  148. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +0 -5
  149. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  150. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  151. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  152. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +0 -5
  153. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +0 -12
  154. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -12
  155. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  156. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  157. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +0 -4
  158. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  159. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  160. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +0 -4
  161. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
  162. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
  163. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +0 -0
@@ -1,190 +0,0 @@
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
- };
7
- import { Maybe } from "purify-ts";
8
- import { Memoize } from "typescript-memoize";
9
- import { AbstractType } from "./AbstractType.js";
10
- import { AbstractUnionType } from "./AbstractUnionType.js";
11
- import { code, def, joinCode } from "./ts-poet-wrapper.js";
12
- export class AbstractNamedUnionType extends AbstractUnionType {
13
- _name;
14
- constructor({ name, ...superParameters }) {
15
- super(superParameters);
16
- this._name = name;
17
- }
18
- get declaration() {
19
- const declarations = [];
20
- if (this.configuration.features.has("Object.type")) {
21
- declarations.push(code `export type ${def(this._name)} = ${this.inlineName};`);
22
- }
23
- const staticModuleDeclarations = Object.entries(this.staticModuleDeclarations);
24
- if (staticModuleDeclarations.length > 0) {
25
- declarations.push(code `\
26
- export namespace ${def(this.name)} {
27
- ${joinCode(staticModuleDeclarations
28
- .sort((left, right) => left[0].localeCompare(right[0]))
29
- .map((_) => _[1]), { on: "\n\n" })}
30
- }`);
31
- }
32
- return Maybe.of(joinCode(declarations, { on: "\n\n" }));
33
- }
34
- get equalsFunction() {
35
- return code `${this.name}.equals`;
36
- }
37
- get filterFunction() {
38
- return code `${this.name}.filter`;
39
- }
40
- get filterType() {
41
- return code `${this.name}.Filter`;
42
- }
43
- get hashFunction() {
44
- return code `${this.name}.hash`;
45
- }
46
- get jsonSchemaFunctionDeclaration() {
47
- const meta = {
48
- // id: this.name,
49
- };
50
- this.comment.ifJust((description) => {
51
- meta["description"] = description;
52
- });
53
- this.label.ifJust((label) => {
54
- meta["title"] = label;
55
- });
56
- return code `export const schema = () => ${this.inlineJsonSchema}.meta(${meta});`;
57
- }
58
- get jsonTypeAliasDeclaration() {
59
- return code `export type Json = ${this.inlineJsonType.name}`;
60
- }
61
- get name() {
62
- return this._name;
63
- }
64
- get valueSparqlConstructTriplesFunction() {
65
- return code `${this.name}.valueSparqlConstructTriples`;
66
- }
67
- get valueSparqlWherePatternsFunction() {
68
- return code `${this.name}.valueSparqlWherePatterns`;
69
- }
70
- get staticModuleDeclarations() {
71
- const staticModuleDeclarations = {};
72
- if (this.configuration.features.has("Object.equals")) {
73
- staticModuleDeclarations[`equals`] =
74
- code `export const equals = ${this.inlineEqualsFunction};`;
75
- }
76
- if (this.configuration.features.has("Object.filter")) {
77
- staticModuleDeclarations[`Filter`] =
78
- code `export type Filter = ${this.inlineFilterType};`;
79
- staticModuleDeclarations[`filter`] =
80
- code `export const filter = ${this.inlineFilterFunction};`;
81
- }
82
- if (this.configuration.features.has("Object.hash")) {
83
- staticModuleDeclarations[`hash`] =
84
- code `export const hash = ${this.inlineHashFunction};`;
85
- }
86
- if (this.configuration.features.has("Object.JSON.type")) {
87
- staticModuleDeclarations[`Json.type`] =
88
- code `${this.jsonTypeAliasDeclaration}`;
89
- }
90
- if (this.configuration.features.has("Object.JSON.schema")) {
91
- staticModuleDeclarations[`Json.namespace`] = code `\
92
- export namespace Json {
93
- ${this.jsonSchemaFunctionDeclaration}
94
-
95
- export function parse(json: unknown): ${this.reusables.imports.Either}<Error, Json> {
96
- const jsonSafeParseResult = schema().safeParse(json);
97
- if (!jsonSafeParseResult.success) { return ${this.reusables.imports.Left}(jsonSafeParseResult.error); }
98
- return ${this.reusables.imports.Right}(jsonSafeParseResult.data);
99
- }
100
- }`;
101
- }
102
- if (this.configuration.features.has("Object.fromJson")) {
103
- staticModuleDeclarations[`fromJson`] =
104
- code `export const fromJson = ${this.inlineFromJsonFunction};`;
105
- }
106
- if (this.configuration.features.has("Object.fromRdf")) {
107
- staticModuleDeclarations[`fromRdfResourceValues`] =
108
- code `export const fromRdfResourceValues: ${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.name}> = ${this.inlineFromRdfResourceValuesFunction};`;
109
- }
110
- if (this.configuration.features.has("Object.toJson")) {
111
- staticModuleDeclarations[`toJson`] =
112
- code `export const toJson = ${this.inlineToJsonFunction};`;
113
- }
114
- if (this.configuration.features.has("Object.toRdf")) {
115
- staticModuleDeclarations[`toRdfResourceValues`] =
116
- code `export const toRdfResourceValues = ${this.inlineToRdfResourceValuesFunction};`;
117
- }
118
- if (this.configuration.features.has("Object.SPARQL")) {
119
- staticModuleDeclarations[`valueSparqlConstructTriples`] =
120
- code `export const valueSparqlConstructTriples: ${this.reusables.snippets.ValueSparqlConstructTriplesFunction}<${this.filterType}, ${this.schemaType}> = ${this.inlineValueSparqlConstructTriplesFunction};`;
121
- staticModuleDeclarations[`valueSparqlWherePatterns`] =
122
- code `export const valueSparqlWherePatterns: ${this.reusables.snippets.ValueSparqlWherePatternsFunction}<${this.filterType}, ${this.schemaType}> = ${this.inlineValueSparqlWherePatternsFunction};`;
123
- }
124
- if (this.configuration.features.has("Object.toString")) {
125
- const syntheticNamePrefix = this.configuration.syntheticNamePrefix;
126
- staticModuleDeclarations[`${syntheticNamePrefix}toString`] =
127
- code `export const ${syntheticNamePrefix}toString = ${this.inlineToStringFunction};`;
128
- }
129
- return staticModuleDeclarations;
130
- }
131
- fromJsonExpression({ variables, }) {
132
- return code `${this.name}.fromJson(${variables.value})`;
133
- }
134
- fromRdfResourceValuesExpression({ variables, }) {
135
- const { resourceValues: resourceValuesVariable, ...fromRdfResourceValuesOptionsTemp } = variables;
136
- const fromRdfResourceValuesOptions = fromRdfResourceValuesOptionsTemp;
137
- if (!this.configuration.features.has("ObjectSet")) {
138
- delete fromRdfResourceValuesOptions["objectSet"];
139
- }
140
- return code `${this.name}.fromRdfResourceValues(${resourceValuesVariable}, ${fromRdfResourceValuesOptions})`;
141
- }
142
- jsonSchema({ context, }) {
143
- const expression = code `${this.name}.Json.schema()`;
144
- if (context === "property" && this.recursive) {
145
- return code `${this.reusables.imports.z}.lazy((): ${this.reusables.imports.z}.ZodType<${this.name}.Json> => ${expression})`;
146
- }
147
- return expression;
148
- }
149
- jsonType() {
150
- return new AbstractType.JsonType(`${this.name}.Json`);
151
- }
152
- toJsonExpression({ variables, }) {
153
- return code `${this.name}.toJson(${variables.value})`;
154
- }
155
- toRdfResourceValuesExpression({ variables, }) {
156
- const { value: valueVariable, ...otherVariables } = variables;
157
- return code `${this.name}.toRdfResourceValues(${valueVariable}, ${otherVariables})`;
158
- }
159
- toStringExpression({ variables, }) {
160
- return code `${this.name}.${this.configuration.syntheticNamePrefix}toString(${variables.value})`;
161
- }
162
- }
163
- __decorate([
164
- Memoize()
165
- ], AbstractNamedUnionType.prototype, "declaration", null);
166
- __decorate([
167
- Memoize()
168
- ], AbstractNamedUnionType.prototype, "equalsFunction", null);
169
- __decorate([
170
- Memoize()
171
- ], AbstractNamedUnionType.prototype, "filterFunction", null);
172
- __decorate([
173
- Memoize()
174
- ], AbstractNamedUnionType.prototype, "filterType", null);
175
- __decorate([
176
- Memoize()
177
- ], AbstractNamedUnionType.prototype, "hashFunction", null);
178
- __decorate([
179
- Memoize()
180
- ], AbstractNamedUnionType.prototype, "name", null);
181
- __decorate([
182
- Memoize()
183
- ], AbstractNamedUnionType.prototype, "valueSparqlConstructTriplesFunction", null);
184
- __decorate([
185
- Memoize()
186
- ], AbstractNamedUnionType.prototype, "valueSparqlWherePatternsFunction", null);
187
- __decorate([
188
- Memoize()
189
- ], AbstractNamedUnionType.prototype, "jsonType", null);
190
- //# sourceMappingURL=AbstractNamedUnionType.js.map
@@ -1,27 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { AbstractType } from "./AbstractType.js";
3
- import { AbstractUnionType } from "./AbstractUnionType.js";
4
- import type { Type } from "./Type.js";
5
- import { type Code } from "./ts-poet-wrapper.js";
6
- export declare class AnonymousUnionType extends AbstractUnionType<Type> {
7
- readonly declaration: Maybe<Code>;
8
- readonly graphqlArgs: AbstractType["graphqlArgs"];
9
- readonly kind = "AnonymousUnion";
10
- get equalsFunction(): Code;
11
- get filterFunction(): Code;
12
- get filterType(): Code;
13
- get graphqlType(): AbstractType.GraphqlType;
14
- get hashFunction(): Code;
15
- get name(): Code;
16
- get valueSparqlConstructTriplesFunction(): Code;
17
- get valueSparqlWherePatternsFunction(): Code;
18
- fromJsonExpression({ variables, }: Parameters<AbstractType["fromJsonExpression"]>[0]): Code;
19
- fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["fromRdfResourceValuesExpression"]>[0]): Code;
20
- graphqlResolveExpression(_parameters: Parameters<AbstractType["graphqlResolveExpression"]>[0]): Code;
21
- jsonSchema(_parameters: Parameters<AbstractType["jsonSchema"]>[0]): Code;
22
- jsonType(): AbstractType.JsonType;
23
- toJsonExpression({ variables, }: Parameters<AbstractType["toJsonExpression"]>[0]): Code;
24
- toRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["toRdfResourceValuesExpression"]>[0]): Code;
25
- toStringExpression({ variables, }: Parameters<AbstractType["toStringExpression"]>[0]): Code;
26
- }
27
- //# sourceMappingURL=AnonymousUnionType.d.ts.map
@@ -1,59 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import { AbstractUnionType } from "./AbstractUnionType.js";
3
- import { code } from "./ts-poet-wrapper.js";
4
- export class AnonymousUnionType extends AbstractUnionType {
5
- declaration = Maybe.empty();
6
- graphqlArgs = Maybe.empty();
7
- kind = "AnonymousUnion";
8
- get equalsFunction() {
9
- return this.inlineEqualsFunction;
10
- }
11
- get filterFunction() {
12
- return this.inlineFilterFunction;
13
- }
14
- get filterType() {
15
- return this.inlineFilterType;
16
- }
17
- get graphqlType() {
18
- throw new Error("GraphQL doesn't support scalar unions");
19
- }
20
- get hashFunction() {
21
- return this.inlineHashFunction;
22
- }
23
- get name() {
24
- return this.inlineName;
25
- }
26
- get valueSparqlConstructTriplesFunction() {
27
- return this.inlineValueSparqlConstructTriplesFunction;
28
- }
29
- get valueSparqlWherePatternsFunction() {
30
- return this.inlineValueSparqlWherePatternsFunction;
31
- }
32
- fromJsonExpression({ variables, }) {
33
- return code `${this.inlineFromJsonFunction}(${variables.value})`;
34
- }
35
- fromRdfResourceValuesExpression({ variables, }) {
36
- const { resourceValues: resourceValuesVariable, ...otherVariables } = variables;
37
- return code `${this.inlineFromRdfResourceValuesFunction}(${resourceValuesVariable}, ${otherVariables})`;
38
- }
39
- graphqlResolveExpression(_parameters) {
40
- throw new Error("not implemented");
41
- }
42
- jsonSchema(_parameters) {
43
- return this.inlineJsonSchema;
44
- }
45
- jsonType() {
46
- return this.inlineJsonType;
47
- }
48
- toJsonExpression({ variables, }) {
49
- return code `${this.inlineToJsonFunction}(${variables.value})`;
50
- }
51
- toRdfResourceValuesExpression({ variables, }) {
52
- const { value: valueVariable, ...otherVariables } = variables;
53
- return code `${this.inlineToRdfResourceValuesFunction}(${valueVariable}, ${otherVariables})`;
54
- }
55
- toStringExpression({ variables, }) {
56
- return code `${this.inlineToStringFunction}(${variables.value})`;
57
- }
58
- }
59
- //# sourceMappingURL=AnonymousUnionType.js.map
@@ -1,342 +0,0 @@
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
- };
7
- import { NodeKind } from "@shaclmate/shacl-ast";
8
- import { camelCase } from "change-case";
9
- import { Maybe } from "purify-ts";
10
- import { Memoize } from "typescript-memoize";
11
- import { DiscriminantProperty as _DiscriminantProperty } from "./_NamedObjectType/DiscriminantProperty.js";
12
- import { IdentifierProperty as _IdentifierProperty } from "./_NamedObjectType/IdentifierProperty.js";
13
- import { identifierTypeDeclarations } from "./_NamedObjectType/identifierTypeDeclarations.js";
14
- import { NamedObjectType_createFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_createFunctionDeclaration.js";
15
- import { NamedObjectType_equalsFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js";
16
- import { NamedObjectType_filterFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js";
17
- import { NamedObjectType_filterTypeDeclaration } from "./_NamedObjectType/NamedObjectType_filterTypeDeclaration.js";
18
- import { NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js";
19
- import { NamedObjectType_focusSparqlWherePatternsFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js";
20
- import { NamedObjectType_fromJsonFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js";
21
- import { NamedObjectType_fromRdfResourceFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js";
22
- import { NamedObjectType_fromRdfResourceValuesFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js";
23
- import { NamedObjectType_fromRdfTypeVariableStatement } from "./_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js";
24
- import { NamedObjectType_graphqlTypeVariableStatement } from "./_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js";
25
- import { NamedObjectType_hashFunctionDeclarations } from "./_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js";
26
- import { NamedObjectType_interfaceDeclaration } from "./_NamedObjectType/NamedObjectType_interfaceDeclaration.js";
27
- import { NamedObjectType_isTypeFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js";
28
- import { NamedObjectType_jsonParseFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js";
29
- import { NamedObjectType_jsonSchemaFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js";
30
- import { NamedObjectType_jsonTypeAliasDeclaration } from "./_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js";
31
- import { NamedObjectType_jsonUiSchemaFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js";
32
- import { NamedObjectType_objectSetMethodNames } from "./_NamedObjectType/NamedObjectType_objectSetMethodNames.js";
33
- import { NamedObjectType_schemaVariableStatement } from "./_NamedObjectType/NamedObjectType_schemaVariableStatement.js";
34
- import { NamedObjectType_sparqlConstructQueryFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js";
35
- import { NamedObjectType_sparqlConstructQueryStringFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js";
36
- import { NamedObjectType_toJsonFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js";
37
- import { NamedObjectType_toRdfResourceFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js";
38
- import { NamedObjectType_toStringFunctionDeclarations } from "./_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js";
39
- import { NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js";
40
- import { NamedObjectType_valueSparqlWherePatternsFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js";
41
- import { ShaclProperty as _ShaclProperty } from "./_NamedObjectType/ShaclProperty.js";
42
- import { AbstractType } from "./AbstractType.js";
43
- import { code, def, joinCode } from "./ts-poet-wrapper.js";
44
- export class NamedObjectType extends AbstractType {
45
- toRdfTypes;
46
- conversionFunction = Maybe.empty();
47
- extern;
48
- fromRdfType;
49
- graphqlArgs = Maybe.empty();
50
- identifierType;
51
- kind = "NamedObjectType";
52
- name;
53
- recursive;
54
- referencesObjectType = true;
55
- synthetic;
56
- typeofs = ["object"];
57
- validationFunction = Maybe.empty();
58
- constructor({ extern, fromRdfType, identifierType, lazyAncestorObjectTypes, lazyChildObjectTypes, lazyDescendantObjectTypes, lazyDiscriminantProperty, lazyParentObjectTypes, lazyProperties, name, recursive, synthetic, toRdfTypes, ...superParameters }) {
59
- super(superParameters);
60
- this.extern = extern;
61
- this.fromRdfType = fromRdfType;
62
- this.identifierType = identifierType;
63
- // Lazily initialize some members in getters to avoid recursive construction
64
- this.lazyAncestorObjectTypes = lazyAncestorObjectTypes;
65
- this.lazyChildObjectTypes = lazyChildObjectTypes;
66
- this.lazyDescendantObjectTypes = lazyDescendantObjectTypes;
67
- this.lazyDiscriminantProperty = lazyDiscriminantProperty;
68
- this.lazyParentObjectTypes = lazyParentObjectTypes;
69
- this.lazyProperties = lazyProperties;
70
- this.name = name;
71
- this.recursive = recursive;
72
- this.synthetic = synthetic;
73
- this.toRdfTypes = toRdfTypes;
74
- }
75
- get _discriminantProperty() {
76
- return this.lazyDiscriminantProperty(this);
77
- }
78
- get ancestorObjectTypes() {
79
- return this.lazyAncestorObjectTypes();
80
- }
81
- get childObjectTypes() {
82
- return this.lazyChildObjectTypes();
83
- }
84
- get declaration() {
85
- const declarations = [];
86
- if (!this.extern) {
87
- const staticModuleDeclarations = [];
88
- if (this.configuration.features.has("Object.type")) {
89
- declarations.push(NamedObjectType_interfaceDeclaration.call(this));
90
- }
91
- staticModuleDeclarations.push(...NamedObjectType_createFunctionDeclaration.call(this).toList(), ...NamedObjectType_equalsFunctionDeclaration.call(this).toList(), ...NamedObjectType_hashFunctionDeclarations.call(this));
92
- const jsonModuleDeclarations = [
93
- ...NamedObjectType_jsonParseFunctionDeclaration.call(this).toList(),
94
- ...NamedObjectType_jsonSchemaFunctionDeclaration.call(this).toList(),
95
- ...NamedObjectType_jsonUiSchemaFunctionDeclaration.call(this).toList(),
96
- ];
97
- staticModuleDeclarations.push(...NamedObjectType_graphqlTypeVariableStatement.call(this).toList(), ...identifierTypeDeclarations.call(this), ...NamedObjectType_jsonTypeAliasDeclaration.call(this).toList(), ...(jsonModuleDeclarations.length > 0
98
- ? [
99
- code `export namespace Json { ${joinCode(jsonModuleDeclarations, { on: "\n\n" })} }`,
100
- ]
101
- : []), ...NamedObjectType_filterFunctionDeclaration.call(this).toList(), ...NamedObjectType_filterTypeDeclaration.call(this).toList(), ...NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.call(this).toList(), ...NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.call(this).toList(), ...NamedObjectType_fromJsonFunctionDeclaration.call(this).toList(), ...NamedObjectType_fromRdfResourceFunctionDeclaration.call(this).toList(), ...NamedObjectType_fromRdfResourceValuesFunctionDeclaration.call(this).toList(), ...NamedObjectType_fromRdfTypeVariableStatement.call(this).toList(), ...NamedObjectType_isTypeFunctionDeclaration.call(this).toList(), ...NamedObjectType_schemaVariableStatement.call(this).toList(), ...NamedObjectType_sparqlConstructQueryFunctionDeclaration.call({
102
- configuration: this.configuration,
103
- filterType: this.filterType,
104
- name: this.name,
105
- reusables: this.reusables,
106
- }).toList(), ...NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.call({
107
- configuration: this.configuration,
108
- filterType: this.filterType,
109
- name: this.name,
110
- reusables: this.reusables,
111
- }).toList(), ...NamedObjectType_toJsonFunctionDeclaration.call(this).toList(), ...NamedObjectType_toRdfResourceFunctionDeclaration.call(this).toList(), ...NamedObjectType_toStringFunctionDeclarations.call(this), ...NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.call(this).toList(), ...NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.call(this).toList());
112
- if (staticModuleDeclarations.length > 0) {
113
- declarations.push(code `\
114
- export namespace ${def(this.name)} {
115
- ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
116
- }`);
117
- }
118
- }
119
- if (declarations.length === 0) {
120
- return Maybe.empty();
121
- }
122
- return Maybe.of(joinCode(declarations, { on: "\n\n" }));
123
- }
124
- get descendantFromRdfTypeVariables() {
125
- return this.descendantObjectTypes.flatMap((descendantObjectType) => descendantObjectType.fromRdfTypeVariable.toList());
126
- }
127
- get descendantFromRdfTypes() {
128
- return this.descendantObjectTypes.flatMap((descendantObjectType) => descendantObjectType.fromRdfType.toList());
129
- }
130
- get descendantObjectTypes() {
131
- return this.lazyDescendantObjectTypes();
132
- }
133
- get discriminantProperty() {
134
- return Maybe.of({
135
- jsonName: this._discriminantProperty.jsonName,
136
- name: this._discriminantProperty.name,
137
- ownValues: this._discriminantProperty.type.ownValues,
138
- descendantValues: this._discriminantProperty.type.descendantValues,
139
- });
140
- }
141
- get discriminantValue() {
142
- return this.name;
143
- }
144
- get equalsFunction() {
145
- return code `${this.name}.equals`;
146
- }
147
- get filterFunction() {
148
- return code `${this.name}.filter`;
149
- }
150
- get filterType() {
151
- return code `${this.name}.Filter`;
152
- }
153
- get fromRdfTypeVariable() {
154
- return this.fromRdfType.map(() => code `${this.name}.fromRdfType`);
155
- }
156
- get graphqlType() {
157
- return new AbstractType.GraphqlType(code `${this.name}.GraphQL`, this.reusables);
158
- }
159
- get hashFunction() {
160
- return code `${this.name}.hash`;
161
- }
162
- get identifierTypeAlias() {
163
- return code `${this.name}.Identifier`;
164
- }
165
- get mutable() {
166
- return this.properties.some((property) => property.mutable);
167
- }
168
- get objectSetMethodNames() {
169
- return NamedObjectType_objectSetMethodNames.call({
170
- configuration: this.configuration,
171
- name: this.name,
172
- });
173
- }
174
- get parentObjectTypes() {
175
- return this.lazyParentObjectTypes();
176
- }
177
- get properties() {
178
- const properties = this.lazyProperties(this);
179
- const propertyNames = new Set();
180
- for (const property of properties) {
181
- if (propertyNames.has(property.name)) {
182
- throw new Error(`duplicate property '${property.name}'`);
183
- }
184
- }
185
- return properties;
186
- }
187
- get schema() {
188
- return code `${this.name}.schema`;
189
- }
190
- get schemaType() {
191
- return code `typeof ${this.schema}`;
192
- }
193
- get toRdfResourceValueTypes() {
194
- return new Set([...this.identifierType.nodeKinds].map(NodeKind.toTermType));
195
- }
196
- get toRdfjsResourceType() {
197
- if (this.parentObjectTypes.length > 0) {
198
- return this.parentObjectTypes[0].toRdfjsResourceType;
199
- }
200
- return code `${this.reusables.imports.Resource}${this.identifierType.kind === "Iri" ? code `<${this.reusables.imports.NamedNode}>` : ""}`;
201
- }
202
- get valueSparqlConstructTriplesFunction() {
203
- return code `${this.name}.valueSparqlConstructTriples`;
204
- }
205
- get valueSparqlWherePatternsFunction() {
206
- return code `${this.name}.valueSparqlWherePatterns`;
207
- }
208
- get thisVariable() {
209
- return code `_${camelCase(this.name)}`;
210
- }
211
- fromJsonExpression({ variables, }) {
212
- // Assumes the JSON object has been recursively validated already.
213
- return code `${this.name}.fromJson(${variables.value})`;
214
- }
215
- fromRdfResourceValuesExpression({ variables, }) {
216
- const { resourceValues: resourceValuesVariable, ...fromRdfResourceValuesOptionsTemp } = variables;
217
- const fromRdfResourceValuesOptions = fromRdfResourceValuesOptionsTemp;
218
- if (!this.configuration.features.has("ObjectSet")) {
219
- delete fromRdfResourceValuesOptions["objectSet"];
220
- }
221
- return code `${this.name}.fromRdfResourceValues(${resourceValuesVariable}, ${fromRdfResourceValuesOptions})`;
222
- }
223
- graphqlResolveExpression({ variables, }) {
224
- return variables.value;
225
- }
226
- jsonSchema({ context, }) {
227
- let expression = code `${this.name}.Json.schema()`;
228
- if (context === "property" &&
229
- this.properties.some((property) => property.recursive)) {
230
- expression = code `${this.reusables.imports.z}.lazy((): ${this.reusables.imports.z}.ZodType<${this.name}.Json> => ${expression})`;
231
- }
232
- return expression;
233
- }
234
- jsonType() {
235
- return new AbstractType.JsonType(code `${this.name}.Json`);
236
- }
237
- jsonUiSchemaElement({ variables, }) {
238
- return Maybe.of(code `${this.name}.Json.uiSchema({ scopePrefix: ${variables.scopePrefix} })`);
239
- }
240
- toJsonExpression({ variables, }) {
241
- return code `${this.name}.toJson(${variables.value})`;
242
- }
243
- toRdfResourceValuesExpression({ variables, }) {
244
- return code `[${this.name}.toRdfResource(${variables.value}, { graph: ${variables.graph}, resourceSet: ${variables.resourceSet} }).identifier]`;
245
- }
246
- toStringExpression({ variables, }) {
247
- return code `${this.name}.${this.configuration.syntheticNamePrefix}toString(${variables.value})`;
248
- }
249
- lazyAncestorObjectTypes;
250
- lazyChildObjectTypes;
251
- lazyDescendantObjectTypes;
252
- lazyDiscriminantProperty;
253
- lazyParentObjectTypes;
254
- lazyProperties;
255
- }
256
- __decorate([
257
- Memoize()
258
- ], NamedObjectType.prototype, "_discriminantProperty", null);
259
- __decorate([
260
- Memoize()
261
- ], NamedObjectType.prototype, "ancestorObjectTypes", null);
262
- __decorate([
263
- Memoize()
264
- ], NamedObjectType.prototype, "childObjectTypes", null);
265
- __decorate([
266
- Memoize()
267
- ], NamedObjectType.prototype, "descendantFromRdfTypeVariables", null);
268
- __decorate([
269
- Memoize()
270
- ], NamedObjectType.prototype, "descendantFromRdfTypes", null);
271
- __decorate([
272
- Memoize()
273
- ], NamedObjectType.prototype, "descendantObjectTypes", null);
274
- __decorate([
275
- Memoize()
276
- ], NamedObjectType.prototype, "discriminantProperty", null);
277
- __decorate([
278
- Memoize()
279
- ], NamedObjectType.prototype, "discriminantValue", null);
280
- __decorate([
281
- Memoize()
282
- ], NamedObjectType.prototype, "equalsFunction", null);
283
- __decorate([
284
- Memoize()
285
- ], NamedObjectType.prototype, "filterFunction", null);
286
- __decorate([
287
- Memoize()
288
- ], NamedObjectType.prototype, "filterType", null);
289
- __decorate([
290
- Memoize()
291
- ], NamedObjectType.prototype, "fromRdfTypeVariable", null);
292
- __decorate([
293
- Memoize()
294
- ], NamedObjectType.prototype, "graphqlType", null);
295
- __decorate([
296
- Memoize()
297
- ], NamedObjectType.prototype, "hashFunction", null);
298
- __decorate([
299
- Memoize()
300
- ], NamedObjectType.prototype, "identifierTypeAlias", null);
301
- __decorate([
302
- Memoize()
303
- ], NamedObjectType.prototype, "mutable", null);
304
- __decorate([
305
- Memoize()
306
- ], NamedObjectType.prototype, "objectSetMethodNames", null);
307
- __decorate([
308
- Memoize()
309
- ], NamedObjectType.prototype, "parentObjectTypes", null);
310
- __decorate([
311
- Memoize()
312
- ], NamedObjectType.prototype, "properties", null);
313
- __decorate([
314
- Memoize()
315
- ], NamedObjectType.prototype, "schema", null);
316
- __decorate([
317
- Memoize()
318
- ], NamedObjectType.prototype, "schemaType", null);
319
- __decorate([
320
- Memoize()
321
- ], NamedObjectType.prototype, "toRdfResourceValueTypes", null);
322
- __decorate([
323
- Memoize()
324
- ], NamedObjectType.prototype, "toRdfjsResourceType", null);
325
- __decorate([
326
- Memoize()
327
- ], NamedObjectType.prototype, "valueSparqlConstructTriplesFunction", null);
328
- __decorate([
329
- Memoize()
330
- ], NamedObjectType.prototype, "valueSparqlWherePatternsFunction", null);
331
- __decorate([
332
- Memoize()
333
- ], NamedObjectType.prototype, "thisVariable", null);
334
- __decorate([
335
- Memoize()
336
- ], NamedObjectType.prototype, "jsonType", null);
337
- (function (NamedObjectType) {
338
- NamedObjectType.IdentifierProperty = _IdentifierProperty;
339
- NamedObjectType.ShaclProperty = _ShaclProperty;
340
- NamedObjectType.DiscriminantProperty = _DiscriminantProperty;
341
- })(NamedObjectType || (NamedObjectType = {}));
342
- //# sourceMappingURL=NamedObjectType.js.map
@@ -1,37 +0,0 @@
1
- import { AbstractNamedUnionType } from "./AbstractNamedUnionType.js";
2
- import { AbstractType } from "./AbstractType.js";
3
- import type { BlankNodeType } from "./BlankNodeType.js";
4
- import type { IdentifierType } from "./IdentifierType.js";
5
- import type { IriType } from "./IriType.js";
6
- import type { NamedObjectType } from "./NamedObjectType.js";
7
- import { type Code } from "./ts-poet-wrapper.js";
8
- export declare class NamedObjectUnionType extends AbstractNamedUnionType<NamedObjectType> {
9
- #private;
10
- readonly graphqlArgs: AbstractType["graphqlArgs"];
11
- readonly kind = "NamedObjectUnion";
12
- readonly synthetic: boolean;
13
- constructor({ identifierType, synthetic, ...superParameters }: {
14
- identifierType: BlankNodeType | IdentifierType | IriType;
15
- synthetic: boolean;
16
- } & Omit<ConstructorParameters<typeof AbstractNamedUnionType<NamedObjectType>>[0], "identifierType">);
17
- get graphqlType(): AbstractType.GraphqlType;
18
- get identifierTypeAlias(): Code;
19
- get objectSetMethodNames(): NamedObjectType.ObjectSetMethodNames;
20
- get schema(): Code;
21
- get schemaType(): Code;
22
- protected get staticModuleDeclarations(): Record<string, Code>;
23
- private get focusSparqlConstructTriplesFunctionDeclaration();
24
- private get focusSparqlWherePatternsFunctionDeclaration();
25
- private get fromRdfResourceFunctionDeclaration();
26
- private get graphqlTypeVariableStatement();
27
- private get identifierTypeDeclarations();
28
- private get isTypeFunctionDeclaration();
29
- private get schemaVariableStatement();
30
- private get toRdfResourceFunctionDeclaration();
31
- graphqlResolveExpression({ variables, }: {
32
- variables: {
33
- value: Code;
34
- };
35
- }): Code;
36
- }
37
- //# sourceMappingURL=NamedObjectUnionType.d.ts.map
@@ -1,11 +0,0 @@
1
- import { AbstractNamedUnionType } from "./AbstractNamedUnionType.js";
2
- import type { AbstractType } from "./AbstractType.js";
3
- import type { Type } from "./Type.js";
4
- import type { Code } from "./ts-poet-wrapper.js";
5
- export declare class NamedUnionType extends AbstractNamedUnionType<Type> {
6
- readonly graphqlArgs: AbstractType["graphqlArgs"];
7
- readonly kind = "NamedUnion";
8
- graphqlResolveExpression(): Code;
9
- get graphqlType(): AbstractType.GraphqlType;
10
- }
11
- //# sourceMappingURL=NamedUnionType.d.ts.map