@cratis/chronicle 6.63.0 → 6.64.0

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 (366) hide show
  1. package/artifacts/DefaultClientArtifactsProvider.ts +5 -0
  2. package/artifacts/IClientArtifactsProvider.ts +3 -0
  3. package/dist/artifacts/DefaultClientArtifactsProvider.d.ts +2 -0
  4. package/dist/artifacts/DefaultClientArtifactsProvider.d.ts.map +1 -1
  5. package/dist/artifacts/DefaultClientArtifactsProvider.js +4 -0
  6. package/dist/artifacts/DefaultClientArtifactsProvider.js.map +1 -1
  7. package/dist/artifacts/IClientArtifactsProvider.d.ts +2 -0
  8. package/dist/artifacts/IClientArtifactsProvider.d.ts.map +1 -1
  9. package/dist/projections/for_Graphs/given/a_discovered_graph.d.ts +2 -1
  10. package/dist/projections/for_Graphs/given/a_discovered_graph.d.ts.map +1 -1
  11. package/dist/projections/for_Graphs/given/a_discovered_graph.js +3 -2
  12. package/dist/projections/for_Graphs/given/a_discovered_graph.js.map +1 -1
  13. package/dist/projections/for_Graphs/given/a_graph_with_views.d.ts +40 -0
  14. package/dist/projections/for_Graphs/given/a_graph_with_views.d.ts.map +1 -0
  15. package/dist/projections/for_Graphs/given/a_graph_with_views.js +80 -0
  16. package/dist/projections/for_Graphs/given/a_graph_with_views.js.map +1 -0
  17. package/dist/projections/for_Graphs/given/organization.d.ts +2 -1
  18. package/dist/projections/for_Graphs/given/organization.d.ts.map +1 -1
  19. package/dist/projections/for_Graphs/given/organization.js +3 -2
  20. package/dist/projections/for_Graphs/given/organization.js.map +1 -1
  21. package/dist/projections/graphs/Graphs.d.ts +5 -0
  22. package/dist/projections/graphs/Graphs.d.ts.map +1 -1
  23. package/dist/projections/graphs/Graphs.js +43 -0
  24. package/dist/projections/graphs/Graphs.js.map +1 -1
  25. package/dist/projections/graphs/IGraphs.d.ts +9 -2
  26. package/dist/projections/graphs/IGraphs.d.ts.map +1 -1
  27. package/dist/projections/graphs/index.d.ts +1 -0
  28. package/dist/projections/graphs/index.d.ts.map +1 -1
  29. package/dist/projections/graphs/index.js +1 -0
  30. package/dist/projections/graphs/index.js.map +1 -1
  31. package/dist/projections/graphs/views/AmbiguousDirection.d.ts +16 -0
  32. package/dist/projections/graphs/views/AmbiguousDirection.d.ts.map +1 -0
  33. package/dist/projections/graphs/views/AmbiguousDirection.js +21 -0
  34. package/dist/projections/graphs/views/AmbiguousDirection.js.map +1 -0
  35. package/dist/projections/graphs/views/DuplicateViewName.d.ts +16 -0
  36. package/dist/projections/graphs/views/DuplicateViewName.d.ts.map +1 -0
  37. package/dist/projections/graphs/views/DuplicateViewName.js +21 -0
  38. package/dist/projections/graphs/views/DuplicateViewName.js.map +1 -0
  39. package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.d.ts +17 -0
  40. package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.d.ts.map +1 -0
  41. package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.js +22 -0
  42. package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.js.map +1 -0
  43. package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.d.ts +14 -0
  44. package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.d.ts.map +1 -0
  45. package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.js +19 -0
  46. package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.js.map +1 -0
  47. package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.d.ts +15 -0
  48. package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.d.ts.map +1 -0
  49. package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.js +20 -0
  50. package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.js.map +1 -0
  51. package/dist/projections/graphs/views/FollowsOptions.d.ts +16 -0
  52. package/dist/projections/graphs/views/FollowsOptions.d.ts.map +1 -0
  53. package/dist/projections/graphs/views/FollowsOptions.js +4 -0
  54. package/dist/projections/graphs/views/FollowsOptions.js.map +1 -0
  55. package/dist/projections/graphs/views/GraphEdgeDirection.d.ts +10 -0
  56. package/dist/projections/graphs/views/GraphEdgeDirection.d.ts.map +1 -0
  57. package/dist/projections/graphs/views/GraphEdgeDirection.js +13 -0
  58. package/dist/projections/graphs/views/GraphEdgeDirection.js.map +1 -0
  59. package/dist/projections/graphs/views/GraphView.d.ts +13 -0
  60. package/dist/projections/graphs/views/GraphView.d.ts.map +1 -0
  61. package/dist/projections/graphs/views/GraphView.js +4 -0
  62. package/dist/projections/graphs/views/GraphView.js.map +1 -0
  63. package/dist/projections/graphs/views/GraphViewBuildResult.d.ts +15 -0
  64. package/dist/projections/graphs/views/GraphViewBuildResult.d.ts.map +1 -0
  65. package/dist/projections/graphs/views/GraphViewBuildResult.js +4 -0
  66. package/dist/projections/graphs/views/GraphViewBuildResult.js.map +1 -0
  67. package/dist/projections/graphs/views/GraphViewCardinality.d.ts +10 -0
  68. package/dist/projections/graphs/views/GraphViewCardinality.d.ts.map +1 -0
  69. package/dist/projections/graphs/views/GraphViewCardinality.js +13 -0
  70. package/dist/projections/graphs/views/GraphViewCardinality.js.map +1 -0
  71. package/dist/projections/graphs/views/GraphViewDefinition.d.ts +15 -0
  72. package/dist/projections/graphs/views/GraphViewDefinition.d.ts.map +1 -0
  73. package/dist/projections/graphs/views/GraphViewDefinition.js +4 -0
  74. package/dist/projections/graphs/views/GraphViewDefinition.js.map +1 -0
  75. package/dist/projections/graphs/views/GraphViewDefinitionBuilder.d.ts +30 -0
  76. package/dist/projections/graphs/views/GraphViewDefinitionBuilder.d.ts.map +1 -0
  77. package/dist/projections/graphs/views/GraphViewDefinitionBuilder.js +259 -0
  78. package/dist/projections/graphs/views/GraphViewDefinitionBuilder.js.map +1 -0
  79. package/dist/projections/graphs/views/GraphViewDefinitionSerializer.d.ts +21 -0
  80. package/dist/projections/graphs/views/GraphViewDefinitionSerializer.d.ts.map +1 -0
  81. package/dist/projections/graphs/views/GraphViewDefinitionSerializer.js +77 -0
  82. package/dist/projections/graphs/views/GraphViewDefinitionSerializer.js.map +1 -0
  83. package/dist/projections/graphs/views/GraphViewEdgeReference.d.ts +6 -0
  84. package/dist/projections/graphs/views/GraphViewEdgeReference.d.ts.map +1 -0
  85. package/dist/projections/graphs/views/GraphViewEdgeReference.js +4 -0
  86. package/dist/projections/graphs/views/GraphViewEdgeReference.js.map +1 -0
  87. package/dist/projections/graphs/views/GraphViewMember.d.ts +8 -0
  88. package/dist/projections/graphs/views/GraphViewMember.d.ts.map +1 -0
  89. package/dist/projections/graphs/views/GraphViewMember.js +4 -0
  90. package/dist/projections/graphs/views/GraphViewMember.js.map +1 -0
  91. package/dist/projections/graphs/views/GraphViewMemberKind.d.ts +12 -0
  92. package/dist/projections/graphs/views/GraphViewMemberKind.d.ts.map +1 -0
  93. package/dist/projections/graphs/views/GraphViewMemberKind.js +15 -0
  94. package/dist/projections/graphs/views/GraphViewMemberKind.js.map +1 -0
  95. package/dist/projections/graphs/views/GraphViewMemberMetadata.d.ts +22 -0
  96. package/dist/projections/graphs/views/GraphViewMemberMetadata.d.ts.map +1 -0
  97. package/dist/projections/graphs/views/GraphViewMemberMetadata.js +4 -0
  98. package/dist/projections/graphs/views/GraphViewMemberMetadata.js.map +1 -0
  99. package/dist/projections/graphs/views/GraphViewPropertyMember.d.ts +13 -0
  100. package/dist/projections/graphs/views/GraphViewPropertyMember.d.ts.map +1 -0
  101. package/dist/projections/graphs/views/GraphViewPropertyMember.js +4 -0
  102. package/dist/projections/graphs/views/GraphViewPropertyMember.js.map +1 -0
  103. package/dist/projections/graphs/views/GraphViewReason.d.ts +33 -0
  104. package/dist/projections/graphs/views/GraphViewReason.d.ts.map +1 -0
  105. package/dist/projections/graphs/views/GraphViewReason.js +36 -0
  106. package/dist/projections/graphs/views/GraphViewReason.js.map +1 -0
  107. package/dist/projections/graphs/views/GraphViewRelationMember.d.ts +21 -0
  108. package/dist/projections/graphs/views/GraphViewRelationMember.d.ts.map +1 -0
  109. package/dist/projections/graphs/views/GraphViewRelationMember.js +4 -0
  110. package/dist/projections/graphs/views/GraphViewRelationMember.js.map +1 -0
  111. package/dist/projections/graphs/views/GraphViewSchema.d.ts +10 -0
  112. package/dist/projections/graphs/views/GraphViewSchema.d.ts.map +1 -0
  113. package/dist/projections/graphs/views/GraphViewSchema.js +4 -0
  114. package/dist/projections/graphs/views/GraphViewSchema.js.map +1 -0
  115. package/dist/projections/graphs/views/GraphViewSchemaEdge.d.ts +14 -0
  116. package/dist/projections/graphs/views/GraphViewSchemaEdge.d.ts.map +1 -0
  117. package/dist/projections/graphs/views/GraphViewSchemaEdge.js +4 -0
  118. package/dist/projections/graphs/views/GraphViewSchemaEdge.js.map +1 -0
  119. package/dist/projections/graphs/views/GraphViewSchemaNode.d.ts +10 -0
  120. package/dist/projections/graphs/views/GraphViewSchemaNode.d.ts.map +1 -0
  121. package/dist/projections/graphs/views/GraphViewSchemaNode.js +4 -0
  122. package/dist/projections/graphs/views/GraphViewSchemaNode.js.map +1 -0
  123. package/dist/projections/graphs/views/GraphViewSerializerOptions.d.ts +9 -0
  124. package/dist/projections/graphs/views/GraphViewSerializerOptions.d.ts.map +1 -0
  125. package/dist/projections/graphs/views/GraphViewSerializerOptions.js +4 -0
  126. package/dist/projections/graphs/views/GraphViewSerializerOptions.js.map +1 -0
  127. package/dist/projections/graphs/views/RecursiveView.d.ts +15 -0
  128. package/dist/projections/graphs/views/RecursiveView.d.ts.map +1 -0
  129. package/dist/projections/graphs/views/RecursiveView.js +20 -0
  130. package/dist/projections/graphs/views/RecursiveView.js.map +1 -0
  131. package/dist/projections/graphs/views/RelationTargetNotAView.d.ts +16 -0
  132. package/dist/projections/graphs/views/RelationTargetNotAView.d.ts.map +1 -0
  133. package/dist/projections/graphs/views/RelationTargetNotAView.js +21 -0
  134. package/dist/projections/graphs/views/RelationTargetNotAView.js.map +1 -0
  135. package/dist/projections/graphs/views/TargetLabelMismatch.d.ts +18 -0
  136. package/dist/projections/graphs/views/TargetLabelMismatch.d.ts.map +1 -0
  137. package/dist/projections/graphs/views/TargetLabelMismatch.js +23 -0
  138. package/dist/projections/graphs/views/TargetLabelMismatch.js.map +1 -0
  139. package/dist/projections/graphs/views/UnknownEdge.d.ts +16 -0
  140. package/dist/projections/graphs/views/UnknownEdge.d.ts.map +1 -0
  141. package/dist/projections/graphs/views/UnknownEdge.js +21 -0
  142. package/dist/projections/graphs/views/UnknownEdge.js.map +1 -0
  143. package/dist/projections/graphs/views/UnknownEdgeProperty.d.ts +17 -0
  144. package/dist/projections/graphs/views/UnknownEdgeProperty.d.ts.map +1 -0
  145. package/dist/projections/graphs/views/UnknownEdgeProperty.js +22 -0
  146. package/dist/projections/graphs/views/UnknownEdgeProperty.js.map +1 -0
  147. package/dist/projections/graphs/views/UnknownNodeProperty.d.ts +17 -0
  148. package/dist/projections/graphs/views/UnknownNodeProperty.d.ts.map +1 -0
  149. package/dist/projections/graphs/views/UnknownNodeProperty.js +22 -0
  150. package/dist/projections/graphs/views/UnknownNodeProperty.js.map +1 -0
  151. package/dist/projections/graphs/views/ViewIsAlsoSchema.d.ts +14 -0
  152. package/dist/projections/graphs/views/ViewIsAlsoSchema.d.ts.map +1 -0
  153. package/dist/projections/graphs/views/ViewIsAlsoSchema.js +19 -0
  154. package/dist/projections/graphs/views/ViewIsAlsoSchema.js.map +1 -0
  155. package/dist/projections/graphs/views/ViewOfMetadata.d.ts +8 -0
  156. package/dist/projections/graphs/views/ViewOfMetadata.d.ts.map +1 -0
  157. package/dist/projections/graphs/views/ViewOfMetadata.js +4 -0
  158. package/dist/projections/graphs/views/ViewOfMetadata.js.map +1 -0
  159. package/dist/projections/graphs/views/ViewOfOptions.d.ts +6 -0
  160. package/dist/projections/graphs/views/ViewOfOptions.d.ts.map +1 -0
  161. package/dist/projections/graphs/views/ViewOfOptions.js +4 -0
  162. package/dist/projections/graphs/views/ViewOfOptions.js.map +1 -0
  163. package/dist/projections/graphs/views/ViewRootNotANode.d.ts +16 -0
  164. package/dist/projections/graphs/views/ViewRootNotANode.d.ts.map +1 -0
  165. package/dist/projections/graphs/views/ViewRootNotANode.js +21 -0
  166. package/dist/projections/graphs/views/ViewRootNotANode.js.map +1 -0
  167. package/dist/projections/graphs/views/declareGraphViewMember.d.ts +17 -0
  168. package/dist/projections/graphs/views/declareGraphViewMember.d.ts.map +1 -0
  169. package/dist/projections/graphs/views/declareGraphViewMember.js +31 -0
  170. package/dist/projections/graphs/views/declareGraphViewMember.js.map +1 -0
  171. package/dist/projections/graphs/views/follows.d.ts +13 -0
  172. package/dist/projections/graphs/views/follows.d.ts.map +1 -0
  173. package/dist/projections/graphs/views/follows.js +24 -0
  174. package/dist/projections/graphs/views/follows.js.map +1 -0
  175. package/dist/projections/graphs/views/fromEdge.d.ts +10 -0
  176. package/dist/projections/graphs/views/fromEdge.d.ts.map +1 -0
  177. package/dist/projections/graphs/views/fromEdge.js +15 -0
  178. package/dist/projections/graphs/views/fromEdge.js.map +1 -0
  179. package/dist/projections/graphs/views/index.d.ts +41 -0
  180. package/dist/projections/graphs/views/index.d.ts.map +1 -0
  181. package/dist/projections/graphs/views/index.js +28 -0
  182. package/dist/projections/graphs/views/index.js.map +1 -0
  183. package/dist/projections/graphs/views/viewKey.d.ts +8 -0
  184. package/dist/projections/graphs/views/viewKey.d.ts.map +1 -0
  185. package/dist/projections/graphs/views/viewKey.js +13 -0
  186. package/dist/projections/graphs/views/viewKey.js.map +1 -0
  187. package/dist/projections/graphs/views/viewOf.d.ts +22 -0
  188. package/dist/projections/graphs/views/viewOf.d.ts.map +1 -0
  189. package/dist/projections/graphs/views/viewOf.js +41 -0
  190. package/dist/projections/graphs/views/viewOf.js.map +1 -0
  191. package/dist/projections/graphs/views/viewProperty.d.ts +9 -0
  192. package/dist/projections/graphs/views/viewProperty.d.ts.map +1 -0
  193. package/dist/projections/graphs/views/viewProperty.js +14 -0
  194. package/dist/projections/graphs/views/viewProperty.js.map +1 -0
  195. package/dist/testing/InProcessAppendMetadata.d.ts +30 -0
  196. package/dist/testing/InProcessAppendMetadata.d.ts.map +1 -0
  197. package/dist/testing/InProcessAppendMetadata.js +107 -0
  198. package/dist/testing/InProcessAppendMetadata.js.map +1 -0
  199. package/dist/testing/InProcessBatchAppend.d.ts +62 -0
  200. package/dist/testing/InProcessBatchAppend.d.ts.map +1 -0
  201. package/dist/testing/InProcessBatchAppend.js +131 -0
  202. package/dist/testing/InProcessBatchAppend.js.map +1 -0
  203. package/dist/testing/InProcessEventPayload.d.ts +23 -0
  204. package/dist/testing/InProcessEventPayload.d.ts.map +1 -0
  205. package/dist/testing/InProcessEventPayload.js +94 -0
  206. package/dist/testing/InProcessEventPayload.js.map +1 -0
  207. package/dist/testing/InProcessEventReadCriteria.d.ts +9 -0
  208. package/dist/testing/InProcessEventReadCriteria.d.ts.map +1 -0
  209. package/dist/testing/InProcessEventReadCriteria.js +4 -0
  210. package/dist/testing/InProcessEventReadCriteria.js.map +1 -0
  211. package/dist/testing/InProcessEventReadFilter.d.ts +14 -0
  212. package/dist/testing/InProcessEventReadFilter.d.ts.map +1 -0
  213. package/dist/testing/InProcessEventReadFilter.js +31 -0
  214. package/dist/testing/InProcessEventReadFilter.js.map +1 -0
  215. package/dist/testing/InProcessEventSequence.d.ts +8 -5
  216. package/dist/testing/InProcessEventSequence.d.ts.map +1 -1
  217. package/dist/testing/InProcessEventSequence.js +59 -275
  218. package/dist/testing/InProcessEventSequence.js.map +1 -1
  219. package/dist/testing/InProcessEventSequenceEnvironment.d.ts +13 -0
  220. package/dist/testing/InProcessEventSequenceEnvironment.d.ts.map +1 -0
  221. package/dist/testing/InProcessEventSequenceEnvironment.js +4 -0
  222. package/dist/testing/InProcessEventSequenceEnvironment.js.map +1 -0
  223. package/dist/testing/InProcessSingleAppend.d.ts +34 -0
  224. package/dist/testing/InProcessSingleAppend.d.ts.map +1 -0
  225. package/dist/testing/InProcessSingleAppend.js +95 -0
  226. package/dist/testing/InProcessSingleAppend.js.map +1 -0
  227. package/dist/testing/projections/ProjectionCapabilities.d.ts +0 -8
  228. package/dist/testing/projections/ProjectionCapabilities.d.ts.map +1 -1
  229. package/dist/testing/projections/ProjectionCapabilities.js +21 -312
  230. package/dist/testing/projections/ProjectionCapabilities.js.map +1 -1
  231. package/dist/testing/projections/ProjectionCapabilityReject.d.ts +3 -0
  232. package/dist/testing/projections/ProjectionCapabilityReject.d.ts.map +1 -0
  233. package/dist/testing/projections/ProjectionCapabilityReject.js +4 -0
  234. package/dist/testing/projections/ProjectionCapabilityReject.js.map +1 -0
  235. package/dist/testing/projections/ProjectionCapabilityReporter.d.ts +12 -0
  236. package/dist/testing/projections/ProjectionCapabilityReporter.d.ts.map +1 -0
  237. package/dist/testing/projections/ProjectionCapabilityReporter.js +33 -0
  238. package/dist/testing/projections/ProjectionCapabilityReporter.js.map +1 -0
  239. package/dist/testing/projections/ProjectionDefinitionCapabilities.d.ts +11 -0
  240. package/dist/testing/projections/ProjectionDefinitionCapabilities.d.ts.map +1 -0
  241. package/dist/testing/projections/ProjectionDefinitionCapabilities.js +45 -0
  242. package/dist/testing/projections/ProjectionDefinitionCapabilities.js.map +1 -0
  243. package/dist/testing/projections/ProjectionEventSchemaResolver.d.ts +13 -0
  244. package/dist/testing/projections/ProjectionEventSchemaResolver.d.ts.map +1 -0
  245. package/dist/testing/projections/ProjectionEventSchemaResolver.js +22 -0
  246. package/dist/testing/projections/ProjectionEventSchemaResolver.js.map +1 -0
  247. package/dist/testing/projections/ProjectionExpressionCapabilities.d.ts +19 -0
  248. package/dist/testing/projections/ProjectionExpressionCapabilities.d.ts.map +1 -0
  249. package/dist/testing/projections/ProjectionExpressionCapabilities.js +103 -0
  250. package/dist/testing/projections/ProjectionExpressionCapabilities.js.map +1 -0
  251. package/dist/testing/projections/ProjectionInitialValueCapabilities.d.ts +16 -0
  252. package/dist/testing/projections/ProjectionInitialValueCapabilities.d.ts.map +1 -0
  253. package/dist/testing/projections/ProjectionInitialValueCapabilities.js +72 -0
  254. package/dist/testing/projections/ProjectionInitialValueCapabilities.js.map +1 -0
  255. package/dist/testing/projections/ProjectionMappingCapabilities.d.ts +21 -0
  256. package/dist/testing/projections/ProjectionMappingCapabilities.d.ts.map +1 -0
  257. package/dist/testing/projections/ProjectionMappingCapabilities.js +86 -0
  258. package/dist/testing/projections/ProjectionMappingCapabilities.js.map +1 -0
  259. package/dist/testing/projections/ProjectionMappingValidation.d.ts +9 -0
  260. package/dist/testing/projections/ProjectionMappingValidation.d.ts.map +1 -0
  261. package/dist/testing/projections/ProjectionMappingValidation.js +4 -0
  262. package/dist/testing/projections/ProjectionMappingValidation.js.map +1 -0
  263. package/dist/testing/projections/ProjectionReadModelCapabilities.d.ts +11 -0
  264. package/dist/testing/projections/ProjectionReadModelCapabilities.d.ts.map +1 -0
  265. package/dist/testing/projections/ProjectionReadModelCapabilities.js +40 -0
  266. package/dist/testing/projections/ProjectionReadModelCapabilities.js.map +1 -0
  267. package/dist/testing/projections/ProjectionRootCapabilities.d.ts +20 -0
  268. package/dist/testing/projections/ProjectionRootCapabilities.d.ts.map +1 -0
  269. package/dist/testing/projections/ProjectionRootCapabilities.js +73 -0
  270. package/dist/testing/projections/ProjectionRootCapabilities.js.map +1 -0
  271. package/dist/testing/projections/ProjectionScalarConverter.d.ts +21 -0
  272. package/dist/testing/projections/ProjectionScalarConverter.d.ts.map +1 -0
  273. package/dist/testing/projections/ProjectionScalarConverter.js +105 -0
  274. package/dist/testing/projections/ProjectionScalarConverter.js.map +1 -0
  275. package/dist/testing/projections/ProjectionSchemaCapabilities.d.ts +26 -0
  276. package/dist/testing/projections/ProjectionSchemaCapabilities.d.ts.map +1 -0
  277. package/dist/testing/projections/ProjectionSchemaCapabilities.js +109 -0
  278. package/dist/testing/projections/ProjectionSchemaCapabilities.js.map +1 -0
  279. package/dist/testing/projections/ProjectionValueConverter.d.ts +5 -0
  280. package/dist/testing/projections/ProjectionValueConverter.d.ts.map +1 -1
  281. package/dist/testing/projections/ProjectionValueConverter.js +36 -84
  282. package/dist/testing/projections/ProjectionValueConverter.js.map +1 -1
  283. package/dist/tsconfig.tsbuildinfo +1 -1
  284. package/dist/types/DecoratorType.d.ts +3 -1
  285. package/dist/types/DecoratorType.d.ts.map +1 -1
  286. package/dist/types/DecoratorType.js +2 -0
  287. package/dist/types/DecoratorType.js.map +1 -1
  288. package/package.json +2 -2
  289. package/projections/for_Graphs/given/a_discovered_graph.ts +3 -2
  290. package/projections/for_Graphs/given/a_graph_with_views.ts +91 -0
  291. package/projections/for_Graphs/given/organization.ts +3 -2
  292. package/projections/for_Graphs/given/organization_with_views.fixture.ts +129 -0
  293. package/projections/for_Graphs/when_building_graph_views.spec.ts +218 -0
  294. package/projections/for_Graphs/when_declaring_an_invalid_graph_view.spec.ts +229 -0
  295. package/projections/for_Graphs/when_declaring_graph_views.standard.spec.ts +49 -0
  296. package/projections/for_Graphs/when_discovering_graph_views.spec.ts +58 -0
  297. package/projections/graphs/Graphs.ts +44 -0
  298. package/projections/graphs/IGraphs.ts +10 -2
  299. package/projections/graphs/index.ts +1 -0
  300. package/projections/graphs/views/AmbiguousDirection.ts +23 -0
  301. package/projections/graphs/views/DuplicateViewName.ts +23 -0
  302. package/projections/graphs/views/EdgeNotIncidentOnRoot.ts +24 -0
  303. package/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.ts +21 -0
  304. package/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.ts +22 -0
  305. package/projections/graphs/views/FollowsOptions.ts +20 -0
  306. package/projections/graphs/views/GraphEdgeDirection.ts +13 -0
  307. package/projections/graphs/views/GraphView.ts +18 -0
  308. package/projections/graphs/views/GraphViewBuildResult.ts +19 -0
  309. package/projections/graphs/views/GraphViewCardinality.ts +13 -0
  310. package/projections/graphs/views/GraphViewDefinition.ts +20 -0
  311. package/projections/graphs/views/GraphViewDefinitionBuilder.ts +322 -0
  312. package/projections/graphs/views/GraphViewDefinitionSerializer.ts +90 -0
  313. package/projections/graphs/views/GraphViewEdgeReference.ts +8 -0
  314. package/projections/graphs/views/GraphViewMember.ts +11 -0
  315. package/projections/graphs/views/GraphViewMemberKind.ts +16 -0
  316. package/projections/graphs/views/GraphViewMemberMetadata.ts +31 -0
  317. package/projections/graphs/views/GraphViewPropertyMember.ts +18 -0
  318. package/projections/graphs/views/GraphViewReason.ts +47 -0
  319. package/projections/graphs/views/GraphViewRelationMember.ts +29 -0
  320. package/projections/graphs/views/GraphViewSchema.ts +14 -0
  321. package/projections/graphs/views/GraphViewSchemaEdge.ts +20 -0
  322. package/projections/graphs/views/GraphViewSchemaNode.ts +14 -0
  323. package/projections/graphs/views/GraphViewSerializerOptions.ts +11 -0
  324. package/projections/graphs/views/RecursiveView.ts +22 -0
  325. package/projections/graphs/views/RelationTargetNotAView.ts +23 -0
  326. package/projections/graphs/views/TargetLabelMismatch.ts +25 -0
  327. package/projections/graphs/views/UnknownEdge.ts +23 -0
  328. package/projections/graphs/views/UnknownEdgeProperty.ts +24 -0
  329. package/projections/graphs/views/UnknownNodeProperty.ts +24 -0
  330. package/projections/graphs/views/ViewIsAlsoSchema.ts +21 -0
  331. package/projections/graphs/views/ViewOfMetadata.ts +11 -0
  332. package/projections/graphs/views/ViewOfOptions.ts +8 -0
  333. package/projections/graphs/views/ViewRootNotANode.ts +23 -0
  334. package/projections/graphs/views/declareGraphViewMember.ts +36 -0
  335. package/projections/graphs/views/follows.ts +28 -0
  336. package/projections/graphs/views/fromEdge.ts +17 -0
  337. package/projections/graphs/views/index.ts +43 -0
  338. package/projections/graphs/views/viewKey.ts +15 -0
  339. package/projections/graphs/views/viewOf.ts +50 -0
  340. package/projections/graphs/views/viewProperty.ts +16 -0
  341. package/testing/InProcessAppendMetadata.ts +119 -0
  342. package/testing/InProcessBatchAppend.ts +142 -0
  343. package/testing/InProcessEventPayload.ts +100 -0
  344. package/testing/InProcessEventReadCriteria.ts +11 -0
  345. package/testing/InProcessEventReadFilter.ts +37 -0
  346. package/testing/InProcessEventSequence.ts +63 -257
  347. package/testing/InProcessEventSequenceEnvironment.ts +16 -0
  348. package/testing/InProcessSingleAppend.ts +99 -0
  349. package/testing/for_InProcessEventSequence/when_preserving_validation_and_commit_order.spec.ts +95 -0
  350. package/testing/projections/ProjectionCapabilities.ts +23 -279
  351. package/testing/projections/ProjectionCapabilityReject.ts +5 -0
  352. package/testing/projections/ProjectionCapabilityReporter.ts +31 -0
  353. package/testing/projections/ProjectionDefinitionCapabilities.ts +45 -0
  354. package/testing/projections/ProjectionEventSchemaResolver.ts +23 -0
  355. package/testing/projections/ProjectionExpressionCapabilities.ts +101 -0
  356. package/testing/projections/ProjectionInitialValueCapabilities.ts +73 -0
  357. package/testing/projections/ProjectionMappingCapabilities.ts +85 -0
  358. package/testing/projections/ProjectionMappingValidation.ts +12 -0
  359. package/testing/projections/ProjectionReadModelCapabilities.ts +42 -0
  360. package/testing/projections/ProjectionRootCapabilities.ts +75 -0
  361. package/testing/projections/ProjectionScalarConverter.ts +106 -0
  362. package/testing/projections/ProjectionSchemaCapabilities.ts +112 -0
  363. package/testing/projections/ProjectionValueConverter.ts +37 -76
  364. package/testing/projections/for_ProjectionCapabilities/when_reporting_the_first_unsupported_operation.spec.ts +74 -0
  365. package/testing/projections/for_ProjectionValueConverter/when_converting_structured_and_scalar_values.spec.ts +64 -0
  366. package/types/DecoratorType.ts +4 -1
