@shaclmate/compiler 4.0.9 → 4.0.11

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 (184) hide show
  1. package/dist/ShapesGraphToAstTransformer.js +1 -1
  2. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +4 -1
  3. package/dist/ast/AbstractCompoundType.js +0 -2
  4. package/dist/ast/Ast.d.ts +1 -1
  5. package/dist/ast/IntersectionType.js +4 -3
  6. package/dist/ast/UnionType.js +3 -2
  7. package/dist/generators/json/AstJsonGenerator.js +1 -1
  8. package/dist/generators/ts/AbstractCollectionType.d.ts +1 -1
  9. package/dist/generators/ts/AbstractCollectionType.js +2 -2
  10. package/dist/generators/ts/AbstractContainerType.d.ts +2 -2
  11. package/dist/generators/ts/AbstractContainerType.js +1 -1
  12. package/dist/generators/ts/AbstractLazyObjectType.d.ts +3 -3
  13. package/dist/generators/ts/AbstractLazyObjectType.js +2 -2
  14. package/dist/generators/ts/AbstractNamedUnionType.d.ts +2 -2
  15. package/dist/generators/ts/AbstractNamedUnionType.js +17 -15
  16. package/dist/generators/ts/AbstractNumericType.d.ts +1 -1
  17. package/dist/generators/ts/AbstractNumericType.js +1 -1
  18. package/dist/generators/ts/AbstractType.d.ts +5 -5
  19. package/dist/generators/ts/AbstractUnionType.d.ts +1 -1
  20. package/dist/generators/ts/AbstractUnionType.js +6 -6
  21. package/dist/generators/ts/AnonymousUnionType.d.ts +1 -1
  22. package/dist/generators/ts/AnonymousUnionType.js +2 -2
  23. package/dist/generators/ts/BigDecimalType.d.ts +1 -1
  24. package/dist/generators/ts/BigDecimalType.js +2 -2
  25. package/dist/generators/ts/BigIntType.d.ts +1 -1
  26. package/dist/generators/ts/BigIntType.js +1 -1
  27. package/dist/generators/ts/BlankNodeType.d.ts +1 -1
  28. package/dist/generators/ts/BlankNodeType.js +1 -1
  29. package/dist/generators/ts/BooleanType.d.ts +1 -1
  30. package/dist/generators/ts/BooleanType.js +1 -1
  31. package/dist/generators/ts/DateTimeType.d.ts +1 -1
  32. package/dist/generators/ts/DateTimeType.js +1 -1
  33. package/dist/generators/ts/DateType.d.ts +1 -1
  34. package/dist/generators/ts/DateType.js +1 -1
  35. package/dist/generators/ts/DefaultValueType.d.ts +1 -1
  36. package/dist/generators/ts/DefaultValueType.js +3 -3
  37. package/dist/generators/ts/IdentifierType.d.ts +1 -1
  38. package/dist/generators/ts/IdentifierType.js +1 -1
  39. package/dist/generators/ts/IriType.d.ts +1 -1
  40. package/dist/generators/ts/IriType.js +1 -1
  41. package/dist/generators/ts/LazyObjectOptionType.js +1 -1
  42. package/dist/generators/ts/LazyObjectSetType.js +1 -1
  43. package/dist/generators/ts/LazyObjectType.js +2 -2
  44. package/dist/generators/ts/ListType.d.ts +2 -2
  45. package/dist/generators/ts/ListType.js +1 -1
  46. package/dist/generators/ts/LiteralType.d.ts +1 -1
  47. package/dist/generators/ts/LiteralType.js +1 -1
  48. package/dist/generators/ts/{ObjectType.d.ts → NamedObjectType.d.ts} +28 -28
  49. package/dist/generators/ts/{ObjectType.js → NamedObjectType.js} +105 -97
  50. package/dist/generators/ts/NamedObjectUnionType.d.ts +4 -4
  51. package/dist/generators/ts/NamedObjectUnionType.js +8 -12
  52. package/dist/generators/ts/OptionType.d.ts +1 -1
  53. package/dist/generators/ts/OptionType.js +2 -2
  54. package/dist/generators/ts/StringType.d.ts +1 -1
  55. package/dist/generators/ts/StringType.js +1 -1
  56. package/dist/generators/ts/TermType.d.ts +1 -1
  57. package/dist/generators/ts/TermType.js +1 -1
  58. package/dist/generators/ts/TsGenerator.js +8 -8
  59. package/dist/generators/ts/Type.d.ts +2 -2
  60. package/dist/generators/ts/TypeFactory.d.ts +2 -2
  61. package/dist/generators/ts/TypeFactory.js +36 -36
  62. package/dist/generators/ts/ZodGenerator.js +14 -12
  63. package/dist/generators/ts/{_ObjectType → _NamedObjectType}/AbstractProperty.d.ts +6 -6
  64. package/dist/generators/ts/{_ObjectType → _NamedObjectType}/AbstractProperty.js +3 -3
  65. package/dist/generators/ts/{_ObjectType → _NamedObjectType}/DiscriminantProperty.d.ts +1 -1
  66. package/dist/generators/ts/{_ObjectType → _NamedObjectType}/DiscriminantProperty.js +13 -11
  67. package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierPrefixProperty.d.ts +1 -1
  68. package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierPrefixProperty.js +4 -4
  69. package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierProperty.d.ts +1 -1
  70. package/dist/generators/ts/{_ObjectType → _NamedObjectType}/IdentifierProperty.js +24 -24
  71. package/dist/generators/ts/_NamedObjectType/NamedObjectType_classDeclaration.d.ts +4 -0
  72. package/dist/generators/ts/{_ObjectType/ObjectType_classDeclaration.js → _NamedObjectType/NamedObjectType_classDeclaration.js} +14 -14
  73. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +5 -0
  74. package/dist/generators/ts/{_ObjectType/ObjectType_createFunctionDeclaration.js → _NamedObjectType/NamedObjectType_createFunctionDeclaration.js} +2 -2
  75. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.d.ts +5 -0
  76. package/dist/generators/ts/{_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.js} +2 -2
  77. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +4 -0
  78. package/dist/generators/ts/{_ObjectType/ObjectType_filterFunctionDeclaration.js → _NamedObjectType/NamedObjectType_filterFunctionDeclaration.js} +2 -2
  79. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +4 -0
  80. package/dist/generators/ts/{_ObjectType/ObjectType_filterTypeDeclaration.js → _NamedObjectType/NamedObjectType_filterTypeDeclaration.js} +2 -2
  81. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  82. package/dist/generators/ts/{_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +2 -2
  83. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  84. package/dist/generators/ts/{_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +2 -2
  85. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  86. package/dist/generators/ts/{_ObjectType/ObjectType_fromJsonFunctionDeclaration.js → _NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js} +2 -2
  87. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  88. package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js → _NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js} +2 -2
  89. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  90. package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js → _NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js} +2 -2
  91. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
  92. package/dist/generators/ts/{_ObjectType/ObjectType_fromRdfTypeVariableStatement.js → _NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js} +2 -2
  93. package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +5 -0
  94. package/dist/generators/ts/{_ObjectType/ObjectType_graphqlTypeVariableStatement.js → _NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js} +2 -2
  95. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.d.ts +4 -0
  96. package/dist/generators/ts/{_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.js → _NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.js} +2 -2
  97. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +4 -0
  98. package/dist/generators/ts/{_ObjectType/ObjectType_interfaceDeclaration.js → _NamedObjectType/NamedObjectType_interfaceDeclaration.js} +2 -2
  99. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +4 -0
  100. package/dist/generators/ts/{_ObjectType/ObjectType_isTypeFunctionDeclaration.js → _NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js} +2 -2
  101. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
  102. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js +19 -0
  103. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
  104. package/dist/generators/ts/{_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.js → _NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js} +5 -5
  105. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
  106. package/dist/generators/ts/{_ObjectType/ObjectType_jsonTypeAliasDeclaration.js → _NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js} +2 -2
  107. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
  108. package/dist/generators/ts/{_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js → _NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
  109. package/dist/generators/ts/_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts +9 -0
  110. package/dist/generators/ts/{_ObjectType/ObjectType_objectSetMethodNames.js → _NamedObjectType/NamedObjectType_objectSetMethodNames.js} +2 -2
  111. package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.d.ts +5 -0
  112. package/dist/generators/ts/{_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.js → _NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.js} +2 -2
  113. package/dist/generators/ts/_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +5 -0
  114. package/dist/generators/ts/{_ObjectType/ObjectType_propertiesFromRdfResourceFunctionDeclaration.js → _NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js} +2 -2
  115. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +4 -0
  116. package/dist/generators/ts/{_ObjectType/ObjectType_schemaVariableStatement.js → _NamedObjectType/NamedObjectType_schemaVariableStatement.js} +2 -2
  117. package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +2 -2
  118. package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js → _NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js} +2 -2
  119. package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +2 -2
  120. package/dist/generators/ts/{_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js → _NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js} +2 -2
  121. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.d.ts +5 -0
  122. package/dist/generators/ts/{_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.js} +2 -2
  123. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +5 -0
  124. package/dist/generators/ts/{_ObjectType/ObjectType_toRdfResourceFunctionOrMethodDeclaration.js → _NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js} +2 -2
  125. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  126. package/dist/generators/ts/{_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +2 -2
  127. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  128. package/dist/generators/ts/{_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +2 -2
  129. package/dist/generators/ts/{_ObjectType → _NamedObjectType}/ShaclProperty.d.ts +1 -1
  130. package/dist/generators/ts/{_ObjectType → _NamedObjectType}/ShaclProperty.js +8 -8
  131. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +4 -0
  132. package/dist/generators/ts/graphqlSchemaVariableStatement.d.ts +2 -2
  133. package/dist/generators/ts/graphqlSchemaVariableStatement.js +23 -23
  134. package/dist/generators/ts/objectSetDeclarations.d.ts +2 -2
  135. package/dist/generators/ts/objectSetDeclarations.js +19 -16
  136. package/dist/generators/ts/objectSetInterfaceDeclaration.d.ts +3 -3
  137. package/dist/generators/ts/objectSetInterfaceDeclaration.js +6 -4
  138. package/dist/generators/ts/objectSetMethodSignatures.d.ts +4 -4
  139. package/dist/generators/ts/objectSetMethodSignatures.js +9 -9
  140. package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.d.ts +3 -3
  141. package/dist/generators/ts/rdfjsDatasetObjectSetClassDeclaration.js +47 -45
  142. package/dist/generators/ts/singleEntryRecord.d.ts +2 -0
  143. package/dist/generators/ts/singleEntryRecord.js +6 -0
  144. package/dist/generators/ts/sparqlObjectSetClassDeclaration.d.ts +3 -3
  145. package/dist/generators/ts/sparqlObjectSetClassDeclaration.js +17 -17
  146. package/dist/generators/ts/synthesizeUberObjectUnionType.d.ts +2 -2
  147. package/dist/generators/ts/synthesizeUberObjectUnionType.js +8 -8
  148. package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.d.ts +5 -5
  149. package/dist/generators/ts/unsupportedObjectSetMethodDeclarations.js +2 -2
  150. package/package.json +4 -4
  151. package/dist/generators/ts/_ObjectType/ObjectType_classDeclaration.d.ts +0 -4
  152. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
  153. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.d.ts +0 -5
  154. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -4
  155. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -4
  156. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  157. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  158. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  159. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  160. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  161. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  162. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  163. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.d.ts +0 -4
  164. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
  165. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +0 -4
  166. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  167. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js +0 -14
  168. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  169. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  170. package/dist/generators/ts/_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.d.ts +0 -5
  171. package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +0 -9
  172. package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.d.ts +0 -5
  173. package/dist/generators/ts/_ObjectType/ObjectType_parseJsonFunctionDeclaration.js +0 -19
  174. package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.d.ts +0 -5
  175. package/dist/generators/ts/_ObjectType/ObjectType_propertiesFromRdfResourceFunctionDeclaration.d.ts +0 -5
  176. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -4
  177. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.d.ts +0 -5
  178. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionOrMethodDeclaration.d.ts +0 -5
  179. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  180. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  181. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
  182. /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/Property.d.ts +0 -0
  183. /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/Property.js +0 -0
  184. /package/dist/generators/ts/{_ObjectType → _NamedObjectType}/identifierTypeDeclarations.js +0 -0
@@ -39,8 +39,8 @@ export class IdentifierProperty extends AbstractProperty {
39
39
  }
40
40
  }
41
41
  const hasQuestionToken = this.identifierMintingStrategy.isJust() ||
42
- this.objectType.ancestorObjectTypes.some((ancestorObjectType) => ancestorObjectType.identifierProperty.identifierMintingStrategy.isJust()) ||
43
- this.objectType.descendantObjectTypes.some((descendantObjectType) => descendantObjectType.identifierProperty.identifierMintingStrategy.isJust());
42
+ this.namedObjectType.ancestorObjectTypes.some((ancestorObjectType) => ancestorObjectType.identifierProperty.identifierMintingStrategy.isJust()) ||
43
+ this.namedObjectType.descendantObjectTypes.some((descendantObjectType) => descendantObjectType.identifierProperty.identifierMintingStrategy.isJust());
44
44
  const typeNames = [];
45
45
  for (const conversion of this.type.conversions) {
46
46
  if (conversion.sourceTypeof !== "undefined" &&
@@ -91,7 +91,7 @@ export class IdentifierProperty extends AbstractProperty {
91
91
  break;
92
92
  case "sha256":
93
93
  // If the object is mutable don't memoize the minted identifier, since the hash will change if the object mutates.
94
- memoizeMintedIdentifier = !this.objectType.mutable;
94
+ memoizeMintedIdentifier = !this.namedObjectType.mutable;
95
95
  mintIdentifier = code `${imports.dataFactory}.namedNode(\`\${this.${this.identifierPrefixPropertyName}}\${this.${syntheticNamePrefix}hashShaclProperties(${imports.sha256}.create())}\`)`;
96
96
  break;
97
97
  case "uuidv4":
@@ -107,11 +107,11 @@ export class IdentifierProperty extends AbstractProperty {
107
107
  ])} }`);
108
108
  }
109
109
  // If this object type has an ancestor or a descendant with an identifier minting strategy, declare a get accessor.
110
- if (this.objectType.ancestorObjectTypes.some((ancestorObjectType) => ancestorObjectType.identifierProperty.identifierMintingStrategy.isJust()) ||
111
- this.objectType.descendantObjectTypes.some((descendantObjectType) => descendantObjectType.identifierProperty.identifierMintingStrategy.isJust())) {
112
- if (this.objectType.parentObjectTypes.length > 0) {
110
+ if (this.namedObjectType.ancestorObjectTypes.some((ancestorObjectType) => ancestorObjectType.identifierProperty.identifierMintingStrategy.isJust()) ||
111
+ this.namedObjectType.descendantObjectTypes.some((descendantObjectType) => descendantObjectType.identifierProperty.identifierMintingStrategy.isJust())) {
112
+ if (this.namedObjectType.parentObjectTypes.length > 0) {
113
113
  // If this object type isn't the root, delegate up.
114
- const checkSuperIdentifierTermTypeStatements = checkIdentifierTermTypeStatements("identifier", this.objectType.parentObjectTypes[0].identifierType.nodeKinds);
114
+ const checkSuperIdentifierTermTypeStatements = checkIdentifierTermTypeStatements("identifier", this.namedObjectType.parentObjectTypes[0].identifierType.nodeKinds);
115
115
  if (checkSuperIdentifierTermTypeStatements.length === 0) {
116
116
  return Maybe.empty(); // Don't need a get accessor just to return super.identifier.
117
117
  }
@@ -148,7 +148,7 @@ export class IdentifierProperty extends AbstractProperty {
148
148
  }
149
149
  return Maybe.of(code `readonly "@id": string`);
150
150
  }
151
- get jsonZodSchema() {
151
+ get jsonZchema() {
152
152
  let schema;
153
153
  if (this.type.in_.length > 0 && this.type.kind === "IriType") {
154
154
  // Treat sh:in as a union of the IRIs
@@ -172,22 +172,22 @@ export class IdentifierProperty extends AbstractProperty {
172
172
  // };
173
173
  // }
174
174
  get abstract() {
175
- return this.objectType.abstract;
175
+ return this.namedObjectType.abstract;
176
176
  }
177
177
  get declarationModifiers() {
178
- if (this.objectType.declarationType === "interface") {
178
+ if (this.namedObjectType.declarationType === "interface") {
179
179
  return Maybe.of({ readonly: true });
180
180
  }
181
- if (this.objectType.parentObjectTypes.length > 0) {
181
+ if (this.namedObjectType.parentObjectTypes.length > 0) {
182
182
  // An ancestor will declare the identifier property.
183
183
  return Maybe.empty();
184
184
  }
185
185
  if (this.identifierMintingStrategy.isJust() ||
186
- this.objectType.ancestorObjectTypes.some((ancestorObjectType) => ancestorObjectType.identifierProperty.identifierMintingStrategy.isJust()) ||
187
- this.objectType.descendantObjectTypes.some((descendantObjectType) => descendantObjectType.identifierProperty.identifierMintingStrategy.isJust())) {
186
+ this.namedObjectType.ancestorObjectTypes.some((ancestorObjectType) => ancestorObjectType.identifierProperty.identifierMintingStrategy.isJust()) ||
187
+ this.namedObjectType.descendantObjectTypes.some((descendantObjectType) => descendantObjectType.identifierProperty.identifierMintingStrategy.isJust())) {
188
188
  return Maybe.of({
189
189
  hasQuestionToken: true,
190
- visibility: this.objectType.descendantObjectTypes.some((descendantObjectType) => descendantObjectType.identifierProperty.identifierMintingStrategy.isJust())
190
+ visibility: this.namedObjectType.descendantObjectTypes.some((descendantObjectType) => descendantObjectType.identifierProperty.identifierMintingStrategy.isJust())
191
191
  ? "protected"
192
192
  : "private",
193
193
  });
@@ -207,10 +207,10 @@ export class IdentifierProperty extends AbstractProperty {
207
207
  });
208
208
  }
209
209
  get declarationName() {
210
- if (this.objectType.declarationType === "class" &&
210
+ if (this.namedObjectType.declarationType === "class" &&
211
211
  (this.identifierMintingStrategy.isJust() ||
212
- this.objectType.ancestorObjectTypes.some((ancestorObjectType) => ancestorObjectType.identifierProperty.identifierMintingStrategy.isJust()) ||
213
- this.objectType.descendantObjectTypes.some((descendantObjectType) => descendantObjectType.identifierProperty.identifierMintingStrategy.isJust()))) {
212
+ this.namedObjectType.ancestorObjectTypes.some((ancestorObjectType) => ancestorObjectType.identifierProperty.identifierMintingStrategy.isJust()) ||
213
+ this.namedObjectType.descendantObjectTypes.some((descendantObjectType) => descendantObjectType.identifierProperty.identifierMintingStrategy.isJust()))) {
214
214
  // If this, an ancestor, or a descendant has an identifier minting strategy, declare the identifier property
215
215
  // private or protected and prefix its name with _ in order to avoid a conflict with the get accessor name.
216
216
  return `_${this.name}`;
@@ -218,7 +218,7 @@ export class IdentifierProperty extends AbstractProperty {
218
218
  return this.name;
219
219
  }
220
220
  get override() {
221
- return this.objectType.parentObjectTypes.length > 0;
221
+ return this.namedObjectType.parentObjectTypes.length > 0;
222
222
  }
223
223
  constructorStatements({ variables, }) {
224
224
  const constructorParametersSignature = this.constructorParametersSignature.extractNullable();
@@ -228,7 +228,7 @@ export class IdentifierProperty extends AbstractProperty {
228
228
  let lhs;
229
229
  const statements = [];
230
230
  const typeConversions = this.type.conversions;
231
- switch (this.objectType.declarationType) {
231
+ switch (this.namedObjectType.declarationType) {
232
232
  case "class": {
233
233
  if (this.declaration.isNothing()) {
234
234
  return [];
@@ -247,7 +247,7 @@ export class IdentifierProperty extends AbstractProperty {
247
247
  conversionBranches.push(code `if (${conversion.sourceTypeCheckExpression(variables.parameter)}) { ${lhs} = ${conversion.conversionExpression(variables.parameter)}; }`);
248
248
  }
249
249
  this.identifierMintingStrategy.ifJust((identifierMintingStrategy) => {
250
- switch (this.objectType.declarationType) {
250
+ switch (this.namedObjectType.declarationType) {
251
251
  case "class":
252
252
  // The identifier will be minted lazily in the get accessor
253
253
  invariant(this.getAccessorDeclaration.isJust());
@@ -260,10 +260,10 @@ export class IdentifierProperty extends AbstractProperty {
260
260
  mintIdentifier = code `${imports.dataFactory}.blankNode()`;
261
261
  break;
262
262
  case "sha256":
263
- logger.warn("minting %s identifiers with %s is unsupported", this.objectType.declarationType, identifierMintingStrategy);
263
+ logger.warn("minting %s identifiers with %s is unsupported", this.namedObjectType.declarationType, identifierMintingStrategy);
264
264
  return;
265
265
  case "uuidv4":
266
- mintIdentifier = code `${imports.dataFactory}.namedNode(\`\${${variables.parameters}.${this.identifierPrefixPropertyName} ?? "urn:shaclmate:${this.objectType.discriminantValue}:"}\${${imports.uuid}.v4()}\`)`;
266
+ mintIdentifier = code `${imports.dataFactory}.namedNode(\`\${${variables.parameters}.${this.identifierPrefixPropertyName} ?? "urn:shaclmate:${this.namedObjectType.discriminantValue}:"}\${${imports.uuid}.v4()}\`)`;
267
267
  break;
268
268
  }
269
269
  conversionBranches.push(code `if (${variables.parameter} === undefined) { ${lhs} = ${mintIdentifier}; }`);
@@ -306,7 +306,7 @@ export class IdentifierProperty extends AbstractProperty {
306
306
  ignoreRdfType: true, // Unused
307
307
  preferredLanguages: variables.preferredLanguages,
308
308
  propertyPatterns: code `[]`,
309
- schema: code `${this.objectType.staticModuleName}.${syntheticNamePrefix}schema.properties.${this.objectType.identifierProperty.name}.type()`,
309
+ schema: code `${this.namedObjectType.staticModuleName}.${syntheticNamePrefix}schema.properties.${this.namedObjectType.identifierProperty.name}.type()`,
310
310
  valueVariable: variables.focusIdentifier,
311
311
  variablePrefix: variables.variablePrefix, // Unused
312
312
  }})`,
@@ -357,7 +357,7 @@ __decorate([
357
357
  ], IdentifierProperty.prototype, "jsonSignature", null);
358
358
  __decorate([
359
359
  Memoize()
360
- ], IdentifierProperty.prototype, "jsonZodSchema", null);
360
+ ], IdentifierProperty.prototype, "jsonZchema", null);
361
361
  __decorate([
362
362
  Memoize()
363
363
  ], IdentifierProperty.prototype, "declarationModifiers", null);
@@ -0,0 +1,4 @@
1
+ import type { NamedObjectType } from "../NamedObjectType.js";
2
+ import { type Code } from "../ts-poet-wrapper.js";
3
+ export declare function NamedObjectType_classDeclaration(this: NamedObjectType): Code;
4
+ //# sourceMappingURL=NamedObjectType_classDeclaration.d.ts.map
@@ -2,11 +2,11 @@ import { Maybe } from "purify-ts";
2
2
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
3
3
  import { code, def, joinCode } from "../ts-poet-wrapper.js";
4
4
  import { tsComment } from "../tsComment.js";
5
- import { ObjectType_equalsFunctionOrMethodDeclaration } from "./ObjectType_equalsFunctionOrMethodDeclaration.js";
6
- import { ObjectType_hashFunctionOrMethodDeclarations } from "./ObjectType_hashFunctionOrMethodDeclarations.js";
7
- import { ObjectType_toJsonFunctionOrMethodDeclaration } from "./ObjectType_toJsonFunctionOrMethodDeclaration.js";
8
- import { ObjectType_toRdfResourceFunctionOrMethodDeclaration } from "./ObjectType_toRdfResourceFunctionOrMethodDeclaration.js";
9
- function ObjectType_constructorDeclaration() {
5
+ import { NamedObjectType_equalsFunctionOrMethodDeclaration } from "./NamedObjectType_equalsFunctionOrMethodDeclaration.js";
6
+ import { NamedObjectType_hashFunctionOrMethodDeclarations } from "./NamedObjectType_hashFunctionOrMethodDeclarations.js";
7
+ import { NamedObjectType_toJsonFunctionOrMethodDeclaration } from "./NamedObjectType_toJsonFunctionOrMethodDeclaration.js";
8
+ import { NamedObjectType_toRdfResourceFunctionOrMethodDeclaration } from "./NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js";
9
+ function NamedObjectType_constructorDeclaration() {
10
10
  const parametersPropertySignatures = this.properties.flatMap((property) => property.constructorParametersSignature.toList());
11
11
  const parametersType = [];
12
12
  if (parametersPropertySignatures.length > 0) {
@@ -41,7 +41,7 @@ constructor(${statements.length > 0 ? "parameters" : "_parameters"}${parametersH
41
41
  ${joinCode(statements)}
42
42
  }`;
