@shaclmate/compiler 4.0.39 → 4.0.41

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 (211) hide show
  1. package/dist/ShapesGraphToAstTransformer.d.ts +0 -8
  2. package/dist/ShapesGraphToAstTransformer.js +5 -85
  3. package/dist/_ShapesGraphToAstTransformer/shapeNodeKinds.js +128 -160
  4. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.d.ts +1 -1
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +0 -16
  6. package/dist/ast/AbstractCompoundType.d.ts +2 -1
  7. package/dist/ast/AbstractCompoundType.js +1 -1
  8. package/dist/ast/AbstractLazyObjectType.d.ts +0 -2
  9. package/dist/ast/Ast.d.ts +1 -3
  10. package/dist/ast/ListType.d.ts +1 -1
  11. package/dist/ast/ListType.js +1 -1
  12. package/dist/ast/ObjectType.d.ts +0 -12
  13. package/dist/ast/ObjectType.js +0 -78
  14. package/dist/generators/AstJsonGenerator.js +7 -3
  15. package/dist/generators/transformAstToLabeledPropertyGraph.js +59 -56
  16. package/dist/generators/ts/AbstractCollectionType.d.ts +5 -12
  17. package/dist/generators/ts/AbstractCollectionType.js +9 -68
  18. package/dist/generators/ts/AbstractContainerType.d.ts +4 -6
  19. package/dist/generators/ts/AbstractContainerType.js +5 -9
  20. package/dist/generators/ts/AbstractDateType.d.ts +6 -3
  21. package/dist/generators/ts/AbstractDateType.js +7 -2
  22. package/dist/generators/ts/AbstractIdentifierType.d.ts +4 -0
  23. package/dist/generators/ts/AbstractIdentifierType.js +3 -0
  24. package/dist/generators/ts/AbstractLazyObjectType.d.ts +9 -9
  25. package/dist/generators/ts/AbstractLazyObjectType.js +30 -19
  26. package/dist/generators/ts/AbstractLiteralType.d.ts +1 -0
  27. package/dist/generators/ts/AbstractNumericType.d.ts +1 -1
  28. package/dist/generators/ts/AbstractNumericType.js +9 -9
  29. package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
  30. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  31. package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -0
  32. package/dist/generators/ts/AbstractPrimitiveType.js +2 -2
  33. package/dist/generators/ts/AbstractTermType.d.ts +1 -2
  34. package/dist/generators/ts/AbstractTermType.js +3 -5
  35. package/dist/generators/ts/AbstractType.d.ts +61 -26
  36. package/dist/generators/ts/AbstractType.js +37 -17
  37. package/dist/generators/ts/BigDecimalType.d.ts +5 -1
  38. package/dist/generators/ts/BigDecimalType.js +6 -3
  39. package/dist/generators/ts/BigIntType.d.ts +3 -1
  40. package/dist/generators/ts/BigIntType.js +3 -3
  41. package/dist/generators/ts/BlankNodeType.d.ts +3 -3
  42. package/dist/generators/ts/BlankNodeType.js +13 -13
  43. package/dist/generators/ts/BooleanType.d.ts +5 -3
  44. package/dist/generators/ts/BooleanType.js +11 -6
  45. package/dist/generators/ts/DefaultValueType.d.ts +40 -2
  46. package/dist/generators/ts/DefaultValueType.js +14 -12
  47. package/dist/generators/ts/FloatType.d.ts +3 -1
  48. package/dist/generators/ts/FloatType.js +1 -1
  49. package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
  50. package/dist/generators/ts/GraphqlSchema.js +6 -6
  51. package/dist/generators/ts/IdentifierType.d.ts +3 -3
  52. package/dist/generators/ts/IdentifierType.js +19 -17
  53. package/dist/generators/ts/IntType.d.ts +3 -1
  54. package/dist/generators/ts/IntType.js +1 -1
  55. package/dist/generators/ts/IriType.d.ts +2 -2
  56. package/dist/generators/ts/IriType.js +21 -19
  57. package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -0
  58. package/dist/generators/ts/LazyObjectOptionType.js +14 -10
  59. package/dist/generators/ts/LazyObjectSetType.js +14 -8
  60. package/dist/generators/ts/LazyObjectType.js +9 -6
  61. package/dist/generators/ts/ListType.d.ts +13 -5
  62. package/dist/generators/ts/ListType.js +48 -12
  63. package/dist/generators/ts/LiteralType.d.ts +5 -1
  64. package/dist/generators/ts/LiteralType.js +11 -8
  65. package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +19 -34
  66. package/dist/generators/ts/ObjectType.js +282 -0
  67. package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
  68. package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +52 -60
  69. package/dist/generators/ts/OptionType.d.ts +6 -2
  70. package/dist/generators/ts/OptionType.js +20 -15
  71. package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -11
  72. package/dist/generators/ts/SetType.d.ts +16 -1
  73. package/dist/generators/ts/SetType.js +80 -2
  74. package/dist/generators/ts/Snippets.d.ts +3 -1
  75. package/dist/generators/ts/Snippets.js +18 -4
  76. package/dist/generators/ts/SparqlObjectSetType.js +2 -2
  77. package/dist/generators/ts/StringType.d.ts +5 -3
  78. package/dist/generators/ts/StringType.js +15 -6
  79. package/dist/generators/ts/TermType.d.ts +6 -2
  80. package/dist/generators/ts/TermType.js +15 -12
  81. package/dist/generators/ts/TsGenerator.d.ts +1 -1
  82. package/dist/generators/ts/TsGenerator.js +60 -32
  83. package/dist/generators/ts/Type.d.ts +4 -5
  84. package/dist/generators/ts/TypeFactory.d.ts +7 -8
  85. package/dist/generators/ts/TypeFactory.js +62 -76
  86. package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +36 -11
  87. package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +296 -105
  88. package/dist/generators/ts/ZodGenerator.d.ts +1 -1
  89. package/dist/generators/ts/ZodGenerator.js +21 -16
  90. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +9 -6
  91. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +3 -3
  92. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +9 -13
  93. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +22 -39
  94. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +1 -5
  95. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +18 -13
  96. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
  97. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +44 -0
  98. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
  99. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +3 -7
  100. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
  101. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -6
  102. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
  103. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +2 -5
  104. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  105. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +2 -6
  106. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  107. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +5 -24
  108. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  109. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +18 -0
  110. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  111. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js +51 -0
  112. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  113. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +15 -0
  114. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
  115. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js → _ObjectType/ObjectType_fromRdfTypeVariableStatement.js} +2 -2
  116. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +5 -0
  117. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js → _ObjectType/ObjectType_graphqlTypeVariableStatement.js} +4 -4
  118. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +4 -0
  119. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +41 -0
  120. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
  121. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +12 -0
  122. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
  123. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +20 -0
  124. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
  125. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js → _ObjectType/ObjectType_jsonParseFunctionDeclaration.js} +2 -2
  126. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
  127. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js} +5 -11
  128. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
  129. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +9 -0
  130. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
  131. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -6
  132. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts → _ObjectType/ObjectType_objectSetMethodNames.d.ts} +3 -3
  133. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.js → _ObjectType/ObjectType_objectSetMethodNames.js} +4 -4
  134. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +5 -0
  135. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +12 -0
  136. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +3 -3
  137. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js} +5 -5
  138. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +3 -3
  139. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +12 -0
  140. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +5 -0
  141. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +20 -0
  142. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
  143. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_toRdfResourceFunctionDeclaration.js} +4 -4
  144. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +4 -0
  145. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js → _ObjectType/ObjectType_toStringFunctionDeclarations.js} +7 -14
  146. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  147. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  148. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  149. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +3 -3
  150. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.js +12 -12
  151. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
  152. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.js +16 -0
  153. package/dist/generators/ts/_snippets/snippets_convertToArraySet.d.ts +3 -0
  154. package/dist/generators/ts/_snippets/snippets_convertToArraySet.js +8 -0
  155. package/dist/generators/ts/_snippets/snippets_convertToList.d.ts +3 -0
  156. package/dist/generators/ts/_snippets/snippets_convertToList.js +7 -0
  157. package/dist/generators/ts/_snippets/snippets_convertToScalarSet.d.ts +3 -0
  158. package/dist/generators/ts/_snippets/snippets_convertToScalarSet.js +15 -0
  159. package/dist/input/generated.d.ts +758 -117
  160. package/dist/input/generated.js +636 -128
  161. package/package.json +4 -6
  162. package/dist/generators/ts/AbstractNamedUnionType.d.ts +0 -30
  163. package/dist/generators/ts/AbstractNamedUnionType.js +0 -190
  164. package/dist/generators/ts/AnonymousUnionType.d.ts +0 -27
  165. package/dist/generators/ts/AnonymousUnionType.js +0 -59
  166. package/dist/generators/ts/NamedObjectType.js +0 -342
  167. package/dist/generators/ts/NamedObjectUnionType.d.ts +0 -37
  168. package/dist/generators/ts/NamedUnionType.d.ts +0 -11
  169. package/dist/generators/ts/NamedUnionType.js +0 -13
  170. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +0 -5
  171. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.js +0 -65
  172. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +0 -5
  173. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +0 -5
  174. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +0 -5
  175. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  176. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  177. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  178. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js +0 -43
  179. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  180. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js +0 -80
  181. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  182. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  183. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  184. package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  185. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +0 -4
  186. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js +0 -45
  187. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
  188. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.js +0 -16
  189. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
  190. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js +0 -17
  191. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +0 -5
  192. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  193. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  194. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js +0 -16
  195. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  196. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +0 -5
  197. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +0 -12
  198. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -12
  199. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  200. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js +0 -41
  201. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  202. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +0 -4
  203. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  204. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  205. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +0 -4
  206. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.js +0 -25
  207. package/dist/generators/ts/_snippets/snippets_convertToArray.d.ts +0 -3
  208. package/dist/generators/ts/_snippets/snippets_convertToArray.js +0 -8
  209. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
  210. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
  211. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +0 -0