@@ -2,6 +2,7 @@
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
 
4
4
  import type { JsonSchema } from '../../schemas/JsonSchema.js';
5
+ import { ProjectionScalarConverter } from './ProjectionScalarConverter.js';
5
6
 
6
7
  /** Converts values only in the numeric and scalar schema subset admitted by ProjectionCapabilities. */
7
8
  export class ProjectionValueConverter {
@@ -23,91 +24,51 @@ export class ProjectionValueConverter {
23
24
 
24
25
  /** The kernel deserializes event JSON against its registered schema before mapping. */
25
26
  static eventContent(content: unknown, schema: JsonSchema): Record<string, unknown> {
26
- const serialized = content !== null && typeof content === 'object' && !Array.isArray(content)
27
- ? content as Record<string, unknown> : {};
28
- const result: Record<string, unknown> = Object.create(null);
29
- for (const [name, property] of Object.entries(schema.properties ?? {})) {
30
- const source = this.sourceKey(serialized, name);
31
- const value = source === undefined ? null : serialized[source];
32
- if (value !== null && value !== undefined) result[name] = this.convert(value, property, true, false);
33
- else {
34
- const fallback = this.defaultValue(property);
35
- if (fallback !== null && fallback !== undefined) result[name] = fallback;
36
- }
37
- }
38
- return result;
27
+ const serialized = this.isObject(content) ? content : {};
28
+ return this.properties(serialized, schema, true);
39
29
  }
40
30
 
41
31
  static convert(value: unknown, schema: JsonSchema, eventContent = false, expression = true): unknown {
42
32
  if (value == null) return null;
43
33
  // Concept conversion belongs to expression evaluation, never schema-bound input deserialization.
44
- if (expression && schema.type !== 'object' && schema.type !== 'array' &&
45
- typeof value === 'object' && !Array.isArray(value) && Object.keys(value).length === 1 && 'value' in value) {
46
- return this.convert((value as Record<string, unknown>).value, schema, eventContent, expression);
47
- }
48
- if (schema.type === 'object' && typeof value === 'object' && !Array.isArray(value)) {
49
- const input = value as Record<string, unknown>;
50
- if (schema.additionalProperties || !schema.properties) return structuredClone(input);
51
- const result: Record<string, unknown> = Object.create(null);
52
- for (const [name, property] of Object.entries(schema.properties)) {
53
- const source = this.sourceKey(input, name);
54
- if (source !== undefined && input[source] != null) result[name] = this.convert(input[source], property, eventContent, false);
55
- else {
56
- const fallback = this.defaultValue(property);
57
- if (fallback !== null && fallback !== undefined) result[name] = fallback;
58
- }
59
- }
60
- return result;
61
- }
62
- if (schema.type === 'array' && Array.isArray(value)) {
63
- return value.map(item => schema.items ? this.convert(item, schema.items, eventContent, false) : structuredClone(item));
34
+ if (expression && this.isConcept(value, schema)) {
35
+ return this.convert(value.value, schema, eventContent, expression);
64
36
  }
65
- if (schema.type === 'boolean') {
66
- if (typeof value === 'boolean') return value;
67
- if (!eventContent && typeof value === 'string' && /^(true|false)$/i.test(value)) return value.toLowerCase() === 'true';
68
- throw new RangeError(`Projection boolean value '${String(value)}' requires a kernel-backed test (ChronicleKernelScenario / live kernel).`);
69
- }
70
- if (schema.type === 'number' || schema.type === 'integer') {
71
- if (eventContent && typeof value !== 'number') {
72
- throw new RangeError(`Projection event numeric value '${String(value)}' must be a JSON number.`);
73
- }
74
- if (typeof value !== 'number' && (typeof value !== 'string' ||
75
- !(schema.type === 'integer' ? /^[+-]?\d+$/.test(value) : /^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(value)))) {
76
- throw new RangeError(`Projection numeric value '${String(value)}' is not supported by ${schema.type}/${schema.format ?? 'double'}.`);
77
- }
78
- const number = typeof value === 'number' ? value : Number(value);
79
- this.checkNumber(number, schema);
80
- return number;
81
- }
82
- if (schema.format === 'date-time') {
83
- if (value === '0001-01-01T00:00:00') return value; // Kernel default for a missing DateTime member.
84
- // Bound the accepted subset to UTC ISO text with a four-digit year. Date.parse accepts
85
- // years beyond DateTime.MaxValue, and silently normalizes some invalid calendar dates.
86
- if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/.test(value) ||
87
- +value.slice(0, 4) < 1 || !Number.isFinite(Date.parse(value)) ||
88
- new Date(value).toISOString().slice(0, 19) !== value.slice(0, 19)) {
89
- throw new RangeError(`Projection date-time value '${String(value)}' is outside the supported DateTime range or UTC ISO format.`);
90
- }
91
- return value;
92
- }
93
- if (eventContent && (schema.type === 'string' || (Array.isArray(schema.type) && schema.type[0] === 'string')) && typeof value !== 'string') {
94
- throw new RangeError(`Projection event string value '${String(value)}' must be a JSON string.`);
95
- }
96
- if (schema.format === 'guid' && typeof value === 'string') {
97
- if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value)) {
98
- throw new RangeError(`Projection GUID value '${value}' requires a kernel-backed test (ChronicleKernelScenario / live kernel).`);
99
- }
100
- return value.toLowerCase();
101
- }
102
- if (schema.type === 'string' && typeof value !== 'string') return String(value);
103
- return value;
37
+ if (schema.type === 'object' && this.isObject(value)) return this.object(value, schema, eventContent);
38
+ if (schema.type === 'array' && Array.isArray(value)) return this.array(value, schema, eventContent);
39
+ return ProjectionScalarConverter.convert(value, schema, eventContent);
104
40
  }
