@shaclmate/compiler 4.0.38 → 4.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/dist/ShapesGraphToAstTransformer.js +12 -12
  2. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.js +24 -24
  3. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstCompoundType.js +4 -4
  4. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +1 -1
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstObjectType.js +16 -16
  6. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +1 -1
  7. package/dist/ast/AbstractCollectionType.d.ts +1 -1
  8. package/dist/ast/AbstractCompoundType.d.ts +1 -1
  9. package/dist/ast/AbstractCompoundType.js +15 -15
  10. package/dist/ast/AbstractContainerType.d.ts +1 -1
  11. package/dist/ast/AbstractContainerType.js +15 -15
  12. package/dist/ast/AbstractLazyObjectType.d.ts +1 -1
  13. package/dist/ast/AbstractTermType.d.ts +1 -1
  14. package/dist/ast/BlankNodeType.d.ts +1 -1
  15. package/dist/ast/BlankNodeType.js +1 -1
  16. package/dist/ast/DefaultValueType.d.ts +1 -1
  17. package/dist/ast/DefaultValueType.js +2 -2
  18. package/dist/ast/IdentifierType.d.ts +1 -1
  19. package/dist/ast/IdentifierType.js +1 -1
  20. package/dist/ast/IntersectionType.d.ts +1 -1
  21. package/dist/ast/IntersectionType.js +3 -3
  22. package/dist/ast/IriType.d.ts +1 -1
  23. package/dist/ast/IriType.js +1 -1
  24. package/dist/ast/LazyObjectOptionType.d.ts +1 -1
  25. package/dist/ast/LazyObjectOptionType.js +1 -1
  26. package/dist/ast/LazyObjectSetType.d.ts +1 -1
  27. package/dist/ast/LazyObjectSetType.js +1 -1
  28. package/dist/ast/LazyObjectType.d.ts +1 -1
  29. package/dist/ast/LazyObjectType.js +1 -1
  30. package/dist/ast/ListType.d.ts +1 -1
  31. package/dist/ast/ListType.js +16 -16
  32. package/dist/ast/LiteralType.d.ts +1 -1
  33. package/dist/ast/LiteralType.js +1 -1
  34. package/dist/ast/ObjectCompoundType.js +3 -3
  35. package/dist/ast/ObjectType.d.ts +1 -1
  36. package/dist/ast/ObjectType.js +16 -16
  37. package/dist/ast/OptionType.d.ts +1 -1
  38. package/dist/ast/OptionType.js +1 -1
  39. package/dist/ast/SetType.d.ts +1 -1
  40. package/dist/ast/SetType.js +1 -1
  41. package/dist/ast/TermType.d.ts +1 -1
  42. package/dist/ast/TermType.js +1 -1
  43. package/dist/ast/Type.js +15 -15
  44. package/dist/ast/UnionType.d.ts +1 -1
  45. package/dist/ast/UnionType.js +3 -3
  46. package/dist/generators/transformAstToLabeledPropertyGraph.js +10 -10
  47. package/dist/generators/ts/AbstractCollectionType.d.ts +2 -6
  48. package/dist/generators/ts/AbstractCollectionType.js +16 -15
  49. package/dist/generators/ts/AbstractContainerType.d.ts +7 -11
  50. package/dist/generators/ts/AbstractContainerType.js +35 -36
  51. package/dist/generators/ts/AbstractDateType.d.ts +4 -4
  52. package/dist/generators/ts/AbstractDateType.js +2 -2
  53. package/dist/generators/ts/AbstractIdentifierType.d.ts +1 -1
  54. package/dist/generators/ts/AbstractLazyObjectType.d.ts +14 -17
  55. package/dist/generators/ts/AbstractLazyObjectType.js +26 -38
  56. package/dist/generators/ts/AbstractLiteralType.d.ts +1 -5
  57. package/dist/generators/ts/AbstractLiteralType.js +7 -6
  58. package/dist/generators/ts/AbstractNumericType.d.ts +2 -2
  59. package/dist/generators/ts/AbstractNumericType.js +3 -3
  60. package/dist/generators/ts/AbstractObjectSetType.d.ts +10 -9
  61. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  62. package/dist/generators/ts/AbstractPrimitiveType.d.ts +2 -6
  63. package/dist/generators/ts/AbstractPrimitiveType.js +9 -10
  64. package/dist/generators/ts/AbstractTermType.d.ts +1 -5
  65. package/dist/generators/ts/AbstractTermType.js +3 -17
  66. package/dist/generators/ts/AbstractType.d.ts +22 -15
  67. package/dist/generators/ts/AbstractType.js +18 -8
  68. package/dist/generators/ts/BigDecimalType.d.ts +2 -2
  69. package/dist/generators/ts/BigDecimalType.js +3 -3
  70. package/dist/generators/ts/BigIntType.d.ts +1 -1
  71. package/dist/generators/ts/BigIntType.js +3 -3
  72. package/dist/generators/ts/BlankNodeType.d.ts +4 -4
  73. package/dist/generators/ts/BlankNodeType.js +12 -12
  74. package/dist/generators/ts/BooleanType.d.ts +3 -3
  75. package/dist/generators/ts/BooleanType.js +11 -6
  76. package/dist/generators/ts/DateTimeType.d.ts +1 -1
  77. package/dist/generators/ts/DateTimeType.js +1 -1
  78. package/dist/generators/ts/DateType.d.ts +1 -1
  79. package/dist/generators/ts/DateType.js +1 -1
  80. package/dist/generators/ts/DefaultValueType.d.ts +3 -7
  81. package/dist/generators/ts/DefaultValueType.js +17 -21
  82. package/dist/generators/ts/FloatType.d.ts +1 -1
  83. package/dist/generators/ts/FloatType.js +1 -1
  84. package/dist/generators/ts/GraphqlSchema.d.ts +4 -4
  85. package/dist/generators/ts/GraphqlSchema.js +4 -4
  86. package/dist/generators/ts/IdentifierType.d.ts +4 -4
  87. package/dist/generators/ts/IdentifierType.js +14 -14
  88. package/dist/generators/ts/IntType.d.ts +1 -1
  89. package/dist/generators/ts/IntType.js +1 -1
  90. package/dist/generators/ts/IriType.d.ts +4 -2
  91. package/dist/generators/ts/IriType.js +27 -22
  92. package/dist/generators/ts/LazyObjectOptionType.d.ts +2 -1
  93. package/dist/generators/ts/LazyObjectOptionType.js +7 -7
  94. package/dist/generators/ts/LazyObjectSetType.d.ts +1 -1
  95. package/dist/generators/ts/LazyObjectSetType.js +6 -6
  96. package/dist/generators/ts/LazyObjectType.d.ts +1 -1
  97. package/dist/generators/ts/LazyObjectType.js +5 -5
  98. package/dist/generators/ts/ListType.d.ts +5 -6
  99. package/dist/generators/ts/ListType.js +24 -25
  100. package/dist/generators/ts/LiteralType.d.ts +3 -2
  101. package/dist/generators/ts/LiteralType.js +14 -7
  102. package/dist/generators/ts/{NamedObjectType.d.ts → ObjectType.d.ts} +24 -24
  103. package/dist/generators/ts/ObjectType.js +350 -0
  104. package/dist/generators/ts/ObjectUnionType.d.ts +20 -0
  105. package/dist/generators/ts/{NamedObjectUnionType.js → ObjectUnionType.js} +54 -64
  106. package/dist/generators/ts/OptionType.d.ts +2 -6
  107. package/dist/generators/ts/OptionType.js +12 -18
  108. package/dist/generators/ts/RdfjsDatasetObjectSetType.js +8 -8
  109. package/dist/generators/ts/SetType.d.ts +1 -1
  110. package/dist/generators/ts/SetType.js +1 -1
  111. package/dist/generators/ts/Snippets.d.ts +1 -0
  112. package/dist/generators/ts/Snippets.js +7 -0
  113. package/dist/generators/ts/SparqlObjectSetType.js +2 -2
  114. package/dist/generators/ts/StringType.d.ts +3 -3
  115. package/dist/generators/ts/StringType.js +11 -6
  116. package/dist/generators/ts/TermType.d.ts +3 -3
  117. package/dist/generators/ts/TermType.js +13 -13
  118. package/dist/generators/ts/TsGenerator.js +12 -9
  119. package/dist/generators/ts/Type.d.ts +4 -5
  120. package/dist/generators/ts/TypeFactory.d.ts +7 -8
  121. package/dist/generators/ts/TypeFactory.js +79 -80
  122. package/dist/generators/ts/{AbstractUnionType.d.ts → UnionType.d.ts} +40 -15
  123. package/dist/generators/ts/{AbstractUnionType.js → UnionType.js} +328 -135
  124. package/dist/generators/ts/ZodGenerator.js +7 -9
  125. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.d.ts +13 -13
  126. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/AbstractProperty.js +11 -14
  127. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.d.ts +3 -2
  128. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/DiscriminantProperty.js +24 -15
  129. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.d.ts +3 -6
  130. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/IdentifierProperty.js +20 -12
  131. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +5 -0
  132. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_createFunctionDeclaration.js → _ObjectType/ObjectType_createFunctionDeclaration.js} +6 -6
  133. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +5 -0
  134. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.js → _ObjectType/ObjectType_equalsFunctionDeclaration.js} +5 -5
  135. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +5 -0
  136. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterFunctionDeclaration.js → _ObjectType/ObjectType_filterFunctionDeclaration.js} +3 -3
  137. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +5 -0
  138. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_filterTypeDeclaration.js → _ObjectType/ObjectType_filterTypeDeclaration.js} +3 -3
  139. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  140. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  141. package/dist/generators/ts/_ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  142. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_focusSparqlWherePatternsFunctionDeclaration.js} +3 -3
  143. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +5 -0
  144. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.js → _ObjectType/ObjectType_fromJsonFunctionDeclaration.js} +4 -4
  145. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +5 -0
  146. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.js} +7 -31
  147. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +5 -0
  148. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +15 -0
  149. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +5 -0
  150. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.js → _ObjectType/ObjectType_fromRdfTypeVariableStatement.js} +2 -2
  151. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +5 -0
  152. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.js → _ObjectType/ObjectType_graphqlTypeVariableStatement.js} +4 -4
  153. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +4 -0
  154. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_hashFunctionDeclarations.js → _ObjectType/ObjectType_hashFunctionDeclarations.js} +8 -8
  155. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +4 -0
  156. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_interfaceDeclaration.js → _ObjectType/ObjectType_interfaceDeclaration.js} +5 -5
  157. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.d.ts +5 -0
  158. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.js → _ObjectType/ObjectType_isTypeFunctionDeclaration.js} +3 -3
  159. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +5 -0
  160. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.js → _ObjectType/ObjectType_jsonParseFunctionDeclaration.js} +2 -2
  161. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +5 -0
  162. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonSchemaFunctionDeclaration.js} +2 -2
  163. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +5 -0
  164. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.js → _ObjectType/ObjectType_jsonTypeAliasDeclaration.js} +2 -2
  165. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +5 -0
  166. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.js → _ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js} +4 -4
  167. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.d.ts → _ObjectType/ObjectType_objectSetMethodNames.d.ts} +3 -3
  168. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_objectSetMethodNames.js → _ObjectType/ObjectType_objectSetMethodNames.js} +4 -4
  169. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +5 -0
  170. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +14 -0
  171. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts} +3 -3
  172. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryFunctionDeclaration.js → _ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js} +5 -5
  173. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts → _ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts} +3 -3
  174. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +12 -0
  175. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +5 -0
  176. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.js → _ObjectType/ObjectType_toJsonFunctionDeclaration.js} +4 -4
  177. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +5 -0
  178. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.js → _ObjectType/ObjectType_toRdfResourceFunctionDeclaration.js} +4 -4
  179. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +4 -0
  180. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.js → _ObjectType/ObjectType_toStringFunctionDeclarations.js} +6 -6
  181. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +5 -0
  182. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js} +3 -3
  183. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +5 -0
  184. package/dist/generators/ts/{_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.js → _ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js} +3 -3
  185. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.d.ts +2 -6
  186. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/ShaclProperty.js +24 -28
  187. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +4 -0
  188. package/dist/generators/ts/{_NamedObjectType → _ObjectType}/identifierTypeDeclarations.js +4 -2
  189. package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +2 -2
  190. package/dist/generators/ts/_snippets/snippets_CollectionSchema.js +1 -1
  191. package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +1 -1
  192. package/dist/generators/ts/_snippets/snippets_IriSchema.js +2 -2
  193. package/dist/generators/ts/_snippets/snippets_MaybeSchema.js +2 -2
  194. package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
  195. package/dist/generators/ts/_snippets/snippets_StringSchema.js +2 -2
  196. package/dist/generators/ts/_snippets/snippets_booleanSparqlWherePatterns.js +1 -1
  197. package/dist/generators/ts/_snippets/snippets_convertToIri.js +1 -1
  198. package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
  199. package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.d.ts +3 -0
  200. package/dist/generators/ts/_snippets/snippets_ensureRdfResourceType.js +16 -0
  201. package/dist/generators/ts/_snippets/snippets_iriSparqlWherePatterns.js +1 -1
  202. package/dist/generators/ts/_snippets/snippets_listSparqlConstructTriples.js +2 -2
  203. package/dist/generators/ts/_snippets/snippets_listSparqlWherePatterns.js +2 -2
  204. package/dist/generators/ts/_snippets/snippets_maybeSparqlConstructTriples.js +1 -1
  205. package/dist/generators/ts/_snippets/snippets_maybeSparqlWherePatterns.js +3 -3
  206. package/dist/generators/ts/_snippets/snippets_setSparqlConstructTriples.js +1 -1
  207. package/dist/generators/ts/_snippets/snippets_setSparqlWherePatterns.js +1 -1
  208. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlConstructTriples.js +1 -1
  209. package/dist/generators/ts/_snippets/snippets_shaclPropertySparqlWherePatterns.js +1 -1
  210. package/dist/generators/ts/_snippets/snippets_stringSparqlWherePatterns.js +1 -1
  211. package/dist/generators/ts/_snippets/snippets_validateArray.js +1 -1
  212. package/dist/generators/ts/_snippets/snippets_validateMaybe.js +1 -1
  213. package/dist/generators/ts/tsComment.js +1 -1
  214. package/dist/input/generated.d.ts +1399 -1468
  215. package/dist/input/generated.js +518 -655
  216. package/package.json +4 -4
  217. package/dist/generators/ts/AbstractNamedUnionType.d.ts +0 -30
  218. package/dist/generators/ts/AbstractNamedUnionType.js +0 -190
  219. package/dist/generators/ts/AnonymousUnionType.d.ts +0 -27
  220. package/dist/generators/ts/AnonymousUnionType.js +0 -59
  221. package/dist/generators/ts/NamedObjectType.js +0 -341
  222. package/dist/generators/ts/NamedObjectUnionType.d.ts +0 -37
  223. package/dist/generators/ts/NamedUnionType.d.ts +0 -11
  224. package/dist/generators/ts/NamedUnionType.js +0 -13
  225. package/dist/generators/ts/_NamedObjectType/NamedObjectType_createFunctionDeclaration.d.ts +0 -5
  226. package/dist/generators/ts/_NamedObjectType/NamedObjectType_equalsFunctionDeclaration.d.ts +0 -5
  227. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterFunctionDeclaration.d.ts +0 -5
  228. package/dist/generators/ts/_NamedObjectType/NamedObjectType_filterTypeDeclaration.d.ts +0 -5
  229. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  230. package/dist/generators/ts/_NamedObjectType/NamedObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  231. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  232. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  233. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  234. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  235. package/dist/generators/ts/_NamedObjectType/NamedObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  236. package/dist/generators/ts/_NamedObjectType/NamedObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  237. package/dist/generators/ts/_NamedObjectType/NamedObjectType_hashFunctionDeclarations.d.ts +0 -4
  238. package/dist/generators/ts/_NamedObjectType/NamedObjectType_interfaceDeclaration.d.ts +0 -4
  239. package/dist/generators/ts/_NamedObjectType/NamedObjectType_isTypeFunctionDeclaration.d.ts +0 -5
  240. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonParseFunctionDeclaration.d.ts +0 -5
  241. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  242. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  243. package/dist/generators/ts/_NamedObjectType/NamedObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  244. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.d.ts +0 -5
  245. package/dist/generators/ts/_NamedObjectType/NamedObjectType_schemaVariableStatement.js +0 -12
  246. package/dist/generators/ts/_NamedObjectType/NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.js +0 -12
  247. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  248. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  249. package/dist/generators/ts/_NamedObjectType/NamedObjectType_toStringFunctionDeclarations.d.ts +0 -4
  250. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts +0 -5
  251. package/dist/generators/ts/_NamedObjectType/NamedObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts +0 -5
  252. package/dist/generators/ts/_NamedObjectType/identifierTypeDeclarations.d.ts +0 -4
  253. package/dist/generators/ts/removeUndefined.d.ts +0 -2
  254. package/dist/generators/ts/removeUndefined.js +0 -17
  255. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.d.ts +0 -0
  256. /package/dist/generators/ts/{_NamedObjectType → _ObjectType}/Property.js +0 -0