@@ -1,15 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import { code } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_fromRdfResourceValuesFunctionDeclaration() {
4
- if (!this.configuration.features.has("Object.fromRdf")) {
5
- return Maybe.empty();
6
- }
7
- return Maybe.of(code `\
8
- export const fromRdfResourceValues: ${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.name}> = (values, options) =>
9
- values.chain(
10
- values => values.chainMap(
11
- value => value.toResource().chain(resource => ${this.name}.fromRdfResource(resource, options))
12
- )
13
- );`);
14
- }
15
- //# sourceMappingURL=NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_fromRdfTypeVariableStatement(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_fromRdfTypeVariableStatement.d.ts.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_graphqlTypeVariableStatement(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_graphqlTypeVariableStatement.d.ts.map
@@ -1,4 +0,0 @@
1
- import type { NamedObjectType } from "../NamedObjectType.js";
2
- import { type Code } from "../ts-poet-wrapper.js";
3
- export declare function NamedObjectType_hashFunctionDeclarations(this: NamedObjectType): readonly Code[];
4
- //# sourceMappingURL=NamedObjectType_hashFunctionDeclarations.d.ts.map
@@ -1,45 +0,0 @@
1
- import { code, joinCode } from "../ts-poet-wrapper.js";
2
- const hasherVariable = code `hasher`;
3
- export function NamedObjectType_hashFunctionDeclarations() {
4
- if (!this.configuration.features.has("Object.hash")) {
5
- return [];
6
- }
7
- const hashOwnShaclPropertiesStatements = this.properties.flatMap((property) => property.kind === "Shacl"
8
- ? property.hashStatements({
9
- variables: {
10
- hasher: hasherVariable,
11
- value: property.accessExpression({
12
- variables: { object: this.thisVariable },
13
- }),
14
- },
15
- })
16
- : []);
17
- const hashShaclPropertiesStatements = [];
18
- const hashStatements = [];
19
- for (const parentObjectType of this.parentObjectTypes) {
20
- hashShaclPropertiesStatements.push(code `${parentObjectType.name}.hashShaclProperties(${hasherVariable}, ${this.thisVariable});`);
21
- }
22
- hashStatements.push(code `${this.name}.hashShaclProperties(${hasherVariable}, ${this.thisVariable});`);
23
- hashShaclPropertiesStatements.push(...hashOwnShaclPropertiesStatements);
24
- hashShaclPropertiesStatements.push(code `return ${hasherVariable};`);
25
- hashStatements.push(...this.properties
26
- .filter((property) => property.kind !== "Shacl")
27
- .flatMap((property) => property.hashStatements({
28
- variables: {
29
- hasher: hasherVariable,
30
- value: code `${property.accessExpression({ variables: { object: this.thisVariable } })}`,
31
- },
32
- })));
33
- hashStatements.push(code `return ${hasherVariable};`);
34
- return [
35
- code `\
36
- export function hash<HasherT extends ${this.reusables.snippets.Hasher}>(${hasherVariable}: HasherT, ${this.thisVariable}: ${this.name}): HasherT {
37
- ${joinCode(hashStatements)}
38
- }`,
39
- code `\
40
- export function hashShaclProperties<HasherT extends ${this.reusables.snippets.Hasher}>(${hasherVariable}: HasherT, ${this.thisVariable}: ${this.name}): HasherT {
41
- ${joinCode(hashShaclPropertiesStatements)}
42
- }`,
43
- ];
44
- }
45
- //# sourceMappingURL=NamedObjectType_hashFunctionDeclarations.js.map
@@ -1,4 +0,0 @@
1
- import type { NamedObjectType } from "../NamedObjectType.js";
2
- import { type Code } from "../ts-poet-wrapper.js";
3
- export declare function NamedObjectType_interfaceDeclaration(this: NamedObjectType): Code;
4
- //# sourceMappingURL=NamedObjectType_interfaceDeclaration.d.ts.map
@@ -1,16 +0,0 @@
1
- import { code, joinCode } from "../ts-poet-wrapper.js";
2
- import { tsComment } from "../tsComment.js";
3
- export function NamedObjectType_interfaceDeclaration() {
4
- return code `\
5
- ${this.comment
6
- .alt(this.label)
7
- .map(tsComment)
8
- .orDefault("")}export interface ${this.name}${this.parentObjectTypes.length > 0
9
- ? ` extends ${this.parentObjectTypes
10
- .map((parentObjectType) => parentObjectType.name)
11
- .join(", ")}`
12
- : ""} {
13
- ${joinCode(this.properties.map((property) => property.declaration), { on: "\n\n" })}
14
- }`;
15
- }
16
- //# sourceMappingURL=NamedObjectType_interfaceDeclaration.js.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_isTypeFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.d.ts.map
@@ -1,17 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import { code } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_isTypeFunctionDeclaration() {
4
- if (!this.configuration.features.has("Object.type")) {
5
- return Maybe.empty();
6
- }
7
- return Maybe.of(code `\
8
- export function is${this.name}(object: ${this.configuration.syntheticNamePrefix}Object): object is ${this.name} {
9
- switch (object.${this._discriminantProperty.name}) {
10
- ${this._discriminantProperty.type.descendantValues
11
- .concat(this._discriminantProperty.type.ownValues)
12
- .map((value) => `case "${value}":`)
13
- .join("\n")} return true; default: return false;
14
- }
15
- }`);
16
- }
17
- //# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.js.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_jsonParseFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_jsonParseFunctionDeclaration.d.ts.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_jsonSchemaFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_jsonSchemaFunctionDeclaration.d.ts.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_jsonTypeAliasDeclaration(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_jsonTypeAliasDeclaration.d.ts.map
@@ -1,16 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import { code, joinCode } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_jsonTypeAliasDeclaration() {
4
- if (!this.configuration.features.has("Object.JSON.type")) {
5
- return Maybe.empty();
6
- }
7
- const members = [];
8
- if (this.properties.length > 0) {
9
- members.push(code `{ ${joinCode(this.properties.flatMap((property) => property.jsonSignature.toList()), { on: ";" })} }`);
10
- }
11
- for (const parentObjectType of this.parentObjectTypes) {
12
- members.push(code `${parentObjectType.jsonType().name}`);
13
- }
14
- return Maybe.of(code `export type Json = ${members.length > 0 ? joinCode(members, { on: " & " }) : "object"};`);
15
- }
16
- //# sourceMappingURL=NamedObjectType_jsonTypeAliasDeclaration.js.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_jsonUiSchemaFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_schemaVariableStatement(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_schemaVariableStatement.d.ts.map
@@ -1,12 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import { code, joinCode } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_schemaVariableStatement() {
4
- if (!this.configuration.features.has("Object.schema")) {
5
- return Maybe.empty();
6
- }
7
- return Maybe.of(code `\
8
- export const schema = { properties: { ${joinCode(this.parentObjectTypes
9
- .map((parentObjectType) => code `...${parentObjectType.name}.schema.properties`)
10
- .concat(this.properties.flatMap(property => property.schema.toList().map(propertySchema => code `${property.name}: ${propertySchema}`))), { on: ", " })} } } as const;`);
11
- }
12
- //# sourceMappingURL=NamedObjectType_schemaVariableStatement.js.map
@@ -1,12 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import { code } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_sparqlConstructQueryStringFunctionDeclaration() {
4
- if (!this.configuration.features.has("Object.SPARQL")) {
5
- return Maybe.empty();
6
- }
7
- return Maybe.of(code `\
8
- export function sparqlConstructQueryString(parameters: Parameters<typeof ${this.name}.sparqlConstructQuery>[0] & ${this.reusables.imports.sparqljs}.GeneratorOptions): string {
9
- return new ${this.reusables.imports.sparqljs}.Generator(parameters).stringify(${this.name}.sparqlConstructQuery(parameters));
10
- }`);
11
- }
12
- //# sourceMappingURL=NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_toJsonFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_toJsonFunctionDeclaration.d.ts.map
@@ -1,41 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import { code, joinCode } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_toJsonFunctionDeclaration() {
4
- if (!this.configuration.features.has("Object.toJson")) {
5
- return Maybe.empty();
6
- }
7
- const jsonObjectMembers = [];
8
- for (const parentObjectType of this.parentObjectTypes) {
9
- jsonObjectMembers.push(code `...${parentObjectType.name}.toJson(${this.thisVariable})`);
10
- }
11
- if (this.properties.length > 0) {
12
- jsonObjectMembers.push(...this.properties.flatMap((property) => property
13
- .toJsonInitializer({
14
- variables: {
15
- value: property.accessExpression({
16
- variables: { object: this.thisVariable },
17
- }),
18
- },
19
- })
20
- .toList()));
21
- }
22
- const returnType = this.jsonType().name;
23
- // 20241220: don't add @type until we're doing JSON-LD
24
- // switch (this.toRdfTypes.length) {
25
- // case 0:
26
- // break;
27
- // case 1:
28
- // jsonObjectMembers.push(`"@type": "${this.toRdfTypes[0].value}"`);
29
- // break;
30
- // default:
31
- // jsonObjectMembers.push(
32
- // `"@type": ${JSON.stringify(this.toRdfTypes.map((rdfType) => rdfType.value))}`,
33
- // );
34
- // break;
35
- // }
36
- return Maybe.of(code `\
37
- export function toJson(${this.thisVariable}: ${this.name}): ${returnType} {
38
- return JSON.parse(JSON.stringify({ ${joinCode(jsonObjectMembers, { on: "," })} } satisfies ${this.jsonType().name}));
39
- }`);
40
- }
41
- //# sourceMappingURL=NamedObjectType_toJsonFunctionDeclaration.js.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_toRdfResourceFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_toRdfResourceFunctionDeclaration.d.ts.map
@@ -1,4 +0,0 @@
1
- import type { NamedObjectType } from "../NamedObjectType.js";
2
- import { type Code } from "../ts-poet-wrapper.js";
3
- export declare function NamedObjectType_toStringFunctionDeclarations(this: NamedObjectType): readonly Code[];
4
- //# sourceMappingURL=NamedObjectType_toStringFunctionDeclarations.d.ts.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts.map
@@ -1,5 +0,0 @@
1
- import { Maybe } from "purify-ts";
2
- import type { NamedObjectType } from "../NamedObjectType.js";
3
- import { type Code } from "../ts-poet-wrapper.js";
4
- export declare function NamedObjectType_valueSparqlWherePatternsFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
- //# sourceMappingURL=NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts.map
@@ -1,4 +0,0 @@
1
- import type { NamedObjectType } from "../NamedObjectType.js";
2
- import { type Code } from "../ts-poet-wrapper.js";
3
- export declare function identifierTypeDeclarations(this: NamedObjectType): readonly Code[];
4
- //# sourceMappingURL=identifierTypeDeclarations.d.ts.map
@@ -1,25 +0,0 @@
1
- import { code } from "../ts-poet-wrapper.js";
2
- export function identifierTypeDeclarations() {
3
- if (!this.configuration.features.has("Object.type")) {
4
- return [];
5
- }
6
- const ancestorObjectTypeWithSameIdentifierType = this.ancestorObjectTypes.find((ancestorObjectType) => ancestorObjectType.identifierType.name === this.identifierType.name);
7
- if (ancestorObjectTypeWithSameIdentifierType) {
8
- // This object type's identifier type has the same identifier type as an ancestor object type,
9
- // so just reuse the latter.
10
- return [
11
- code `export type Identifier = ${ancestorObjectTypeWithSameIdentifierType.identifierTypeAlias};`,
12
- code `export const Identifier = ${ancestorObjectTypeWithSameIdentifierType.identifierTypeAlias};`,
13
- ];
14
- }
15
- // Bespoke identifier type and associated functions
16
- return [
17
- code `export type Identifier = ${this.identifierType.name};`,
18
- code `\
19
- export namespace Identifier {
20
- export const parse = ${this.identifierType.parseFunction};
21
- export const stringify = ${this.identifierType.stringifyFunction};
22
- }`,
23
- ];
24
- }
25
- //# sourceMappingURL=identifierTypeDeclarations.js.map
@@ -1,3 +0,0 @@
1
- import type { SnippetFactory } from "../SnippetFactory.js";
2
- export declare const snippets_convertToArray: SnippetFactory;
3
- //# sourceMappingURL=snippets_convertToArray.d.ts.map
@@ -1,8 +0,0 @@
1
- import { code, conditionalOutput } from "../ts-poet-wrapper.js";
2
- export const snippets_convertToArray = ({ imports, snippets, syntheticNamePrefix, }) => conditionalOutput(`${syntheticNamePrefix}convertToArray`, code `\
3
- function ${syntheticNamePrefix}convertToArray<ItemSourceT, ItemTargetT, Readonly extends boolean>(convertToItem: ${snippets.ConversionFunction}<ItemSourceT, ItemTargetT>, _readonly: Readonly) {
4
- type EitherR = Readonly extends true ? ReadonlyArray<ItemTargetT> : Array<ItemTargetT>;
5
- return (value: readonly ItemSourceT[] | undefined): ${imports.Either}<Error, EitherR> =>
6
- (typeof value === "undefined" ? ${imports.Either}.of([]) : ${imports.Either}.sequence(value.map(convertToItem))) as ${imports.Either}<Error, EitherR>;
7
- }`);
8
- //# sourceMappingURL=snippets_convertToArray.js.map