@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
@@ -28,7 +28,7 @@ export class LazyObjectOptionType extends Super {
28
28
  }
29
29
  get conversions() {
30
30
  const conversions = super.conversions.concat();
31
- if (this.partialType.itemType.kind === "ObjectType") {
31
+ if (this.partialType.itemType.kind === "NamedObjectType") {
32
32
  conversions.push({
33
33
  conversionExpression: (value) => code `new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}: ${value}.map(object => ${this.partialType.itemType.newExpression({ parameters: code `object` })}), resolver: async () => ${imports.Right}((${value} as ${imports.Maybe}<${this.resolveType.itemType.name}>).unsafeCoerce()) })`,
34
34
  sourceTypeCheckExpression: (value) => code `${imports.Maybe}.isMaybe(${value})`,
@@ -34,7 +34,7 @@ export class LazyObjectSetType extends AbstractLazyObjectType {
34
34
  }
35
35
  get conversions() {
36
36
  const conversions = super.conversions.concat();
37
- if (this.partialType.itemType.kind === "ObjectType") {
37
+ if (this.partialType.itemType.kind === "NamedObjectType") {
38
38
  conversions.push({
39
39
  conversionExpression: (value) => code `new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}: ${value}.map(object => ${this.partialType.itemType.newExpression({ parameters: code `object` })}), resolver: async () => ${imports.Right}(${value} as readonly ${this.resolveType.itemType.name}[]) })`,
40
40
  sourceTypeCheckExpression: (value) => code `typeof ${value} === "object"`,
@@ -20,10 +20,10 @@ export class LazyObjectType extends AbstractLazyObjectType {
20
20
  }
21
21
  get conversions() {
22
22
  const conversions = super.conversions.concat();
23
- if (this.partialType.kind === "ObjectType") {
23
+ if (this.partialType.kind === "NamedObjectType") {
24
24
  conversions.push({
25
25
  conversionExpression: (value) => code `new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}: ${this.partialType.newExpression({ parameters: value })}, resolver: async () => ${imports.Right}(${value} as ${this.resolveType.name}) })`,
26
- // Don't check instanceof value since the ObjectType may be an interface
26
+ // Don't check instanceof value since the NamedObjectType may be an interface
27
27
  // Rely on the fact that this will be the last type check on an object
28
28
  sourceTypeCheckExpression: (value) => code `typeof ${value} === "object"`,
29
29
  sourceTypeName: this.resolveType.name,
@@ -14,9 +14,9 @@ import type { IdentifierType } from "./IdentifierType.js";
14
14
  import type { IntType } from "./IntType.js";
15
15
  import type { IriType } from "./IriType.js";
16
16
  import type { LiteralType } from "./LiteralType.js";
17
+ import type { NamedObjectType } from "./NamedObjectType.js";
17
18
  import type { NamedObjectUnionType } from "./NamedObjectUnionType.js";
18
19
  import type { NamedUnionType } from "./NamedUnionType.js";
19
- import type { ObjectType } from "./ObjectType.js";
20
20
  import type { StringType } from "./StringType.js";
21
21
  import type { TermType } from "./TermType.js";
22
22
  import type { Type } from "./Type.js";
@@ -38,7 +38,7 @@ export declare class ListType<ItemTypeT extends ListType.ItemType> extends Abstr
38
38
  toRdfResourceValuesExpression({ variables, }: Parameters<AbstractCollectionType<ItemTypeT>["toRdfResourceValuesExpression"]>[0]): Code;
39
39
  }
40
40
  export declare namespace ListType {
41
- type ItemType = AnonymousUnionType | BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | FloatType | IdentifierType | IntType | IriType | LiteralType | NamedObjectUnionType | NamedUnionType | ObjectType | StringType | TermType;
41
+ type ItemType = AnonymousUnionType | BigDecimalType | BigIntType | BlankNodeType | BooleanType | DateTimeType | DateType | FloatType | IdentifierType | IntType | IriType | LiteralType | NamedObjectUnionType | NamedUnionType | NamedObjectType | StringType | TermType;
42
42
  function isItemType(type: Type): type is ItemType;
43
43
  }
44
44
  //# sourceMappingURL=ListType.d.ts.map
@@ -135,7 +135,7 @@ __decorate([
135
135
  case "LiteralType":
136
136
  case "NamedObjectUnionType":
137
137
  case "NamedUnionType":
138
- case "ObjectType":
138
+ case "NamedObjectType":
139
139
  case "StringType":
140
140
  case "TermType":
141
141
  return true;
@@ -12,7 +12,7 @@ export declare class LiteralType extends AbstractLiteralType {
12
12
  graphqlResolveExpression(_parameters: Parameters<AbstractLiteralType["graphqlResolveExpression"]>[0]): Code;
13
13
  hashStatements({ depth, variables, }: Parameters<AbstractLiteralType["hashStatements"]>[0]): readonly Code[];
14
14
  jsonType(parameters?: Parameters<AbstractLiteralType["jsonType"]>[0]): AbstractLiteralType.JsonType;
15
- jsonZodSchema({ includeDiscriminantProperty, }: Parameters<AbstractLiteralType["jsonZodSchema"]>[0]): Code;
15
+ jsonSchema({ includeDiscriminantProperty, }: Parameters<AbstractLiteralType["jsonSchema"]>[0]): Code;
16
16
  toJsonExpression({ includeDiscriminantProperty, variables, }: Parameters<AbstractLiteralType["toJsonExpression"]>[0]): Code;
17
17
  }
18
18
  //# sourceMappingURL=LiteralType.d.ts.map
@@ -32,7 +32,7 @@ export class LiteralType extends AbstractLiteralType {
32
32
  : "";
33
33
  return new AbstractLiteralType.JsonType(code `{ readonly "@language"?: string${discriminantProperty}, readonly "@type"?: string, readonly "@value": string }`);
34
34
  }
35
- jsonZodSchema({ includeDiscriminantProperty, }) {
35
+ jsonSchema({ includeDiscriminantProperty, }) {
36
36
  const discriminantProperty = includeDiscriminantProperty
37
37
  ? code `, termType: ${imports.z}.literal("Literal")`
38
38
  : "";
@@ -2,18 +2,18 @@ import type { NamedNode } from "@rdfjs/types";
2
2
  import { Maybe, NonEmptyList } from "purify-ts";
3
3
  import type { TsFeature } from "../../enums/TsFeature.js";
4
4
  import type { TsObjectDeclarationType } from "../../enums/TsObjectDeclarationType.js";
5
- import { DiscriminantProperty as _DiscriminantProperty } from "./_ObjectType/DiscriminantProperty.js";
6
- import { IdentifierPrefixProperty as _IdentifierPrefixProperty } from "./_ObjectType/IdentifierPrefixProperty.js";
7
- import { IdentifierProperty as _IdentifierProperty } from "./_ObjectType/IdentifierProperty.js";
8
- import type { Property as _Property } from "./_ObjectType/Property.js";
9
- import { ShaclProperty as _ShaclProperty } from "./_ObjectType/ShaclProperty.js";
5
+ import { DiscriminantProperty as _DiscriminantProperty } from "./_NamedObjectType/DiscriminantProperty.js";
6
+ import { IdentifierPrefixProperty as _IdentifierPrefixProperty } from "./_NamedObjectType/IdentifierPrefixProperty.js";
7
+ import { IdentifierProperty as _IdentifierProperty } from "./_NamedObjectType/IdentifierProperty.js";
8
+ import type { Property as _Property } from "./_NamedObjectType/Property.js";
9
+ import { ShaclProperty as _ShaclProperty } from "./_NamedObjectType/ShaclProperty.js";
10
10
  import { AbstractType } from "./AbstractType.js";
11
11
  import type { BlankNodeType } from "./BlankNodeType.js";
12
12
  import type { IdentifierType } from "./IdentifierType.js";
13
13
  import type { IriType } from "./IriType.js";
14
14
  import type { Type } from "./Type.js";
15
15
  import { type Code } from "./ts-poet-wrapper.js";
16
- export declare class ObjectType extends AbstractType {
16
+ export declare class NamedObjectType extends AbstractType {
17
17
  private readonly imports;
18
18
  protected readonly toRdfTypes: readonly NamedNode[];
19
19
  readonly abstract: boolean;
@@ -23,7 +23,7 @@ export declare class ObjectType extends AbstractType {
23
23
  readonly fromRdfType: Maybe<NamedNode>;
24
24
  readonly graphqlArgs: AbstractType["graphqlArgs"];
25
25
  readonly identifierType: BlankNodeType | IdentifierType | IriType;
26
- readonly kind = "ObjectType";
26
+ readonly kind = "NamedObjectType";
27
27
  readonly name: string;
28
28
  readonly recursive: boolean;
29
29
  readonly staticModuleName: string;
@@ -39,26 +39,27 @@ export declare class ObjectType extends AbstractType {
39
39
  identifierType: BlankNodeType | IdentifierType | IriType;
40
40
  imports: readonly string[];
41
41
  label: Maybe<string>;
42
- lazyAncestorObjectTypes: () => readonly ObjectType[];
43
- lazyChildObjectTypes: () => readonly ObjectType[];
44
- lazyDiscriminantProperty: (objectType: ObjectType) => ObjectType.DiscriminantProperty;
45
- lazyIdentifierProperty: (objectType: ObjectType) => ObjectType.IdentifierProperty;
46
- lazyDescendantObjectTypes: () => readonly ObjectType[];
47
- lazyParentObjectTypes: () => readonly ObjectType[];
48
- lazyProperties: (objectType: ObjectType) => readonly ObjectType.Property[];
42
+ lazyAncestorObjectTypes: () => readonly NamedObjectType[];
43
+ lazyChildObjectTypes: () => readonly NamedObjectType[];
44
+ lazyDiscriminantProperty: (namedObjectType: NamedObjectType) => NamedObjectType.DiscriminantProperty;
45
+ lazyIdentifierProperty: (namedObjectType: NamedObjectType) => NamedObjectType.IdentifierProperty;
46
+ lazyDescendantObjectTypes: () => readonly NamedObjectType[];
47
+ lazyParentObjectTypes: () => readonly NamedObjectType[];
48
+ lazyProperties: (namedObjectType: NamedObjectType) => readonly NamedObjectType.Property[];
49
49
  name: string;
50
50
  recursive: boolean;
51
51
  staticModuleName: string;
52
52
  synthetic: boolean;
53
53
  toRdfTypes: readonly NamedNode[];
54
54
  } & ConstructorParameters<typeof AbstractType>[0]);
55
- get ancestorObjectTypes(): readonly ObjectType[];
56
- get childObjectTypes(): readonly ObjectType[];
55
+ get _discriminantProperty(): NamedObjectType.DiscriminantProperty;
56
+ get ancestorObjectTypes(): readonly NamedObjectType[];
57
+ get childObjectTypes(): readonly NamedObjectType[];
57
58
  get conversions(): readonly AbstractType.Conversion[];
58
59
  get declaration(): Maybe<Code>;
59
60
  get descendantFromRdfTypeVariables(): readonly Code[];
60
61
  get descendantFromRdfTypes(): readonly NamedNode[];
61
- get descendantObjectTypes(): readonly ObjectType[];
62
+ get descendantObjectTypes(): readonly NamedObjectType[];
62
63
  get discriminantProperty(): Maybe<AbstractType.DiscriminantProperty>;
63
64
  get discriminantValue(): string;
64
65
  get equalsFunction(): Code;
@@ -66,20 +67,19 @@ export declare class ObjectType extends AbstractType {
66
67
  get filterType(): Code;
67
68
  get fromRdfTypeVariable(): Maybe<Code>;
68
69
  get graphqlType(): AbstractType.GraphqlType;
69
- get identifierProperty(): ObjectType.IdentifierProperty;
70
+ get identifierProperty(): NamedObjectType.IdentifierProperty;
70
71
  get identifierTypeAlias(): Code;
71
72
  get mutable(): boolean;
72
- get objectSetMethodNames(): ObjectType.ObjectSetMethodNames;
73
- get ownProperties(): readonly ObjectType.Property[];
74
- get ownShaclProperties(): readonly ObjectType.ShaclProperty<Type>[];
75
- get parentObjectTypes(): readonly ObjectType[];
76
- get properties(): readonly ObjectType.Property[];
73
+ get objectSetMethodNames(): NamedObjectType.ObjectSetMethodNames;
74
+ get ownProperties(): readonly NamedObjectType.Property[];
75
+ get ownShaclProperties(): readonly NamedObjectType.ShaclProperty<Type>[];
76
+ get parentObjectTypes(): readonly NamedObjectType[];
77
+ get properties(): readonly NamedObjectType.Property[];
77
78
  get schema(): Code;
78
79
  get schemaType(): Code;
80
+ get toRdfjsResourceType(): Code;
79
81
  get valueSparqlConstructTriplesFunction(): Code;
80
82
  get valueSparqlWherePatternsFunction(): Code;
81
- get toRdfjsResourceType(): Code;
82
- get _discriminantProperty(): ObjectType.DiscriminantProperty;
83
83
  protected get thisVariable(): Code;
84
84
  fromJsonExpression({ variables, }: Parameters<AbstractType["fromJsonExpression"]>[0]): Code;
85
85
  fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractType["fromRdfResourceValuesExpression"]>[0]): Code;
@@ -89,9 +89,9 @@ export declare class ObjectType extends AbstractType {
89
89
  };
90
90
  }): Code;
91
91
  hashStatements({ variables, }: Parameters<AbstractType["hashStatements"]>[0]): readonly Code[];
92
+ jsonSchema({ context, }: Parameters<AbstractType["jsonSchema"]>[0]): Code;
92
93
  jsonType(): AbstractType.JsonType;
93
94
  jsonUiSchemaElement({ variables, }: Parameters<AbstractType["jsonUiSchemaElement"]>[0]): Maybe<Code>;
94
- jsonZodSchema({ context, }: Parameters<AbstractType["jsonZodSchema"]>[0]): Code;
95
95
  newExpression({ parameters }: {
96
96
  parameters: Code;
97
97
  }): Code;
@@ -106,7 +106,7 @@ export declare class ObjectType extends AbstractType {
106
106
  private readonly lazyParentObjectTypes;
107
107
  private readonly lazyProperties;
108
108
  }
109
- export declare namespace ObjectType {
109
+ export declare namespace NamedObjectType {
110
110
  const IdentifierPrefixProperty: typeof _IdentifierPrefixProperty;
111
111
  type IdentifierPrefixProperty = _IdentifierPrefixProperty;
112
112
  const IdentifierProperty: typeof _IdentifierProperty;
@@ -123,4 +123,4 @@ export declare namespace ObjectType {
123
123
  const DiscriminantProperty: typeof _DiscriminantProperty;
124
124
  type DiscriminantProperty = _DiscriminantProperty;
125
125
  }
126
- //# sourceMappingURL=ObjectType.d.ts.map
126
+ //# sourceMappingURL=NamedObjectType.d.ts.map
@@ -7,46 +7,45 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { camelCase } from "change-case";
8
8
  import { Maybe, NonEmptyList } from "purify-ts";
9
9
  import { Memoize } from "typescript-memoize";
10
- import { DiscriminantProperty as _DiscriminantProperty } from "./_ObjectType/DiscriminantProperty.js";
11
- import { IdentifierPrefixProperty as _IdentifierPrefixProperty } from "./_ObjectType/IdentifierPrefixProperty.js";
12
- import { IdentifierProperty as _IdentifierProperty } from "./_ObjectType/IdentifierProperty.js";
13
- import { identifierTypeDeclarations } from "./_ObjectType/identifierTypeDeclarations.js";
14
- import { ObjectType_classDeclaration } from "./_ObjectType/ObjectType_classDeclaration.js";
15
- import { ObjectType_createFunctionDeclaration } from "./_ObjectType/ObjectType_createFunctionDeclaration.js";
16
- import { ObjectType_equalsFunctionOrMethodDeclaration } from "./_ObjectType/ObjectType_equalsFunctionOrMethodDeclaration.js";
17
- import { ObjectType_filterFunctionDeclaration } from "./_ObjectType/ObjectType_filterFunctionDeclaration.js";
18
- import { ObjectType_filterTypeDeclaration } from "./_ObjectType/ObjectType_filterTypeDeclaration.js";
19
- import { ObjectType_focusSparqlConstructTriplesFunctionDeclaration } from "./_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js";
20
- import { ObjectType_focusSparqlWherePatternsFunctionDeclaration } from "./_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js";
21
- import { ObjectType_fromJsonFunctionDeclaration } from "./_ObjectType/ObjectType_fromJsonFunctionDeclaration.js";
22
- import { ObjectType_fromRdfResourceFunctionDeclaration } from "./_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js";
23
- import { ObjectType_fromRdfResourceValuesFunctionDeclaration } from "./_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js";
24
- import { ObjectType_fromRdfTypeVariableStatement } from "./_ObjectType/ObjectType_fromRdfTypeVariableStatement.js";
25
- import { ObjectType_graphqlTypeVariableStatement } from "./_ObjectType/ObjectType_graphqlTypeVariableStatement.js";
26
- import { ObjectType_hashFunctionOrMethodDeclarations } from "./_ObjectType/ObjectType_hashFunctionOrMethodDeclarations.js";
27
- import { ObjectType_interfaceDeclaration } from "./_ObjectType/ObjectType_interfaceDeclaration.js";
28
- import { ObjectType_isTypeFunctionDeclaration } from "./_ObjectType/ObjectType_isTypeFunctionDeclaration.js";
29
- import { ObjectType_jsonSchemaFunctionDeclaration } from "./_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js";
30
- import { ObjectType_jsonTypeAliasDeclaration } from "./_ObjectType/ObjectType_jsonTypeAliasDeclaration.js";
31
- import { ObjectType_jsonUiSchemaFunctionDeclaration } from "./_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js";
32
- import { ObjectType_jsonZodSchemaFunctionDeclaration } from "./_ObjectType/ObjectType_jsonZodSchemaFunctionDeclaration.js";
33
- import { ObjectType_objectSetMethodNames } from "./_ObjectType/ObjectType_objectSetMethodNames.js";
34
- import { ObjectType_parseJsonFunctionDeclaration } from "./_ObjectType/ObjectType_parseJsonFunctionDeclaration.js";
35
- import { ObjectType_propertiesFromJsonFunctionDeclaration } from "./_ObjectType/ObjectType_propertiesFromJsonFunctionDeclaration.js";
36
- import { ObjectType_propertiesFromRdfResourceFunctionDeclaration } from "./_ObjectType/ObjectType_propertiesFromRdfResourceFunctionDeclaration.js";
37
- import { ObjectType_schemaVariableStatement } from "./_ObjectType/ObjectType_schemaVariableStatement.js";
38
- import { ObjectType_sparqlConstructQueryFunctionDeclaration } from "./_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js";
39
- import { ObjectType_sparqlConstructQueryStringFunctionDeclaration } from "./_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js";
40
- import { ObjectType_toJsonFunctionOrMethodDeclaration } from "./_ObjectType/ObjectType_toJsonFunctionOrMethodDeclaration.js";
41
- import { ObjectType_toRdfResourceFunctionOrMethodDeclaration } from "./_ObjectType/ObjectType_toRdfResourceFunctionOrMethodDeclaration.js";
42
- import { ObjectType_valueSparqlConstructTriplesFunctionDeclaration } from "./_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js";
43
- import { ObjectType_valueSparqlWherePatternsFunctionDeclaration } from "./_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js";
44
- import { ShaclProperty as _ShaclProperty } from "./_ObjectType/ShaclProperty.js";
10
+ import { DiscriminantProperty as _DiscriminantProperty } from "./_NamedObjectType/DiscriminantProperty.js";
11
+ import { IdentifierPrefixProperty as _IdentifierPrefixProperty } from "./_NamedObjectType/IdentifierPrefixProperty.js";
12
+ import { IdentifierProperty as _IdentifierProperty } from "./_NamedObjectType/IdentifierProperty.js";
13
+ import { identifierTypeDeclarations } from "./_NamedObjectType/identifierTypeDeclarations.js";
14
+ import { NamedObjectType_classDeclaration } from "./_NamedObjectType/NamedObjectType_classDeclaration.js";
15
+ import { NamedObjectType_createFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_createFunctionDeclaration.js";
16
+ import { NamedObjectType_equalsFunctionOrMethodDeclaration } from "./_NamedObjectType/NamedObjectType_equalsFunctionOrMethodDeclaration.js";
17
+ import { NamedObjectType_filterFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js";
18
+ import { NamedObjectType_filterTypeDeclaration } from "./_NamedObjectType/NamedObjectType_filterTypeDeclaration.js";
19
+ import { NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js";
20
+ import { NamedObjectType_focusSparqlWherePatternsFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js";
21
+ import { NamedObjectType_fromJsonFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js";
22
+ import { NamedObjectType_fromRdfResourceFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js";
23
+ import { NamedObjectType_fromRdfResourceValuesFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js";
24
+ import { NamedObjectType_fromRdfTypeVariableStatement } from "./_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js";
25
+ import { NamedObjectType_graphqlTypeVariableStatement } from "./_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js";
26
+ import { NamedObjectType_hashFunctionOrMethodDeclarations } from "./_NamedObjectType/NamedObjectType_hashFunctionOrMethodDeclarations.js";
27
+ import { NamedObjectType_interfaceDeclaration } from "./_NamedObjectType/NamedObjectType_interfaceDeclaration.js";
28
+ import { NamedObjectType_isTypeFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js";
29
+ import { NamedObjectType_jsonParseFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js";
30
+ import { NamedObjectType_jsonSchemaFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js";
31
+ import { NamedObjectType_jsonTypeAliasDeclaration } from "./_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js";
32
+ import { NamedObjectType_jsonUiSchemaFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js";
33
+ import { NamedObjectType_objectSetMethodNames } from "./_NamedObjectType/NamedObjectType_objectSetMethodNames.js";
34
+ import { NamedObjectType_propertiesFromJsonFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_propertiesFromJsonFunctionDeclaration.js";
35
+ import { NamedObjectType_propertiesFromRdfResourceFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.js";
36
+ import { NamedObjectType_schemaVariableStatement } from "./_NamedObjectType/NamedObjectType_schemaVariableStatement.js";
37
+ import { NamedObjectType_sparqlConstructQueryFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js";
38
+ import { NamedObjectType_sparqlConstructQueryStringFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js";
39
+ import { NamedObjectType_toJsonFunctionOrMethodDeclaration } from "./_NamedObjectType/NamedObjectType_toJsonFunctionOrMethodDeclaration.js";
40
+ import { NamedObjectType_toRdfResourceFunctionOrMethodDeclaration } from "./_NamedObjectType/NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.js";
41
+ import { NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js";
42
+ import { NamedObjectType_valueSparqlWherePatternsFunctionDeclaration } from "./_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js";
43
+ import { ShaclProperty as _ShaclProperty } from "./_NamedObjectType/ShaclProperty.js";
45
44
  import { AbstractType } from "./AbstractType.js";
46
45
  import { imports } from "./imports.js";
47
46
  import { syntheticNamePrefix } from "./syntheticNamePrefix.js";
48
47
  import { code, def, joinCode } from "./ts-poet-wrapper.js";
49
- export class ObjectType extends AbstractType {
48
+ export class NamedObjectType extends AbstractType {
50
49
  imports;
51
50
  toRdfTypes;
52
51
  abstract;
@@ -56,7 +55,7 @@ export class ObjectType extends AbstractType {
56
55
  fromRdfType;
57
56
  graphqlArgs = Maybe.empty();
58
57
  identifierType;
59
- kind = "ObjectType";
58
+ kind = "NamedObjectType";
60
59
  name;
61
60
  recursive;
62
61
  staticModuleName;
@@ -85,6 +84,9 @@ export class ObjectType extends AbstractType {
85
84
  this.synthetic = synthetic;
86
85
  this.toRdfTypes = toRdfTypes;
87
86
  }
87
+ get _discriminantProperty() {
88
+ return this.lazyDiscriminantProperty(this);
89
+ }
88
90
  get ancestorObjectTypes() {
89
91
  return this.lazyAncestorObjectTypes();
90
92
  }
@@ -110,20 +112,29 @@ export class ObjectType extends AbstractType {
110
112
  const staticModuleDeclarations = [];
111
113
  switch (this.declarationType) {
112
114
  case "class": {
113
- declarations.push(ObjectType_classDeclaration.call(this));
115
+ declarations.push(NamedObjectType_classDeclaration.call(this));
114
116
  break;
115
117
  }
116
118
  case "interface": {
117
- declarations.push(ObjectType_interfaceDeclaration.call(this));
118
- staticModuleDeclarations.push(...ObjectType_createFunctionDeclaration.call(this).toList(), ...ObjectType_equalsFunctionOrMethodDeclaration.bind(this)().toList(), ...ObjectType_hashFunctionOrMethodDeclarations.call(this));
119
+ declarations.push(NamedObjectType_interfaceDeclaration.call(this));
120
+ staticModuleDeclarations.push(...NamedObjectType_createFunctionDeclaration.call(this).toList(), ...NamedObjectType_equalsFunctionOrMethodDeclaration.bind(this)().toList(), ...NamedObjectType_hashFunctionOrMethodDeclarations.call(this));
119
121
  break;
120
122
  }
121
123
  }
122
- staticModuleDeclarations.push(...ObjectType_graphqlTypeVariableStatement.call(this).toList(), ...identifierTypeDeclarations.call(this), ...ObjectType_jsonTypeAliasDeclaration.call(this).toList(), ObjectType_filterFunctionDeclaration.call(this), ObjectType_filterTypeDeclaration.call(this), ...ObjectType_focusSparqlConstructTriplesFunctionDeclaration.bind(this)().toList(), ...ObjectType_focusSparqlWherePatternsFunctionDeclaration.bind(this)().toList(), ...ObjectType_fromJsonFunctionDeclaration.call(this).toList(), ...ObjectType_fromRdfResourceFunctionDeclaration.call(this).toList(), ...ObjectType_fromRdfResourceValuesFunctionDeclaration.call(this).toList(), ...ObjectType_fromRdfTypeVariableStatement.call(this).toList(), ObjectType_isTypeFunctionDeclaration.call(this), ...ObjectType_jsonSchemaFunctionDeclaration.call(this).toList(), ...ObjectType_jsonUiSchemaFunctionDeclaration.call(this).toList(), ...ObjectType_jsonZodSchemaFunctionDeclaration.call(this).toList(), ...ObjectType_parseJsonFunctionDeclaration.call(this).toList(), ...ObjectType_propertiesFromJsonFunctionDeclaration.bind(this)().toList(), ...ObjectType_propertiesFromRdfResourceFunctionDeclaration.bind(this)().toList(), ObjectType_schemaVariableStatement.call(this), ...ObjectType_sparqlConstructQueryFunctionDeclaration.bind(this)().toList(), ...ObjectType_sparqlConstructQueryStringFunctionDeclaration.bind(this)().toList(), ...(this.declarationType === "interface"
123
- ? ObjectType_toJsonFunctionOrMethodDeclaration.call(this).toList()
124
+ const jsonModuleDeclarations = [
125
+ ...NamedObjectType_jsonParseFunctionDeclaration.call(this).toList(),
126
+ ...NamedObjectType_jsonSchemaFunctionDeclaration.call(this).toList(),
127
+ ...NamedObjectType_jsonUiSchemaFunctionDeclaration.call(this).toList(),
128
+ ];
129
+ staticModuleDeclarations.push(...NamedObjectType_graphqlTypeVariableStatement.call(this).toList(), ...identifierTypeDeclarations.call(this), ...NamedObjectType_jsonTypeAliasDeclaration.call(this).toList(), ...(jsonModuleDeclarations.length > 0
130
+ ? [
131
+ code `export namespace ${syntheticNamePrefix}Json { ${joinCode(jsonModuleDeclarations, { on: "\n\n" })} }`,
132
+ ]
133
+ : []), NamedObjectType_filterFunctionDeclaration.call(this), NamedObjectType_filterTypeDeclaration.call(this), ...NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.bind(this)().toList(), ...NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.bind(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), ...NamedObjectType_propertiesFromJsonFunctionDeclaration.bind(this)().toList(), ...NamedObjectType_propertiesFromRdfResourceFunctionDeclaration.bind(this)().toList(), NamedObjectType_schemaVariableStatement.call(this), ...NamedObjectType_sparqlConstructQueryFunctionDeclaration.bind(this)().toList(), ...NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.bind(this)().toList(), ...(this.declarationType === "interface"
134
+ ? NamedObjectType_toJsonFunctionOrMethodDeclaration.call(this).toList()
124
135
  : []), ...(this.declarationType === "interface"
125
- ? ObjectType_toRdfResourceFunctionOrMethodDeclaration.call(this).toList()
126
- : []), ...ObjectType_valueSparqlConstructTriplesFunctionDeclaration.bind(this)().toList(), ...ObjectType_valueSparqlWherePatternsFunctionDeclaration.bind(this)().toList());
136
+ ? NamedObjectType_toRdfResourceFunctionOrMethodDeclaration.call(this).toList()
137
+ : []), ...NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.bind(this)().toList(), ...NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.bind(this)().toList());
127
138
  if (staticModuleDeclarations.length > 0) {
128
139
  declarations.push(code `\
129
140
  export namespace ${def(this.staticModuleName)} {
@@ -184,7 +195,7 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
184
195
  return this.properties.some((property) => property.mutable);
185
196
  }
186
197
  get objectSetMethodNames() {
187
- return ObjectType_objectSetMethodNames.call(this);
198
+ return NamedObjectType_objectSetMethodNames.call(this);
188
199
  }
189
200
  get ownProperties() {
190
201
  if (this.parentObjectTypes.length === 0) {
@@ -217,20 +228,17 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
217
228
  get schemaType() {
218
229
  return code `typeof ${this.schema}`;
219
230
  }
220
- get valueSparqlConstructTriplesFunction() {
221
- return code `${this.staticModuleName}.${syntheticNamePrefix}valueSparqlConstructTriples`;
222
- }
223
- get valueSparqlWherePatternsFunction() {
224
- return code `${this.staticModuleName}.${syntheticNamePrefix}valueSparqlWherePatterns`;
225
- }
226
231
  get toRdfjsResourceType() {
227
232
  if (this.parentObjectTypes.length > 0) {
228
233
  return this.parentObjectTypes[0].toRdfjsResourceType;
229
234
  }
230
235
  return code `${imports.Resource}${this.identifierType.kind === "IriType" ? code `<${imports.NamedNode}>` : ""}`;
231
236
  }
232
- get _discriminantProperty() {
233
- return this.lazyDiscriminantProperty(this);
237
+ get valueSparqlConstructTriplesFunction() {
238
+ return code `${this.staticModuleName}.${syntheticNamePrefix}valueSparqlConstructTriples`;
239
+ }
240
+ get valueSparqlWherePatternsFunction() {
241
+ return code `${this.staticModuleName}.${syntheticNamePrefix}valueSparqlWherePatterns`;
234
242
  }
235
243
  get thisVariable() {
236
244
  switch (this.declarationType) {
@@ -265,20 +273,20 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
265
273
  ];
266
274
  }
267
275
  }
268
- jsonType() {
269
- return new AbstractType.JsonType(code `${this.staticModuleName}.${syntheticNamePrefix}Json`);
270
- }
271
- jsonUiSchemaElement({ variables, }) {
272
- return Maybe.of(code `${this.staticModuleName}.${syntheticNamePrefix}jsonUiSchema({ scopePrefix: ${variables.scopePrefix} })`);
273
- }
274
- jsonZodSchema({ context, }) {
275
- let expression = code `${this.staticModuleName}.${syntheticNamePrefix}jsonZodSchema()`;
276
+ jsonSchema({ context, }) {
277
+ let expression = code `${this.staticModuleName}.${syntheticNamePrefix}Json.schema()`;
276
278
  if (context === "property" &&
277
279
  this.properties.some((property) => property.recursive)) {
278
280
  expression = code `${imports.z}.lazy((): ${imports.z}.ZodType<${this.staticModuleName}.${syntheticNamePrefix}Json> => ${expression})`;
279
281
  }
280
282
  return expression;
281
283
  }
284
+ jsonType() {
285
+ return new AbstractType.JsonType(code `${this.staticModuleName}.${syntheticNamePrefix}Json`);
286
+ }
287
+ jsonUiSchemaElement({ variables, }) {
288
+ return Maybe.of(code `${this.staticModuleName}.${syntheticNamePrefix}Json.uiSchema({ scopePrefix: ${variables.scopePrefix} })`);
289
+ }
282
290
  newExpression({ parameters }) {
283
291
  switch (this.declarationType) {
284
292
  case "class":
@@ -318,95 +326,95 @@ ${joinCode(staticModuleDeclarations, { on: "\n\n" })}
318
326
  }
319
327
  __decorate([
320
328
  Memoize()
321
- ], ObjectType.prototype, "ancestorObjectTypes", null);
329
+ ], NamedObjectType.prototype, "_discriminantProperty", null);
322
330
  __decorate([
323
331
  Memoize()
324
- ], ObjectType.prototype, "childObjectTypes", null);
332
+ ], NamedObjectType.prototype, "ancestorObjectTypes", null);
325
333
  __decorate([
326
334
  Memoize()
327
- ], ObjectType.prototype, "conversions", null);
335
+ ], NamedObjectType.prototype, "childObjectTypes", null);
328
336
  __decorate([
329
337
  Memoize()
330
- ], ObjectType.prototype, "descendantFromRdfTypeVariables", null);
338
+ ], NamedObjectType.prototype, "conversions", null);
331
339
  __decorate([
332
340
  Memoize()
333
- ], ObjectType.prototype, "descendantFromRdfTypes", null);
341
+ ], NamedObjectType.prototype, "descendantFromRdfTypeVariables", null);
334
342
  __decorate([
335
343
  Memoize()
336
- ], ObjectType.prototype, "descendantObjectTypes", null);
344
+ ], NamedObjectType.prototype, "descendantFromRdfTypes", null);
337
345
  __decorate([
338
346
  Memoize()
339
- ], ObjectType.prototype, "discriminantProperty", null);
347
+ ], NamedObjectType.prototype, "descendantObjectTypes", null);
340
348
  __decorate([
341
349
  Memoize()
342
- ], ObjectType.prototype, "discriminantValue", null);
350
+ ], NamedObjectType.prototype, "discriminantProperty", null);
343
351
  __decorate([
344
352
  Memoize()
345
- ], ObjectType.prototype, "equalsFunction", null);
353
+ ], NamedObjectType.prototype, "discriminantValue", null);
346
354
  __decorate([
347
355
  Memoize()
348
- ], ObjectType.prototype, "filterFunction", null);
356
+ ], NamedObjectType.prototype, "equalsFunction", null);
349
357
  __decorate([
350
358
  Memoize()
351
- ], ObjectType.prototype, "filterType", null);
359
+ ], NamedObjectType.prototype, "filterFunction", null);
352
360
  __decorate([
353
361
  Memoize()
354
- ], ObjectType.prototype, "fromRdfTypeVariable", null);
362
+ ], NamedObjectType.prototype, "filterType", null);
355
363
  __decorate([
356
364
  Memoize()
357
- ], ObjectType.prototype, "graphqlType", null);
365
+ ], NamedObjectType.prototype, "fromRdfTypeVariable", null);
358
366
  __decorate([
359
367
  Memoize()
360
- ], ObjectType.prototype, "identifierProperty", null);
368
+ ], NamedObjectType.prototype, "graphqlType", null);
361
369
  __decorate([
362
370
  Memoize()
363
- ], ObjectType.prototype, "identifierTypeAlias", null);
371
+ ], NamedObjectType.prototype, "identifierProperty", null);
364
372
  __decorate([
365
373
  Memoize()
366
- ], ObjectType.prototype, "mutable", null);
374
+ ], NamedObjectType.prototype, "identifierTypeAlias", null);
367
375
  __decorate([
368
376
  Memoize()
369
- ], ObjectType.prototype, "objectSetMethodNames", null);
377
+ ], NamedObjectType.prototype, "mutable", null);
370
378
  __decorate([
371
379
  Memoize()
372
- ], ObjectType.prototype, "ownProperties", null);
380
+ ], NamedObjectType.prototype, "objectSetMethodNames", null);
373
381
  __decorate([
374
382
  Memoize()
375
- ], ObjectType.prototype, "ownShaclProperties", null);
383
+ ], NamedObjectType.prototype, "ownProperties", null);
376
384
  __decorate([
377
385
  Memoize()
378
- ], ObjectType.prototype, "parentObjectTypes", null);
386
+ ], NamedObjectType.prototype, "ownShaclProperties", null);
379
387
  __decorate([
380
388
  Memoize()
381
- ], ObjectType.prototype, "properties", null);
389
+ ], NamedObjectType.prototype, "parentObjectTypes", null);
382
390
  __decorate([
383
391
  Memoize()
384
- ], ObjectType.prototype, "schema", null);
392
+ ], NamedObjectType.prototype, "properties", null);
385
393
  __decorate([
386
394
  Memoize()
387
- ], ObjectType.prototype, "schemaType", null);
395
+ ], NamedObjectType.prototype, "schema", null);
388
396
  __decorate([
389
397
  Memoize()
390
- ], ObjectType.prototype, "valueSparqlConstructTriplesFunction", null);
398
+ ], NamedObjectType.prototype, "schemaType", null);
391
399
  __decorate([
392
400
  Memoize()
393
- ], ObjectType.prototype, "valueSparqlWherePatternsFunction", null);
401
+ ], NamedObjectType.prototype, "toRdfjsResourceType", null);
394
402
  __decorate([
395
403
  Memoize()
396
- ], ObjectType.prototype, "toRdfjsResourceType", null);
404
+ ], NamedObjectType.prototype, "valueSparqlConstructTriplesFunction", null);
397
405
  __decorate([
398
406
  Memoize()
399
- ], ObjectType.prototype, "_discriminantProperty", null);
407
+ ], NamedObjectType.prototype, "valueSparqlWherePatternsFunction", null);
400
408
  __decorate([
401
409
  Memoize()
402
- ], ObjectType.prototype, "thisVariable", null);
410
+ ], NamedObjectType.prototype, "thisVariable", null);
403
411
  __decorate([
404
412
  Memoize()
405
- ], ObjectType.prototype, "jsonType", null);
406
- (function (ObjectType) {
407
- ObjectType.IdentifierPrefixProperty = _IdentifierPrefixProperty;
408
- ObjectType.IdentifierProperty = _IdentifierProperty;
409
- ObjectType.ShaclProperty = _ShaclProperty;
410
- ObjectType.DiscriminantProperty = _DiscriminantProperty;
411
- })(ObjectType || (ObjectType = {}));
412
- //# sourceMappingURL=ObjectType.js.map
413
+ ], NamedObjectType.prototype, "jsonType", null);
414
+ (function (NamedObjectType) {
415
+ NamedObjectType.IdentifierPrefixProperty = _IdentifierPrefixProperty;
416
+ NamedObjectType.IdentifierProperty = _IdentifierProperty;
417
+ NamedObjectType.ShaclProperty = _ShaclProperty;
418
+ NamedObjectType.DiscriminantProperty = _DiscriminantProperty;
419
+ })(NamedObjectType || (NamedObjectType = {}));
420
+ //# sourceMappingURL=NamedObjectType.js.map
@@ -3,18 +3,18 @@ import { AbstractType } from "./AbstractType.js";
3
3
  import type { BlankNodeType } from "./BlankNodeType.js";
4
4
  import type { IdentifierType } from "./IdentifierType.js";
5
5
  import type { IriType } from "./IriType.js";
6
- import type { ObjectType } from "./ObjectType.js";
6
+ import type { NamedObjectType } from "./NamedObjectType.js";
7
7
  import { type Code } from "./ts-poet-wrapper.js";
8
- export declare class NamedObjectUnionType extends AbstractNamedUnionType<ObjectType> {
8
+ export declare class NamedObjectUnionType extends AbstractNamedUnionType<NamedObjectType> {
9
9
  #private;
10
10
  readonly graphqlArgs: AbstractType["graphqlArgs"];
11
11
  readonly kind = "NamedObjectUnionType";
12
12
  constructor({ identifierType, ...superParameters }: {
13
13
  identifierType: BlankNodeType | IdentifierType | IriType;
14
- } & Omit<ConstructorParameters<typeof AbstractNamedUnionType<ObjectType>>[0], "identifierType">);
14
+ } & Omit<ConstructorParameters<typeof AbstractNamedUnionType<NamedObjectType>>[0], "identifierType">);
15
15
  get graphqlType(): AbstractType.GraphqlType;
16
16
  get identifierTypeAlias(): Code;
17
- get objectSetMethodNames(): ObjectType.ObjectSetMethodNames;
17
+ get objectSetMethodNames(): NamedObjectType.ObjectSetMethodNames;
18
18
  get schema(): Code;
19
19
  get schemaType(): Code;
20
20
  protected get staticModuleDeclarations(): Record<string, Code>;