105
41
 
106
42
  static checkNumber(number: number, schema: JsonSchema): void {
107
- if (!Number.isFinite(number) || (schema.type === 'integer' && (!Number.isSafeInteger(number) ||
108
- (schema.format === 'int32' && (number < -2147483648 || number > 2147483647)) ||
109
- (schema.format === 'uint32' && (number < 0 || number > 4294967295))))) {
110
- throw new RangeError(`Projection numeric value '${number}' is outside the supported ${schema.type}/${schema.format ?? 'double'} range.`);
43
+ ProjectionScalarConverter.checkNumber(number, schema);
44
+ }
45
+
46
+ private static isObject(value: unknown): value is Record<string, unknown> {
47
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
48
+ }
49
+
50
+ private static isConcept(value: unknown, schema: JsonSchema): value is Record<string, unknown> {
51
+ if (schema.type === 'object' || schema.type === 'array') return false;
52
+ return this.isObject(value) && Object.keys(value).length === 1 && 'value' in value;
53
+ }
54
+
55
+ private static object(input: Record<string, unknown>, schema: JsonSchema, eventContent: boolean): Record<string, unknown> {
56
+ if (schema.additionalProperties || !schema.properties) return structuredClone(input);
57
+ return this.properties(input, schema, eventContent);
58
+ }
59
+
60
+ private static array(input: unknown[], schema: JsonSchema, eventContent: boolean): unknown[] {
61
+ return input.map(item => schema.items ? this.convert(item, schema.items, eventContent, false) : structuredClone(item));
62
+ }
63
+
64
+ private static properties(input: Record<string, unknown>, schema: JsonSchema, eventContent: boolean): Record<string, unknown> {
65
+ const result: Record<string, unknown> = Object.create(null);
66
+ for (const [name, property] of Object.entries(schema.properties ?? {})) {
67
+ const source = this.sourceKey(input, name);
68
+ const value = source === undefined ? null : input[source];
69
+ const converted = value == null ? this.defaultValue(property) : this.convert(value, property, eventContent, false);
70
+ if (converted != null) result[name] = converted;
111
71
  }
72
+ return result;
112
73
  }
113
74
  }
