@shaclmate/compiler 4.0.41 → 4.0.43

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 (320) hide show
  1. package/dist/ShapesGraphToAstTransformer.d.ts +1 -0
  2. package/dist/ShapesGraphToAstTransformer.js +11 -43
  3. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstStructTypeField.d.ts +17 -0
  4. package/dist/_ShapesGraphToAstTransformer/{transformPropertyShapeToAstObjectTypeProperty.js → transformPropertyShapeToAstStructTypeField.js} +71 -48
  5. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.d.ts +1 -1
  6. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstListType.js +29 -20
  7. package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.d.ts → transformShapeToAstStructType.d.ts} +2 -2
  8. package/dist/_ShapesGraphToAstTransformer/{transformShapeToAstObjectType.js → transformShapeToAstStructType.js} +35 -29
  9. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstTermType.js +2 -1
  10. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.d.ts +1 -1
  11. package/dist/_ShapesGraphToAstTransformer/transformShapeToAstType.js +9 -4
  12. package/dist/ast/AbstractCompoundType.d.ts +2 -2
  13. package/dist/ast/AbstractCompoundType.js +4 -4
  14. package/dist/ast/AbstractContainerType.d.ts +2 -2
  15. package/dist/ast/AbstractContainerType.js +4 -4
  16. package/dist/ast/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +10 -10
  17. package/dist/ast/{AbstractLazyObjectType.js → AbstractLazyType.js} +3 -3
  18. package/dist/ast/AbstractType.d.ts +1 -1
  19. package/dist/ast/AbstractType.js +3 -0
  20. package/dist/ast/Ast.d.ts +2 -4
  21. package/dist/ast/DefaultValueType.js +2 -1
  22. package/dist/ast/IntersectionType.d.ts +2 -2
  23. package/dist/ast/IntersectionType.js +3 -3
  24. package/dist/ast/LazyOptionType.d.ts +6 -0
  25. package/dist/ast/LazyOptionType.js +5 -0
  26. package/dist/ast/LazySetType.d.ts +6 -0
  27. package/dist/ast/LazySetType.js +5 -0
  28. package/dist/ast/LazyType.d.ts +5 -0
  29. package/dist/ast/LazyType.js +5 -0
  30. package/dist/ast/ListType.d.ts +2 -2
  31. package/dist/ast/ListType.js +4 -4
  32. package/dist/ast/OptionType.js +2 -1
  33. package/dist/ast/SetType.js +2 -1
  34. package/dist/ast/StructCompoundType.d.ts +12 -0
  35. package/dist/ast/{ObjectCompoundType.js → StructCompoundType.js} +18 -18
  36. package/dist/ast/StructIntersectionType.d.ts +4 -0
  37. package/dist/ast/StructIntersectionType.js +2 -0
  38. package/dist/ast/{ObjectType.d.ts → StructType.d.ts} +28 -27
  39. package/dist/ast/{ObjectType.js → StructType.js} +81 -78
  40. package/dist/ast/StructUnionType.d.ts +4 -0
  41. package/dist/ast/StructUnionType.js +2 -0
  42. package/dist/ast/Type.d.ts +5 -5
  43. package/dist/ast/Type.js +4 -4
  44. package/dist/ast/UnionType.d.ts +2 -2
  45. package/dist/ast/UnionType.js +3 -3
  46. package/dist/ast/index.d.ts +7 -7
  47. package/dist/ast/index.js +7 -7
  48. package/dist/generators/AstJsonGenerator.js +2 -2
  49. package/dist/generators/transformAstToLabeledPropertyGraph.js +8 -8
  50. package/dist/generators/ts/AbstractContainerType.d.ts +1 -1
  51. package/dist/generators/ts/AbstractContainerType.js +6 -6
  52. package/dist/generators/ts/AbstractDateType.d.ts +1 -7
  53. package/dist/generators/ts/AbstractDateType.js +1 -11
  54. package/dist/generators/ts/{AbstractLazyObjectType.d.ts → AbstractLazyType.d.ts} +7 -7
  55. package/dist/generators/ts/{AbstractLazyObjectType.js → AbstractLazyType.js} +19 -17
  56. package/dist/generators/ts/AbstractLiteralType.d.ts +2 -5
  57. package/dist/generators/ts/AbstractLiteralType.js +0 -21
  58. package/dist/generators/ts/AbstractNumericType.d.ts +1 -7
  59. package/dist/generators/ts/AbstractNumericType.js +15 -25
  60. package/dist/generators/ts/AbstractObjectSetType.d.ts +1 -1
  61. package/dist/generators/ts/AbstractObjectSetType.js +2 -2
  62. package/dist/generators/ts/AbstractPrimitiveType.d.ts +1 -1
  63. package/dist/generators/ts/AbstractPrimitiveType.js +1 -1
  64. package/dist/generators/ts/AbstractTermType.d.ts +6 -21
  65. package/dist/generators/ts/AbstractTermType.js +26 -55
  66. package/dist/generators/ts/AbstractType.d.ts +40 -47
  67. package/dist/generators/ts/AbstractType.js +17 -6
  68. package/dist/generators/ts/BigDecimalType.d.ts +3 -3
  69. package/dist/generators/ts/BigDecimalType.js +3 -8
  70. package/dist/generators/ts/BigIntType.d.ts +2 -2
  71. package/dist/generators/ts/BigIntType.js +7 -4
  72. package/dist/generators/ts/BlankNodeType.d.ts +2 -7
  73. package/dist/generators/ts/BlankNodeType.js +2 -7
  74. package/dist/generators/ts/BooleanType.d.ts +3 -3
  75. package/dist/generators/ts/BooleanType.js +12 -14
  76. package/dist/generators/ts/DateTimeType.d.ts +2 -2
  77. package/dist/generators/ts/DateTimeType.js +14 -4
  78. package/dist/generators/ts/DateType.d.ts +2 -2
  79. package/dist/generators/ts/DateType.js +14 -4
  80. package/dist/generators/ts/DefaultValueType.d.ts +8 -8
  81. package/dist/generators/ts/DefaultValueType.js +10 -12
  82. package/dist/generators/ts/FloatType.d.ts +2 -2
  83. package/dist/generators/ts/FloatType.js +7 -4
  84. package/dist/generators/ts/IdentifierType.d.ts +2 -2
  85. package/dist/generators/ts/IdentifierType.js +2 -7
  86. package/dist/generators/ts/IntType.d.ts +2 -2
  87. package/dist/generators/ts/IntType.js +7 -4
  88. package/dist/generators/ts/IriType.d.ts +2 -2
  89. package/dist/generators/ts/IriType.js +12 -14
  90. package/dist/generators/ts/{LazyObjectOptionType.d.ts → LazyOptionType.d.ts} +12 -11
  91. package/dist/generators/ts/{LazyObjectOptionType.js → LazyOptionType.js} +23 -14
  92. package/dist/generators/ts/LazySetType.d.ts +20 -0
  93. package/dist/generators/ts/{LazyObjectSetType.js → LazySetType.js} +22 -13
  94. package/dist/generators/ts/LazyType.d.ts +19 -0
  95. package/dist/generators/ts/{LazyObjectType.js → LazyType.js} +22 -13
  96. package/dist/generators/ts/ListType.d.ts +1 -1
  97. package/dist/generators/ts/ListType.js +9 -19
  98. package/dist/generators/ts/LiteralType.d.ts +3 -2
  99. package/dist/generators/ts/LiteralType.js +6 -2
  100. package/dist/generators/ts/ObjectType.d.ts +16 -3
  101. package/dist/generators/ts/ObjectType.js +301 -91
  102. package/dist/generators/ts/ObjectUnionType.js +40 -40
  103. package/dist/generators/ts/OptionType.d.ts +2 -2
  104. package/dist/generators/ts/OptionType.js +7 -5
  105. package/dist/generators/ts/SetType.d.ts +3 -3
  106. package/dist/generators/ts/SetType.js +8 -10
  107. package/dist/generators/ts/Snippets.d.ts +26 -8
  108. package/dist/generators/ts/Snippets.js +161 -35
  109. package/dist/generators/ts/StringType.d.ts +4 -3
  110. package/dist/generators/ts/StringType.js +18 -11
  111. package/dist/generators/ts/TermType.d.ts +7 -5
  112. package/dist/generators/ts/TermType.js +28 -9
  113. package/dist/generators/ts/TsGenerator.js +11 -6
  114. package/dist/generators/ts/Type.d.ts +4 -4
  115. package/dist/generators/ts/TypeFactory.d.ts +5 -5
  116. package/dist/generators/ts/TypeFactory.js +79 -58
  117. package/dist/generators/ts/UnionType.d.ts +23 -18
  118. package/dist/generators/ts/UnionType.js +227 -221
  119. package/dist/generators/ts/ZodGenerator.js +15 -7
  120. package/dist/generators/ts/_ObjectType/AbstractProperty.d.ts +24 -15
  121. package/dist/generators/ts/_ObjectType/AbstractProperty.js +1 -24
  122. package/dist/generators/ts/_ObjectType/DiscriminantProperty.d.ts +8 -6
  123. package/dist/generators/ts/_ObjectType/DiscriminantProperty.js +11 -24
  124. package/dist/generators/ts/_ObjectType/IdentifierProperty.d.ts +8 -2
  125. package/dist/generators/ts/_ObjectType/IdentifierProperty.js +44 -16
  126. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.d.ts +4 -0
  127. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionExpression.js +28 -0
  128. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionExpression.d.ts +4 -0
  129. package/dist/generators/ts/_ObjectType/{ObjectType_equalsFunctionDeclaration.js → ObjectType_equalsFunctionExpression.js} +6 -10
  130. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.d.ts +4 -0
  131. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionExpression.js +12 -0
  132. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeExpression.d.ts +4 -0
  133. package/dist/generators/ts/_ObjectType/{ObjectType_filterTypeDeclaration.js → ObjectType_filterTypeExpression.js} +6 -8
  134. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_focusSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
  135. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlConstructTriplesFunctionDeclaration.js → ObjectType_focusSparqlConstructTriplesFunctionExpression.js} +5 -9
  136. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_focusSparqlWherePatternsFunctionExpression.d.ts} +2 -3
  137. package/dist/generators/ts/_ObjectType/{ObjectType_focusSparqlWherePatternsFunctionDeclaration.js → ObjectType_focusSparqlWherePatternsFunctionExpression.js} +5 -9
  138. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.d.ts +4 -0
  139. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionExpression.js +12 -0
  140. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionExpression.d.ts +4 -0
  141. package/dist/generators/ts/_ObjectType/{ObjectType_fromRdfResourceFunctionDeclaration.js → ObjectType_fromRdfResourceFunctionExpression.js} +8 -16
  142. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeExpression.d.ts +4 -0
  143. package/dist/generators/ts/_ObjectType/{ObjectType_graphqlTypeVariableStatement.js → ObjectType_graphqlTypeExpression.js} +6 -13
  144. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.d.ts +4 -0
  145. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionExpression.js +30 -0
  146. package/dist/generators/ts/_ObjectType/ObjectType_identifierTypeDeclarations.d.ts +4 -0
  147. package/dist/generators/ts/_ObjectType/{identifierTypeDeclarations.js → ObjectType_identifierTypeDeclarations.js} +2 -5
  148. package/dist/generators/ts/_ObjectType/ObjectType_isTypeFunctionDeclaration.js +3 -3
  149. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.d.ts +1 -2
  150. package/dist/generators/ts/_ObjectType/ObjectType_jsonParseFunctionDeclaration.js +2 -6
  151. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaExpression.d.ts +4 -0
  152. package/dist/generators/ts/_ObjectType/{ObjectType_jsonSchemaFunctionDeclaration.js → ObjectType_jsonSchemaExpression.js} +3 -10
  153. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.d.ts +4 -0
  154. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeExpression.js +5 -0
  155. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.d.ts +4 -0
  156. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionExpression.js +17 -0
  157. package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.d.ts +1 -1
  158. package/dist/generators/ts/_ObjectType/ObjectType_objectSetMethodNames.js +2 -2
  159. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.d.ts +4 -0
  160. package/dist/generators/ts/_ObjectType/ObjectType_schemaExpression.js +18 -0
  161. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.d.ts +4 -0
  162. package/dist/generators/ts/_ObjectType/ObjectType_schemaTypeExpression.js +18 -0
  163. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.d.ts +2 -3
  164. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryFunctionDeclaration.js +5 -9
  165. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.d.ts +2 -3
  166. package/dist/generators/ts/_ObjectType/ObjectType_sparqlConstructQueryStringFunctionDeclaration.js +4 -8
  167. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.d.ts +4 -0
  168. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionExpression.js +14 -0
  169. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionExpression.d.ts +4 -0
  170. package/dist/generators/ts/_ObjectType/{ObjectType_toRdfResourceFunctionDeclaration.js → ObjectType_toRdfResourceFunctionExpression.js} +6 -12
  171. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.d.ts +4 -0
  172. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionExpression.js +7 -0
  173. package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.d.ts +4 -0
  174. package/dist/generators/ts/_ObjectType/ObjectType_toStringRecordFunctionExpression.js +5 -0
  175. package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlConstructTriplesFunctionDeclaration.d.ts → ObjectType_valueSparqlConstructTriplesFunctionExpression.d.ts} +2 -3
  176. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionExpression.js +8 -0
  177. package/dist/generators/ts/_ObjectType/{ObjectType_valueSparqlWherePatternsFunctionDeclaration.d.ts → ObjectType_valueSparqlWherePatternsFunctionExpression.d.ts} +2 -3
  178. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionExpression.js +10 -0
  179. package/dist/generators/ts/_ObjectType/ShaclProperty.d.ts +9 -2
  180. package/dist/generators/ts/_ObjectType/ShaclProperty.js +65 -33
  181. package/dist/generators/ts/_snippets/snippets_BooleanSchema.js +4 -3
  182. package/dist/generators/ts/_snippets/snippets_DateSchema.js +4 -3
  183. package/dist/generators/ts/_snippets/snippets_DefaultValueSchema.js +3 -3
  184. package/dist/generators/ts/_snippets/snippets_FromRdfResourceValuesFunction.js +6 -5
  185. package/dist/generators/ts/_snippets/snippets_IdentifierSchema.js +2 -1
  186. package/dist/generators/ts/_snippets/snippets_IriSchema.js +1 -0
  187. package/dist/generators/ts/_snippets/snippets_Lazy.d.ts +3 -0
  188. package/dist/generators/ts/_snippets/snippets_Lazy.js +22 -0
  189. package/dist/generators/ts/_snippets/snippets_LazyOption.d.ts +3 -0
  190. package/dist/generators/ts/_snippets/snippets_LazyOption.js +25 -0
  191. package/dist/generators/ts/_snippets/snippets_LazySet.d.ts +3 -0
  192. package/dist/generators/ts/_snippets/snippets_LazySet.js +40 -0
  193. package/dist/generators/ts/_snippets/snippets_LiteralFilter.js +1 -3
  194. package/dist/generators/ts/_snippets/snippets_LiteralSchema.js +1 -0
  195. package/dist/generators/ts/_snippets/snippets_NumericSchema.js +2 -1
  196. package/dist/generators/ts/_snippets/snippets_PropertyPath.js +6 -8
  197. package/dist/generators/ts/_snippets/snippets_RdfVocabularies.js +32 -32
  198. package/dist/generators/ts/_snippets/snippets_ShaclPropertySchema.js +1 -1
  199. package/dist/generators/ts/_snippets/snippets_StringSchema.js +5 -3
  200. package/dist/generators/ts/_snippets/snippets_TermFilter.js +3 -3
  201. package/dist/generators/ts/_snippets/snippets_TermSchema.js +4 -2
  202. package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.d.ts +3 -0
  203. package/dist/generators/ts/_snippets/snippets_bigDecimalFromRdfResourceValues.js +6 -0
  204. package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.d.ts +3 -0
  205. package/dist/generators/ts/_snippets/snippets_bigIntFromRdfResourceValues.js +6 -0
  206. package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.d.ts +3 -0
  207. package/dist/generators/ts/_snippets/snippets_blankNodeFromRdfResourceValues.js +6 -0
  208. package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.d.ts +3 -0
  209. package/dist/generators/ts/_snippets/snippets_booleanFromRdfResourceValues.js +6 -0
  210. package/dist/generators/ts/_snippets/snippets_convertToLazy.d.ts +3 -0
  211. package/dist/generators/ts/_snippets/snippets_convertToLazy.js +15 -0
  212. package/dist/generators/ts/_snippets/snippets_convertToLazyOption.d.ts +3 -0
  213. package/dist/generators/ts/_snippets/snippets_convertToLazyOption.js +33 -0
  214. package/dist/generators/ts/_snippets/snippets_convertToLazySet.d.ts +3 -0
  215. package/dist/generators/ts/_snippets/snippets_convertToLazySet.js +27 -0
  216. package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.d.ts +3 -0
  217. package/dist/generators/ts/_snippets/snippets_dateFromRdfResourceValues.js +6 -0
  218. package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.d.ts +3 -0
  219. package/dist/generators/ts/_snippets/snippets_dateTimeFromRdfResourceValues.js +6 -0
  220. package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.d.ts +3 -0
  221. package/dist/generators/ts/_snippets/snippets_defaultValueFromRdfResourceValues.js +10 -0
  222. package/dist/generators/ts/_snippets/snippets_defaultValueSparqlWherePatterns.js +1 -1
  223. package/dist/generators/ts/_snippets/snippets_filterNumeric.js +1 -1
  224. package/dist/generators/ts/_snippets/snippets_filterTerm.js +1 -2
  225. package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.d.ts +3 -0
  226. package/dist/generators/ts/_snippets/snippets_floatFromRdfResourceValues.js +6 -0
  227. package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.d.ts +3 -0
  228. package/dist/generators/ts/_snippets/snippets_identifierFromRdfResourceValues.js +6 -0
  229. package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.d.ts +3 -0
  230. package/dist/generators/ts/_snippets/snippets_intFromRdfResourceValues.js +6 -0
  231. package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.d.ts +3 -0
  232. package/dist/generators/ts/_snippets/snippets_iriFromRdfResourceValues.js +6 -0
  233. package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.d.ts +3 -0
  234. package/dist/generators/ts/_snippets/snippets_listFromRdfResourceValues.js +15 -0
  235. package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.d.ts +3 -0
  236. package/dist/generators/ts/_snippets/snippets_literalFromRdfResourceValues.js +6 -0
  237. package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.d.ts +3 -0
  238. package/dist/generators/ts/_snippets/snippets_maybeFromRdfResourceValues.js +11 -0
  239. package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.d.ts +3 -0
  240. package/dist/generators/ts/_snippets/snippets_mutableListFromRdfResourceValues.js +8 -0
  241. package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.d.ts +3 -0
  242. package/dist/generators/ts/_snippets/snippets_mutableSetFromRdfResourceValues.js +8 -0
  243. package/dist/generators/ts/_snippets/snippets_numericSparqlWherePatterns.js +1 -1
  244. package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.d.ts +3 -0
  245. package/dist/generators/ts/_snippets/snippets_setFromRdfResourceValues.js +9 -0
  246. package/dist/generators/ts/_snippets/snippets_shaclPropertyFromRdf.js +13 -7
  247. package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.d.ts +3 -0
  248. package/dist/generators/ts/_snippets/snippets_stringFromRdfResourceValues.js +6 -0
  249. package/dist/generators/ts/_snippets/snippets_termFilterSparqlPatterns.js +1 -1
  250. package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.d.ts +3 -0
  251. package/dist/generators/ts/_snippets/snippets_termFromRdfResourceValues.js +17 -0
  252. package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.d.ts +3 -0
  253. package/dist/generators/ts/_snippets/snippets_termLikeFromRdfResourceValues.js +60 -0
  254. package/dist/generators/ts/_snippets/snippets_termSparqlWherePatterns.js +2 -2
  255. package/dist/input/generated.d.ts +511 -386
  256. package/dist/input/generated.js +1780 -2293
  257. package/package.json +2 -2
  258. package/dist/_ShapesGraphToAstTransformer/transformPropertyShapeToAstObjectTypeProperty.d.ts +0 -9
  259. package/dist/ast/LazyObjectOptionType.d.ts +0 -6
  260. package/dist/ast/LazyObjectOptionType.js +0 -5
  261. package/dist/ast/LazyObjectSetType.d.ts +0 -6
  262. package/dist/ast/LazyObjectSetType.js +0 -5
  263. package/dist/ast/LazyObjectType.d.ts +0 -5
  264. package/dist/ast/LazyObjectType.js +0 -5
  265. package/dist/ast/ObjectCompoundType.d.ts +0 -12
  266. package/dist/ast/ObjectIntersectionType.d.ts +0 -4
  267. package/dist/ast/ObjectIntersectionType.js +0 -2
  268. package/dist/ast/ObjectUnionType.d.ts +0 -4
  269. package/dist/ast/ObjectUnionType.js +0 -2
  270. package/dist/generators/ts/LazyObjectSetType.d.ts +0 -20
  271. package/dist/generators/ts/LazyObjectType.d.ts +0 -19
  272. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.d.ts +0 -5
  273. package/dist/generators/ts/_ObjectType/ObjectType_createFunctionDeclaration.js +0 -44
  274. package/dist/generators/ts/_ObjectType/ObjectType_equalsFunctionDeclaration.d.ts +0 -5
  275. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.d.ts +0 -5
  276. package/dist/generators/ts/_ObjectType/ObjectType_filterFunctionDeclaration.js +0 -21
  277. package/dist/generators/ts/_ObjectType/ObjectType_filterTypeDeclaration.d.ts +0 -5
  278. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.d.ts +0 -5
  279. package/dist/generators/ts/_ObjectType/ObjectType_fromJsonFunctionDeclaration.js +0 -18
  280. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceFunctionDeclaration.d.ts +0 -5
  281. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.d.ts +0 -5
  282. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfResourceValuesFunctionDeclaration.js +0 -15
  283. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.d.ts +0 -5
  284. package/dist/generators/ts/_ObjectType/ObjectType_fromRdfTypeVariableStatement.js +0 -10
  285. package/dist/generators/ts/_ObjectType/ObjectType_graphqlTypeVariableStatement.d.ts +0 -5
  286. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.d.ts +0 -4
  287. package/dist/generators/ts/_ObjectType/ObjectType_hashFunctionDeclarations.js +0 -41
  288. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.d.ts +0 -4
  289. package/dist/generators/ts/_ObjectType/ObjectType_interfaceDeclaration.js +0 -12
  290. package/dist/generators/ts/_ObjectType/ObjectType_jsonSchemaFunctionDeclaration.d.ts +0 -5
  291. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.d.ts +0 -5
  292. package/dist/generators/ts/_ObjectType/ObjectType_jsonTypeAliasDeclaration.js +0 -9
  293. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.d.ts +0 -5
  294. package/dist/generators/ts/_ObjectType/ObjectType_jsonUiSchemaFunctionDeclaration.js +0 -15
  295. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.d.ts +0 -5
  296. package/dist/generators/ts/_ObjectType/ObjectType_schemaVariableStatement.js +0 -12
  297. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.d.ts +0 -5
  298. package/dist/generators/ts/_ObjectType/ObjectType_toJsonFunctionDeclaration.js +0 -20
  299. package/dist/generators/ts/_ObjectType/ObjectType_toRdfResourceFunctionDeclaration.d.ts +0 -5
  300. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.d.ts +0 -4
  301. package/dist/generators/ts/_ObjectType/ObjectType_toStringFunctionDeclarations.js +0 -29
  302. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlConstructTriplesFunctionDeclaration.js +0 -11
  303. package/dist/generators/ts/_ObjectType/ObjectType_valueSparqlWherePatternsFunctionDeclaration.js +0 -13
  304. package/dist/generators/ts/_ObjectType/identifierTypeDeclarations.d.ts +0 -4
  305. package/dist/generators/ts/_snippets/snippets_LazyObject.d.ts +0 -3
  306. package/dist/generators/ts/_snippets/snippets_LazyObject.js +0 -22
  307. package/dist/generators/ts/_snippets/snippets_LazyObjectOption.d.ts +0 -3
  308. package/dist/generators/ts/_snippets/snippets_LazyObjectOption.js +0 -25
  309. package/dist/generators/ts/_snippets/snippets_LazyObjectSet.d.ts +0 -3
  310. package/dist/generators/ts/_snippets/snippets_LazyObjectSet.js +0 -40
  311. package/dist/generators/ts/_snippets/snippets_convertToLazyObject.d.ts +0 -3
  312. package/dist/generators/ts/_snippets/snippets_convertToLazyObject.js +0 -15
  313. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.d.ts +0 -3
  314. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectOption.js +0 -31
  315. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.d.ts +0 -3
  316. package/dist/generators/ts/_snippets/snippets_convertToLazyObjectSet.js +0 -25
  317. package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.d.ts +0 -3
  318. package/dist/generators/ts/_snippets/snippets_fromRdfLanguageIn.js +0 -15
  319. package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.d.ts +0 -3
  320. package/dist/generators/ts/_snippets/snippets_fromRdfPreferredLanguages.js +0 -23