43
43
  }
44
- export function ObjectType_classDeclaration() {
44
+ export function NamedObjectType_classDeclaration() {
45
45
  this.ensureAtMostOneSuperObjectType();
46
46
  return code `\
47
47
  ${this.comment
@@ -50,20 +50,20 @@ ${this.comment
50
50
  .orDefault("")}export ${this.abstract ? "abstract " : ""}class ${def(this.name)}${this.parentObjectTypes.length > 0 ? ` extends ${this.parentObjectTypes[0].name}` : ""} {
51
51
  ${joinCode([
52
52
  ...this.properties.flatMap((property) => property.declaration.toList()),
53
- ObjectType_constructorDeclaration.call(this),
53
+ NamedObjectType_constructorDeclaration.call(this),
54
54
  ...this.properties.flatMap((property) => property.getAccessorDeclaration.toList()),
55
- ...ObjectType_equalsFunctionOrMethodDeclaration.call(this).toList(),
56
- ...ObjectType_hashFunctionOrMethodDeclarations.call(this),
57
- ...ObjectType_toJsonFunctionOrMethodDeclaration.call(this).toList(),
58
- ...ObjectType_toRdfResourceFunctionOrMethodDeclaration.call(this).toList(),
59
- ...ObjectType_toStringMethodDeclaration.call(this).toList(),
55
+ ...NamedObjectType_equalsFunctionOrMethodDeclaration.call(this).toList(),
56
+ ...NamedObjectType_hashFunctionOrMethodDeclarations.call(this),
57
+ ...NamedObjectType_toJsonFunctionOrMethodDeclaration.call(this).toList(),
58
+ ...NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.call(this).toList(),
59
+ ...NamedObjectType_toStringMethodDeclaration.call(this).toList(),
60
60
  ], { on: "\n\n" })}
61
61
  }`;
62
62
  }
63
- function ObjectType_toStringMethodDeclaration() {
63
+ function NamedObjectType_toStringMethodDeclaration() {
64
64
  if (!this.features.has("json")) {
65
65
  return Maybe.empty();
66
66
  }
67
67
  return Maybe.of(code `${this.parentObjectTypes.length > 0 ? "override " : ""}toString(): string { return JSON.stringify(this.${syntheticNamePrefix}toJson()); }`);
68
68
  }
69
- //# sourceMappingURL=ObjectType_classDeclaration.js.map
69
+ //# sourceMappingURL=NamedObjectType_classDeclaration.js.map
@@ -0,0 +1,5 @@
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_createFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=NamedObjectType_createFunctionDeclaration.d.ts.map
@@ -2,7 +2,7 @@ import { Maybe } from "purify-ts";
2
2
  import { invariant } from "ts-invariant";
3
3
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
4
4
  import { code, joinCode } from "../ts-poet-wrapper.js";
5
- export function ObjectType_createFunctionDeclaration() {
5
+ export function NamedObjectType_createFunctionDeclaration() {
6
6
  if (!this.features.has("create")) {
7
7
  return Maybe.empty();
8
8
  }
@@ -49,4 +49,4 @@ export function ${syntheticNamePrefix}create(parameters${parametersHasQuestionTo
49
49
  return { ${propertyInitializers.join(", ")} };
50
50
  }`);
51
51
  }
52
- //# sourceMappingURL=ObjectType_createFunctionDeclaration.js.map
52
+ //# sourceMappingURL=NamedObjectType_createFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
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_equalsFunctionOrMethodDeclaration(this: NamedObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=NamedObjectType_equalsFunctionOrMethodDeclaration.d.ts.map
@@ -2,7 +2,7 @@ import { Maybe } from "purify-ts";
2
2
  import { snippets } from "../snippets.js";
3
3
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
4
4
  import { code, joinCode } from "../ts-poet-wrapper.js";
5
- export function ObjectType_equalsFunctionOrMethodDeclaration() {
5
+ export function NamedObjectType_equalsFunctionOrMethodDeclaration() {
6
6
  if (!this.features.has("equals")) {
7
7
  return Maybe.empty();
8
8
  }
@@ -48,4 +48,4 @@ ${preamble}${syntheticNamePrefix}equals(${parameters}): ${snippets.EqualsResult}
48
48
  return ${joinCode(chain.map((chainPart, chainPartI) => chainPartI === 0 ? chainPart : code `chain(() => ${chainPart})`), { on: "." })}
49
49
  }`);
50
50
  }
51
- //# sourceMappingURL=ObjectType_equalsFunctionOrMethodDeclaration.js.map
51
+ //# sourceMappingURL=NamedObjectType_equalsFunctionOrMethodDeclaration.js.map
@@ -0,0 +1,4 @@
1
+ import type { NamedObjectType } from "../NamedObjectType.js";
2
+ import { type Code } from "../ts-poet-wrapper.js";
3
+ export declare function NamedObjectType_filterFunctionDeclaration(this: NamedObjectType): Code;
4
+ //# sourceMappingURL=NamedObjectType_filterFunctionDeclaration.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
2
2
  import { code, joinCode } from "../ts-poet-wrapper.js";
3
- export function ObjectType_filterFunctionDeclaration() {
3
+ export function NamedObjectType_filterFunctionDeclaration() {
4
4
  const statements = [];
5
5
  for (const parentObjectType of this.parentObjectTypes) {
6
6
  statements.push(code `if (!${parentObjectType.filterFunction}(filter, value)) { return false; }`);
@@ -18,4 +18,4 @@ export function ${syntheticNamePrefix}filter(filter: ${this.filterType}, value:
18
18
  ${joinCode(statements)}
19
19
  }`;
20
20
  }
21
- //# sourceMappingURL=ObjectType_filterFunctionDeclaration.js.map
21
+ //# sourceMappingURL=NamedObjectType_filterFunctionDeclaration.js.map
@@ -0,0 +1,4 @@
1
+ import type { NamedObjectType } from "../NamedObjectType.js";
2
+ import { type Code } from "../ts-poet-wrapper.js";
3
+ export declare function NamedObjectType_filterTypeDeclaration(this: NamedObjectType): Code;
4
+ //# sourceMappingURL=NamedObjectType_filterTypeDeclaration.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
2
2
  import { code, joinCode } from "../ts-poet-wrapper.js";
3
- export function ObjectType_filterTypeDeclaration() {
3
+ export function NamedObjectType_filterTypeDeclaration() {
4
4
  const members = [];
5
5
  if (this.properties.length > 0) {
6
6
  const filterProperties = {};
@@ -19,4 +19,4 @@ export function ObjectType_filterTypeDeclaration() {
19
19
  return code `\
20
20
  export type ${syntheticNamePrefix}Filter = ${members.length > 0 ? joinCode(members, { on: " & " }) : "object"};`;
21
21
  }
22
- //# sourceMappingURL=ObjectType_filterTypeDeclaration.js.map
22
+ //# sourceMappingURL=NamedObjectType_filterTypeDeclaration.js.map
@@ -0,0 +1,5 @@
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_focusSparqlConstructTriplesFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts.map
@@ -10,7 +10,7 @@ const variables = {
10
10
  focusIdentifier: code `parameters.focusIdentifier`,
11
11
  variablePrefix: code `parameters.variablePrefix`,
12
12
  };
13
- export function ObjectType_focusSparqlConstructTriplesFunctionDeclaration() {
13
+ export function NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration() {
14
14
  if (!this.features.has("sparql")) {
15
15
  return Maybe.empty();
16
16
  }
@@ -55,4 +55,4 @@ ${statements.length > 0
55
55
  : "return [];"}
56
56
  };`);
57
57
  }
58
- //# sourceMappingURL=ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js.map
58
+ //# sourceMappingURL=NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
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_focusSparqlWherePatternsFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts.map
@@ -11,7 +11,7 @@ const variables = {
11
11
  focusIdentifier: code `parameters.focusIdentifier`,
12
12
  variablePrefix: code `parameters.variablePrefix`,
13
13
  };
14
- export function ObjectType_focusSparqlWherePatternsFunctionDeclaration() {
14
+ export function NamedObjectType_focusSparqlWherePatternsFunctionDeclaration() {
15
15
  if (!this.features.has("sparql")) {
16
16
  return Maybe.empty();
17
17
  }
@@ -103,4 +103,4 @@ ${statements.length > 0
103
103
  : "return [];"}
104
104
  };`);
105
105
  }
106
- //# sourceMappingURL=ObjectType_focusSparqlWherePatternsFunctionDeclaration.js.map
106
+ //# sourceMappingURL=NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
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_fromJsonFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=NamedObjectType_fromJsonFunctionDeclaration.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
3
3
  import { code } from "../ts-poet-wrapper.js";
4
- export function ObjectType_fromJsonFunctionDeclaration() {
4
+ export function NamedObjectType_fromJsonFunctionDeclaration() {
5
5
  if (!this.features.has("json")) {
6
6
  return Maybe.empty();
7
7
  }
@@ -17,4 +17,4 @@ export function ${syntheticNamePrefix}fromJson(json: ${this.jsonType().name}): $
17
17
  return ${returnExpression};
18
18
  }`);
19
19
  }
20
- //# sourceMappingURL=ObjectType_fromJsonFunctionDeclaration.js.map
20
+ //# sourceMappingURL=NamedObjectType_fromJsonFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
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_fromRdfResourceFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts.map
@@ -2,7 +2,7 @@ import { Maybe } from "purify-ts";
2
2
  import { snippets } from "../snippets.js";
3
3
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
4
4
  import { code, joinCode } from "../ts-poet-wrapper.js";
5
- export function ObjectType_fromRdfResourceFunctionDeclaration() {
5
+ export function NamedObjectType_fromRdfResourceFunctionDeclaration() {
6
6
  if (!this.features.has("rdf")) {
7
7
  return Maybe.empty();
8
8
  }
@@ -23,4 +23,4 @@ export const ${syntheticNamePrefix}fromRdfResource: ${snippets.FromRdfResourceFu
23
23
  ${joinCode(statements)}
24
24
  };`);
25
25
  }
26
- //# sourceMappingURL=ObjectType_fromRdfResourceFunctionDeclaration.js.map
26
+ //# sourceMappingURL=NamedObjectType_fromRdfResourceFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
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_fromRdfResourceValuesFunctionDeclaration(this: NamedObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts.map
@@ -2,7 +2,7 @@ import { Maybe } from "purify-ts";
2
2
  import { snippets } from "../snippets.js";
3
3
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
4
4
  import { code } from "../ts-poet-wrapper.js";
5
- export function ObjectType_fromRdfResourceValuesFunctionDeclaration() {
5
+ export function NamedObjectType_fromRdfResourceValuesFunctionDeclaration() {
6
6
  if (!this.features.has("rdf")) {
7
7
  return Maybe.empty();
8
8
  }
@@ -17,4 +17,4 @@ export const ${syntheticNamePrefix}fromRdfResourceValues: ${snippets.FromRdfReso
17
17
  )
18
18
  );`);
19
19
  }
20
- //# sourceMappingURL=ObjectType_fromRdfResourceValuesFunctionDeclaration.js.map
20
+ //# sourceMappingURL=NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
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
@@ -3,11 +3,11 @@ import { imports } from "../imports.js";
3
3
  import { rdfjsTermExpression } from "../rdfjsTermExpression.js";
4
4
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
5
5
  import { code } from "../ts-poet-wrapper.js";
6
- export function ObjectType_fromRdfTypeVariableStatement() {
6
+ export function NamedObjectType_fromRdfTypeVariableStatement() {
7
7
  if (!this.features.has("rdf")) {
8
8
  return Maybe.empty();
9
9
  }
10
10
  return this.fromRdfType.map((fromRdfType) => code `\
11
11
  export const ${syntheticNamePrefix}fromRdfType: ${imports.NamedNode}<string> = ${rdfjsTermExpression(fromRdfType)};`);
12
12
  }
13
- //# sourceMappingURL=ObjectType_fromRdfTypeVariableStatement.js.map
13
+ //# sourceMappingURL=NamedObjectType_fromRdfTypeVariableStatement.js.map
@@ -0,0 +1,5 @@
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
@@ -2,7 +2,7 @@ import { Maybe } from "purify-ts";
2
2
  import { imports } from "../imports.js";
3
3
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
4
4
  import { code } from "../ts-poet-wrapper.js";
5
- export function ObjectType_graphqlTypeVariableStatement() {
5
+ export function NamedObjectType_graphqlTypeVariableStatement() {
6
6
  if (!this.features.has("graphql")) {
7
7
  return Maybe.empty();
8
8
  }
@@ -32,4 +32,4 @@ export const ${syntheticNamePrefix}GraphQL = new ${imports.GraphQLObjectType}<${
32
32
  name: this.name,
33
33
  }});`);
34
34
  }
35
- //# sourceMappingURL=ObjectType_graphqlTypeVariableStatement.js.map
35
+ //# sourceMappingURL=NamedObjectType_graphqlTypeVariableStatement.js.map
@@ -0,0 +1,4 @@
1
+ import type { NamedObjectType } from "../NamedObjectType.js";
2
+ import { type Code } from "../ts-poet-wrapper.js";
3
+ export declare function NamedObjectType_hashFunctionOrMethodDeclarations(this: NamedObjectType): readonly Code[];
4
+ //# sourceMappingURL=NamedObjectType_hashFunctionOrMethodDeclarations.d.ts.map
@@ -2,7 +2,7 @@ import { snippets } from "../snippets.js";
2
2
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
3
3
  import { code, joinCode } from "../ts-poet-wrapper.js";
4
4
  const hasherVariable = code `_hasher`;
5
- export function ObjectType_hashFunctionOrMethodDeclarations() {
5
+ export function NamedObjectType_hashFunctionOrMethodDeclarations() {
6
6
  if (!this.features.has("hash")) {
7
7
  return [];
8
8
  }
@@ -70,4 +70,4 @@ ${hashShaclPropertiesPreamble}${syntheticNamePrefix}hashShaclProperties<HasherT
70
70
  }`,
71
71
  ];
72
72
  }
73
- //# sourceMappingURL=ObjectType_hashFunctionOrMethodDeclarations.js.map
73
+ //# sourceMappingURL=NamedObjectType_hashFunctionOrMethodDeclarations.js.map
@@ -0,0 +1,4 @@
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,6 +1,6 @@
1
1
  import { code, joinCode } from "../ts-poet-wrapper.js";
2
2
  import { tsComment } from "../tsComment.js";
3
- export function ObjectType_interfaceDeclaration() {
3
+ export function NamedObjectType_interfaceDeclaration() {
4
4
  return code `\
5
5
  ${this.comment
6
6
  .alt(this.label)
@@ -13,4 +13,4 @@ ${this.comment
13
13
  ${joinCode(this.properties.flatMap((property) => property.declaration.toList()))}
14
14
  }`;
15
15
  }
16
- //# sourceMappingURL=ObjectType_interfaceDeclaration.js.map
16
+ //# sourceMappingURL=NamedObjectType_interfaceDeclaration.js.map
@@ -0,0 +1,4 @@
1
+ import type { NamedObjectType } from "../NamedObjectType.js";
2
+ import { type Code } from "../ts-poet-wrapper.js";
3
+ export declare function NamedObjectType_isTypeFunctionDeclaration(this: NamedObjectType): Code;
4
+ //# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
2
2
  import { code } from "../ts-poet-wrapper.js";
3
- export function ObjectType_isTypeFunctionDeclaration() {
3
+ export function NamedObjectType_isTypeFunctionDeclaration() {
4
4
  return code `\
5
5
  export function is${this.name}(object: ${syntheticNamePrefix}Object): object is ${this.name} {
6
6
  switch (object.${this._discriminantProperty.name}) {
@@ -11,4 +11,4 @@ export function is${this.name}(object: ${syntheticNamePrefix}Object): object is
11
11
  }
12
12
  }`;
13
13
  }
14
- //# sourceMappingURL=ObjectType_isTypeFunctionDeclaration.js.map
14
+ //# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
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
@@ -0,0 +1,19 @@
1
+ import { Maybe } from "purify-ts";
2
+ import { imports } from "../imports.js";
3
+ import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
4
+ import { code } from "../ts-poet-wrapper.js";
5
+ export function NamedObjectType_jsonParseFunctionDeclaration() {
6
+ if (!this.features.has("json")) {
7
+ return Maybe.empty();
8
+ }
9
+ if (this.abstract) {
10
+ return Maybe.empty();
11
+ }
12
+ return Maybe.of(code `\
13
+ export function parse(json: unknown): ${imports.Either}<Error, ${syntheticNamePrefix}Json> {
14
+ const jsonSafeParseResult = schema().safeParse(json);
15
+ if (!jsonSafeParseResult.success) { return ${imports.Left}(jsonSafeParseResult.error); }
16
+ return ${imports.Right}(jsonSafeParseResult.data);
17
+ }`);
18
+ }
19
+ //# sourceMappingURL=NamedObjectType_jsonParseFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
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
@@ -2,21 +2,21 @@ import { Maybe } from "purify-ts";
2
2
  import { imports } from "../imports.js";
3
3
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
4
4
  import { code, joinCode } from "../ts-poet-wrapper.js";
5
- export function ObjectType_jsonZodSchemaFunctionDeclaration() {
5
+ export function NamedObjectType_jsonSchemaFunctionDeclaration() {
6
6
  if (!this.features.has("json")) {
7
7
  return Maybe.empty();
8
8
  }
9
9
  const mergeZodObjectSchemas = [];
10
10
  for (const parentObjectType of this.parentObjectTypes) {
11
- mergeZodObjectSchemas.push(parentObjectType.jsonZodSchema({ context: "type" }));
11
+ mergeZodObjectSchemas.push(parentObjectType.jsonSchema({ context: "type" }));
12
12
  }
13
13
  if (this.properties.length > 0) {
14
14
  mergeZodObjectSchemas.push(code `${imports.z}.object({ ${joinCode(this.properties
15
- .flatMap((property) => property.jsonZodSchema.toList())
15
+ .flatMap((property) => property.jsonZchema.toList())
16
16
  .map(({ key, schema }) => code `"${key}": ${schema}`), { on: "," })} })`);
17
17
  }
18
18
  return Maybe.of(code `\
19
- export function ${syntheticNamePrefix}jsonZodSchema() {
19
+ export function schema() {
20
20
  return ${mergeZodObjectSchemas.length > 0
21
21
  ? mergeZodObjectSchemas.reduce((merged, zodObjectSchema) => {
22
22
  if (merged === null) {
@@ -27,4 +27,4 @@ export function ${syntheticNamePrefix}jsonZodSchema() {
27
27
  : `${imports.z}.object()`} satisfies ${imports.z}.ZodType<${syntheticNamePrefix}Json>;
28
28
  }`);
29
29
  }
30
- //# sourceMappingURL=ObjectType_jsonZodSchemaFunctionDeclaration.js.map
30
+ //# sourceMappingURL=NamedObjectType_jsonSchemaFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
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,7 +1,7 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { syntheticNamePrefix } from "../syntheticNamePrefix.js";
3
3
  import { code, joinCode } from "../ts-poet-wrapper.js";
4
- export function ObjectType_jsonTypeAliasDeclaration() {
4
+ export function NamedObjectType_jsonTypeAliasDeclaration() {
5
5
  if (!this.features.has("json")) {
6
6
  return Maybe.empty();
7
7
  }
@@ -14,4 +14,4 @@ export function ObjectType_jsonTypeAliasDeclaration() {
14
14
  }
15
15
  return Maybe.of(code `export type ${syntheticNamePrefix}Json = ${members.length > 0 ? joinCode(members, { on: " & " }) : "object"};`);
16
16
  }
17
- //# sourceMappingURL=ObjectType_jsonTypeAliasDeclaration.js.map
17
+ //# sourceMappingURL=NamedObjectType_jsonTypeAliasDeclaration.js.map
@@ -0,0 +1,5 @@
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