@@ -0,0 +1,74 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import 'reflect-metadata';
5
+ import { chai, describe, it } from 'vitest';
6
+ import { ProjectionCapabilities } from '../ProjectionCapabilities.js';
7
+ import { UnsupportedProjectionOperation } from '../UnsupportedProjectionOperation.js';
8
+ import { Changed } from './given/Changed.js';
9
+ import { compileDeclarative } from './given/compile.js';
10
+
11
+ chai.should();
12
+
13
+ describe('when reporting the first unsupported operation', () => {
14
+ const compile = () => compileDeclarative(builder => builder.from(Changed));
15
+
16
+ it('should reject definition membership before missing evidence', () => {
17
+ const { compiled, definition } = compile();
18
+ (() => ProjectionCapabilities.validate({ ...compiled, definitions: [], provenance: new Map(), eventSchemas: new Map() }, definition))
19
+ .should.throw(UnsupportedProjectionOperation, 'Definition (contract): definition is not part of this compile');
20
+ });
21
+
22
+ it('should reject missing provenance before a missing event catalog', () => {
23
+ const { compiled, definition } = compile();
24
+ (() => ProjectionCapabilities.validate({ ...compiled, provenance: new Map(), eventSchemas: new Map() }, definition))
25
+ .should.throw(UnsupportedProjectionOperation, 'Definition (contract): capability provenance is unavailable');
26
+ });
27
+
28
+ it('should reject a missing catalog before passive projections', () => {
29
+ const { compiled, definition } = compile();
30
+ definition.IsActive = false;
31
+ (() => ProjectionCapabilities.validate({ ...compiled, eventSchemas: new Map() }, definition))
32
+ .should.throw(UnsupportedProjectionOperation, 'Definition (contract): event-schema catalog is unavailable');
33
+ });
34
+
35
+ it('should reject passive projections before malformed read-model schemas', () => {
36
+ const { compiled, definition } = compile();
37
+ definition.IsActive = false;
38
+ compiled.readModels[0].Schema = '{';
39
+ (() => ProjectionCapabilities.validate(compiled, definition))
40
+ .should.throw(UnsupportedProjectionOperation, 'IsActive (contract): passive projections require a kernel-backed test');
41
+ });
42
+
43
+ it('should report malformed model schemas with their source declaration', () => {
44
+ const { compiled, definition } = compile();
45
+ compiled.readModels[0].Schema = '{';
46
+ (() => ProjectionCapabilities.validate(compiled, definition))
47
+ .should.throw(UnsupportedProjectionOperation, 'ReadModel.Schema (.from): read-model schema is not valid JSON');
48
+ });
49
+
50
+ it('should reject malformed initial JSON before invalid subscription keys', () => {
51
+ const { compiled, definition } = compile();
52
+ definition.InitialModelState = '[';
53
+ definition.From[0].Value.Key = 'unsupported';
54
+ (() => ProjectionCapabilities.validate(compiled, definition))
55
+ .should.throw(UnsupportedProjectionOperation, 'InitialModelState (.withInitialValues): initial values must be a JSON object');
56
+ });
57
+
58
+ it('should report the first initial value in JSON property order', () => {
59
+ const { compiled, definition } = compile();
60
+ definition.InitialModelState = '{"unknownFirst":1,"unknownSecond":2}';
61
+ (() => ProjectionCapabilities.validate(compiled, definition))
62
+ .should.throw(UnsupportedProjectionOperation, 'InitialModelState.unknownFirst (.withInitialValues): initial value has no read-model schema');
63
+ });
64
+
65
+ it('should validate a destination schema before interpreting its expression', () => {
66
+ const { compiled, definition } = compileDeclarative(builder => builder.from(Changed, from => from.set(model => model.state).to(event => event.name)));
67
+ definition.From[0].Value.Properties.state = '$setOnce(name)';
68
+ const schema = JSON.parse(compiled.readModels[0].Schema);
69
+ schema.properties.state = { type: 'string', format: 'unsupported' };
70
+ compiled.readModels[0].Schema = JSON.stringify(schema);
71
+ (() => ProjectionCapabilities.validate(compiled, definition)).should.throw(UnsupportedProjectionOperation,
72
+ "expression '$setOnce(name)': schema type/format 'string/unsupported' requires a kernel-backed test");
73
+ });
74
+ });
@@ -0,0 +1,64 @@
1
+ // Copyright (c) Cratis. All rights reserved.
2
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+
4
+ import { chai, describe, it } from 'vitest';
5
+ import { ProjectionValueConverter } from '../ProjectionValueConverter.js';
6
+ import type { JsonSchema } from '../../../schemas/JsonSchema.js';
7
+
8
+ chai.should();
9
+
10
+ describe('when converting structured and scalar values', () => {
11
+ it('should unwrap concepts only at expression boundaries', () => {
12
+ (ProjectionValueConverter.convert({ value: { value: '12' } }, { type: 'integer' }) as number).should.equal(12);
13
+ (() => ProjectionValueConverter.convert({ value: 12 }, { type: 'integer' }, true, false))
14
+ .should.throw(RangeError, "Projection event numeric value '[object Object]' must be a JSON number.");
15
+ (() => ProjectionValueConverter.convert([{ value: 12 }], { type: 'array', items: { type: 'integer' } }))
16
+ .should.throw(RangeError, "Projection numeric value '[object Object]' is not supported by integer/double.");
17
+ });
18
+
19
+ it('should apply defaults to missing object members and omit null defaults', () => {
20
+ const schema: JsonSchema = { type: 'object', properties: {
21
+ amount: { type: 'integer' }, flag: { type: 'boolean' }, text: { type: 'string' },
22
+ nullable: { type: ['string', 'null'] }, identifier: { type: 'string', format: 'guid' },
23
+ date: { type: 'string', format: 'date-time' }
24
+ } };
25
+ const expected = { amount: 0, flag: false, identifier: '00000000-0000-0000-0000-000000000000', date: '0001-01-01T00:00:00' };
26
+ ({ ...ProjectionValueConverter.convert({ amount: null }, schema) as object }).should.deep.equal(expected);
27
+ ({ ...ProjectionValueConverter.eventContent([], schema) }).should.deep.equal(expected);
28
+ (ProjectionValueConverter.convert(undefined, schema) === null).should.equal(true);
29
+ });
30
+
31
+ it('should clone open objects and untyped array items without coercing them', () => {
32
+ const input = { nested: { value: '12' } };
33
+ const result = ProjectionValueConverter.convert(input, { type: 'object', additionalProperties: true }) as typeof input;
34
+ result.should.deep.equal(input);
35
+ result.nested.should.not.equal(input.nested);
36
+ (ProjectionValueConverter.convert([input], { type: 'array' }) as object[]).should.deep.equal([input]);
37
+ (ProjectionValueConverter.convert(['12'], { type: 'array', items: { type: 'integer' } }) as number[]).should.deep.equal([12]);
38
+ });
39
+
40
+ it('should distinguish boolean expression text from event JSON', () => {
41
+ (ProjectionValueConverter.convert('TrUe', { type: 'boolean' }) as boolean).should.equal(true);
42
+ (ProjectionValueConverter.convert(false, { type: 'boolean' }, true) as boolean).should.equal(false);
43
+ (() => ProjectionValueConverter.convert('false', { type: 'boolean' }, true))
44
+ .should.throw(RangeError, "Projection boolean value 'false' requires a kernel-backed test (ChronicleKernelScenario / live kernel).");
45
+ });
46
+
47
+ for (const [value, schema] of [
48
+ [Infinity, { type: 'number' }], [1.5, { type: 'integer' }],
49
+ [2147483648, { type: 'integer', format: 'int32' }], [-1, { type: 'integer', format: 'uint32' }],
50
+ [4294967296, { type: 'integer', format: 'uint32' }], [9007199254740992, { type: 'integer' }]
51
+ ] satisfies [number, JsonSchema][]) {
52
+ it(`should reject ${value} outside ${schema.type}/${schema.format ?? 'double'}`, () => {
53
+ (() => ProjectionValueConverter.convert(value, schema)).should.throw(RangeError,
54
+ `Projection numeric value '${value}' is outside the supported ${schema.type}/${schema.format ?? 'double'} range.`);
55
+ });
56
+ }
57
+
58
+ it('should preserve the precedence of formats and scalar types', () => {
59
+ (ProjectionValueConverter.convert('0001-01-01T00:00:00', { type: 'string', format: 'date-time' }) as string)
60
+ .should.equal('0001-01-01T00:00:00');
61
+ (ProjectionValueConverter.convert('12', { type: 'number', format: 'guid' }) as number).should.equal(12);
62
+ (ProjectionValueConverter.convert(5, { type: ['string', 'null'] }) as number).should.equal(5);
63
+ });
64
+ });
@@ -42,5 +42,8 @@ export enum DecoratorType {
42
42
  GraphElement = 'graphElement',
43
43
 
44
44
  /** Fluent graph projection artifacts discovered through the graphProjection decorator. */
45
- GraphProjection = 'graphProjection'
45
+ GraphProjection = 'graphProjection',
46
+
47
+ /** View artifacts over a property graph discovered through the viewOf decorator. */
48
+ GraphView = 'graphView'
46
49
  }