@@ -13,8 +13,8 @@ export class DefaultValueType extends AbstractContainerType {
13
13
  defaultValue;
14
14
  discriminantProperty = Maybe.empty();
15
15
  graphqlArgs = Maybe.empty();
16
- kind = "DefaultValue";
17
16
  jsTypes = this.itemType.jsTypes;
17
+ kind = "DefaultValue";
18
18
  validationFunction = this.itemType.validationFunction;
19
19
  constructor({ defaultValue, ...superParameters }) {
20
20
  super(superParameters);
@@ -44,6 +44,9 @@ export class DefaultValueType extends AbstractContainerType {
44
44
  get filterType() {
45
45
  return this.itemType.filterType;
46
46
  }
47
+ get fromRdfResourceValuesFunction() {
48
+ return code `${this.reusables.snippets.defaultValueFromRdfResourceValues}<${this.itemType.expression}, ${this.itemType.schemaType}>(${this.itemType.fromRdfResourceValuesFunction})`;
49
+ }
47
50
  get graphqlType() {
48
51
  return this.itemType.graphqlType;
49
52
  }
@@ -54,7 +57,7 @@ export class DefaultValueType extends AbstractContainerType {
54
57
  return this.itemType.mutable;
55
58
  }
56
59
  get schemaType() {
57
- return code `${this.reusables.snippets.DefaultValueSchema}<${this.itemType.expression}, ${this.itemType.schemaType}>`;
60
+ return code `${this.reusables.snippets.DefaultValueSchema}<${this.itemType.schemaType}>`;
58
61
  }
59
62
  get toRdfResourceValueTypes() {
60
63
  return this.itemType.toRdfResourceValueTypes;
@@ -66,7 +69,7 @@ export class DefaultValueType extends AbstractContainerType {
66
69
  return code `${this.reusables.snippets.defaultValueSparqlWherePatterns}<${this.itemType.filterType}, ${this.itemType.schemaType}>(${this.itemType.valueSparqlWherePatternsFunction})`;
67
70
  }
68
71
  get schemaInitializers() {
69
- return super.schemaInitializers.concat(code `defaultValue: ${this.defaultValueExpression}`);
72
+ return super.schemaInitializers.concat(code `defaultValue: ${this.rdfjsTermExpression(this.defaultValue)}`);
70
73
  }
71
74
  get defaultValueExpression() {
72
75
  switch (this.itemType.kind) {
@@ -82,19 +85,11 @@ export class DefaultValueType extends AbstractContainerType {
82
85
  throw new RangeError(`not implemented ${this.itemType.kind}`);
83
86
  }
84
87
  invariant(this.defaultValue.termType === "Literal");
85
- return this.itemType.literalExpression(this.defaultValue);
88
+ return this.itemType.literalValueExpression(this.defaultValue);
86
89
  }
87
90
  fromJsonExpression(parameters) {
88
91
  return this.itemType.fromJsonExpression(parameters);
89
92
  }
90
- fromRdfResourceValuesExpression({ variables, }) {
91
- return this.itemType.fromRdfResourceValuesExpression({
92
- variables: {
93
- ...variables,
94
- resourceValues: code `${variables.resourceValues}.map(values => values.length > 0 ? values : new ${this.reusables.imports.Resource}.Value(${{ dataFactory: this.reusables.imports.dataFactory, focusResource: variables.resource, propertyPath: variables.propertyPath, term: this.rdfjsTermExpression(this.defaultValue) }}).toValues())`,
95
- },
96
- });
97
- }
98
93
  graphqlResolveExpression(parameters) {
99
94
  return this.itemType.graphqlResolveExpression(parameters);
100
95
  }
@@ -121,6 +116,9 @@ export class DefaultValueType extends AbstractContainerType {
121
116
  __decorate([
122
117
  Memoize()
123
118
  ], DefaultValueType.prototype, "conversionFunction", null);
119
+ __decorate([
120
+ Memoize()
121
+ ], DefaultValueType.prototype, "fromRdfResourceValuesFunction", null);
124
122
  __decorate([
125
123
  Memoize()
126
124
  ], DefaultValueType.prototype, "schemaType", null);
@@ -6,8 +6,8 @@ export declare class FloatType extends AbstractNumericType<number> {
6
6
  readonly typeof: "number";
7
7
  }];
8
8
  readonly kind = "Float";
9
+ get fromRdfResourceValuesFunction(): Code;
9
10
  get graphqlType(): import("./AbstractType.js").AbstractType.GraphqlType;
10
- literalExpression(literal: Literal | number): Code;
11
- protected fromRdfResourceValueExpression({ variables, }: Parameters<AbstractNumericType<number>["fromRdfResourceValueExpression"]>[0]): Code;
11
+ literalValueExpression(literal: Literal | number): Code;
12
12
  }
13
13
  //# sourceMappingURL=FloatType.d.ts.map
@@ -11,16 +11,19 @@ import { code } from "./ts-poet-wrapper.js";
11
11
  export class FloatType extends AbstractNumericType {
12
12
  jsTypes = [{ typeof: "number" }];
13
13
  kind = "Float";
14
+ get fromRdfResourceValuesFunction() {
15
+ return code `${this.reusables.snippets.floatFromRdfResourceValues}<${this.expression}>`;
16
+ }
14
17
  get graphqlType() {
15
18
  return new AbstractNumericType.GraphqlType(code `${this.reusables.imports.GraphQLFloat}`, this.reusables);
16
19
  }
17
- literalExpression(literal) {
20
+ literalValueExpression(literal) {
18
21
  return code `${typeof literal === "number" ? literal : LiteralDecoder.decodeFloatLiteral(literal).unsafeCoerce()}`;
19
22
  }
20
- fromRdfResourceValueExpression({ variables, }) {
21
- return code `${variables.value}.toFloat(${this.primitiveIn.length > 0 ? `${JSON.stringify(this.primitiveIn)} as const` : ""})`;
22
- }
23
23
  }
24
+ __decorate([
25
+ Memoize()
26
+ ], FloatType.prototype, "fromRdfResourceValuesFunction", null);
24
27
  __decorate([
25
28
  Memoize()
26
29
  ], FloatType.prototype, "graphqlType", null);
@@ -4,10 +4,11 @@ import { Maybe } from "purify-ts";
4
4
  import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
5
5
  import { type Code } from "./ts-poet-wrapper.js";
6
6
  export declare class IdentifierType extends AbstractIdentifierType<BlankNode | NamedNode> {
7
- readonly expression: Code;
7
+ protected readonly inlineExpression: Code;
8
8
  readonly conversionFunction: Maybe<AbstractIdentifierType.ConversionFunction>;
9
9
  readonly filterFunction: Code;
10
10
  readonly filterType: Code;
11
+ readonly fromRdfResourceValuesFunction: Code;
11
12
  readonly kind = "Identifier";
12
13
  readonly nodeKinds: ReadonlySet<IdentifierNodeKind>;
13
14
  readonly parseFunction: Code;
@@ -18,6 +19,5 @@ export declare class IdentifierType extends AbstractIdentifierType<BlankNode | N
18
19
  jsonSchema({ includeDiscriminantProperty, }: Parameters<AbstractIdentifierType<BlankNode | NamedNode>["jsonSchema"]>[0]): Code;
19
20
  jsonType(parameters?: Parameters<AbstractIdentifierType<BlankNode | NamedNode>["jsonType"]>[0]): AbstractIdentifierType.JsonType;
20
21
  toJsonExpression({ includeDiscriminantProperty, variables, }: Parameters<AbstractIdentifierType<BlankNode | NamedNode>["toJsonExpression"]>[0]): Code;
21
- protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractIdentifierType<BlankNode | NamedNode>["fromRdfResourceValuesExpressionChain"]>[0]): ReturnType<AbstractIdentifierType<BlankNode | NamedNode>["fromRdfResourceValuesExpressionChain"]>;
22
22
  }
23
23
  //# sourceMappingURL=IdentifierType.d.ts.map
@@ -10,7 +10,7 @@ import { Memoize } from "typescript-memoize";
10
10
  import { AbstractIdentifierType } from "./AbstractIdentifierType.js";
11
11
  import { arrayOf, code } from "./ts-poet-wrapper.js";
12
12
  export class IdentifierType extends AbstractIdentifierType {
13
- expression = code `(${this.reusables.imports.BlankNode} | ${this.reusables.imports.NamedNode})`;
13
+ inlineExpression = code `(${this.reusables.imports.BlankNode} | ${this.reusables.imports.NamedNode})`;
14
14
  conversionFunction = Maybe.of({
15
15
  code: code `${this.reusables.snippets.convertToIdentifier}`,
16
16
  sourceTypes: [
@@ -36,6 +36,7 @@ export class IdentifierType extends AbstractIdentifierType {
36
36
  });
37
37
  filterFunction = code `${this.reusables.snippets.filterIdentifier}`;
38
38
  filterType = code `${this.reusables.snippets.IdentifierFilter}`;
39
+ fromRdfResourceValuesFunction = code `${this.reusables.snippets.identifierFromRdfResourceValues}`;
39
40
  kind = "Identifier";
40
41
  nodeKinds = nodeKinds;
41
42
  parseFunction = code `${this.reusables.snippets.parseIdentifier};`;
@@ -71,12 +72,6 @@ export class IdentifierType extends AbstractIdentifierType {
71
72
  const valueToNamedNode = code `{ "@id": ${variables.value}.value${discriminantProperty} }`;
72
73
  return code `(${variables.value}.termType === "BlankNode" ? ${valueToBlankNode} : ${valueToNamedNode})`;
73
74
  }
74
- fromRdfResourceValuesExpressionChain({ variables, }) {
75
- return {
76
- ...super.fromRdfResourceValuesExpressionChain({ variables }),
77
- valueTo: code `chain(values => values.chainMap(value => value.toIdentifier()))`,
78
- };
79
- }
80
75
  }
81
76
  __decorate([
82
77
  Memoize()
@@ -6,8 +6,8 @@ export declare class IntType extends AbstractNumericType<number> {
6
6
  readonly typeof: "number";
7
7
  }];
8
8
  readonly kind = "Int";
9
+ get fromRdfResourceValuesFunction(): Code;
9
10
  get graphqlType(): import("./AbstractType.js").AbstractType.GraphqlType;
10
- literalExpression(literal: Literal | number): Code;
11
- protected fromRdfResourceValueExpression({ variables, }: Parameters<AbstractNumericType<number>["fromRdfResourceValueExpression"]>[0]): Code;
11
+ literalValueExpression(literal: Literal | number): Code;
12
12
  }
13
13
  //# sourceMappingURL=IntType.d.ts.map
@@ -11,16 +11,19 @@ import { code } from "./ts-poet-wrapper.js";
11
11
  export class IntType extends AbstractNumericType {
12
12
  jsTypes = [{ typeof: "number" }];
13
13
  kind = "Int";
14
+ get fromRdfResourceValuesFunction() {
15
+ return code `${this.reusables.snippets.intFromRdfResourceValues}<${this.expression}>`;
16
+ }
14
17
  get graphqlType() {
15
18
  return new AbstractNumericType.GraphqlType(code `${this.reusables.imports.GraphQLInt}`, this.reusables);
16
19
  }
17
- literalExpression(literal) {
20
+ literalValueExpression(literal) {
18
21
  return code `${typeof literal === "number" ? literal : LiteralDecoder.decodeIntLiteral(literal).unsafeCoerce()}`;
19
22
  }
20
- fromRdfResourceValueExpression({ variables, }) {
21
- return code `${variables.value}.toInt(${this.primitiveIn.length > 0 ? `${JSON.stringify(this.primitiveIn)} as const` : ""})`;
22
- }
23
23
  }
24
+ __decorate([
25
+ Memoize()
26
+ ], IntType.prototype, "fromRdfResourceValuesFunction", null);
24
27
  __decorate([
25
28
  Memoize()
26
29
  ], IntType.prototype, "graphqlType", null);
@@ -10,14 +10,14 @@ export declare class IriType extends AbstractIdentifierType<NamedNode> {
10
10
  readonly schemaType: Code;
11
11
  readonly valueSparqlWherePatternsFunction: Code;
12
12
  get conversionFunction(): Maybe<AbstractIdentifierType.ConversionFunction>;
13
- get expression(): Code;
13
+ get fromRdfResourceValuesFunction(): Code;
14
14
  get parseFunction(): Code;
15
+ protected get inlineExpression(): Code;
15
16
  protected get schemaInitializers(): readonly Code[];
16
17
  private get valueTypeExpression();
17
18
  fromJsonExpression({ variables, }: Parameters<AbstractIdentifierType<NamedNode>["fromJsonExpression"]>[0]): Code;
18
19
  jsonSchema({ includeDiscriminantProperty, }: Parameters<AbstractIdentifierType<NamedNode>["jsonSchema"]>[0]): Code;
19
20
  jsonType(parameters?: Parameters<AbstractIdentifierType<NamedNode>["jsonType"]>[0]): AbstractIdentifierType.JsonType;
20
21
  toJsonExpression({ includeDiscriminantProperty, variables, }: Parameters<AbstractIdentifierType<NamedNode>["toJsonExpression"]>[0]): Code;
21
- protected fromRdfResourceValuesExpressionChain({ variables, }: Parameters<AbstractIdentifierType<NamedNode>["fromRdfResourceValuesExpressionChain"]>[0]): ReturnType<AbstractIdentifierType<NamedNode>["fromRdfResourceValuesExpressionChain"]>;
22
22
  }
23
23
  //# sourceMappingURL=IriType.d.ts.map
@@ -32,11 +32,8 @@ export class IriType extends AbstractIdentifierType {
32
32
  ],
33
33
  });
34
34
  }
35
- get expression() {
36
- if (this.in_.length > 0) {
37
- return code `${this.reusables.imports.NamedNode}<${this.valueTypeExpression}>`;
38
- }
39
- return code `${this.reusables.imports.NamedNode}`;
35
+ get fromRdfResourceValuesFunction() {
36
+ return code `${this.reusables.snippets.iriFromRdfResourceValues}<${this.valueTypeExpression}>`;
40
37
  }
41
38
  get parseFunction() {
42
39
  if (this.in_.length > 0) {
@@ -44,6 +41,12 @@ export class IriType extends AbstractIdentifierType {
44
41
  }
45
42
  return code `${this.reusables.snippets.parseIri}`;
46
43
  }
44
+ get inlineExpression() {
45
+ if (this.in_.length > 0) {
46
+ return code `${this.reusables.imports.NamedNode}<${this.valueTypeExpression}>`;
47
+ }
48
+ return code `${this.reusables.imports.NamedNode}`;
49
+ }
47
50
  get schemaInitializers() {
48
51
  let initializers = super.schemaInitializers;
49
52
  if (this.in_.length > 0) {
@@ -86,24 +89,19 @@ export class IriType extends AbstractIdentifierType {
86
89
  : "";
87
90
  return code `{ "@id": ${variables.value}.value${discriminantProperty} }`;
88
91
  }
89
- fromRdfResourceValuesExpressionChain({ variables, }) {
90
- return {
91
- ...super.fromRdfResourceValuesExpressionChain({ variables }),
92
- valueTo: code `chain(values => values.chainMap(value => value.toIri(${this.in_.length > 0
93
- ? code `[${joinCode(this.in_.map((in_) => this.rdfjsTermExpression(in_)), { on: ", " })}]`
94
- : ""})))`,
95
- };
96
- }
97
92
  }
98
93
  __decorate([
99
94
  Memoize()
100
95
  ], IriType.prototype, "conversionFunction", null);
101
96
  __decorate([
102
97
  Memoize()
103
- ], IriType.prototype, "expression", null);
98
+ ], IriType.prototype, "fromRdfResourceValuesFunction", null);
104
99
  __decorate([
105
100
  Memoize()
106
101
  ], IriType.prototype, "parseFunction", null);
102
+ __decorate([
103
+ Memoize()
104
+ ], IriType.prototype, "inlineExpression", null);
107
105
  __decorate([
108
106
  Memoize()
109
107
  ], IriType.prototype, "valueTypeExpression", null);
@@ -1,35 +1,36 @@
1
1
  import { Maybe } from "purify-ts";
2
- import { AbstractLazyObjectType } from "./AbstractLazyObjectType.js";
2
+ import { AbstractLazyType } from "./AbstractLazyType.js";
3
3
  import type { OptionType } from "./OptionType.js";
4
4
  import { type Code } from "./ts-poet-wrapper.js";
5
- type Super = AbstractLazyObjectType<OptionType<AbstractLazyObjectType.ObjectTypeConstraint>, OptionType<AbstractLazyObjectType.ObjectTypeConstraint>>;
5
+ type Super = AbstractLazyType<OptionType<AbstractLazyType.ItemTypeConstraint>, OptionType<AbstractLazyType.ItemTypeConstraint>>;
6
6
  declare const Super: (abstract new ({ partialType, resolveType, ...superParameters }: {
7
- partialType: OptionType<AbstractLazyObjectType.ObjectTypeConstraint>;
8
- resolveType: OptionType<AbstractLazyObjectType.ObjectTypeConstraint>;
7
+ partialType: OptionType<AbstractLazyType.ItemTypeConstraint>;
8
+ resolveType: OptionType<AbstractLazyType.ItemTypeConstraint>;
9
9
  } & {
10
- alias: Maybe<string>;
10
+ name: Maybe<string>;
11
11
  comment: Maybe<string>;
12
12
  configuration: import("./TsGenerator.js").TsGenerator.Configuration;
13
13
  label: Maybe<string>;
14
14
  logger: import("ts-log").Logger;
15
15
  reusables: import("./Reusables.js").Reusables;
16
- }) => AbstractLazyObjectType<OptionType<AbstractLazyObjectType.ObjectTypeConstraint>, OptionType<AbstractLazyObjectType.ObjectTypeConstraint>>) & {
16
+ shapeIdentifier: import("@rdfjs/types").BlankNode | import("@rdfjs/types").NamedNode;
17
+ }) => AbstractLazyType<OptionType<AbstractLazyType.ItemTypeConstraint>, OptionType<AbstractLazyType.ItemTypeConstraint>>) & {
17
18
  readonly GraphqlType: typeof import("./AbstractType.js").AbstractType.GraphqlType;
18
19
  readonly JsonType: typeof import("./AbstractType.js").AbstractType.JsonType;
19
20
  JsType: typeof import("./AbstractType.js").AbstractType.JsType;
20
21
  };
21
- export declare class LazyObjectOptionType extends Super {
22
+ export declare class LazyOptionType extends Super {
22
23
  readonly graphqlArgs: Super["graphqlArgs"];
23
- readonly kind = "LazyObjectOption";
24
- get conversionFunction(): Maybe<AbstractLazyObjectType.ConversionFunction>;
24
+ readonly kind = "LazyOption";
25
+ get conversionFunction(): Maybe<AbstractLazyType.ConversionFunction>;
25
26
  protected get runtimeClass(): {
26
27
  name: Code;
27
28
  partialPropertyName: string;
28
29
  rawName: Code;
29
30
  };
30
31
  fromJsonExpression(parameters: Parameters<Super["fromJsonExpression"]>[0]): Code;
31
- fromRdfResourceValuesExpression(parameters: Parameters<Super["fromRdfResourceValuesExpression"]>[0]): Code;
32
+ get fromRdfResourceValuesFunction(): Code;
32
33
  graphqlResolveExpression({ variables, }: Parameters<Super["graphqlResolveExpression"]>[0]): Code;
33
34
  }
34
35
  export {};
35
- //# sourceMappingURL=LazyObjectOptionType.d.ts.map
36
+ //# sourceMappingURL=LazyOptionType.d.ts.map
@@ -7,18 +7,18 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Maybe } from "purify-ts";
8
8
  import { invariant } from "ts-invariant";
9
9
  import { Memoize } from "typescript-memoize";
10
- import { AbstractLazyObjectType } from "./AbstractLazyObjectType.js";
10
+ import { AbstractLazyType } from "./AbstractLazyType.js";
11
11
  import { code } from "./ts-poet-wrapper.js";
12
- const Super = (AbstractLazyObjectType);
13
- export class LazyObjectOptionType extends Super {
12
+ const Super = (AbstractLazyType);
13
+ export class LazyOptionType extends Super {
14
14
  graphqlArgs = Maybe.empty();
15
- kind = "LazyObjectOption";
15
+ kind = "LazyOption";
16
16
  get conversionFunction() {
17
17
  invariant(this.jsTypes.length === 1);
18
18
  invariant(this.resolveType.jsTypes.length === 1);
19
19
  invariant(this.resolveType.itemType.jsTypes.length === 1);
20
20
  return Maybe.of({
21
- code: code `${this.reusables.snippets.convertToLazyObjectOption}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType.itemType, resolveType: this.resolveType.itemType })})`,
21
+ code: code `${this.reusables.snippets.convertToLazyOption}<${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType.itemType, resolveType: this.resolveType.itemType })})`,
22
22
  sourceTypes: [
23
23
  {
24
24
  expression: this.expression,
@@ -41,17 +41,23 @@ export class LazyObjectOptionType extends Super {
41
41
  }
42
42
  get runtimeClass() {
43
43
  return {
44
- name: code `${this.reusables.snippets.LazyObjectOption}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>`,
44
+ name: code `${this.reusables.snippets.LazyOption}<${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>`,
45
45
  partialPropertyName: "partial",
46
- rawName: code `${this.reusables.snippets.LazyObjectOption}`,
46
+ rawName: code `${this.reusables.snippets.LazyOption}`,
47
47
  };
48
48
  }
49
49
  fromJsonExpression(parameters) {
50
- return code `${this.partialType.fromJsonExpression(parameters)}.map(partial => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}: partial, resolver: (identifier) => Promise.resolve(${this.reusables.imports.Left}(new Error(\`unable to resolve identifier \${identifier} deserialized from JSON\`))) }))`;
50
+ return code `${this.partialType.fromJsonExpression(parameters)}.map(partial => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}: partial, resolver: (partial) => Promise.resolve(${this.reusables.imports.Left}(new Error(\`unable to resolve \${partial} deserialized from JSON\`))) }))`;
51
51
  }
52
- fromRdfResourceValuesExpression(parameters) {
53
- const { variables } = parameters;
54
- return code `${this.partialType.fromRdfResourceValuesExpression(parameters)}.map(values => values.map(${this.runtimeClass.partialPropertyName} => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}, resolver: (identifier, options) => ${variables.objectSet}.${this.resolveType.itemType.objectSetMethodNames.object}(identifier, options) })))`;
52
+ get fromRdfResourceValuesFunction() {
53
+ return code `\
54
+ (
55
+ (
56
+ (values, { objectSet, schema, ...otherOptions }) =>
57
+ ${this.partialType.fromRdfResourceValuesFunction}(values, { ...otherOptions, objectSet, schema: schema.partialType })
58
+ .map(values => values.map(${this.runtimeClass.partialPropertyName} => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}, resolver: (partial, options) => objectSet.${this.resolveType.itemType.objectSetMethodNames.object}(partial.${this.configuration.syntheticNamePrefix}identifier(), options) })))
59
+ ) satisfies ${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.expression}, ${this.schemaType}>
60
+ )`;
55
61
  }
56
62
  graphqlResolveExpression({ variables, }) {
57
63
  return code `${variables.value}.resolve().then(either => either.unsafeCoerce().extractNullable())`;
@@ -59,8 +65,11 @@ export class LazyObjectOptionType extends Super {
59
65
  }
60
66
  __decorate([
61
67
  Memoize()
62
- ], LazyObjectOptionType.prototype, "conversionFunction", null);
68
+ ], LazyOptionType.prototype, "conversionFunction", null);
63
69
  __decorate([
64
70
  Memoize()
65
- ], LazyObjectOptionType.prototype, "runtimeClass", null);
66
- //# sourceMappingURL=LazyObjectOptionType.js.map
71
+ ], LazyOptionType.prototype, "runtimeClass", null);
72
+ __decorate([
73
+ Memoize()
74
+ ], LazyOptionType.prototype, "fromRdfResourceValuesFunction", null);
75
+ //# sourceMappingURL=LazyOptionType.js.map
@@ -0,0 +1,20 @@
1
+ import { Maybe } from "purify-ts";
2
+ import { AbstractLazyType } from "./AbstractLazyType.js";
3
+ import type { SetType } from "./SetType.js";
4
+ import { type Code } from "./ts-poet-wrapper.js";
5
+ export declare class LazySetType extends AbstractLazyType<SetType<AbstractLazyType.ItemTypeConstraint>, SetType<AbstractLazyType.ItemTypeConstraint>> {
6
+ readonly graphqlArgs: Super["graphqlArgs"];
7
+ readonly kind = "LazySet";
8
+ get conversionFunction(): Maybe<AbstractLazyType.ConversionFunction>;
9
+ protected get runtimeClass(): {
10
+ name: Code;
11
+ partialPropertyName: string;
12
+ rawName: Code;
13
+ };
14
+ fromJsonExpression(parameters: Parameters<Super["fromJsonExpression"]>[0]): Code;
15
+ get fromRdfResourceValuesFunction(): Code;
16
+ graphqlResolveExpression({ variables, }: Parameters<Super["graphqlResolveExpression"]>[0]): Code;
17
+ }
18
+ type Super = AbstractLazyType<SetType<AbstractLazyType.ItemTypeConstraint>, SetType<AbstractLazyType.ItemTypeConstraint>>;
19
+ export {};
20
+ //# sourceMappingURL=LazySetType.d.ts.map
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Maybe } from "purify-ts";
8
8
  import { invariant } from "ts-invariant";
9
9
  import { Memoize } from "typescript-memoize";
10
- import { AbstractLazyObjectType } from "./AbstractLazyObjectType.js";
10
+ import { AbstractLazyType } from "./AbstractLazyType.js";
11
11
  import { code } from "./ts-poet-wrapper.js";
12
- export class LazyObjectSetType extends AbstractLazyObjectType {
12
+ export class LazySetType extends AbstractLazyType {
13
13
  graphqlArgs = Maybe.of({
14
14
  limit: {
15
15
  type: code `${this.reusables.imports.GraphQLInt}`,
@@ -18,12 +18,12 @@ export class LazyObjectSetType extends AbstractLazyObjectType {
18
18
  type: code `${this.reusables.imports.GraphQLInt}`,
19
19
  },
20
20
  });
21
- kind = "LazyObjectSet";
21
+ kind = "LazySet";
22
22
  get conversionFunction() {
23
23
  invariant(this.jsTypes.length === 1);
24
24
  invariant(this.resolveType.jsTypes.length === 1);
25
25
  return Maybe.of({
26
- code: code `${this.reusables.snippets.convertToLazyObjectSet}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType.itemType, resolveType: this.resolveType.itemType })})`,
26
+ code: code `${this.reusables.snippets.convertToLazySet}<${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType.itemType, resolveType: this.resolveType.itemType })})`,
27
27
  sourceTypes: [
28
28
  {
29
29
  expression: this.expression,
@@ -42,17 +42,23 @@ export class LazyObjectSetType extends AbstractLazyObjectType {
42
42
  }
43
43
  get runtimeClass() {
44
44
  return {
45
- name: code `${this.reusables.snippets.LazyObjectSet}<${this.resolveType.itemType.identifierTypeAlias}, ${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>`,
45
+ name: code `${this.reusables.snippets.LazySet}<${this.partialType.itemType.expression}, ${this.resolveType.itemType.expression}>`,
46
46
  partialPropertyName: "partials",
47
- rawName: code `${this.reusables.snippets.LazyObjectSet}`,
47
+ rawName: code `${this.reusables.snippets.LazySet}`,
48
48
  };
49
49
  }
50
50
  fromJsonExpression(parameters) {
51
- return code `${this.partialType.fromJsonExpression(parameters)}.map(partial => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}: partial, resolver: () => Promise.resolve(${this.reusables.imports.Left}(new Error("unable to resolve identifiers deserialized from JSON"))) }))`;
51
+ return code `${this.partialType.fromJsonExpression(parameters)}.map(partials => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}: partials, resolver: () => Promise.resolve(${this.reusables.imports.Left}(new Error("unable to resolve partials deserialized from JSON"))) }))`;
52
52
  }
53
- fromRdfResourceValuesExpression(parameters) {
54
- const { variables } = parameters;
55
- return code `${this.partialType.fromRdfResourceValuesExpression(parameters)}.map(values => values.map(${this.runtimeClass.partialPropertyName} => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}, resolver: (identifiers, options) => ${variables.objectSet}.${this.resolveType.itemType.objectSetMethodNames.objects}({ identifiers, ...options }) })))`;
53
+ get fromRdfResourceValuesFunction() {
54
+ return code `\
55
+ (
56
+ (
57
+ (values, { objectSet, schema, ...otherOptions }) =>
58
+ ${this.partialType.fromRdfResourceValuesFunction}(values, { ...otherOptions, objectSet, schema: schema.partialType })
59
+ .map(values => values.map(${this.runtimeClass.partialPropertyName} => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}, resolver: (partials, options) => objectSet.${this.resolveType.itemType.objectSetMethodNames.objects}({ identifiers: partials.map(partial => partial.${this.configuration.syntheticNamePrefix}identifier()), ...options }) })))
60
+ ) satisfies ${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.expression}, ${this.schemaType}>
61
+ )`;
56
62
  }
57
63
  graphqlResolveExpression({ variables, }) {
58
64
  return code `(${variables.value}.resolve({ limit: ${variables.args}.limit, offset: ${variables.args}.offset })).then(either => either.unsafeCoerce())`;
@@ -60,8 +66,11 @@ export class LazyObjectSetType extends AbstractLazyObjectType {
60
66
  }
61
67
  __decorate([
62
68
  Memoize()
63
- ], LazyObjectSetType.prototype, "conversionFunction", null);
69
+ ], LazySetType.prototype, "conversionFunction", null);
64
70
  __decorate([
65
71
  Memoize()
66
- ], LazyObjectSetType.prototype, "runtimeClass", null);
67
- //# sourceMappingURL=LazyObjectSetType.js.map
72
+ ], LazySetType.prototype, "runtimeClass", null);
73
+ __decorate([
74
+ Memoize()
75
+ ], LazySetType.prototype, "fromRdfResourceValuesFunction", null);
76
+ //# sourceMappingURL=LazySetType.js.map
@@ -0,0 +1,19 @@
1
+ import { Maybe } from "purify-ts";
2
+ import { AbstractLazyType } from "./AbstractLazyType.js";
3
+ import { type Code } from "./ts-poet-wrapper.js";
4
+ export declare class LazyType extends AbstractLazyType<AbstractLazyType.ItemTypeConstraint, AbstractLazyType.ItemTypeConstraint> {
5
+ readonly graphqlArgs: Super["graphqlArgs"];
6
+ readonly kind = "Lazy";
7
+ get conversionFunction(): Maybe<AbstractLazyType.ConversionFunction>;
8
+ protected get runtimeClass(): {
9
+ name: Code;
10
+ partialPropertyName: string;
11
+ rawName: Code;
12
+ };
13
+ fromJsonExpression(parameters: Parameters<Super["fromJsonExpression"]>[0]): Code;
14
+ get fromRdfResourceValuesFunction(): Code;
15
+ graphqlResolveExpression({ variables, }: Parameters<Super["graphqlResolveExpression"]>[0]): Code;
16
+ }
17
+ type Super = AbstractLazyType<AbstractLazyType.ItemTypeConstraint, AbstractLazyType.ItemTypeConstraint>;
18
+ export {};
19
+ //# sourceMappingURL=LazyType.d.ts.map
@@ -7,16 +7,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { Maybe } from "purify-ts";
8
8
  import { invariant } from "ts-invariant";
9
9
  import { Memoize } from "typescript-memoize";
10
- import { AbstractLazyObjectType } from "./AbstractLazyObjectType.js";
10
+ import { AbstractLazyType } from "./AbstractLazyType.js";
11
11
  import { code } from "./ts-poet-wrapper.js";
12
- export class LazyObjectType extends AbstractLazyObjectType {
12
+ export class LazyType extends AbstractLazyType {
13
13
  graphqlArgs = Maybe.empty();
14
- kind = "LazyObject";
14
+ kind = "Lazy";
15
15
  get conversionFunction() {
16
16
  invariant(this.jsTypes.length === 1);
17
17
  invariant(this.resolveType.jsTypes.length === 1);
18
18
  return Maybe.of({
19
- code: code `${this.reusables.snippets.convertToLazyObject}<${this.resolveType.identifierTypeAlias}, ${this.partialType.expression}, ${this.resolveType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType, resolveType: this.resolveType })})`,
19
+ code: code `${this.reusables.snippets.convertToLazy}<${this.partialType.expression}, ${this.resolveType.expression}>(${this.resolveToPartialFunction({ partialType: this.partialType, resolveType: this.resolveType })})`,
20
20
  sourceTypes: [
21
21
  {
22
22
  expression: this.expression,
@@ -31,17 +31,23 @@ export class LazyObjectType extends AbstractLazyObjectType {
31
31
  }
32
32
  get runtimeClass() {
33
33
  return {
34
- name: code `${this.reusables.snippets.LazyObject}<${this.resolveType.identifierTypeAlias}, ${this.partialType.expression}, ${this.resolveType.expression}>`,
34
+ name: code `${this.reusables.snippets.Lazy}<${this.partialType.expression}, ${this.resolveType.expression}>`,
35
35
  partialPropertyName: "partial",
36
- rawName: code `${this.reusables.snippets.LazyObject}`,
36
+ rawName: code `${this.reusables.snippets.Lazy}`,
37
37
  };
38
38
  }
39
39
  fromJsonExpression(parameters) {
40
- return code `${this.partialType.fromJsonExpression(parameters)}.map(partial => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}: partial, resolver: (identifier) => Promise.resolve(${this.reusables.imports.Left}(new Error(\`unable to resolve identifier \${identifier} deserialized from JSON\`))) }))`;
40
+ return code `${this.partialType.fromJsonExpression(parameters)}.map(partial => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}: partial, resolver: (partial) => Promise.resolve(${this.reusables.imports.Left}(new Error(\`unable to resolve \${partial} deserialized from JSON\`))) }))`;
41
41
  }
42
- fromRdfResourceValuesExpression(parameters) {
43
- const { variables } = parameters;
44
- return code `${this.partialType.fromRdfResourceValuesExpression(parameters)}.map(values => values.map(${this.runtimeClass.partialPropertyName} => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}, resolver: (identifier, options) => ${variables.objectSet}.${this.resolveType.objectSetMethodNames.object}(identifier, options) })))`;
42
+ get fromRdfResourceValuesFunction() {
43
+ return code `\
44
+ (
45
+ (
46
+ (values, { objectSet, schema, ...otherOptions }) =>
47
+ ${this.partialType.fromRdfResourceValuesFunction}(values, { ...otherOptions, objectSet, schema: schema.partialType })
48
+ .map(values => values.map(${this.runtimeClass.partialPropertyName} => new ${this.runtimeClass.name}({ ${this.runtimeClass.partialPropertyName}, resolver: (partial, options) => objectSet.${this.resolveType.objectSetMethodNames.object}(partial.${this.configuration.syntheticNamePrefix}identifier(), options) })))
49
+ ) satisfies ${this.reusables.snippets.FromRdfResourceValuesFunction}<${this.expression}, ${this.schemaType}>
50
+ )`;
45
51
  }
46
52
  graphqlResolveExpression({ variables, }) {
47
53
  return code `${variables.value}.resolve().then(either => either.unsafeCoerce())`;
@@ -49,8 +55,11 @@ export class LazyObjectType extends AbstractLazyObjectType {
49
55
  }
50
56
  __decorate([
51
57
  Memoize()
52
- ], LazyObjectType.prototype, "conversionFunction", null);
58
+ ], LazyType.prototype, "conversionFunction", null);
53
59
  __decorate([
54
60
  Memoize()
55
- ], LazyObjectType.prototype, "runtimeClass", null);
56
- //# sourceMappingURL=LazyObjectType.js.map
61
+ ], LazyType.prototype, "runtimeClass", null);
62
+ __decorate([
63
+ Memoize()
64
+ ], LazyType.prototype, "fromRdfResourceValuesFunction", null);
65
+ //# sourceMappingURL=LazyType.js.map
@@ -32,11 +32,11 @@ export declare class ListType<ItemTypeT extends ListType.ItemType> extends Abstr
32
32
  toRdfTypes: readonly NamedNode[];
33
33
  } & ConstructorParameters<typeof AbstractCollectionType<ItemTypeT>>[0]);
34
34
  get conversionFunction(): Maybe<AbstractCollectionType.ConversionFunction>;
35
+ get fromRdfResourceValuesFunction(): Code;
35
36
  get toRdfResourceValueTypes(): AbstractCollectionType<ItemTypeT>["toRdfResourceValueTypes"];
36
37
  get valueSparqlConstructTriplesFunction(): Code;
37
38
  get valueSparqlWherePatternsFunction(): Code;
38
39
  fromJsonExpression({ variables, }: Parameters<AbstractCollectionType<ItemTypeT>["fromJsonExpression"]>[0]): Code;
39
- fromRdfResourceValuesExpression({ variables, }: Parameters<AbstractCollectionType<ItemTypeT>["fromRdfResourceValuesExpression"]>[0]): Code;
40
40
  jsonSchema(parameters: Parameters<AbstractCollectionType<ItemTypeT>["jsonSchema"]>[0]): Code;
41
41
  jsonType(): AbstractCollectionType.JsonType;
42
42
  toRdfResourceValuesExpression({ variables, }: Parameters<AbstractCollectionType<ItemTypeT>["toRdfResourceValuesExpression"]>[0]): Code;
@@ -33,6 +33,9 @@ export class ListType extends AbstractCollectionType {
33
33
  ],
34
34
  });
35
35
  }
36
+ get fromRdfResourceValuesFunction() {
37
+ return code `${this._mutable ? this.reusables.snippets.mutableListFromRdfResourceValues : this.reusables.snippets.listFromRdfResourceValues}<${this.itemType.expression}, ${this.itemType.schemaType}>(${this.itemType.fromRdfResourceValuesFunction})`;
38
+ }
36
39
  get toRdfResourceValueTypes() {
37
40
  return new Set(["BlankNode", "NamedNode"]); // List or rdf:nil
38
41
  }
@@ -47,22 +50,6 @@ export class ListType extends AbstractCollectionType {
47
50
  variables: { value: code `item` },
48
51
  })})))`;
49
52
  }
50
- fromRdfResourceValuesExpression({ variables, }) {
51
- return joinCode([
52
- variables.resourceValues,
53
- code `chain(values => values.chainMap(value => value.toList(${{ graph: variables.graph }})))`, // Resource.Values<Resource.Value> to Resource.Values<Resource.Values>
54
- code `chain(valueLists =>
55
- valueLists.chainMap(
56
- valueList => ${this.itemType.fromRdfResourceValuesExpression({
57
- variables: {
58
- ...variables,
59
- resourceValues: code `${this.reusables.imports.Right}(${this.reusables.imports.Resource}.Values.fromArray({ focusResource: ${variables.resource}, propertyPath: ${variables.propertyPath}, values: valueList.toArray() }))`,
60
- },
61
- })}
62
- ))`, // Resource.Values<Resource.Values> to Resource.Values<item type arrays>
63
- code `map(valueLists => valueLists.map(valueList => valueList.toArray()${this.mutable ? ".concat()" : ""}))`, // Convert inner Resource.Values to arrays
64
- ], { on: "." });
65
- }
66
53
  jsonSchema(parameters) {
67
54
  let schema = code `${this.itemType.jsonSchema(parameters)}.array()`;
68
55
  if (!this._mutable) {
@@ -124,6 +111,9 @@ export class ListType extends AbstractCollectionType {
124
111
  __decorate([
125
112
  Memoize()
126
113
  ], ListType.prototype, "conversionFunction", null);
114
+ __decorate([
115
+ Memoize()
116
+ ], ListType.prototype, "fromRdfResourceValuesFunction", null);
127
117
  __decorate([
128
118
  Memoize()
129
119
  ], ListType.prototype, "toRdfResourceValueTypes", null);
@@ -158,9 +148,9 @@ __decorate([
158
148
  case "Union":
159
149
  return true;
160
150
  case "DefaultValue":
161
- case "LazyObjectOption":
162
- case "LazyObjectSet":
163
- case "LazyObject":
151
+ case "LazyOption":
152
+ case "LazySet":
153
+ case "Lazy":
164
154
  case "Option":
165
155
  case "Set":
166
156
  return false;