@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
@@ -0,0 +1,73 @@
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
+ import { AutoMap } from '@cratis/chronicle.contracts';
4
+ import { eventContractPath } from '../../projections/eventContractPath.js';
5
+ import { ProjectionArithmetic } from './ProjectionArithmetic.js';
6
+ import { ProjectionMappingCapabilities } from './ProjectionMappingCapabilities.js';
7
+ /** Validates root subscriptions and accumulator interactions before child traversal. */
8
+ export class ProjectionRootCapabilities {
9
+ schema;
10
+ wire;
11
+ reject;
12
+ from;
13
+ removedWith;
14
+ constructor(schema, wire, reject) {
15
+ this.schema = schema;
16
+ this.wire = wire;
17
+ this.reject = reject;
18
+ this.from = wire.From ?? [];
19
+ this.removedWith = wire.RemovedWith ?? [];
20
+ }
21
+ validate(resolver) {
22
+ this.checkOverlaps();
23
+ const accumulators = new Set(this.from.flatMap(entry => Object.entries(entry.Value.Properties ?? {})
24
+ .filter(([, expression]) => ProjectionArithmetic.isArithmetic(expression)).map(([property]) => property)));
25
+ this.checkAccumulatorChildren(accumulators);
26
+ for (const entry of this.from)
27
+ this.checkClearedAccumulators(entry, accumulators);
28
+ const mappings = new ProjectionMappingCapabilities(this.schema, this.reject, accumulators);
29
+ for (const entry of [...this.from, ...this.removedWith])
30
+ this.subscription(entry, resolver, mappings);
31
+ }
32
+ checkOverlaps() {
33
+ for (const entry of this.from) {
34
+ if (this.removedWith.some(removal => removal.Key.Id === entry.Key.Id)) {
35
+ this.reject(eventContractPath('From', entry.Key), 'events subscribed through both From and RemovedWith require a kernel-backed test (ChronicleKernelScenario / live kernel)');
36
+ }
37
+ }
38
+ }
39
+ checkAccumulatorChildren(accumulators) {
40
+ if (accumulators.size && Object.keys(this.wire.Children ?? {}).length) {
41
+ this.reject('Children', 'root arithmetic combined with children requires a kernel-backed test');
42
+ }
43
+ }
44
+ checkClearedAccumulators(entry, accumulators) {
45
+ for (const [property, expression] of Object.entries(entry.Value.Properties ?? {})) {
46
+ if (expression === '$null' && accumulators.has(property)) {
47
+ this.reject(`${eventContractPath('From', entry.Key)}.Properties.${property}`, 'clearing an arithmetic accumulator requires a kernel-backed test; the kernel rejects arithmetic on a present null');
48
+ }
49
+ }
50
+ }
51
+ subscription(entry, resolver, mappings) {
52
+ const section = this.from.includes(entry) ? 'From' : 'RemovedWith';
53
+ const path = eventContractPath(section, entry.Key);
54
+ const eventSchema = resolver.require(entry.Key, path);
55
+ if (entry.Value.Key !== '$eventSourceId')
56
+ this.reject(`${path}.Key`, 'only $eventSourceId keys are supported');
57
+ if (entry.Value.ParentKey)
58
+ this.reject(`${path}.ParentKey`, 'parent keys require a kernel-backed test');
59
+ if (section === 'RemovedWith')
60
+ return;
61
+ this.properties(entry, eventSchema, path, mappings);
62
+ }
63
+ properties(entry, eventSchema, path, mappings) {
64
+ const properties = entry.Value.Properties ?? {};
65
+ for (const [property, expression] of Object.entries(properties)) {
66
+ mappings.check({ eventSchema, destination: property, expression, path: `${path}.Properties.${property}` });
67
+ }
68
+ if (this.wire.AutoMap !== AutoMap.Disabled && !ProjectionArithmetic.suppressesAutoMap(properties)) {
69
+ mappings.autoMap(eventSchema, properties, this.wire.NoAutoMapProperties ?? [], path);
70
+ }
71
+ }
72
+ }
73
+ //# sourceMappingURL=ProjectionRootCapabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectionRootCapabilities.js","sourceRoot":"","sources":["../../../testing/projections/ProjectionRootCapabilities.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAE3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CA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EAAE,IAAI,CAAC,CAAC;QACrG,CAAC;IACL,CAAC;CACJ"}
@@ -0,0 +1,21 @@
1
+ import type { JsonSchema } from '../../schemas/JsonSchema.js';
2
+ /** Scalar conversions shared by schema-bound input and expression evaluation. */
3
+ export declare class ProjectionScalarConverter {
4
+ static convert(value: unknown, schema: JsonSchema, eventContent: boolean): unknown;
5
+ static checkNumber(number: number, schema: JsonSchema): void;
6
+ private static invalidInteger;
7
+ private static outsideBounds;
8
+ private static boolean;
9
+ private static booleanText;
10
+ private static number;
11
+ private static numericText;
12
+ private static dateTime;
13
+ private static utcDateTime;
14
+ private static utcDateTimeText;
15
+ private static stringSchema;
16
+ private static schemaString;
17
+ private static checkEventString;
18
+ private static string;
19
+ private static guid;
20
+ }
21
+ //# sourceMappingURL=ProjectionScalarConverter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectionScalarConverter.d.ts","sourceRoot":"","sources":["../../../testing/projections/ProjectionScalarConverter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,iFAAiF;AACjF,qBAAa,yBAAyB;IAClC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAKjF;IAED,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAI3D;IAED,OAAO,CAAC,MAAM,CAAC,cAAc;IAQ7B,OAAO,CAAC,MAAM,CAAC,aAAa;IAI5B,OAAO,CAAC,MAAM,CAAC,OAAO;IAMtB,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B,OAAO,CAAC,MAAM,CAAC,MAAM;IAYrB,OAAO,CAAC,MAAM,CAAC,WAAW;IAK1B,OAAO,CAAC,MAAM,CAAC,QAAQ;IAQvB,OAAO,CAAC,MAAM,CAAC,WAAW;IAO1B,OAAO,CAAC,MAAM,CAAC,eAAe;IAI9B,OAAO,CAAC,MAAM,CAAC,YAAY;IAI3B,OAAO,CAAC,MAAM,CAAC,YAAY;IAK3B,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAM/B,OAAO,CAAC,MAAM,CAAC,MAAM;IAMrB,OAAO,CAAC,MAAM,CAAC,IAAI;CAMtB"}
@@ -0,0 +1,105 @@
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
+ /** Scalar conversions shared by schema-bound input and expression evaluation. */
4
+ export class ProjectionScalarConverter {
5
+ static convert(value, schema, eventContent) {
6
+ if (schema.type === 'boolean')
7
+ return this.boolean(value, eventContent);
8
+ if (schema.type === 'number' || schema.type === 'integer')
9
+ return this.number(value, schema, eventContent);
10
+ if (schema.format === 'date-time')
11
+ return this.dateTime(value);
12
+ return this.schemaString(value, schema, eventContent);
13
+ }
14
+ static checkNumber(number, schema) {
15
+ if (!Number.isFinite(number) || this.invalidInteger(number, schema)) {
16
+ throw new RangeError(`Projection numeric value '${number}' is outside the supported ${schema.type}/${schema.format ?? 'double'} range.`);
17
+ }
18
+ }
19
+ static invalidInteger(number, schema) {
20
+ if (schema.type !== 'integer')
21
+ return false;
22
+ if (!Number.isSafeInteger(number))
23
+ return true;
24
+ if (schema.format === 'int32')
25
+ return this.outsideBounds(number, [-2147483648, 2147483647]);
26
+ if (schema.format === 'uint32')
27
+ return this.outsideBounds(number, [0, 4294967295]);
28
+ return false;
29
+ }
30
+ static outsideBounds(number, [minimum, maximum]) {
31
+ return number < minimum || number > maximum;
32
+ }
33
+ static boolean(value, eventContent) {
34
+ if (typeof value === 'boolean')
35
+ return value;
36
+ if (!eventContent && this.booleanText(value))
37
+ return value.toLowerCase() === 'true';
38
+ throw new RangeError(`Projection boolean value '${String(value)}' requires a kernel-backed test (ChronicleKernelScenario / live kernel).`);
39
+ }
40
+ static booleanText(value) {
41
+ return typeof value === 'string' && /^(true|false)$/i.test(value);
42
+ }
43
+ static number(value, schema, eventContent) {
44
+ if (eventContent && typeof value !== 'number') {
45
+ throw new RangeError(`Projection event numeric value '${String(value)}' must be a JSON number.`);
46
+ }
47
+ if (typeof value !== 'number' && !this.numericText(value, schema)) {
48
+ throw new RangeError(`Projection numeric value '${String(value)}' is not supported by ${schema.type}/${schema.format ?? 'double'}.`);
49
+ }
50
+ const number = typeof value === 'number' ? value : Number(value);
51
+ this.checkNumber(number, schema);
52
+ return number;
53
+ }
54
+ static numericText(value, schema) {
55
+ if (typeof value !== 'string')
56
+ return false;
57
+ return schema.type === 'integer' ? /^[+-]?\d+$/.test(value) : /^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(value);
58
+ }
59
+ static dateTime(value) {
60
+ if (value === '0001-01-01T00:00:00')
61
+ return value; // Kernel default for a missing DateTime member.
62
+ if (!this.utcDateTime(value)) {
63
+ throw new RangeError(`Projection date-time value '${String(value)}' is outside the supported DateTime range or UTC ISO format.`);
64
+ }
65
+ return value;
66
+ }
67
+ static utcDateTime(value) {
68
+ // Date.parse accepts years beyond DateTime.MaxValue and normalizes invalid calendar dates.
69
+ if (!this.utcDateTimeText(value))
70
+ return false;
71
+ if (+value.slice(0, 4) < 1 || !Number.isFinite(Date.parse(value)))
72
+ return false;
73
+ return new Date(value).toISOString().slice(0, 19) === value.slice(0, 19);
74
+ }
75
+ static utcDateTimeText(value) {
76
+ return typeof value === 'string' && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/.test(value);
77
+ }
78
+ static stringSchema(schema) {
79
+ return schema.type === 'string' || (Array.isArray(schema.type) && schema.type[0] === 'string');
80
+ }
81
+ static schemaString(value, schema, eventContent) {
82
+ if (eventContent && this.stringSchema(schema))
83
+ this.checkEventString(value);
84
+ return this.string(value, schema);
85
+ }
86
+ static checkEventString(value) {
87
+ if (typeof value !== 'string') {
88
+ throw new RangeError(`Projection event string value '${String(value)}' must be a JSON string.`);
89
+ }
90
+ }
91
+ static string(value, schema) {
92
+ if (schema.format === 'guid' && typeof value === 'string')
93
+ return this.guid(value);
94
+ if (schema.type === 'string' && typeof value !== 'string')
95
+ return String(value);
96
+ return value;
97
+ }
98
+ static guid(value) {
99
+ if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value)) {
100
+ throw new RangeError(`Projection GUID value '${value}' requires a kernel-backed test (ChronicleKernelScenario / live kernel).`);
101
+ }
102
+ return value.toLowerCase();
103
+ }
104
+ }
105
+ //# sourceMappingURL=ProjectionScalarConverter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectionScalarConverter.js","sourceRoot":"","sources":["../../../testing/projections/ProjectionScalarConverter.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAIrG,iFAAiF;AACjF,MAAM,OAAO,yBAAyB;IAClC,MAAM,CAAC,OAAO,CAAC,KAAc,EAAE,MAAkB,EAAE,YAAqB;QACpE,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACxE,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QAC3G,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW;YAAE,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,MAAc,EAAE,MAAkB;QACjD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,MA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gBAAgB,CAAC,KAAc;QAC1C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,MAAM,IAAI,UAAU,CAAC,kCAAkC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QACpG,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,MAAM,CAAC,KAAc,EAAE,MAAkB;QACpD,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnF,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;QAChF,OAAO,KAAK,CAAC;IACjB,CAAC;IAEO,MAAM,CAAC,IAAI,CAAC,KAAa;QAC7B,IAAI,CAAC,iEAAiE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACjF,MAAM,IAAI,UAAU,CAAC,0BAA0B,KAAK,0EAA0E,CAAC,CAAC;QACpI,CAAC;QACD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC;IAC/B,CAAC;CACJ"}
@@ -0,0 +1,26 @@
1
+ import type { JsonSchema } from '../../schemas/JsonSchema.js';
2
+ import type { ProjectionCapabilityReject } from './ProjectionCapabilityReject.js';
3
+ /** Schema boundaries shared by root, join, and child mappings. */
4
+ export declare class ProjectionSchemaCapabilities {
5
+ static numeric(schema: JsonSchema): boolean;
6
+ static compatible(source: JsonSchema, target: JsonSchema): boolean;
7
+ static check(schema: JsonSchema, path: string, reject: ProjectionCapabilityReject): void;
8
+ static checkProtection(schema: JsonSchema, path: string, reject: ProjectionCapabilityReject): void;
9
+ static outsideIntegerRange(value: number, schema: JsonSchema): boolean;
10
+ private static doubleFormat;
11
+ private static integer;
12
+ private static sameSchema;
13
+ private static scalar;
14
+ private static nullableString;
15
+ private static checkIntegerWidth;
16
+ private static checkItems;
17
+ private static plainString;
18
+ private static textTarget;
19
+ private static integerToNumber;
20
+ private static supportedType;
21
+ private static supportedFormat;
22
+ private static checkProtected;
23
+ private static checkProperties;
24
+ private static checkAdditionalProtection;
25
+ }
26
+ //# sourceMappingURL=ProjectionSchemaCapabilities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectionSchemaCapabilities.d.ts","sourceRoot":"","sources":["../../../testing/projections/ProjectionSchemaCapabilities.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAElF,kEAAkE;AAClE,qBAAa,4BAA4B;IACrC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAG1C;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAKjE;IAED,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,0BAA0B,GAAG,IAAI,CAQvF;IAED,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,0BAA0B,GAAG,IAAI,CAKjG;IAED,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAKrE;IAED,OAAO,CAAC,MAAM,CAAC,YAAY;IAI3B,OAAO,CAAC,MAAM,CAAC,OAAO;IAItB,OAAO,CAAC,MAAM,CAAC,UAAU;IAIzB,OAAO,CAAC,MAAM,CAAC,MAAM;IAIrB,OAAO,CAAC,MAAM,CAAC,cAAc;IAI7B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAIhC,OAAO,CAAC,MAAM,CAAC,UAAU;IAIzB,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B,OAAO,CAAC,MAAM,CAAC,UAAU;IAKzB,OAAO,CAAC,MAAM,CAAC,eAAe;IAK9B,OAAO,CAAC,MAAM,CAAC,aAAa;IAM5B,OAAO,CAAC,MAAM,CAAC,eAAe;IAM9B,OAAO,CAAC,MAAM,CAAC,cAAc;IAI7B,OAAO,CAAC,MAAM,CAAC,eAAe;IAI9B,OAAO,CAAC,MAAM,CAAC,yBAAyB;CAK3C"}
@@ -0,0 +1,109 @@
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
+ /** Schema boundaries shared by root, join, and child mappings. */
4
+ export class ProjectionSchemaCapabilities {
5
+ static numeric(schema) {
6
+ if (schema.type === 'number')
7
+ return this.doubleFormat(schema);
8
+ return this.integer(schema);
9
+ }
10
+ static compatible(source, target) {
11
+ if (this.sameSchema(source, target))
12
+ return this.scalar(source);
13
+ if (this.plainString(source))
14
+ return this.textTarget(target);
15
+ if (source.type === 'string' && source.format === 'guid')
16
+ return this.plainString(target);
17
+ return this.integerToNumber(source, target);
18
+ }
19
+ static check(schema, path, reject) {
20
+ this.checkProtected(schema, path, reject);
21
+ if (!this.supportedType(schema.type) || !this.supportedFormat(schema)) {
22
+ reject(path, `schema type/format '${schema.type ?? 'unknown'}${schema.format ? `/${schema.format}` : ''}' requires a kernel-backed test`);
23
+ }
24
+ this.checkIntegerWidth(schema, path, reject);
25
+ this.checkItems(schema, path, reject);
26
+ if (schema.type === 'object')
27
+ this.checkProperties(schema, path, reject);
28
+ }
29
+ static checkProtection(schema, path, reject) {
30
+ this.checkProtected(schema, path, reject);
31
+ for (const [name, property] of Object.entries(schema.properties ?? {}))
32
+ this.checkProtection(property, `${path}.${name}`, reject);
33
+ if (schema.items)
34
+ this.checkProtection(schema.items, `${path}.items`, reject);
35
+ this.checkAdditionalProtection(schema, path, reject);
36
+ }
37
+ static outsideIntegerRange(value, schema) {
38
+ if (!Number.isSafeInteger(value))
39
+ return true;
40
+ if (schema.format === 'int32')
41
+ return value < -2147483648 || value > 2147483647;
42
+ if (schema.format === 'uint32')
43
+ return value < 0 || value > 4294967295;
44
+ return false;
45
+ }
46
+ static doubleFormat(schema) {
47
+ return !schema.format || schema.format === 'double';
48
+ }
49
+ static integer(schema) {
50
+ return schema.type === 'integer' && ['int32', 'uint32'].includes(schema.format ?? '');
51
+ }
52
+ static sameSchema(source, target) {
53
+ return JSON.stringify(source.type) === JSON.stringify(target.type) && source.format === target.format;
54
+ }
55
+ static scalar(schema) {
56
+ return schema.type !== 'object' && schema.type !== 'array';
57
+ }
58
+ static nullableString(type) {
59
+ return Array.isArray(type) && type[0] === 'string' && type[1] === 'null';
60
+ }
61
+ static checkIntegerWidth(schema, path, reject) {
62
+ if (schema.type === 'integer' && !this.numeric(schema))
63
+ reject(path, 'integer width requires a kernel-backed test');
64
+ }
65
+ static checkItems(schema, path, reject) {
66
+ if (schema.type === 'array' && schema.items)
67
+ this.check(schema.items, path, reject);
68
+ }
69
+ static plainString(schema) {
70
+ return schema.type === 'string' && !schema.format;
71
+ }
72
+ static textTarget(target) {
73
+ if (this.nullableString(target.type))
74
+ return true;
75
+ return this.numeric(target);
76
+ }
77
+ static integerToNumber(source, target) {
78
+ if (!this.integer(source))
79
+ return false;
80
+ return target.type === 'number' && this.numeric(target);
81
+ }
82
+ static supportedType(type) {
83
+ if (!type || type === 'null')
84
+ return false;
85
+ if (!Array.isArray(type))
86
+ return true;
87
+ return type.length === 2 && this.nullableString(type);
88
+ }
89
+ static supportedFormat(schema) {
90
+ if (!schema.format)
91
+ return true;
92
+ const types = { guid: 'string', 'date-time': 'string', double: 'number', int32: 'integer', uint32: 'integer' };
93
+ return Object.hasOwn(types, schema.format) && schema.type === types[schema.format];
94
+ }
95
+ static checkProtected(schema, path, reject) {
96
+ if (schema.compliance?.length || schema.security?.length)
97
+ reject(path, 'protected fields require a kernel-backed test');
98
+ }
99
+ static checkProperties(schema, path, reject) {
100
+ for (const property of Object.values(schema.properties ?? {}))
101
+ this.check(property, path, reject);
102
+ }
103
+ static checkAdditionalProtection(schema, path, reject) {
104
+ if (schema.additionalProperties && typeof schema.additionalProperties === 'object') {
105
+ this.checkProtection(schema.additionalProperties, `${path}.additionalProperties`, reject);
106
+ }
107
+ }
108
+ }
109
+ //# sourceMappingURL=ProjectionSchemaCapabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProjectionSchemaCapabilities.js","sourceRoot":"","sources":["../../../testing/projections/ProjectionSchemaCapabilities.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAKrG,kEAAkE;AAClE,MAAM,OAAO,4BAA4B;IACrC,MAAM,CAAC,OAAO,CAAC,MAAkB;QAC7B,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAC/D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,MAAkB,EAAE,MAAkB;QACpD,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC;YAAE,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAChE,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC7D,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM;YAAE,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC1F,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,MAAkB,EAAE,IAAY,EAAE,MAAkC;QAC7E,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1C,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<string, unknown>;
10
10
  static convert(value: unknown, schema: JsonSchema, eventContent?: boolean, expression?: boolean): unknown;
