@cratis/chronicle 6.63.0 → 6.65.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 (411) hide show
  1. package/README.md +1 -1
  2. package/artifacts/DefaultClientArtifactsProvider.ts +5 -0
  3. package/artifacts/IClientArtifactsProvider.ts +3 -0
  4. package/connection/ChronicleConnection.ts +17 -7
  5. package/connection/ChronicleConnectionString.spec.ts +85 -0
  6. package/connection/ChronicleConnectionString.ts +186 -12
  7. package/connection/ChronicleTlsMaterial.spec.ts +160 -0
  8. package/connection/ChronicleTlsMaterial.ts +121 -0
  9. package/connection/CompatibilityPreflight.ts +9 -1
  10. package/connection/LeastConnectionsLoadBalancerStrategy.ts +4 -2
  11. package/connection/LoadBalancerStrategyFactory.ts +7 -2
  12. package/connection/TokenProvider.ts +4 -1
  13. package/connection/fetchOAuthAccessToken.ts +4 -2
  14. package/connection/for_CompatibilityPreflight/when_verifying/with_the_check_skipped.spec.ts +23 -0
  15. package/dist/artifacts/DefaultClientArtifactsProvider.d.ts +2 -0
  16. package/dist/artifacts/DefaultClientArtifactsProvider.d.ts.map +1 -1
  17. package/dist/artifacts/DefaultClientArtifactsProvider.js +4 -0
  18. package/dist/artifacts/DefaultClientArtifactsProvider.js.map +1 -1
  19. package/dist/artifacts/IClientArtifactsProvider.d.ts +2 -0
  20. package/dist/artifacts/IClientArtifactsProvider.d.ts.map +1 -1
  21. package/dist/connection/ChronicleConnection.d.ts +1 -0
  22. package/dist/connection/ChronicleConnection.d.ts.map +1 -1
  23. package/dist/connection/ChronicleConnection.js +15 -7
  24. package/dist/connection/ChronicleConnection.js.map +1 -1
  25. package/dist/connection/ChronicleConnectionString.d.ts +50 -1
  26. package/dist/connection/ChronicleConnectionString.d.ts.map +1 -1
  27. package/dist/connection/ChronicleConnectionString.js +154 -12
  28. package/dist/connection/ChronicleConnectionString.js.map +1 -1
  29. package/dist/connection/ChronicleTlsMaterial.d.ts +54 -0
  30. package/dist/connection/ChronicleTlsMaterial.d.ts.map +1 -0
  31. package/dist/connection/ChronicleTlsMaterial.js +88 -0
  32. package/dist/connection/ChronicleTlsMaterial.js.map +1 -0
  33. package/dist/connection/CompatibilityPreflight.d.ts +2 -1
  34. package/dist/connection/CompatibilityPreflight.d.ts.map +1 -1
  35. package/dist/connection/CompatibilityPreflight.js +6 -1
  36. package/dist/connection/CompatibilityPreflight.js.map +1 -1
  37. package/dist/connection/LeastConnectionsLoadBalancerStrategy.d.ts +2 -1
  38. package/dist/connection/LeastConnectionsLoadBalancerStrategy.d.ts.map +1 -1
  39. package/dist/connection/LeastConnectionsLoadBalancerStrategy.js +3 -2
  40. package/dist/connection/LeastConnectionsLoadBalancerStrategy.js.map +1 -1
  41. package/dist/connection/LoadBalancerStrategyFactory.d.ts +2 -1
  42. package/dist/connection/LoadBalancerStrategyFactory.d.ts.map +1 -1
  43. package/dist/connection/LoadBalancerStrategyFactory.js +3 -2
  44. package/dist/connection/LoadBalancerStrategyFactory.js.map +1 -1
  45. package/dist/connection/TokenProvider.d.ts +4 -1
  46. package/dist/connection/TokenProvider.d.ts.map +1 -1
  47. package/dist/connection/TokenProvider.js +5 -1
  48. package/dist/connection/TokenProvider.js.map +1 -1
  49. package/dist/connection/fetchOAuthAccessToken.d.ts +2 -1
  50. package/dist/connection/fetchOAuthAccessToken.d.ts.map +1 -1
  51. package/dist/connection/fetchOAuthAccessToken.js +3 -2
  52. package/dist/connection/fetchOAuthAccessToken.js.map +1 -1
  53. package/dist/projections/for_Graphs/given/a_discovered_graph.d.ts +2 -1
  54. package/dist/projections/for_Graphs/given/a_discovered_graph.d.ts.map +1 -1
  55. package/dist/projections/for_Graphs/given/a_discovered_graph.js +3 -2
  56. package/dist/projections/for_Graphs/given/a_discovered_graph.js.map +1 -1
  57. package/dist/projections/for_Graphs/given/a_graph_with_views.d.ts +40 -0
  58. package/dist/projections/for_Graphs/given/a_graph_with_views.d.ts.map +1 -0
  59. package/dist/projections/for_Graphs/given/a_graph_with_views.js +80 -0
  60. package/dist/projections/for_Graphs/given/a_graph_with_views.js.map +1 -0
  61. package/dist/projections/for_Graphs/given/organization.d.ts +2 -1
  62. package/dist/projections/for_Graphs/given/organization.d.ts.map +1 -1
  63. package/dist/projections/for_Graphs/given/organization.js +3 -2
  64. package/dist/projections/for_Graphs/given/organization.js.map +1 -1
  65. package/dist/projections/graphs/Graphs.d.ts +5 -0
  66. package/dist/projections/graphs/Graphs.d.ts.map +1 -1
  67. package/dist/projections/graphs/Graphs.js +43 -0
  68. package/dist/projections/graphs/Graphs.js.map +1 -1
  69. package/dist/projections/graphs/IGraphs.d.ts +9 -2
  70. package/dist/projections/graphs/IGraphs.d.ts.map +1 -1
  71. package/dist/projections/graphs/index.d.ts +1 -0
  72. package/dist/projections/graphs/index.d.ts.map +1 -1
  73. package/dist/projections/graphs/index.js +1 -0
  74. package/dist/projections/graphs/index.js.map +1 -1
  75. package/dist/projections/graphs/views/AmbiguousDirection.d.ts +16 -0
  76. package/dist/projections/graphs/views/AmbiguousDirection.d.ts.map +1 -0
  77. package/dist/projections/graphs/views/AmbiguousDirection.js +21 -0
  78. package/dist/projections/graphs/views/AmbiguousDirection.js.map +1 -0
  79. package/dist/projections/graphs/views/DuplicateViewName.d.ts +16 -0
  80. package/dist/projections/graphs/views/DuplicateViewName.d.ts.map +1 -0
  81. package/dist/projections/graphs/views/DuplicateViewName.js +21 -0
  82. package/dist/projections/graphs/views/DuplicateViewName.js.map +1 -0
  83. package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.d.ts +17 -0
  84. package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.d.ts.map +1 -0
  85. package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.js +22 -0
  86. package/dist/projections/graphs/views/EdgeNotIncidentOnRoot.js.map +1 -0
  87. package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.d.ts +14 -0
  88. package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.d.ts.map +1 -0
  89. package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.js +19 -0
  90. package/dist/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.js.map +1 -0
  91. package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.d.ts +15 -0
  92. package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.d.ts.map +1 -0
  93. package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.js +20 -0
  94. package/dist/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.js.map +1 -0
  95. package/dist/projections/graphs/views/FollowsOptions.d.ts +16 -0
  96. package/dist/projections/graphs/views/FollowsOptions.d.ts.map +1 -0
  97. package/dist/projections/graphs/views/FollowsOptions.js +4 -0
  98. package/dist/projections/graphs/views/FollowsOptions.js.map +1 -0
  99. package/dist/projections/graphs/views/GraphEdgeDirection.d.ts +10 -0
  100. package/dist/projections/graphs/views/GraphEdgeDirection.d.ts.map +1 -0
  101. package/dist/projections/graphs/views/GraphEdgeDirection.js +13 -0
  102. package/dist/projections/graphs/views/GraphEdgeDirection.js.map +1 -0
  103. package/dist/projections/graphs/views/GraphView.d.ts +13 -0
  104. package/dist/projections/graphs/views/GraphView.d.ts.map +1 -0
  105. package/dist/projections/graphs/views/GraphView.js +4 -0
  106. package/dist/projections/graphs/views/GraphView.js.map +1 -0
  107. package/dist/projections/graphs/views/GraphViewBuildResult.d.ts +15 -0
  108. package/dist/projections/graphs/views/GraphViewBuildResult.d.ts.map +1 -0
  109. package/dist/projections/graphs/views/GraphViewBuildResult.js +4 -0
  110. package/dist/projections/graphs/views/GraphViewBuildResult.js.map +1 -0
  111. package/dist/projections/graphs/views/GraphViewCardinality.d.ts +10 -0
  112. package/dist/projections/graphs/views/GraphViewCardinality.d.ts.map +1 -0
  113. package/dist/projections/graphs/views/GraphViewCardinality.js +13 -0
  114. package/dist/projections/graphs/views/GraphViewCardinality.js.map +1 -0
  115. package/dist/projections/graphs/views/GraphViewDefinition.d.ts +15 -0
  116. package/dist/projections/graphs/views/GraphViewDefinition.d.ts.map +1 -0
  117. package/dist/projections/graphs/views/GraphViewDefinition.js +4 -0
  118. package/dist/projections/graphs/views/GraphViewDefinition.js.map +1 -0
  119. package/dist/projections/graphs/views/GraphViewDefinitionBuilder.d.ts +30 -0
  120. package/dist/projections/graphs/views/GraphViewDefinitionBuilder.d.ts.map +1 -0
  121. package/dist/projections/graphs/views/GraphViewDefinitionBuilder.js +259 -0
  122. package/dist/projections/graphs/views/GraphViewDefinitionBuilder.js.map +1 -0
  123. package/dist/projections/graphs/views/GraphViewDefinitionSerializer.d.ts +21 -0
  124. package/dist/projections/graphs/views/GraphViewDefinitionSerializer.d.ts.map +1 -0
  125. package/dist/projections/graphs/views/GraphViewDefinitionSerializer.js +77 -0
  126. package/dist/projections/graphs/views/GraphViewDefinitionSerializer.js.map +1 -0
  127. package/dist/projections/graphs/views/GraphViewEdgeReference.d.ts +6 -0
  128. package/dist/projections/graphs/views/GraphViewEdgeReference.d.ts.map +1 -0
  129. package/dist/projections/graphs/views/GraphViewEdgeReference.js +4 -0
  130. package/dist/projections/graphs/views/GraphViewEdgeReference.js.map +1 -0
  131. package/dist/projections/graphs/views/GraphViewMember.d.ts +8 -0
  132. package/dist/projections/graphs/views/GraphViewMember.d.ts.map +1 -0
  133. package/dist/projections/graphs/views/GraphViewMember.js +4 -0
  134. package/dist/projections/graphs/views/GraphViewMember.js.map +1 -0
  135. package/dist/projections/graphs/views/GraphViewMemberKind.d.ts +12 -0
  136. package/dist/projections/graphs/views/GraphViewMemberKind.d.ts.map +1 -0
  137. package/dist/projections/graphs/views/GraphViewMemberKind.js +15 -0
  138. package/dist/projections/graphs/views/GraphViewMemberKind.js.map +1 -0
  139. package/dist/projections/graphs/views/GraphViewMemberMetadata.d.ts +22 -0
  140. package/dist/projections/graphs/views/GraphViewMemberMetadata.d.ts.map +1 -0
  141. package/dist/projections/graphs/views/GraphViewMemberMetadata.js +4 -0
  142. package/dist/projections/graphs/views/GraphViewMemberMetadata.js.map +1 -0
  143. package/dist/projections/graphs/views/GraphViewPropertyMember.d.ts +13 -0
  144. package/dist/projections/graphs/views/GraphViewPropertyMember.d.ts.map +1 -0
  145. package/dist/projections/graphs/views/GraphViewPropertyMember.js +4 -0
  146. package/dist/projections/graphs/views/GraphViewPropertyMember.js.map +1 -0
  147. package/dist/projections/graphs/views/GraphViewReason.d.ts +33 -0
  148. package/dist/projections/graphs/views/GraphViewReason.d.ts.map +1 -0
  149. package/dist/projections/graphs/views/GraphViewReason.js +36 -0
  150. package/dist/projections/graphs/views/GraphViewReason.js.map +1 -0
  151. package/dist/projections/graphs/views/GraphViewRelationMember.d.ts +21 -0
  152. package/dist/projections/graphs/views/GraphViewRelationMember.d.ts.map +1 -0
  153. package/dist/projections/graphs/views/GraphViewRelationMember.js +4 -0
  154. package/dist/projections/graphs/views/GraphViewRelationMember.js.map +1 -0
  155. package/dist/projections/graphs/views/GraphViewSchema.d.ts +10 -0
  156. package/dist/projections/graphs/views/GraphViewSchema.d.ts.map +1 -0
  157. package/dist/projections/graphs/views/GraphViewSchema.js +4 -0
  158. package/dist/projections/graphs/views/GraphViewSchema.js.map +1 -0
  159. package/dist/projections/graphs/views/GraphViewSchemaEdge.d.ts +14 -0
  160. package/dist/projections/graphs/views/GraphViewSchemaEdge.d.ts.map +1 -0
  161. package/dist/projections/graphs/views/GraphViewSchemaEdge.js +4 -0
  162. package/dist/projections/graphs/views/GraphViewSchemaEdge.js.map +1 -0
  163. package/dist/projections/graphs/views/GraphViewSchemaNode.d.ts +10 -0
  164. package/dist/projections/graphs/views/GraphViewSchemaNode.d.ts.map +1 -0
  165. package/dist/projections/graphs/views/GraphViewSchemaNode.js +4 -0
  166. package/dist/projections/graphs/views/GraphViewSchemaNode.js.map +1 -0
  167. package/dist/projections/graphs/views/GraphViewSerializerOptions.d.ts +9 -0
  168. package/dist/projections/graphs/views/GraphViewSerializerOptions.d.ts.map +1 -0
  169. package/dist/projections/graphs/views/GraphViewSerializerOptions.js +4 -0
  170. package/dist/projections/graphs/views/GraphViewSerializerOptions.js.map +1 -0
  171. package/dist/projections/graphs/views/RecursiveView.d.ts +15 -0
  172. package/dist/projections/graphs/views/RecursiveView.d.ts.map +1 -0
  173. package/dist/projections/graphs/views/RecursiveView.js +20 -0
  174. package/dist/projections/graphs/views/RecursiveView.js.map +1 -0
  175. package/dist/projections/graphs/views/RelationTargetNotAView.d.ts +16 -0
  176. package/dist/projections/graphs/views/RelationTargetNotAView.d.ts.map +1 -0
  177. package/dist/projections/graphs/views/RelationTargetNotAView.js +21 -0
  178. package/dist/projections/graphs/views/RelationTargetNotAView.js.map +1 -0
  179. package/dist/projections/graphs/views/TargetLabelMismatch.d.ts +18 -0
  180. package/dist/projections/graphs/views/TargetLabelMismatch.d.ts.map +1 -0
  181. package/dist/projections/graphs/views/TargetLabelMismatch.js +23 -0
  182. package/dist/projections/graphs/views/TargetLabelMismatch.js.map +1 -0
  183. package/dist/projections/graphs/views/UnknownEdge.d.ts +16 -0
  184. package/dist/projections/graphs/views/UnknownEdge.d.ts.map +1 -0
  185. package/dist/projections/graphs/views/UnknownEdge.js +21 -0
  186. package/dist/projections/graphs/views/UnknownEdge.js.map +1 -0
  187. package/dist/projections/graphs/views/UnknownEdgeProperty.d.ts +17 -0
  188. package/dist/projections/graphs/views/UnknownEdgeProperty.d.ts.map +1 -0
  189. package/dist/projections/graphs/views/UnknownEdgeProperty.js +22 -0
  190. package/dist/projections/graphs/views/UnknownEdgeProperty.js.map +1 -0
  191. package/dist/projections/graphs/views/UnknownNodeProperty.d.ts +17 -0
  192. package/dist/projections/graphs/views/UnknownNodeProperty.d.ts.map +1 -0
  193. package/dist/projections/graphs/views/UnknownNodeProperty.js +22 -0
  194. package/dist/projections/graphs/views/UnknownNodeProperty.js.map +1 -0
  195. package/dist/projections/graphs/views/ViewIsAlsoSchema.d.ts +14 -0
  196. package/dist/projections/graphs/views/ViewIsAlsoSchema.d.ts.map +1 -0
  197. package/dist/projections/graphs/views/ViewIsAlsoSchema.js +19 -0
  198. package/dist/projections/graphs/views/ViewIsAlsoSchema.js.map +1 -0
  199. package/dist/projections/graphs/views/ViewOfMetadata.d.ts +8 -0
  200. package/dist/projections/graphs/views/ViewOfMetadata.d.ts.map +1 -0
  201. package/dist/projections/graphs/views/ViewOfMetadata.js +4 -0
  202. package/dist/projections/graphs/views/ViewOfMetadata.js.map +1 -0
  203. package/dist/projections/graphs/views/ViewOfOptions.d.ts +6 -0
  204. package/dist/projections/graphs/views/ViewOfOptions.d.ts.map +1 -0
  205. package/dist/projections/graphs/views/ViewOfOptions.js +4 -0
  206. package/dist/projections/graphs/views/ViewOfOptions.js.map +1 -0
  207. package/dist/projections/graphs/views/ViewRootNotANode.d.ts +16 -0
  208. package/dist/projections/graphs/views/ViewRootNotANode.d.ts.map +1 -0
  209. package/dist/projections/graphs/views/ViewRootNotANode.js +21 -0
  210. package/dist/projections/graphs/views/ViewRootNotANode.js.map +1 -0
  211. package/dist/projections/graphs/views/declareGraphViewMember.d.ts +17 -0
  212. package/dist/projections/graphs/views/declareGraphViewMember.d.ts.map +1 -0
  213. package/dist/projections/graphs/views/declareGraphViewMember.js +31 -0
  214. package/dist/projections/graphs/views/declareGraphViewMember.js.map +1 -0
  215. package/dist/projections/graphs/views/follows.d.ts +13 -0
  216. package/dist/projections/graphs/views/follows.d.ts.map +1 -0
  217. package/dist/projections/graphs/views/follows.js +24 -0
  218. package/dist/projections/graphs/views/follows.js.map +1 -0
  219. package/dist/projections/graphs/views/fromEdge.d.ts +10 -0
  220. package/dist/projections/graphs/views/fromEdge.d.ts.map +1 -0
  221. package/dist/projections/graphs/views/fromEdge.js +15 -0
  222. package/dist/projections/graphs/views/fromEdge.js.map +1 -0
  223. package/dist/projections/graphs/views/index.d.ts +41 -0
  224. package/dist/projections/graphs/views/index.d.ts.map +1 -0
  225. package/dist/projections/graphs/views/index.js +28 -0
  226. package/dist/projections/graphs/views/index.js.map +1 -0
  227. package/dist/projections/graphs/views/viewKey.d.ts +8 -0
  228. package/dist/projections/graphs/views/viewKey.d.ts.map +1 -0
  229. package/dist/projections/graphs/views/viewKey.js +13 -0
  230. package/dist/projections/graphs/views/viewKey.js.map +1 -0
  231. package/dist/projections/graphs/views/viewOf.d.ts +22 -0
  232. package/dist/projections/graphs/views/viewOf.d.ts.map +1 -0
  233. package/dist/projections/graphs/views/viewOf.js +41 -0
  234. package/dist/projections/graphs/views/viewOf.js.map +1 -0
  235. package/dist/projections/graphs/views/viewProperty.d.ts +9 -0
  236. package/dist/projections/graphs/views/viewProperty.d.ts.map +1 -0
  237. package/dist/projections/graphs/views/viewProperty.js +14 -0
  238. package/dist/projections/graphs/views/viewProperty.js.map +1 -0
  239. package/dist/testing/InProcessAppendMetadata.d.ts +30 -0
  240. package/dist/testing/InProcessAppendMetadata.d.ts.map +1 -0
  241. package/dist/testing/InProcessAppendMetadata.js +107 -0
  242. package/dist/testing/InProcessAppendMetadata.js.map +1 -0
  243. package/dist/testing/InProcessBatchAppend.d.ts +62 -0
  244. package/dist/testing/InProcessBatchAppend.d.ts.map +1 -0
  245. package/dist/testing/InProcessBatchAppend.js +131 -0
  246. package/dist/testing/InProcessBatchAppend.js.map +1 -0
  247. package/dist/testing/InProcessEventPayload.d.ts +23 -0
  248. package/dist/testing/InProcessEventPayload.d.ts.map +1 -0
  249. package/dist/testing/InProcessEventPayload.js +94 -0
  250. package/dist/testing/InProcessEventPayload.js.map +1 -0
  251. package/dist/testing/InProcessEventReadCriteria.d.ts +9 -0
  252. package/dist/testing/InProcessEventReadCriteria.d.ts.map +1 -0
  253. package/dist/testing/InProcessEventReadCriteria.js +4 -0
  254. package/dist/testing/InProcessEventReadCriteria.js.map +1 -0
  255. package/dist/testing/InProcessEventReadFilter.d.ts +14 -0
  256. package/dist/testing/InProcessEventReadFilter.d.ts.map +1 -0
  257. package/dist/testing/InProcessEventReadFilter.js +31 -0
  258. package/dist/testing/InProcessEventReadFilter.js.map +1 -0
  259. package/dist/testing/InProcessEventSequence.d.ts +8 -5
  260. package/dist/testing/InProcessEventSequence.d.ts.map +1 -1
  261. package/dist/testing/InProcessEventSequence.js +59 -275
  262. package/dist/testing/InProcessEventSequence.js.map +1 -1
  263. package/dist/testing/InProcessEventSequenceEnvironment.d.ts +13 -0
  264. package/dist/testing/InProcessEventSequenceEnvironment.d.ts.map +1 -0
  265. package/dist/testing/InProcessEventSequenceEnvironment.js +4 -0
  266. package/dist/testing/InProcessEventSequenceEnvironment.js.map +1 -0
  267. package/dist/testing/InProcessSingleAppend.d.ts +34 -0
  268. package/dist/testing/InProcessSingleAppend.d.ts.map +1 -0
  269. package/dist/testing/InProcessSingleAppend.js +95 -0
  270. package/dist/testing/InProcessSingleAppend.js.map +1 -0
  271. package/dist/testing/projections/ProjectionCapabilities.d.ts +0 -8
  272. package/dist/testing/projections/ProjectionCapabilities.d.ts.map +1 -1
  273. package/dist/testing/projections/ProjectionCapabilities.js +21 -312
  274. package/dist/testing/projections/ProjectionCapabilities.js.map +1 -1
  275. package/dist/testing/projections/ProjectionCapabilityReject.d.ts +3 -0
  276. package/dist/testing/projections/ProjectionCapabilityReject.d.ts.map +1 -0
  277. package/dist/testing/projections/ProjectionCapabilityReject.js +4 -0
  278. package/dist/testing/projections/ProjectionCapabilityReject.js.map +1 -0
  279. package/dist/testing/projections/ProjectionCapabilityReporter.d.ts +12 -0
  280. package/dist/testing/projections/ProjectionCapabilityReporter.d.ts.map +1 -0
  281. package/dist/testing/projections/ProjectionCapabilityReporter.js +33 -0
  282. package/dist/testing/projections/ProjectionCapabilityReporter.js.map +1 -0
  283. package/dist/testing/projections/ProjectionDefinitionCapabilities.d.ts +11 -0
  284. package/dist/testing/projections/ProjectionDefinitionCapabilities.d.ts.map +1 -0
  285. package/dist/testing/projections/ProjectionDefinitionCapabilities.js +45 -0
  286. package/dist/testing/projections/ProjectionDefinitionCapabilities.js.map +1 -0
  287. package/dist/testing/projections/ProjectionEventSchemaResolver.d.ts +13 -0
  288. package/dist/testing/projections/ProjectionEventSchemaResolver.d.ts.map +1 -0
  289. package/dist/testing/projections/ProjectionEventSchemaResolver.js +22 -0
  290. package/dist/testing/projections/ProjectionEventSchemaResolver.js.map +1 -0
  291. package/dist/testing/projections/ProjectionExpressionCapabilities.d.ts +19 -0
  292. package/dist/testing/projections/ProjectionExpressionCapabilities.d.ts.map +1 -0
  293. package/dist/testing/projections/ProjectionExpressionCapabilities.js +103 -0
  294. package/dist/testing/projections/ProjectionExpressionCapabilities.js.map +1 -0
  295. package/dist/testing/projections/ProjectionInitialValueCapabilities.d.ts +16 -0
  296. package/dist/testing/projections/ProjectionInitialValueCapabilities.d.ts.map +1 -0
  297. package/dist/testing/projections/ProjectionInitialValueCapabilities.js +72 -0
  298. package/dist/testing/projections/ProjectionInitialValueCapabilities.js.map +1 -0
  299. package/dist/testing/projections/ProjectionMappingCapabilities.d.ts +21 -0
  300. package/dist/testing/projections/ProjectionMappingCapabilities.d.ts.map +1 -0
  301. package/dist/testing/projections/ProjectionMappingCapabilities.js +86 -0
  302. package/dist/testing/projections/ProjectionMappingCapabilities.js.map +1 -0
  303. package/dist/testing/projections/ProjectionMappingValidation.d.ts +9 -0
  304. package/dist/testing/projections/ProjectionMappingValidation.d.ts.map +1 -0
  305. package/dist/testing/projections/ProjectionMappingValidation.js +4 -0
  306. package/dist/testing/projections/ProjectionMappingValidation.js.map +1 -0
  307. package/dist/testing/projections/ProjectionReadModelCapabilities.d.ts +11 -0
  308. package/dist/testing/projections/ProjectionReadModelCapabilities.d.ts.map +1 -0
  309. package/dist/testing/projections/ProjectionReadModelCapabilities.js +40 -0
  310. package/dist/testing/projections/ProjectionReadModelCapabilities.js.map +1 -0
  311. package/dist/testing/projections/ProjectionRootCapabilities.d.ts +20 -0
  312. package/dist/testing/projections/ProjectionRootCapabilities.d.ts.map +1 -0
  313. package/dist/testing/projections/ProjectionRootCapabilities.js +73 -0
  314. package/dist/testing/projections/ProjectionRootCapabilities.js.map +1 -0
  315. package/dist/testing/projections/ProjectionScalarConverter.d.ts +21 -0
  316. package/dist/testing/projections/ProjectionScalarConverter.d.ts.map +1 -0
  317. package/dist/testing/projections/ProjectionScalarConverter.js +105 -0
  318. package/dist/testing/projections/ProjectionScalarConverter.js.map +1 -0
  319. package/dist/testing/projections/ProjectionSchemaCapabilities.d.ts +26 -0
  320. package/dist/testing/projections/ProjectionSchemaCapabilities.d.ts.map +1 -0
  321. package/dist/testing/projections/ProjectionSchemaCapabilities.js +109 -0
  322. package/dist/testing/projections/ProjectionSchemaCapabilities.js.map +1 -0
  323. package/dist/testing/projections/ProjectionValueConverter.d.ts +5 -0
  324. package/dist/testing/projections/ProjectionValueConverter.d.ts.map +1 -1
  325. package/dist/testing/projections/ProjectionValueConverter.js +36 -84
  326. package/dist/testing/projections/ProjectionValueConverter.js.map +1 -1
  327. package/dist/tsconfig.tsbuildinfo +1 -1
  328. package/dist/types/DecoratorType.d.ts +3 -1
  329. package/dist/types/DecoratorType.d.ts.map +1 -1
  330. package/dist/types/DecoratorType.js +2 -0
  331. package/dist/types/DecoratorType.js.map +1 -1
  332. package/for_ChronicleOptions/when_configuring_keep_alive/with_skip_keep_alive.spec.ts +1 -1
  333. package/package.json +2 -2
  334. package/projections/for_Graphs/given/a_discovered_graph.ts +3 -2
  335. package/projections/for_Graphs/given/a_graph_with_views.ts +91 -0
  336. package/projections/for_Graphs/given/organization.ts +3 -2
  337. package/projections/for_Graphs/given/organization_with_views.fixture.ts +129 -0
  338. package/projections/for_Graphs/when_building_graph_views.spec.ts +218 -0
  339. package/projections/for_Graphs/when_declaring_an_invalid_graph_view.spec.ts +229 -0
  340. package/projections/for_Graphs/when_declaring_graph_views.standard.spec.ts +49 -0
  341. package/projections/for_Graphs/when_discovering_graph_views.spec.ts +58 -0
  342. package/projections/graphs/Graphs.ts +44 -0
  343. package/projections/graphs/IGraphs.ts +10 -2
  344. package/projections/graphs/index.ts +1 -0
  345. package/projections/graphs/views/AmbiguousDirection.ts +23 -0
  346. package/projections/graphs/views/DuplicateViewName.ts +23 -0
  347. package/projections/graphs/views/EdgeNotIncidentOnRoot.ts +24 -0
  348. package/projections/graphs/views/EdgePropertyViewNotUsedAsTarget.ts +21 -0
  349. package/projections/graphs/views/EdgePropertyViewSharedAcrossEdges.ts +22 -0
  350. package/projections/graphs/views/FollowsOptions.ts +20 -0
  351. package/projections/graphs/views/GraphEdgeDirection.ts +13 -0
  352. package/projections/graphs/views/GraphView.ts +18 -0
  353. package/projections/graphs/views/GraphViewBuildResult.ts +19 -0
  354. package/projections/graphs/views/GraphViewCardinality.ts +13 -0
  355. package/projections/graphs/views/GraphViewDefinition.ts +20 -0
  356. package/projections/graphs/views/GraphViewDefinitionBuilder.ts +322 -0
  357. package/projections/graphs/views/GraphViewDefinitionSerializer.ts +90 -0
  358. package/projections/graphs/views/GraphViewEdgeReference.ts +8 -0
  359. package/projections/graphs/views/GraphViewMember.ts +11 -0
  360. package/projections/graphs/views/GraphViewMemberKind.ts +16 -0
  361. package/projections/graphs/views/GraphViewMemberMetadata.ts +31 -0
  362. package/projections/graphs/views/GraphViewPropertyMember.ts +18 -0
  363. package/projections/graphs/views/GraphViewReason.ts +47 -0
  364. package/projections/graphs/views/GraphViewRelationMember.ts +29 -0
  365. package/projections/graphs/views/GraphViewSchema.ts +14 -0
  366. package/projections/graphs/views/GraphViewSchemaEdge.ts +20 -0
  367. package/projections/graphs/views/GraphViewSchemaNode.ts +14 -0
  368. package/projections/graphs/views/GraphViewSerializerOptions.ts +11 -0
  369. package/projections/graphs/views/RecursiveView.ts +22 -0
  370. package/projections/graphs/views/RelationTargetNotAView.ts +23 -0
  371. package/projections/graphs/views/TargetLabelMismatch.ts +25 -0
  372. package/projections/graphs/views/UnknownEdge.ts +23 -0
  373. package/projections/graphs/views/UnknownEdgeProperty.ts +24 -0
  374. package/projections/graphs/views/UnknownNodeProperty.ts +24 -0
  375. package/projections/graphs/views/ViewIsAlsoSchema.ts +21 -0
  376. package/projections/graphs/views/ViewOfMetadata.ts +11 -0
  377. package/projections/graphs/views/ViewOfOptions.ts +8 -0
  378. package/projections/graphs/views/ViewRootNotANode.ts +23 -0
  379. package/projections/graphs/views/declareGraphViewMember.ts +36 -0
  380. package/projections/graphs/views/follows.ts +28 -0
  381. package/projections/graphs/views/fromEdge.ts +17 -0
  382. package/projections/graphs/views/index.ts +43 -0
  383. package/projections/graphs/views/viewKey.ts +15 -0
  384. package/projections/graphs/views/viewOf.ts +50 -0
  385. package/projections/graphs/views/viewProperty.ts +16 -0
  386. package/testing/InProcessAppendMetadata.ts +119 -0
  387. package/testing/InProcessBatchAppend.ts +142 -0
  388. package/testing/InProcessEventPayload.ts +100 -0
  389. package/testing/InProcessEventReadCriteria.ts +11 -0
  390. package/testing/InProcessEventReadFilter.ts +37 -0
  391. package/testing/InProcessEventSequence.ts +63 -257
  392. package/testing/InProcessEventSequenceEnvironment.ts +16 -0
  393. package/testing/InProcessSingleAppend.ts +99 -0
  394. package/testing/for_InProcessEventSequence/when_preserving_validation_and_commit_order.spec.ts +95 -0
  395. package/testing/projections/ProjectionCapabilities.ts +23 -279
  396. package/testing/projections/ProjectionCapabilityReject.ts +5 -0
  397. package/testing/projections/ProjectionCapabilityReporter.ts +31 -0
  398. package/testing/projections/ProjectionDefinitionCapabilities.ts +45 -0
  399. package/testing/projections/ProjectionEventSchemaResolver.ts +23 -0
  400. package/testing/projections/ProjectionExpressionCapabilities.ts +101 -0
  401. package/testing/projections/ProjectionInitialValueCapabilities.ts +73 -0
  402. package/testing/projections/ProjectionMappingCapabilities.ts +85 -0
  403. package/testing/projections/ProjectionMappingValidation.ts +12 -0
  404. package/testing/projections/ProjectionReadModelCapabilities.ts +42 -0
  405. package/testing/projections/ProjectionRootCapabilities.ts +75 -0
  406. package/testing/projections/ProjectionScalarConverter.ts +106 -0
  407. package/testing/projections/ProjectionSchemaCapabilities.ts +112 -0
  408. package/testing/projections/ProjectionValueConverter.ts +37 -76
  409. package/testing/projections/for_ProjectionCapabilities/when_reporting_the_first_unsupported_operation.spec.ts +74 -0
  410. package/testing/projections/for_ProjectionValueConverter/when_converting_structured_and_scalar_values.spec.ts +64 -0
  411. 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
  }