@@ -1,7 +1,6 @@
1
- import { rdf } from "@tpluscode/rdf-ns-builders";
2
1
  import { Maybe } from "purify-ts";
3
- import { code, joinCode } from "../ts-poet-wrapper.js";
4
- export function NamedObjectType_fromRdfResourceFunctionDeclaration() {
2
+ import { arrayOf, code, joinCode } from "../ts-poet-wrapper.js";
3
+ export function ObjectType_fromRdfResourceFunctionDeclaration() {
5
4
  if (!this.configuration.features.has("Object.fromRdf")) {
6
5
  return Maybe.empty();
7
6
  }
@@ -26,37 +25,14 @@ export function NamedObjectType_fromRdfResourceFunctionDeclaration() {
26
25
  const partials = [];
27
26
  this.parentObjectTypes.forEach((parentObjectType, parentObjectTypeI) => {
28
27
  chains.push({
29
- expression: code `${parentObjectType.name}._fromRdfResource(${variables.resource}, { ...${optionsVariable}, ignoreRdfType: true })`,
28
+ expression: code `${parentObjectType.alias.unsafeCoerce()}._fromRdfResource(${variables.resource}, { ...${optionsVariable}, ignoreRdfType: true })`,
30
29
  variable: `super${parentObjectTypeI}`,
31
30
  });
32
31
  partials.push(`super${parentObjectTypeI}`);
33
32
  });
34
- this.fromRdfType.ifJust((fromRdfType) => {
35
- const fromRdfTypeVariable = this.fromRdfTypeVariable.unsafeCoerce();
36
- const predicate = this.rdfjsTermExpression(rdf.type);
37
- // Check the expected type and its known subtypes
38
- const cases = new Set();
39
- cases.add(fromRdfType.value);
40
- for (const descendantFromRdfType of this.descendantFromRdfTypes) {
41
- cases.add(descendantFromRdfType.value);
42
- }
33
+ this.fromRdfTypeVariable.ifJust((fromRdfTypeVariable) => {
43
34
  chains.push({
44
- expression: code `!${variables.ignoreRdfType} ? ${variables.resource}.value(${predicate}, ${{ graph: variables.graph }})
45
- .chain(actualRdfType => actualRdfType.toIri())
46
- .chain((actualRdfType) => {
47
- // Check the expected type and its known subtypes
48
- switch (actualRdfType.value) {
49
- ${[...cases].map((fromRdfType) => `case "${fromRdfType}":`).join("\n")}
50
- return ${this.reusables.imports.Right}(true as const);
51
- }
52
-
53
- // Check arbitrary rdfs:subClassOf's of the expected type
54
- if (${variables.resource}.isInstanceOf(${fromRdfTypeVariable}, ${{ graph: variables.graph }})) {
55
- return ${this.reusables.imports.Right}(true as const);
56
- }
57
-
58
- return ${this.reusables.imports.Left}(new Error(\`\${${variables.resource}.identifier} has unexpected RDF type (actual: \${actualRdfType.value}, expected: ${fromRdfType.value})\`));
59
- }) : ${this.reusables.imports.Right}(true as const)`,
35
+ expression: code `!${variables.ignoreRdfType} ? ${this.reusables.snippets.ensureRdfResourceType}(${variables.resource}, ${arrayOf(fromRdfTypeVariable, ...this.descendantFromRdfTypeVariables)}, ${{ graph: variables.graph }}) : ${this.reusables.imports.Right}(true as const)`,
60
36
  variable: `_rdfTypeCheck`,
61
37
  });
62
38
  });
@@ -95,10 +71,10 @@ export function NamedObjectType_fromRdfResourceFunctionDeclaration() {
95
71
  .reduce((acc, { expression, variable }) => code `(${expression}).chain(${variable} => ${acc})`, code `(${resultExpression})`)}`;
96
72
  }
97
73
  return Maybe.of(code `\
98
- export const _fromRdfResource: ${this.reusables.snippets._FromRdfResourceFunction}<${this.name}> = (${variables.resource}, ${optionsVariable}) => {
74
+ export const _fromRdfResource: ${this.reusables.snippets._FromRdfResourceFunction}<${this.expression}> = (${variables.resource}, ${optionsVariable}) => {
99
75
  return ${returnExpression};
100
76
  }
101
77
 
102
78
  export const fromRdfResource = ${this.reusables.snippets.wrap_FromRdfResourceFunction}(_fromRdfResource);`);
103
79
  }
104
- //# sourceMappingURL=NamedObjectType_fromRdfResourceFunctionDeclaration.js.map
80
+ //# sourceMappingURL=ObjectType_fromRdfResourceFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_fromRdfResourceValuesFunctionDeclaration(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { Maybe } from "purify-ts";
2
+ import { code } from "../ts-poet-wrapper.js";
3
+ export function ObjectType_fromRdfResourceValuesFunctionDeclaration() {
4
+ if (!this.configuration.features.has("Object.fromRdf")) {
5
+ return Maybe.empty();
6
+ }
7
+ return Maybe.of(code `\
8
+ export const fromRdfResourceValues: ${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.alias.unsafeCoerce()}> = (values, options) =>
9
+ values.chain(
10
+ values => values.chainMap(
11
+ value => value.toResource().chain(resource => ${this.alias.unsafeCoerce()}.fromRdfResource(resource, options))
12
+ )
13
+ );`);
14
+ }
15
+ //# sourceMappingURL=ObjectType_fromRdfResourceValuesFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_fromRdfTypeVariableStatement(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_fromRdfTypeVariableStatement.d.ts.map
@@ -1,10 +1,10 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { code } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_fromRdfTypeVariableStatement() {
3
+ export function ObjectType_fromRdfTypeVariableStatement() {
4
4
  if (!this.configuration.features.has("Object.fromRdf")) {
5
5
  return Maybe.empty();
6
6
  }
7
7
  return this.fromRdfType.map((fromRdfType) => code `\
8
8
  export const fromRdfType: ${this.reusables.imports.NamedNode}<string> = ${this.rdfjsTermExpression(fromRdfType)};`);
9
9
  }
10
- //# sourceMappingURL=NamedObjectType_fromRdfTypeVariableStatement.js.map
10
+ //# sourceMappingURL=ObjectType_fromRdfTypeVariableStatement.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_graphqlTypeVariableStatement(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_graphqlTypeVariableStatement.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { code } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_graphqlTypeVariableStatement() {
3
+ export function ObjectType_graphqlTypeVariableStatement() {
4
4
  if (!this.configuration.features.has("GraphQL")) {
5
5
  return Maybe.empty();
6
6
  }
@@ -8,7 +8,7 @@ export function NamedObjectType_graphqlTypeVariableStatement() {
8
8
  return Maybe.empty();
9
9
  }
10
10
  return Maybe.of(code `\
11
- export const GraphQL = new ${this.reusables.imports.GraphQLObjectType}<${this.name}, { objectSet: ${this.configuration.syntheticNamePrefix}ObjectSet }>(${{
11
+ export const GraphQL = new ${this.reusables.imports.GraphQLObjectType}<${this.expression}, { objectSet: ${this.configuration.syntheticNamePrefix}ObjectSet }>(${{
12
12
  description: this.comment.extract(),
13
13
  fields: code `() => (${this.properties.reduce((fields, property) => {
14
14
  property.graphqlField.ifJust((field) => {
@@ -27,7 +27,7 @@ export const GraphQL = new ${this.reusables.imports.GraphQLObjectType}<${this.na
27
27
  });
28
28
  return fields;
29
29
  }, {})})`,
30
- name: this.name,
30
+ name: this.alias.unsafeCoerce(),
31
31
  }});`);
32
32
  }
33
- //# sourceMappingURL=NamedObjectType_graphqlTypeVariableStatement.js.map
33
+ //# sourceMappingURL=ObjectType_graphqlTypeVariableStatement.js.map
@@ -0,0 +1,4 @@
1
+ import type { ObjectType } from "../ObjectType.js";
2
+ import { type Code } from "../ts-poet-wrapper.js";
3
+ export declare function ObjectType_hashFunctionDeclarations(this: ObjectType): readonly Code[];
4
+ //# sourceMappingURL=ObjectType_hashFunctionDeclarations.d.ts.map
@@ -1,10 +1,10 @@
1
1
  import { code, joinCode } from "../ts-poet-wrapper.js";
2
2
  const hasherVariable = code `hasher`;
3
- export function NamedObjectType_hashFunctionDeclarations() {
3
+ export function ObjectType_hashFunctionDeclarations() {
4
4
  if (!this.configuration.features.has("Object.hash")) {
5
5
  return [];
6
6
  }
7
- const hashOwnShaclPropertiesStatements = this.properties.flatMap((property) => property.kind === "ShaclProperty"
7
+ const hashOwnShaclPropertiesStatements = this.properties.flatMap((property) => property.kind === "Shacl"
8
8
  ? property.hashStatements({
9
9
  variables: {
10
10
  hasher: hasherVariable,
@@ -17,13 +17,13 @@ export function NamedObjectType_hashFunctionDeclarations() {
17
17
  const hashShaclPropertiesStatements = [];
18
18
  const hashStatements = [];
19
19
  for (const parentObjectType of this.parentObjectTypes) {
20
- hashShaclPropertiesStatements.push(code `${parentObjectType.name}.hashShaclProperties(${hasherVariable}, ${this.thisVariable});`);
20
+ hashShaclPropertiesStatements.push(code `${parentObjectType.alias.unsafeCoerce()}.hashShaclProperties(${hasherVariable}, ${this.thisVariable});`);
21
21
  }
22
- hashStatements.push(code `${this.name}.hashShaclProperties(${hasherVariable}, ${this.thisVariable});`);
22
+ hashStatements.push(code `${this.alias.unsafeCoerce()}.hashShaclProperties(${hasherVariable}, ${this.thisVariable});`);
23
23
  hashShaclPropertiesStatements.push(...hashOwnShaclPropertiesStatements);
24
24
  hashShaclPropertiesStatements.push(code `return ${hasherVariable};`);
25
25
  hashStatements.push(...this.properties
26
- .filter((property) => property.kind !== "ShaclProperty")
26
+ .filter((property) => property.kind !== "Shacl")
27
27
  .flatMap((property) => property.hashStatements({
28
28
  variables: {
29
29
  hasher: hasherVariable,
@@ -33,13 +33,13 @@ export function NamedObjectType_hashFunctionDeclarations() {
33
33
  hashStatements.push(code `return ${hasherVariable};`);
34
34
  return [
35
35
  code `\
36
- export function hash<HasherT extends ${this.reusables.snippets.Hasher}>(${hasherVariable}: HasherT, ${this.thisVariable}: ${this.name}): HasherT {
36
+ export function hash<HasherT extends ${this.reusables.snippets.Hasher}>(${hasherVariable}: HasherT, ${this.thisVariable}: ${this.expression}): HasherT {
37
37
  ${joinCode(hashStatements)}
38
38
  }`,
39
39
  code `\
40
- export function hashShaclProperties<HasherT extends ${this.reusables.snippets.Hasher}>(${hasherVariable}: HasherT, ${this.thisVariable}: ${this.name}): HasherT {
40
+ export function hashShaclProperties<HasherT extends ${this.reusables.snippets.Hasher}>(${hasherVariable}: HasherT, ${this.thisVariable}: ${this.expression}): HasherT {
41
41
  ${joinCode(hashShaclPropertiesStatements)}
42
42
  }`,
43
43
  ];
44
44
  }
45
- //# sourceMappingURL=NamedObjectType_hashFunctionDeclarations.js.map
45
+ //# sourceMappingURL=ObjectType_hashFunctionDeclarations.js.map
@@ -0,0 +1,4 @@
1
+ import type { ObjectType } from "../ObjectType.js";
2
+ import { type Code } from "../ts-poet-wrapper.js";
3
+ export declare function ObjectType_interfaceDeclaration(this: ObjectType): Code;
4
+ //# sourceMappingURL=ObjectType_interfaceDeclaration.d.ts.map
@@ -1,16 +1,16 @@
1
1
  import { code, joinCode } from "../ts-poet-wrapper.js";
2
2
  import { tsComment } from "../tsComment.js";
3
- export function NamedObjectType_interfaceDeclaration() {
3
+ export function ObjectType_interfaceDeclaration() {
4
4
  return code `\
5
5
  ${this.comment
6
6
  .alt(this.label)
7
7
  .map(tsComment)
8
- .orDefault("")}export interface ${this.name}${this.parentObjectTypes.length > 0
8
+ .orDefault("")}export interface ${this.alias.unsafeCoerce()}${this.parentObjectTypes.length > 0
9
9
  ? ` extends ${this.parentObjectTypes
10
- .map((parentObjectType) => parentObjectType.name)
10
+ .map((parentObjectType) => parentObjectType.alias.unsafeCoerce())
11
11
  .join(", ")}`
12
12
  : ""} {
13
- ${joinCode(this.properties.map((property) => property.declaration))}
13
+ ${joinCode(this.properties.map((property) => property.declaration), { on: "\n\n" })}
14
14
  }`;
15
15
  }
16
- //# sourceMappingURL=NamedObjectType_interfaceDeclaration.js.map
16
+ //# sourceMappingURL=ObjectType_interfaceDeclaration.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_isTypeFunctionDeclaration(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_isTypeFunctionDeclaration.d.ts.map
@@ -1,11 +1,11 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { code } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_isTypeFunctionDeclaration() {
3
+ export function ObjectType_isTypeFunctionDeclaration() {
4
4
  if (!this.configuration.features.has("Object.type")) {
5
5
  return Maybe.empty();
6
6
  }
7
7
  return Maybe.of(code `\
8
- export function is${this.name}(object: ${this.configuration.syntheticNamePrefix}Object): object is ${this.name} {
8
+ export function is${this.alias.unsafeCoerce()}(object: ${this.configuration.syntheticNamePrefix}Object): object is ${this.alias.unsafeCoerce()} {
9
9
  switch (object.${this._discriminantProperty.name}) {
10
10
  ${this._discriminantProperty.type.descendantValues
11
11
  .concat(this._discriminantProperty.type.ownValues)
@@ -14,4 +14,4 @@ export function is${this.name}(object: ${this.configuration.syntheticNamePrefix}
14
14
  }
15
15
  }`);
16
16
  }
17
- //# sourceMappingURL=NamedObjectType_isTypeFunctionDeclaration.js.map
17
+ //# sourceMappingURL=ObjectType_isTypeFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_jsonParseFunctionDeclaration(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_jsonParseFunctionDeclaration.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { code } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_jsonParseFunctionDeclaration() {
3
+ export function ObjectType_jsonParseFunctionDeclaration() {
4
4
  if (!this.configuration.features.has("Object.JSON.parse")) {
5
5
  return Maybe.empty();
6
6
  }
@@ -11,4 +11,4 @@ export function parse(json: unknown): ${this.reusables.imports.Either}<Error, Js
11
11
  return ${this.reusables.imports.Right}(jsonSafeParseResult.data);
12
12
  }`);
13
13
  }
14
- //# sourceMappingURL=NamedObjectType_jsonParseFunctionDeclaration.js.map
14
+ //# sourceMappingURL=ObjectType_jsonParseFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_jsonSchemaFunctionDeclaration(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_jsonSchemaFunctionDeclaration.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { code, joinCode } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_jsonSchemaFunctionDeclaration() {
3
+ export function ObjectType_jsonSchemaFunctionDeclaration() {
4
4
  if (!this.configuration.features.has("Object.JSON.schema")) {
5
5
  return Maybe.empty();
6
6
  }
@@ -28,4 +28,4 @@ export function schema() {
28
28
  return ${this.reusables.imports.z}.object({${joinCode(properties, { on: "," })}}).meta(${meta}) satisfies ${this.reusables.imports.z}.ZodType<Json>;
29
29
  }`);
30
30
  }
31
- //# sourceMappingURL=NamedObjectType_jsonSchemaFunctionDeclaration.js.map
31
+ //# sourceMappingURL=ObjectType_jsonSchemaFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_jsonTypeAliasDeclaration(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_jsonTypeAliasDeclaration.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { code, joinCode } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_jsonTypeAliasDeclaration() {
3
+ export function ObjectType_jsonTypeAliasDeclaration() {
4
4
  if (!this.configuration.features.has("Object.JSON.type")) {
5
5
  return Maybe.empty();
6
6
  }
@@ -13,4 +13,4 @@ export function NamedObjectType_jsonTypeAliasDeclaration() {
13
13
  }
14
14
  return Maybe.of(code `export type Json = ${members.length > 0 ? joinCode(members, { on: " & " }) : "object"};`);
15
15
  }
16
- //# sourceMappingURL=NamedObjectType_jsonTypeAliasDeclaration.js.map
16
+ //# sourceMappingURL=ObjectType_jsonTypeAliasDeclaration.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_jsonUiSchemaFunctionDeclaration(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_jsonUiSchemaFunctionDeclaration.d.ts.map
@@ -1,17 +1,17 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { code, joinCode } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_jsonUiSchemaFunctionDeclaration() {
3
+ export function ObjectType_jsonUiSchemaFunctionDeclaration() {
4
4
  if (!this.configuration.features.has("Object.JSON.uiSchema")) {
5
5
  return Maybe.empty();
6
6
  }
7
7
  const variables = { scopePrefix: code `scopePrefix` };
8
8
  const elements = this.parentObjectTypes
9
- .map((parentObjectType) => code `${parentObjectType.name}.Json.uiSchema({ scopePrefix })`)
9
+ .map((parentObjectType) => code `${parentObjectType.alias.unsafeCoerce()}.Json.uiSchema({ scopePrefix })`)
10
10
  .concat(this.properties.flatMap((property) => property.jsonUiSchemaElement({ variables }).toList()));
11
11
  return Maybe.of(code `\
12
12
  export function uiSchema(parameters?: { scopePrefix?: string }): any {
13
13
  const scopePrefix = parameters?.scopePrefix ?? "#";
14
- return { "elements": [ ${joinCode(elements, { on: "," })} ], label: "${this.label.orDefault(this.name)}", type: "Group" };
14
+ return { "elements": [ ${joinCode(elements, { on: "," })} ], label: "${this.label.orDefault(this.alias.unsafeCoerce())}", type: "Group" };
15
15
  }`);
16
16
  }
17
- //# sourceMappingURL=NamedObjectType_jsonUiSchemaFunctionDeclaration.js.map
17
+ //# sourceMappingURL=ObjectType_jsonUiSchemaFunctionDeclaration.js.map
@@ -1,11 +1,11 @@
1
1
  import type { TsGenerator } from "../TsGenerator.js";
2
- export declare function NamedObjectType_objectSetMethodNames(this: {
2
+ export declare function ObjectType_objectSetMethodNames(this: {
3
+ readonly alias: string;
3
4
  readonly configuration: TsGenerator.Configuration;
4
- readonly name: string;
5
5
  }): {
6
6
  object: string;
7
7
  objectCount: string;
8
8
  objectIdentifiers: string;
9
9
  objects: string;
10
10
  };
11
- //# sourceMappingURL=NamedObjectType_objectSetMethodNames.d.ts.map
11
+ //# sourceMappingURL=ObjectType_objectSetMethodNames.d.ts.map
@@ -1,11 +1,11 @@
1
1
  import { camelCase, trainCase } from "change-case";
2
2
  import plur from "plur";
3
- export function NamedObjectType_objectSetMethodNames() {
3
+ export function ObjectType_objectSetMethodNames() {
4
4
  const syntheticNamePrefix = this.configuration.syntheticNamePrefix;
5
- const prefixSingular = camelCase(this.name, {
5
+ const prefixSingular = camelCase(this.alias, {
6
6
  prefixCharacters: syntheticNamePrefix,
7
7
  });
8
- const thisNameParts = trainCase(this.name, {
8
+ const thisNameParts = trainCase(this.alias, {
9
9
  prefixCharacters: syntheticNamePrefix,
10
10
  }).split("-");
11
11
  let prefixPlural = camelCase(`${thisNameParts.slice(0, thisNameParts.length - 1).join("")}${plur(thisNameParts[thisNameParts.length - 1])}`, { prefixCharacters: syntheticNamePrefix });
@@ -20,4 +20,4 @@ export function NamedObjectType_objectSetMethodNames() {
20
20
  objects: prefixPlural,
21
21
  };
22
22
  }
23
- //# sourceMappingURL=NamedObjectType_objectSetMethodNames.js.map
23
+ //# sourceMappingURL=ObjectType_objectSetMethodNames.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_schemaVariableStatement(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_schemaVariableStatement.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { Maybe } from "purify-ts";
2
+ import { code, joinCode } from "../ts-poet-wrapper.js";
3
+ export function ObjectType_schemaVariableStatement() {
4
+ if (!this.configuration.features.has("Object.schema")) {
5
+ return Maybe.empty();
6
+ }
7
+ return Maybe.of(code `\
8
+ export const schema = { properties: { ${joinCode(this.parentObjectTypes
9
+ .map((parentObjectType) => code `...${parentObjectType.alias.unsafeCoerce()}.schema.properties`)
10
+ .concat(this.properties.flatMap((property) => property.schema
11
+ .toList()
12
+ .map((propertySchema) => code `${property.name}: ${propertySchema}`))), { on: ", " })} } } as const;`);
13
+ }
14
+ //# sourceMappingURL=ObjectType_schemaVariableStatement.js.map
@@ -2,10 +2,10 @@ import { Maybe } from "purify-ts";
2
2
  import type { Reusables } from "../Reusables.js";
3
3
  import type { TsGenerator } from "../TsGenerator.js";
4
4
  import { type Code } from "../ts-poet-wrapper.js";
5
- export declare function NamedObjectType_sparqlConstructQueryFunctionDeclaration(this: {
5
+ export declare function ObjectType_sparqlConstructQueryFunctionDeclaration(this: {
6
+ readonly alias: string;
6
7
  readonly configuration: TsGenerator.Configuration;
7
8
  readonly filterType: Code;
8
- readonly name: string;
9
9
  readonly reusables: Reusables;
10
10
  }): Maybe<Code>;
11
- //# sourceMappingURL=NamedObjectType_sparqlConstructQueryFunctionDeclaration.d.ts.map
11
+ //# sourceMappingURL=ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts.map
@@ -1,20 +1,20 @@
1
1
  import { camelCase } from "change-case";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { code } from "../ts-poet-wrapper.js";
4
- export function NamedObjectType_sparqlConstructQueryFunctionDeclaration() {
4
+ export function ObjectType_sparqlConstructQueryFunctionDeclaration() {
5
5
  if (!this.configuration.features.has("Object.SPARQL")) {
6
6
  return Maybe.empty();
7
7
  }
8
8
  return Maybe.of(code `\
9
9
  export function sparqlConstructQuery({ filter, ignoreRdfType, preferredLanguages, prefixes, subject, ...queryParameters }: { filter?: ${this.filterType}; ignoreRdfType?: boolean; prefixes?: { [prefix: string]: string }; preferredLanguages?: readonly string[]; subject: ${this.reusables.imports.NamedNode} | ${this.reusables.imports.Variable} } & Omit<${this.reusables.imports.sparqljs}.ConstructQuery, "prefixes" | "queryType" | "type">): ${this.reusables.imports.sparqljs}.ConstructQuery {
10
- const variablePrefix = subject.termType === "Variable" ? subject.value : "${camelCase(this.name)}";
10
+ const variablePrefix = subject.termType === "Variable" ? subject.value : "${camelCase(this.alias)}";
11
11
 
12
12
  return {
13
13
  ...queryParameters,
14
14
  prefixes: prefixes ?? {},
15
15
  queryType: "CONSTRUCT",
16
16
  template: (queryParameters.template ?? []).concat(
17
- ${this.name}.focusSparqlConstructTriples({
17
+ ${this.alias}.focusSparqlConstructTriples({
18
18
  filter,
19
19
  focusIdentifier: subject,
20
20
  ignoreRdfType: !!ignoreRdfType,
@@ -24,7 +24,7 @@ export function sparqlConstructQuery({ filter, ignoreRdfType, preferredLanguages
24
24
  type: "query",
25
25
  where: (queryParameters.where ?? []).concat(
26
26
  ${this.reusables.snippets.normalizeSparqlWherePatterns}(
27
- ${this.name}.focusSparqlWherePatterns({
27
+ ${this.alias}.focusSparqlWherePatterns({
28
28
  filter,
29
29
  focusIdentifier: subject,
30
30
  ignoreRdfType: !!ignoreRdfType,
@@ -36,4 +36,4 @@ export function sparqlConstructQuery({ filter, ignoreRdfType, preferredLanguages
36
36
  };
37
37
  }`);
38
38
  }
39
- //# sourceMappingURL=NamedObjectType_sparqlConstructQueryFunctionDeclaration.js.map
39
+ //# sourceMappingURL=ObjectType_sparqlConstructQueryFunctionDeclaration.js.map
@@ -2,10 +2,10 @@ import { Maybe } from "purify-ts";
2
2
  import type { Reusables } from "../Reusables.js";
3
3
  import type { TsGenerator } from "../TsGenerator.js";
4
4
  import { type Code } from "../ts-poet-wrapper.js";
5
- export declare function NamedObjectType_sparqlConstructQueryStringFunctionDeclaration(this: {
5
+ export declare function ObjectType_sparqlConstructQueryStringFunctionDeclaration(this: {
6
+ readonly alias: string;
6
7
  readonly configuration: TsGenerator.Configuration;
7
8
  readonly filterType: Code;
8
- readonly name: string;
9
9
  readonly reusables: Reusables;
10
10
  }): Maybe<Code>;
11
- //# sourceMappingURL=NamedObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts.map
11
+ //# sourceMappingURL=ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { Maybe } from "purify-ts";
2
+ import { code } from "../ts-poet-wrapper.js";
3
+ export function ObjectType_sparqlConstructQueryStringFunctionDeclaration() {
4
+ if (!this.configuration.features.has("Object.SPARQL")) {
5
+ return Maybe.empty();
6
+ }
7
+ return Maybe.of(code `\
8
+ export function sparqlConstructQueryString(parameters: Parameters<typeof ${this.alias}.sparqlConstructQuery>[0] & ${this.reusables.imports.sparqljs}.GeneratorOptions): string {
9
+ return new ${this.reusables.imports.sparqljs}.Generator(parameters).stringify(${this.alias}.sparqlConstructQuery(parameters));
10
+ }`);
11
+ }
12
+ //# sourceMappingURL=ObjectType_sparqlConstructQueryStringFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_toJsonFunctionDeclaration(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_toJsonFunctionDeclaration.d.ts.map
@@ -1,12 +1,12 @@
1
1
  import { Maybe } from "purify-ts";
2
2
  import { code, joinCode } from "../ts-poet-wrapper.js";
3
- export function NamedObjectType_toJsonFunctionDeclaration() {
3
+ export function ObjectType_toJsonFunctionDeclaration() {
4
4
  if (!this.configuration.features.has("Object.toJson")) {
5
5
  return Maybe.empty();
6
6
  }
7
7
  const jsonObjectMembers = [];
8
8
  for (const parentObjectType of this.parentObjectTypes) {
9
- jsonObjectMembers.push(code `...${parentObjectType.name}.toJson(${this.thisVariable})`);
9
+ jsonObjectMembers.push(code `...${parentObjectType.alias.unsafeCoerce()}.toJson(${this.thisVariable})`);
10
10
  }
11
11
  if (this.properties.length > 0) {
12
12
  jsonObjectMembers.push(...this.properties.flatMap((property) => property
@@ -34,8 +34,8 @@ export function NamedObjectType_toJsonFunctionDeclaration() {
34
34
  // break;
35
35
  // }
36
36
  return Maybe.of(code `\
37
- export function toJson(${this.thisVariable}: ${this.name}): ${returnType} {
37
+ export function toJson(${this.thisVariable}: ${this.expression}): ${returnType} {
38
38
  return JSON.parse(JSON.stringify({ ${joinCode(jsonObjectMembers, { on: "," })} } satisfies ${this.jsonType().name}));
39
39
  }`);
40
40
  }
41
- //# sourceMappingURL=NamedObjectType_toJsonFunctionDeclaration.js.map
41
+ //# sourceMappingURL=ObjectType_toJsonFunctionDeclaration.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_toRdfResourceFunctionDeclaration(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_toRdfResourceFunctionDeclaration.d.ts.map
@@ -1,11 +1,11 @@
1
1
  import { rdf } from "@tpluscode/rdf-ns-builders";
2
2
  import { Maybe } from "purify-ts";
3
3
  import { code, joinCode } from "../ts-poet-wrapper.js";
4
- export function NamedObjectType_toRdfResourceFunctionDeclaration() {
4
+ export function ObjectType_toRdfResourceFunctionDeclaration() {
5
5
  if (!this.configuration.features.has("Object.toRdf")) {
6
6
  return Maybe.empty();
7
7
  }
8
- const statements = this.parentObjectTypes.map((parentObjectType) => code `${parentObjectType.name}._toRdfResource({ ...parameters, ignoreRdfType: true });`);
8
+ const statements = this.parentObjectTypes.map((parentObjectType) => code `${parentObjectType.alias.unsafeCoerce()}._toRdfResource({ ...parameters, ignoreRdfType: true });`);
9
9
  if (this.toRdfTypes.length > 0) {
10
10
  statements.push(code `if (!${variables.ignoreRdfType}) { ${joinCode(this.toRdfTypes.map((toRdfType) => code `${variables.resource}.add(${this.rdfjsTermExpression(rdf.type)}, ${this.reusables.imports.dataFactory}.namedNode("${toRdfType.value}"), ${variables.graph});`), { on: " " })} }`);
11
11
  }
@@ -23,7 +23,7 @@ export function NamedObjectType_toRdfResourceFunctionDeclaration() {
23
23
  }
24
24
  statements.push(code `return ${variables.resource};`);
25
25
  return Maybe.of(code `\
26
- export const _toRdfResource: ${this.reusables.snippets._ToRdfResourceFunction}<${this.identifierTypeAlias}, ${this.name}> = (parameters) => {
26
+ export const _toRdfResource: ${this.reusables.snippets._ToRdfResourceFunction}<${this.identifierTypeAlias}, ${this.expression}> = (parameters) => {
27
27
  ${joinCode(statements)}
28
28
  }
29
29
 
@@ -36,4 +36,4 @@ const variables = {
36
36
  resource: code `parameters.resource`,
37
37
  resourceSet: code `parameters.resourceSet`,
38
38
  };
39
- //# sourceMappingURL=NamedObjectType_toRdfResourceFunctionDeclaration.js.map
39
+ //# sourceMappingURL=ObjectType_toRdfResourceFunctionDeclaration.js.map
@@ -0,0 +1,4 @@
1
+ import type { ObjectType } from "../ObjectType.js";
2
+ import { type Code } from "../ts-poet-wrapper.js";
3
+ export declare function ObjectType_toStringFunctionDeclarations(this: ObjectType): readonly Code[];
4
+ //# sourceMappingURL=ObjectType_toStringFunctionDeclarations.d.ts.map
@@ -1,12 +1,12 @@
1
1
  import { code, joinCode } from "../ts-poet-wrapper.js";
2
- export function NamedObjectType_toStringFunctionDeclarations() {
2
+ export function ObjectType_toStringFunctionDeclarations() {
3
3
  if (!this.configuration.features.has("Object.toString")) {
4
4
  return [];
5
5
  }
6
6
  let propertiesToStringInitializers = [];
7
7
  if (this.parentObjectTypes.length > 0) {
8
8
  for (const parentObjectType of this.parentObjectTypes) {
9
- propertiesToStringInitializers.push(code `...${parentObjectType.name}._propertiesToStrings(${this.thisVariable})`);
9
+ propertiesToStringInitializers.push(code `...${parentObjectType.alias.unsafeCoerce()}._propertiesToStrings(${this.thisVariable})`);
10
10
  }
11
11
  }
12
12
  propertiesToStringInitializers = propertiesToStringInitializers.concat(this.properties.flatMap((property) => property
@@ -19,18 +19,18 @@ export function NamedObjectType_toStringFunctionDeclarations() {
19
19
  })
20
20
  .toList()));
21
21
  const propertiesToStringsReturnExpression = code `${this.reusables.snippets.compactRecord}({${joinCode(propertiesToStringInitializers, { on: "," })}})`;
22
- const toStringReturnExpression = (propertiesToStrings) => code `\`${this.name}(\${JSON.stringify(${propertiesToStrings})})\``;
22
+ const toStringReturnExpression = (propertiesToStrings) => code `\`${this.alias.unsafeCoerce()}(\${JSON.stringify(${propertiesToStrings})})\``;
23
23
  const syntheticNamePrefix = this.configuration.syntheticNamePrefix;
24
24
  return [
25
25
  // Use overloads to allow the function to be attached to an instance or used freestanding
26
26
  code `\
27
- export function _propertiesToStrings(${this.thisVariable}: ${this.name}): Record<string, string> {
27
+ export function _propertiesToStrings(${this.thisVariable}: ${this.expression}): Record<string, string> {
28
28
  return ${propertiesToStringsReturnExpression};
29
29
  }`,
30
30
  code `\
31
- export function ${syntheticNamePrefix}toString(${this.thisVariable}: ${this.name}): string {
31
+ export function ${syntheticNamePrefix}toString(${this.thisVariable}: ${this.expression}): string {
32
32
  return ${toStringReturnExpression(code `_propertiesToStrings(${this.thisVariable})`)};
33
33
  }`,
34
34
  ];
35
35
  }
36
- //# sourceMappingURL=NamedObjectType_toStringFunctionDeclarations.js.map
36
+ //# sourceMappingURL=ObjectType_toStringFunctionDeclarations.js.map
@@ -0,0 +1,5 @@
1
+ import { Maybe } from "purify-ts";
2
+ import type { ObjectType } from "../ObjectType.js";
3
+ import { type Code } from "../ts-poet-wrapper.js";
4
+ export declare function ObjectType_valueSparqlConstructTriplesFunctionDeclaration(this: ObjectType): Maybe<Code>;
5
+ //# sourceMappingURL=ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts.map