11
11
  static checkNumber(number: number, schema: JsonSchema): void;
12
+ private static isObject;
13
+ private static isConcept;
14
+ private static object;
15
+ private static array;
16
+ private static properties;
12
17
  }
13
18
  //# sourceMappingURL=ProjectionValueConverter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectionValueConverter.d.ts","sourceRoot":"","sources":["../../../testing/projections/ProjectionValueConverter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,uGAAuG;AACvG,qBAAa,wBAAwB;IACjC,8FAA8F;IAC9F,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAO/C;IAED,kGAAkG;IAClG,OAAO,CAAC,MAAM,CAAC,SAAS;IAKxB,uFAAuF;IACvF,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAcjF;IAED,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,UAAQ,EAAE,UAAU,UAAO,GAAG,OAAO,CA+DnG;IAED,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAM3D;CACJ"}
1
+ {"version":3,"file":"ProjectionValueConverter.d.ts","sourceRoot":"","sources":["../../../testing/projections/ProjectionValueConverter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAG9D,uGAAuG;AACvG,qBAAa,wBAAwB;IACjC,8FAA8F;IAC9F,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAO/C;IAED,kGAAkG;IAClG,OAAO,CAAC,MAAM,CAAC,SAAS;IAKxB,uFAAuF;IACvF,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGjF;IAED,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,UAAQ,EAAE,UAAU,UAAO,GAAG,OAAO,CASnG;IAED,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAE3D;IAED,OAAO,CAAC,MAAM,CAAC,QAAQ;IAIvB,OAAO,CAAC,MAAM,CAAC,SAAS;IAKxB,OAAO,CAAC,MAAM,CAAC,MAAM;IAKrB,OAAO,CAAC,MAAM,CAAC,KAAK;IAIpB,OAAO,CAAC,MAAM,CAAC,UAAU;CAU5B"}
@@ -1,5 +1,6 @@
1
1
  // Copyright (c) Cratis. All rights reserved.
2
2
  // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
+ import { ProjectionScalarConverter } from './ProjectionScalarConverter.js';
3
4
  /** Converts values only in the numeric and scalar schema subset admitted by ProjectionCapabilities. */
4
5
  export class ProjectionValueConverter {
5
6
  /** Kernel JsonSchemaExtensions.GetDefaultValue: only nullable schemas have a null default. */
@@ -23,100 +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, schema) {
26
- const serialized = content !== null && typeof content === 'object' && !Array.isArray(content)
27
- ? content : {};
28
- const result = 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)
33
- result[name] = this.convert(value, property, true, false);
34
- else {
35
- const fallback = this.defaultValue(property);
36
- if (fallback !== null && fallback !== undefined)
37
- result[name] = fallback;
38
- }
39
- }
40
- return result;
27
+ const serialized = this.isObject(content) ? content : {};
28
+ return this.properties(serialized, schema, true);
41
29
  }
42
30
  static convert(value, schema, eventContent = false, expression = true) {
43
31
  if (value == null)
44
32
  return null;
45
33
  // Concept conversion belongs to expression evaluation, never schema-bound input deserialization.
46
- if (expression && schema.type !== 'object' && schema.type !== 'array' &&
47
- typeof value === 'object' && !Array.isArray(value) && Object.keys(value).length === 1 && 'value' in value) {
34
+ if (expression && this.isConcept(value, schema)) {
48
35
  return this.convert(value.value, schema, eventContent, expression);
49
36
  }
50
- if (schema.type === 'object' && typeof value === 'object' && !Array.isArray(value)) {
51
- const input = value;
52
- if (schema.additionalProperties || !schema.properties)
53
- return structuredClone(input);
54
- const result = Object.create(null);
55
- for (const [name, property] of Object.entries(schema.properties)) {
56
- const source = this.sourceKey(input, name);
57
- if (source !== undefined && input[source] != null)
58
- result[name] = this.convert(input[source], property, eventContent, false);
59
- else {
60
- const fallback = this.defaultValue(property);
61
- if (fallback !== null && fallback !== undefined)
62
- result[name] = fallback;
63
- }
64
- }
65
- return result;
66
- }
67
- if (schema.type === 'array' && Array.isArray(value)) {
68
- return value.map(item => schema.items ? this.convert(item, schema.items, eventContent, false) : structuredClone(item));
69
- }
70
- if (schema.type === 'boolean') {
71
- if (typeof value === 'boolean')
72
- return value;
73
- if (!eventContent && typeof value === 'string' && /^(true|false)$/i.test(value))
74
- return value.toLowerCase() === 'true';
75
- throw new RangeError(`Projection boolean value '${String(value)}' requires a kernel-backed test (ChronicleKernelScenario / live kernel).`);
76
- }
77
- if (schema.type === 'number' || schema.type === 'integer') {
78
- if (eventContent && typeof value !== 'number') {
79
- throw new RangeError(`Projection event numeric value '${String(value)}' must be a JSON number.`);
80
- }
81
- if (typeof value !== 'number' && (typeof value !== 'string' ||
82
- !(schema.type === 'integer' ? /^[+-]?\d+$/.test(value) : /^[+-]?(?:\d+(?:\.\d+)?|\.\d+)$/.test(value)))) {
83
- throw new RangeError(`Projection numeric value '${String(value)}' is not supported by ${schema.type}/${schema.format ?? 'double'}.`);
84
- }
85
- const number = typeof value === 'number' ? value : Number(value);
86
- this.checkNumber(number, schema);
87
- return number;
88
- }
89
- if (schema.format === 'date-time') {
90
- if (value === '0001-01-01T00:00:00')
91
- return value; // Kernel default for a missing DateTime member.
92
- // Bound the accepted subset to UTC ISO text with a four-digit year. Date.parse accepts
93
- // years beyond DateTime.MaxValue, and silently normalizes some invalid calendar dates.
94
- if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/.test(value) ||
95
- +value.slice(0, 4) < 1 || !Number.isFinite(Date.parse(value)) ||
96
- new Date(value).toISOString().slice(0, 19) !== value.slice(0, 19)) {
97
- throw new RangeError(`Projection date-time value '${String(value)}' is outside the supported DateTime range or UTC ISO format.`);
98
- }
99
- return value;
100
- }
101
- if (eventContent && (schema.type === 'string' || (Array.isArray(schema.type) && schema.type[0] === 'string')) && typeof value !== 'string') {
102
- throw new RangeError(`Projection event string value '${String(value)}' must be a JSON string.`);
103
- }
104
- if (schema.format === 'guid' && typeof value === 'string') {
105
- if (!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value)) {
106
- throw new RangeError(`Projection GUID value '${value}' requires a kernel-backed test (ChronicleKernelScenario / live kernel).`);
107
- }
108
- return value.toLowerCase();
109
- }
110
- if (schema.type === 'string' && typeof value !== 'string')
111
- return String(value);
112
- return value;
37
+ if (schema.type === 'object' && this.isObject(value))
38
+ return this.object(value, schema, eventContent);
39
+ if (schema.type === 'array' && Array.isArray(value))
40
+ return this.array(value, schema, eventContent);
41
+ return ProjectionScalarConverter.convert(value, schema, eventContent);
113
42
  }
114
43
  static checkNumber(number, schema) {
115
- if (!Number.isFinite(number) || (schema.type === 'integer' && (!Number.isSafeInteger(number) ||
116
- (schema.format === 'int32' && (number < -2147483648 || number > 2147483647)) ||
117
- (schema.format === 'uint32' && (number < 0 || number > 4294967295))))) {
118
- throw new RangeError(`Projection numeric value '${number}' is outside the supported ${schema.type}/${schema.format ?? 'double'} range.`);
44
+ ProjectionScalarConverter.checkNumber(number, schema);
45
+ }
46
+ static isObject(value) {
47
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
48
+ }
49
+ static isConcept(value, schema) {
50
+ if (schema.type === 'object' || schema.type === 'array')
51
+ return false;
52
+ return this.isObject(value) && Object.keys(value).length === 1 && 'value' in value;
53
+ }
54
+ static object(input, schema, eventContent) {
55
+ if (schema.additionalProperties || !schema.properties)
56
+ return structuredClone(input);
57
+ return this.properties(input, schema, eventContent);
58
+ }
59
+ static array(input, schema, eventContent) {
60
+ return input.map(item => schema.items ? this.convert(item, schema.items, eventContent, false) : structuredClone(item));
61
+ }
62
+ static properties(input, schema, eventContent) {
63
+ const result = Object.create(null);
64
+ for (const [name, property] of Object.entries(schema.properties ?? {})) {
65
+ const source = this.sourceKey(input, name);
66
+ const value = source === undefined ? null : input[source];
67
+ const converted = value == null ? this.defaultValue(property) : this.convert(value, property, eventContent, false);
68
+ if (converted != null)
69
+ result[name] = converted;
119
70
  }
71
+ return result;
120
72
  }
121
73
  }
122
74
  //# sourceMappingURL=ProjectionValueConverter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectionValueConverter.js","sourceRoot":"","sources":["../../../testing/projections/ProjectionValueConverter.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAIrG,uGAAuG;AACvG,MAAM,OAAO,wBAAwB;IACjC,8FAA8F;IAC9F,MAAM,CAAC,YAAY,CAAC,MAAkB;QAClC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5E,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM;YAAE,OAAO,sCAAsC,CAAC;QAC5E,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW;YAAE,OAAO,q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