@reventlessdev/reventless-aws 3.0.0-alpha.344 → 3.0.0-alpha.345

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 (232) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +11 -11
  3. package/scripts/ProvisionIdentity.res +8 -3
  4. package/src/Platform.res +327 -328
  5. package/src/Platform.res.mjs +4 -2
  6. package/src/Platform_Casts.res +13 -4
  7. package/src/adapter/Api/AppSyncEventsSigner_Ops.res +8 -4
  8. package/src/adapter/Api/AppSync_EventsApi.res +12 -14
  9. package/src/adapter/Api/AppSync_Resolver_Native.res +3 -4
  10. package/src/adapter/Api/AppSync_Resolver_Retrying.res +78 -70
  11. package/src/adapter/Api/AppSync_SourceApiAssociation_Retrying.res +11 -8
  12. package/src/adapter/Api/Platform_AdminScan_Ops.res +15 -14
  13. package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +10 -2
  14. package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +40 -50
  15. package/src/adapter/Api/Platform_UIFragments_Lambda.res +39 -32
  16. package/src/adapter/Api/Platform_UIFragments_Lambda_Ops.res +5 -2
  17. package/src/adapter/Auth/Auth_ActiveRolePoolAttachment.res +0 -1
  18. package/src/adapter/Auth/Auth_ActiveRoleStore.res +1 -2
  19. package/src/adapter/Auth/Auth_ActiveRoleStore_Schema.res +1 -4
  20. package/src/adapter/Auth/Auth_ActiveRoleTrigger_Ops.res +5 -2
  21. package/src/adapter/Auth/Auth_Cognito.res +3 -9
  22. package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res +1 -4
  23. package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res +3 -1
  24. package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res +1 -4
  25. package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res +7 -4
  26. package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res +6 -1
  27. package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res +7 -4
  28. package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res +24 -18
  29. package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res +9 -4
  30. package/src/adapter/CommandTopic/CommandTopicRegistry.res +1 -4
  31. package/src/adapter/Counter/CounterHandler_DynamoDbStream.res +15 -15
  32. package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res +9 -5
  33. package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +179 -213
  34. package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res +5 -5
  35. package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res +6 -2
  36. package/src/adapter/EventCollector/EventCollectorChannel_SQS.res +14 -7
  37. package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res +14 -7
  38. package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res +6 -3
  39. package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res +6 -1
  40. package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res +13 -17
  41. package/src/adapter/EventLog/EventLogStorage_Postgres.res +7 -4
  42. package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res +12 -7
  43. package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync_Ops.res +4 -2
  44. package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res +3 -2
  45. package/src/adapter/EventTopic/EventTopicPublisher_SNS.res +20 -12
  46. package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res +21 -9
  47. package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res +5 -3
  48. package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver.res +6 -3
  49. package/src/adapter/Mcp/MCP_Lambda.res +31 -46
  50. package/src/adapter/Messaging/Messaging_Ses_Backend.res +11 -7
  51. package/src/adapter/Messaging/Messaging_Ses_Backend.res.mjs +2 -4
  52. package/src/adapter/Monitoring/Monitoring_CloudWatch.res +16 -16
  53. package/src/adapter/Postgres/PgChangeFeedRelay_Builder.res +5 -10
  54. package/src/adapter/Postgres/PgChangeFeedRelay_Runtime.res +4 -2
  55. package/src/adapter/Postgres/PgConnection.res +6 -5
  56. package/src/adapter/Postgres/PgMigration_Builder.res +4 -8
  57. package/src/adapter/Postgres/PgRuntime.res +4 -7
  58. package/src/adapter/QueryDb/PgQueryResolver_Builder.res +9 -11
  59. package/src/adapter/QueryDb/PgQueryResolver_Lambda.res +22 -21
  60. package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res +114 -111
  61. package/src/adapter/QueryDb/QueryDbResolvers_Lambda.res +1 -7
  62. package/src/adapter/QueryDb/QueryDbStorage.res +4 -2
  63. package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res +23 -24
  64. package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res +8 -2
  65. package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res +71 -73
  66. package/src/adapter/QueryDb/QueryDbStorage_Postgres.res +5 -2
  67. package/src/adapter/QueryDb/QueryInterceptor_Provisioning.res +1 -4
  68. package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res +8 -2
  69. package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +73 -81
  70. package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res +72 -78
  71. package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +44 -67
  72. package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res +44 -67
  73. package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +53 -82
  74. package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res +47 -77
  75. package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +18 -11
  76. package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res +80 -97
  77. package/src/adapter/Runtime/CounterEntryPoint_Ops.res +2 -7
  78. package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res +16 -10
  79. package/src/adapter/Runtime/EventCollectorEntryPoint_Ops.res +24 -15
  80. package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +17 -37
  81. package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +31 -57
  82. package/src/adapter/Runtime/EventMapperEntryPoint_Ops.res +18 -24
  83. package/src/adapter/Runtime/ExtensionPointEntryPoint_Ops.res +1 -5
  84. package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res +4 -3
  85. package/src/adapter/Runtime/HeartbeatEntryPoint.res +0 -1
  86. package/src/adapter/Runtime/PgChangeFeedRelayEntryPoint.res +4 -2
  87. package/src/adapter/Runtime/PgMigrationEntryPoint.res +0 -1
  88. package/src/adapter/Runtime/PgQueryResolverEntryPoint_Ops.res +3 -2
  89. package/src/adapter/Runtime/PluginExtensionPointEntryPoint.res +1 -2
  90. package/src/adapter/Runtime/ProjectionEntryPoint_Ops.res +4 -5
  91. package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +22 -10
  92. package/src/adapter/Runtime/RuntimeExtensionEntryPoint_Ops.res +8 -2
  93. package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res +14 -31
  94. package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +16 -17
  95. package/src/adapter/Runtime/StateViewSliceEntryPoint_Ops.res +10 -9
  96. package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res +46 -52
  97. package/src/adapter/Runtime/StreamRoutedEntryPoint_Ops.res +36 -41
  98. package/src/adapter/Runtime/TaskBucketEntryPoint_Ops.res +31 -37
  99. package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res +6 -7
  100. package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res +4 -6
  101. package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res +2 -6
  102. package/src/adapter/StateTopic/StateTopic_AppSync.res +21 -16
  103. package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res +36 -32
  104. package/src/adapter/Task/TaskBucket_S3.res +6 -1
  105. package/src/adapter/Upload/Upload_Claim_S3.res +17 -20
  106. package/src/adapter/Upload/Upload_Claim_S3_Ops.res +5 -2
  107. package/src/adapter/Upload/Upload_Presign_S3.res +51 -49
  108. package/src/capability/Capability_Geocoding_AwsLocation.res +4 -1
  109. package/src/capability/Capability_Messaging.res +4 -5
  110. package/src/capability/Capability_Messaging_Ses.res +3 -1
  111. package/src/capability/Capability_ObjectStore_S3.res +1 -7
  112. package/src/components/Api/AppSync_Adapter.res +28 -41
  113. package/src/components/Api/AppSync_SdlDecorate.res +38 -30
  114. package/src/components/AutomationSlice_Builder.res +6 -4
  115. package/src/components/ExtensionPoint_Builder.res +9 -10
  116. package/src/components/InboundTranslationSlice_Builder.res +7 -8
  117. package/src/components/OutboundTranslationSlice_Builder.res +14 -8
  118. package/src/components/OutboundTranslationSlice_Builder.res.mjs +1 -1
  119. package/src/components/SideEffectHandler_Single.res +4 -4
  120. package/src/components/StateViewSlice_Builder.res +6 -4
  121. package/src/components/StateViewSlice_Builder_Stream.res +6 -4
  122. package/src/components/Task_Builder_PerBucket.res +10 -11
  123. package/src/plugin/cloner/ClonerRunner_Fargate.res +3 -10
  124. package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res +1 -4
  125. package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res +5 -5
  126. package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res +19 -21
  127. package/src/plugin/runtime/PluginRuntime_Builder.res +167 -188
  128. package/src/plugin/runtime/Util_PluginMessage_Runtime.res +6 -5
  129. package/src/plugin/stack/Plugin_Stack.res +104 -103
  130. package/src/util/Util_AlarmSpec.res +2 -1
  131. package/src/util/Util_AppSync.res +8 -2
  132. package/src/util/Util_AppSync_Caller.res +15 -14
  133. package/src/util/Util_Bundle.res +46 -42
  134. package/src/util/Util_CognitoGroupUser_Runtime.res +32 -34
  135. package/src/util/Util_Cognito_Runtime.res +11 -7
  136. package/src/util/Util_DeadLetterQueue.res +12 -2
  137. package/src/util/Util_DynamoDb.res +5 -3
  138. package/src/util/Util_DynamoDbStream.res +7 -3
  139. package/src/util/Util_DynamoDbStream_Runtime.res +1 -2
  140. package/src/util/Util_DynamoDb_Runtime.res +23 -41
  141. package/src/util/Util_HostUiDomain.res +6 -1
  142. package/src/util/Util_Kinesis_Runtime.res +10 -11
  143. package/src/util/Util_Lambda.res +12 -5
  144. package/src/util/Util_LambdaEnvBudget.res +5 -5
  145. package/src/util/Util_LambdaLogging.res +1 -2
  146. package/src/util/Util_LogGroup_Adopting.res +1 -4
  147. package/src/util/Util_ResourceNaming.res +1 -2
  148. package/src/util/Util_SNS.res +8 -3
  149. package/src/util/Util_SNS_FIFO.res +1 -1
  150. package/src/util/Util_SNS_Runtime.res +11 -10
  151. package/src/util/Util_SQS.res +4 -2
  152. package/src/util/Util_SQS_FIFO.res +5 -2
  153. package/src/util/Util_SQS_Runtime.res +37 -36
  154. package/src/util/Util_ShellConfig.res +3 -2
  155. package/src/util/Util_StaticBundle.res +1 -3
  156. package/src/util/Util_StoreLayout.res +4 -1
  157. package/tests/AWS_TagsTest.res +16 -5
  158. package/tests/AppSyncEventsSigner_OpsTest.res +11 -2
  159. package/tests/AppSync_AdapterTest.res +203 -224
  160. package/tests/AppSync_Resolver_RetryingTest.res +64 -44
  161. package/tests/AppSync_RetirementNarrowingTest.res +59 -46
  162. package/tests/AppSync_SdlDecorateTest.res +22 -20
  163. package/tests/AppSync_SourceApiAssociation_RetryingTest.res +40 -22
  164. package/tests/Auth_ActiveRolePoolAttachmentTest.res +114 -107
  165. package/tests/Auth_ActiveRoleStoreTest.res +12 -9
  166. package/tests/Auth_ActiveRoleStore_SchemaTest.res +2 -1
  167. package/tests/Auth_ActiveRoleTrigger_OpsTest.res +20 -16
  168. package/tests/Auth_CognitoTest.res +31 -46
  169. package/tests/AutomationSliceEntryPoint_OpsTest.res +69 -67
  170. package/tests/BakeConvergenceTest.res +22 -25
  171. package/tests/Capability_MessagingTest.res +28 -12
  172. package/tests/CommandTopicQueuePolicyTest.res +1 -2
  173. package/tests/CounterEntryPoint_OpsTest.res +3 -7
  174. package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res +306 -210
  175. package/tests/EventCollectorConnectLambdaPreviewTest.res +14 -7
  176. package/tests/EventCollectorEntryPoint_OpsTest.res +12 -4
  177. package/tests/EventCollectorPluginDefinitionAssetTest.res +18 -11
  178. package/tests/EventCollectorReadyGateTest.res +5 -4
  179. package/tests/EventLogStorage_DynamoDb_RuntimeTest.res +1 -2
  180. package/tests/EventMapperEntryPoint_OpsTest.res +1 -3
  181. package/tests/ExtensionPointEntryPoint_OpsTest.res +1 -4
  182. package/tests/HandlerFactoryDispatchTest.res +97 -70
  183. package/tests/MCP_LambdaTest.res +16 -27
  184. package/tests/PgChangeFeedRelay_IntegrationTest.res +123 -93
  185. package/tests/PgChangeFeedRelay_RuntimeTest.res +13 -10
  186. package/tests/PgMigrationEntryPoint_IntegrationTest.res +0 -1
  187. package/tests/PgPipeline_IntegrationTest.res +80 -66
  188. package/tests/PgQueryDbUnion_IntegrationTest.res +1 -2
  189. package/tests/PgQueryResolverEntryPoint_OpsTest.res +2 -6
  190. package/tests/PgQueryResolver_LambdaTest.res +41 -24
  191. package/tests/Platform_AdminScan_OpsTest.res +4 -1
  192. package/tests/Platform_ComponentDefinitions_Lambda_OpsTest.res +137 -129
  193. package/tests/ProjectionEntryPoint_DisplayNameTest.res +7 -3
  194. package/tests/ProjectionEntryPoint_UnionStampTest.res +3 -2
  195. package/tests/ProvisionIdentityTest.res +2 -6
  196. package/tests/QueryDbOwnerIndexTableTest.res +6 -4
  197. package/tests/QueryDbResolvers_AppSyncTest.res +23 -16
  198. package/tests/QueryInterceptor_LambdaTest.res +11 -13
  199. package/tests/ReadModelEntryPoint_OpsTest.res +43 -41
  200. package/tests/RuntimeExtensionEntryPoint_OpsTest.res +4 -3
  201. package/tests/SideEffectEntryPoint_OpsTest.res +23 -18
  202. package/tests/StateChangeDescriptorParityTest.res +28 -26
  203. package/tests/StateTopicKeySchemaTest.res +18 -15
  204. package/tests/StateViewSliceEntryPoint_OpsTest.res +55 -44
  205. package/tests/TaskBucketEntryPoint_OpsTest.res +13 -13
  206. package/tests/Upload_ClaimTest.res +3 -3
  207. package/tests/Util_AwsErrorTest.res +4 -7
  208. package/tests/Util_BundleDependencyClosureTest.res +15 -3
  209. package/tests/Util_BundleEsmLoaderTest.res +3 -3
  210. package/tests/Util_BundleResolveTest.res +4 -6
  211. package/tests/Util_BundleRuntimeExtensionTest.res +17 -18
  212. package/tests/Util_DcbMetricsTest.res +6 -6
  213. package/tests/Util_DynamoDbStreamTest.res +4 -5
  214. package/tests/Util_DynamoDbTest.res +3 -2
  215. package/tests/Util_LambdaEnvBudgetTest.res +22 -18
  216. package/tests/Util_LambdaLoggingTest.res +9 -8
  217. package/tests/Util_LogGroup_AdoptingTest.res +10 -5
  218. package/tests/Util_LogRetentionTest.res +6 -2
  219. package/tests/Util_OwnerScopeEnvTest.res +10 -8
  220. package/tests/Util_SQS_RuntimeTest.res +5 -7
  221. package/tests/Util_ShellConfigTest.res +7 -17
  222. package/tests/Util_StaticBundleTest.res +3 -8
  223. package/tests/Util_StoreLayoutTest.res +17 -12
  224. package/tests/integration/AggregateEntryPoint_IntegrationTest.res +1 -4
  225. package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res +15 -15
  226. package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res +296 -232
  227. package/tests/integration/DcbIntegrationHarness.res +8 -8
  228. package/tests/integration/EpCompositeSlice.res +16 -8
  229. package/tests/integration/QueryDbUnion_DynamoDb_IntegrationTest.res +8 -10
  230. package/tests/integration/StateViewSliceEntryPoint_IntegrationTest.res +10 -10
  231. package/tests/integration/SvsTestSlice_Projection.res +1 -3
  232. package/tests/util/Util_AlarmSpecTest.res +62 -49
@@ -20,21 +20,27 @@ describe("QueryDbResolvers_AppSync.internalRowRequiredAttr", () => {
20
20
  })
21
21
 
22
22
  describe("AppSync_Resolver_Retrying.Functions.listAllItemsConnection", () => {
23
- testSync("with ~requireAttribute emits an attribute_exists filter that excludes internal rows", () => {
24
- let code =
25
- AppSync_Resolver_Retrying.Functions.listAllItemsConnection(
26
- ~labelField="name",
27
- ~requireAttribute="name",
28
- )->codeOf
29
- expect(code->String.includes("attribute_exists(#name)"))->toBe(true)
30
- expect(code->String.includes("names['#name'] = 'name'"))->toBe(true)
31
- })
23
+ testSync(
24
+ "with ~requireAttribute emits an attribute_exists filter that excludes internal rows",
25
+ () => {
26
+ let code =
27
+ AppSync_Resolver_Retrying.Functions.listAllItemsConnection(
28
+ ~labelField="name",
29
+ ~requireAttribute="name",
30
+ )->codeOf
31
+ expect(code->String.includes("attribute_exists(#name)"))->toBe(true)
32
+ expect(code->String.includes("names['#name'] = 'name'"))->toBe(true)
33
+ },
34
+ )
32
35
 
33
- testSync("without ~requireAttribute emits no attribute_exists filter (default read models unchanged)", () => {
34
- let code =
35
- AppSync_Resolver_Retrying.Functions.listAllItemsConnection(~labelField="name")->codeOf
36
- expect(code->String.includes("attribute_exists"))->toBe(false)
37
- })
36
+ testSync(
37
+ "without ~requireAttribute emits no attribute_exists filter (default read models unchanged)",
38
+ () => {
39
+ let code =
40
+ AppSync_Resolver_Retrying.Functions.listAllItemsConnection(~labelField="name")->codeOf
41
+ expect(code->String.includes("attribute_exists"))->toBe(false)
42
+ },
43
+ )
38
44
  })
39
45
 
40
46
  // Tripwires for the Scan connection's paging. The behaviour itself is exercised
@@ -56,8 +62,9 @@ describe("listAllItemsConnection — paging", () => {
56
62
  expect(
57
63
  code->String.includes("parts.length > 0 ? ((_backward ? _upTo : _first + _from) > 1000"),
58
64
  )->toBe(true)
59
- expect(code->String.includes("const _page = _backward ? _rest : _rest.slice(0, _first);"))
60
- ->toBe(true)
65
+ expect(
66
+ code->String.includes("const _page = _backward ? _rest : _rest.slice(0, _first);"),
67
+ )->toBe(true)
61
68
  expect(code->String.includes("hasNextPage: _more || !!_next,"))->toBe(true)
62
69
  })
63
70
 
@@ -54,14 +54,12 @@ describe("interceptor handler", () => {
54
54
 
55
55
  testPromise("an allowing hook is consulted and the read proceeds", async () => {
56
56
  let seen = ref([])
57
- QueryDb_Callback.registerQueryInterceptor(async (
58
- ~identity as _,
59
- ~readModelName,
60
- ~args as _,
61
- ) => {
62
- seen := seen.contents->Array.concat([readModelName])
63
- QueryDb_Callback.Allow
64
- })
57
+ QueryDb_Callback.registerQueryInterceptor(
58
+ async (~identity as _, ~readModelName, ~args as _) => {
59
+ seen := seen.contents->Array.concat([readModelName])
60
+ QueryDb_Callback.Allow
61
+ },
62
+ )
65
63
  let allowed = await QueryInterceptor_Lambda.handler(read(~readModelName="Order"), context)
66
64
  expect((allowed, seen.contents))->toEqual((true, ["Order"]))
67
65
  })
@@ -70,11 +68,11 @@ describe("interceptor handler", () => {
70
68
  // The refusal has to surface as a thrown error: the pipeline's response
71
69
  // function turns `ctx.error` into a GraphQL field error, and a returned
72
70
  // `false` would read as a successful read of nothing.
73
- QueryDb_Callback.registerQueryInterceptor(async (
74
- ~identity as _,
75
- ~readModelName as _,
76
- ~args as _,
77
- ) => QueryDb_Callback.Deny("over the allowance"))
71
+ QueryDb_Callback.registerQueryInterceptor(
72
+ async (~identity as _, ~readModelName as _, ~args as _) => QueryDb_Callback.Deny(
73
+ "over the allowance",
74
+ ),
75
+ )
78
76
  let message = try {
79
77
  let _ = await QueryInterceptor_Lambda.handler(read(), context)
80
78
  "did not throw"
@@ -18,32 +18,33 @@ describe("ReadModelEntryPoint_Ops.parseHandlerConfig", () => {
18
18
  })
19
19
 
20
20
  testSync("decodes a full entry incl. attribution and Postgres fields", () => {
21
- let config = obj([
22
- (
23
- "handlers",
24
- JSON.Encode.array([
25
- obj([
26
- ("specModule", str("@x/spec/src/ReadModel/Products.res.mjs")),
27
- ("mappingsModule", str("@x/spec/src/ReadModel/Products_Projections.res.mjs")),
28
- ("queryDbTableName", str("Products-abc")),
29
- ("sourceUrn", str("arn:aws:sqs:eu-west-1:1:q")),
30
- ("comp", str("EventCollector(ProductsEC)")),
31
- ("plugin", str("Catalog")),
32
- ("stateTopicName", str("catalogProducts")),
33
- (
34
- "pgConnection",
35
- obj([
36
- ("host", str("db.local")),
37
- ("port", JSON.Encode.int(5432)),
38
- ("database", str("app")),
39
- ("username", str("master")),
40
- ("secretArn", str("arn:secret")),
41
- ]),
42
- ),
21
+ let config =
22
+ obj([
23
+ (
24
+ "handlers",
25
+ JSON.Encode.array([
26
+ obj([
27
+ ("specModule", str("@x/spec/src/ReadModel/Products.res.mjs")),
28
+ ("mappingsModule", str("@x/spec/src/ReadModel/Products_Projections.res.mjs")),
29
+ ("queryDbTableName", str("Products-abc")),
30
+ ("sourceUrn", str("arn:aws:sqs:eu-west-1:1:q")),
31
+ ("comp", str("EventCollector(ProductsEC)")),
32
+ ("plugin", str("Catalog")),
33
+ ("stateTopicName", str("catalogProducts")),
34
+ (
35
+ "pgConnection",
36
+ obj([
37
+ ("host", str("db.local")),
38
+ ("port", JSON.Encode.int(5432)),
39
+ ("database", str("app")),
40
+ ("username", str("master")),
41
+ ("secretArn", str("arn:secret")),
42
+ ]),
43
+ ),
44
+ ]),
43
45
  ]),
44
- ]),
45
- ),
46
- ])->JSON.stringify
46
+ ),
47
+ ])->JSON.stringify
47
48
  let entries = ReadModelEntryPoint_Ops.parseHandlerConfig(config)
48
49
  expect(entries->Array.length)->toBe(1)
49
50
  let e = entries->Array.getUnsafe(0)
@@ -65,20 +66,21 @@ describe("ReadModelEntryPoint_Ops.parseHandlerConfig", () => {
65
66
  })
66
67
 
67
68
  testSync("optional fields default to None; null pgConnection maps to None", () => {
68
- let config = obj([
69
- (
70
- "handlers",
71
- JSON.Encode.array([
72
- obj([
73
- ("specModule", str("a.res.mjs")),
74
- ("mappingsModule", str("b.res.mjs")),
75
- ("queryDbTableName", str("t")),
76
- ("sourceUrn", str("u")),
77
- ("pgConnection", JSON.Null),
69
+ let config =
70
+ obj([
71
+ (
72
+ "handlers",
73
+ JSON.Encode.array([
74
+ obj([
75
+ ("specModule", str("a.res.mjs")),
76
+ ("mappingsModule", str("b.res.mjs")),
77
+ ("queryDbTableName", str("t")),
78
+ ("sourceUrn", str("u")),
79
+ ("pgConnection", JSON.Null),
80
+ ]),
78
81
  ]),
79
- ]),
80
- ),
81
- ])->JSON.stringify
82
+ ),
83
+ ])->JSON.stringify
82
84
  let e = ReadModelEntryPoint_Ops.parseHandlerConfig(config)->Array.getUnsafe(0)
83
85
  expect(e.comp->Option.isNone)->toBe(true)
84
86
  expect(e.plugin->Option.isNone)->toBe(true)
@@ -99,9 +101,9 @@ describe("ReadModelEntryPoint_Ops.injectId", () => {
99
101
 
100
102
  testSync("passes non-object states through unchanged", () => {
101
103
  expect(ReadModelEntryPoint_Ops.injectId("p-1", str("scalar")))->toEqual(str("scalar"))
102
- expect(
103
- ReadModelEntryPoint_Ops.injectId("p-1", JSON.Encode.array([str("a")])),
104
- )->toEqual(JSON.Encode.array([str("a")]))
104
+ expect(ReadModelEntryPoint_Ops.injectId("p-1", JSON.Encode.array([str("a")])))->toEqual(
105
+ JSON.Encode.array([str("a")]),
106
+ )
105
107
  expect(ReadModelEntryPoint_Ops.injectId("p-1", JSON.Null))->toEqual(JSON.Null)
106
108
  })
107
109
  })
@@ -99,9 +99,10 @@ describe("RuntimeExtensionEntryPoint_Ops.fire", () => {
99
99
  // ComponentType and the layer's. Firing under a guessed kind would silently
100
100
  // attach a kind-routing extension to the wrong runtime.
101
101
  let seen: array<string> = []
102
- let config = RuntimeExtensionEntryPoint_Ops.parseConfig(
103
- Some(`{"modules":["a"],"runtimeKind":"SomethingNewer","component":"X"}`),
104
- )->Option.getOrThrow
102
+ let config =
103
+ RuntimeExtensionEntryPoint_Ops.parseConfig(
104
+ Some(`{"modules":["a"],"runtimeKind":"SomethingNewer","component":"X"}`),
105
+ )->Option.getOrThrow
105
106
 
106
107
  RuntimeExtensionEntryPoint_Ops.fire(config, [recordingHook("tracing", seen)])
107
108
 
@@ -16,23 +16,27 @@ describe("SideEffectEntryPoint_Ops.parseHandlerConfig", () => {
16
16
  })
17
17
 
18
18
  testSync("decodes handlers incl. attribution fields", () => {
19
- let config = obj([
20
- (
21
- "handlers",
22
- JSON.Encode.array([
23
- obj([
24
- ("sideEffectModules", JSON.Encode.array([str("@x/p/src/A.res.mjs"), str("@x/p/src/B.res.mjs")])),
25
- ("sourceUrn", str("arn:stream-1")),
26
- ("comp", str("SideEffectHandler(Mailer)")),
27
- ("plugin", str("Ordering")),
19
+ let config =
20
+ obj([
21
+ (
22
+ "handlers",
23
+ JSON.Encode.array([
24
+ obj([
25
+ (
26
+ "sideEffectModules",
27
+ JSON.Encode.array([str("@x/p/src/A.res.mjs"), str("@x/p/src/B.res.mjs")]),
28
+ ),
29
+ ("sourceUrn", str("arn:stream-1")),
30
+ ("comp", str("SideEffectHandler(Mailer)")),
31
+ ("plugin", str("Ordering")),
32
+ ]),
33
+ obj([
34
+ ("sideEffectModules", JSON.Encode.array([str("@x/p/src/C.res.mjs")])),
35
+ ("sourceUrn", str("arn:stream-2")),
36
+ ]),
28
37
  ]),
29
- obj([
30
- ("sideEffectModules", JSON.Encode.array([str("@x/p/src/C.res.mjs")])),
31
- ("sourceUrn", str("arn:stream-2")),
32
- ]),
33
- ]),
34
- ),
35
- ])->JSON.stringify
38
+ ),
39
+ ])->JSON.stringify
36
40
  let entries = SideEffectEntryPoint_Ops.parseHandlerConfig(config)
37
41
  expect(entries->Array.length)->toBe(2)
38
42
  let first = entries->Array.getUnsafe(0)
@@ -70,8 +74,9 @@ describe("SideEffectEntryPoint_Ops.makeRegisteredHandler", () => {
70
74
  comp: Some("SideEffectHandler(Mailer)"),
71
75
  plugin: Some("Ordering"),
72
76
  }
73
- let registered = SideEffectEntryPoint_Ops.makeRegisteredHandler(entry, _stream =>
74
- Effect.succeed()
77
+ let registered = SideEffectEntryPoint_Ops.makeRegisteredHandler(
78
+ entry,
79
+ _stream => Effect.succeed(),
75
80
  )
76
81
  expect(registered.comp)->toEqual(Some("SideEffectHandler(Mailer)"))
77
82
  expect(registered.plugin)->toEqual(Some("Ordering"))
@@ -30,16 +30,17 @@ describe("state-change descriptor parity", () => {
30
30
  let cases = await buildAll()
31
31
  // A silent zero-case run would pass while asserting nothing.
32
32
  expect(cases->Array.length)->toBe(11)
33
- cases->Array.forEach(c => {
34
- expect((c.name, c.relay))->toEqual((c.name, c.local))
35
- expect((c.name, c.postgres))->toEqual((c.name, c.local))
36
- })
33
+ cases->Array.forEach(
34
+ c => {
35
+ expect((c.name, c.relay))->toEqual((c.name, c.local))
36
+ expect((c.name, c.postgres))->toEqual((c.name, c.local))
37
+ },
38
+ )
37
39
  })
38
40
 
39
41
  testAsync("a save carries the row, a delete carries none", async () => {
40
42
  let cases = await buildAll()
41
- let stateOf = (d: JSON.t) =>
42
- d->JSON.Decode.object->Option.flatMap(o => o->Dict.get("state"))
43
+ let stateOf = (d: JSON.t) => d->JSON.Decode.object->Option.flatMap(o => o->Dict.get("state"))
43
44
  let byName = name => cases->Array.find(c => c.name == name)
44
45
 
45
46
  switch byName("single-key save with updatedAt") {
@@ -102,26 +103,27 @@ describe("state-change descriptor parity", () => {
102
103
  [
103
104
  "row in the first retired state degrades to metadata only",
104
105
  "row in the second retired state degrades to metadata only",
105
- ]->Array.forEach(name =>
106
- switch byName(name) {
107
- | Some(c) =>
108
- expect((name, keyOf(c.local, "state"), keyOf(c.local, "sortKeyValue")))->toEqual((
109
- name,
110
- None,
111
- None,
112
- ))
113
- expect((name, keyOf(c.relay, "state"), keyOf(c.relay, "sortKeyValue")))->toEqual((
114
- name,
115
- None,
116
- None,
117
- ))
118
- expect((name, keyOf(c.postgres, "state"), keyOf(c.postgres, "sortKeyValue")))->toEqual((
119
- name,
120
- None,
121
- None,
122
- ))
123
- | None => expect(name ++ " missing")->toBe("present")
124
- }
106
+ ]->Array.forEach(
107
+ name =>
108
+ switch byName(name) {
109
+ | Some(c) =>
110
+ expect((name, keyOf(c.local, "state"), keyOf(c.local, "sortKeyValue")))->toEqual((
111
+ name,
112
+ None,
113
+ None,
114
+ ))
115
+ expect((name, keyOf(c.relay, "state"), keyOf(c.relay, "sortKeyValue")))->toEqual((
116
+ name,
117
+ None,
118
+ None,
119
+ ))
120
+ expect((name, keyOf(c.postgres, "state"), keyOf(c.postgres, "sortKeyValue")))->toEqual((
121
+ name,
122
+ None,
123
+ None,
124
+ ))
125
+ | None => expect(name ++ " missing")->toBe("present")
126
+ },
125
127
  )
126
128
 
127
129
  // The control for the state form: a live state on the same lifecycle, so an
@@ -16,32 +16,35 @@ let capture = f =>
16
16
 
17
17
  describe("StateTopic_AppSync_Helpers.checkPartitionKeyName", () => {
18
18
  testSync("accepts the framework convention", () => {
19
- let thrown = capture(() =>
20
- StateTopic_AppSync_Helpers.checkPartitionKeyName(
21
- ~tableName="PlatformUsageLedger-1a2b3c4",
22
- ~partitionKeyName="id",
23
- )
19
+ let thrown = capture(
20
+ () =>
21
+ StateTopic_AppSync_Helpers.checkPartitionKeyName(
22
+ ~tableName="PlatformUsageLedger-1a2b3c4",
23
+ ~partitionKeyName="id",
24
+ ),
24
25
  )
25
26
  expect(thrown)->toEqual(None)
26
27
  })
27
28
 
28
29
  testSync("rejects a table keyed on anything else", () => {
29
- let thrown = capture(() =>
30
- StateTopic_AppSync_Helpers.checkPartitionKeyName(
31
- ~tableName="PlatformUsageLedger-1a2b3c4",
32
- ~partitionKeyName="pluginId",
33
- )
30
+ let thrown = capture(
31
+ () =>
32
+ StateTopic_AppSync_Helpers.checkPartitionKeyName(
33
+ ~tableName="PlatformUsageLedger-1a2b3c4",
34
+ ~partitionKeyName="pluginId",
35
+ ),
34
36
  )
35
37
  expect(thrown->Option.isSome)->toBe(true)
36
38
  })
37
39
 
38
40
  testSync("names the table and its actual key in the message", () => {
39
41
  let message =
40
- capture(() =>
41
- StateTopic_AppSync_Helpers.checkPartitionKeyName(
42
- ~tableName="PlatformUsageLedger-1a2b3c4",
43
- ~partitionKeyName="pluginId",
44
- )
42
+ capture(
43
+ () =>
44
+ StateTopic_AppSync_Helpers.checkPartitionKeyName(
45
+ ~tableName="PlatformUsageLedger-1a2b3c4",
46
+ ~partitionKeyName="pluginId",
47
+ ),
45
48
  )->Option.getOr("")
46
49
  expect(message->String.includes("PlatformUsageLedger-1a2b3c4"))->toBe(true)
47
50
  expect(message->String.includes("pluginId"))->toBe(true)
@@ -33,34 +33,39 @@ describe("StateViewSliceEntryPoint_Ops.parseHandlerConfig", () => {
33
33
  })
34
34
 
35
35
  testSync("expands compact-v2 entries against shared base/sourceUrn/pgConnection", () => {
36
- let config = obj([
37
- ("v", JSON.Encode.int(2)),
38
- ("base", str("@x/plugin/src/StateViewSlice/")),
39
- ("sourceUrn", str("arn:shared")),
40
- (
41
- "pgConnection",
42
- obj([
43
- ("host", str("db.local")),
44
- ("port", JSON.Encode.int(5432)),
45
- ("database", str("app")),
46
- ("username", str("master")),
47
- ("secretArn", str("arn:secret")),
48
- ]),
49
- ),
50
- (
51
- "handlers",
52
- JSON.Encode.array([
53
- obj([("s", str("Carts.res.mjs")), ("p", str("Carts_Projection.res.mjs")), ("q", str("qdb_Carts"))]),
36
+ let config =
37
+ obj([
38
+ ("v", JSON.Encode.int(2)),
39
+ ("base", str("@x/plugin/src/StateViewSlice/")),
40
+ ("sourceUrn", str("arn:shared")),
41
+ (
42
+ "pgConnection",
54
43
  obj([
55
- ("s", str("Totals.res.mjs")),
56
- ("p", str("Totals_Projection.res.mjs")),
57
- ("q", str("qdb_Totals")),
58
- ("u", str("arn:override")),
59
- ("t", str("cartTotals")),
44
+ ("host", str("db.local")),
45
+ ("port", JSON.Encode.int(5432)),
46
+ ("database", str("app")),
47
+ ("username", str("master")),
48
+ ("secretArn", str("arn:secret")),
60
49
  ]),
61
- ]),
62
- ),
63
- ])->JSON.stringify
50
+ ),
51
+ (
52
+ "handlers",
53
+ JSON.Encode.array([
54
+ obj([
55
+ ("s", str("Carts.res.mjs")),
56
+ ("p", str("Carts_Projection.res.mjs")),
57
+ ("q", str("qdb_Carts")),
58
+ ]),
59
+ obj([
60
+ ("s", str("Totals.res.mjs")),
61
+ ("p", str("Totals_Projection.res.mjs")),
62
+ ("q", str("qdb_Totals")),
63
+ ("u", str("arn:override")),
64
+ ("t", str("cartTotals")),
65
+ ]),
66
+ ]),
67
+ ),
68
+ ])->JSON.stringify
64
69
  let entries = StateViewSliceEntryPoint_Ops.parseHandlerConfig(config)
65
70
  expect(entries->Array.length)->toBe(2)
66
71
  let first = entries->Array.getUnsafe(0)
@@ -76,21 +81,22 @@ describe("StateViewSliceEntryPoint_Ops.parseHandlerConfig", () => {
76
81
  })
77
82
 
78
83
  testSync("passes legacy full-key entries through with per-entry fields", () => {
79
- let config = obj([
80
- ("base", str("ignored/")),
81
- ("sourceUrn", str("arn:shared")),
82
- (
83
- "handlers",
84
- JSON.Encode.array([
85
- obj([
86
- ("specModule", str("full/Carts.res.mjs")),
87
- ("projectionModule", str("full/Carts_Projection.res.mjs")),
88
- ("queryDbTableName", str("qdb_Carts")),
89
- ("sourceUrn", str("arn:own")),
84
+ let config =
85
+ obj([
86
+ ("base", str("ignored/")),
87
+ ("sourceUrn", str("arn:shared")),
88
+ (
89
+ "handlers",
90
+ JSON.Encode.array([
91
+ obj([
92
+ ("specModule", str("full/Carts.res.mjs")),
93
+ ("projectionModule", str("full/Carts_Projection.res.mjs")),
94
+ ("queryDbTableName", str("qdb_Carts")),
95
+ ("sourceUrn", str("arn:own")),
96
+ ]),
90
97
  ]),
91
- ]),
92
- ),
93
- ])->JSON.stringify
98
+ ),
99
+ ])->JSON.stringify
94
100
  let e = StateViewSliceEntryPoint_Ops.parseHandlerConfig(config)->Array.getUnsafe(0)
95
101
  // Legacy entries are NOT base-prefixed and keep their own sourceUrn.
96
102
  expect(e.specModule)->toBe("full/Carts.res.mjs")
@@ -142,9 +148,9 @@ describe("StateViewSliceEntryPoint_Ops.makeJsonEventsHandler", () => {
142
148
 
143
149
  // String-typed consumed events keep the pipeline test independent of any
144
150
  // real slice: each event value becomes the row id, `recordedAt` the state.
145
- let project = (
146
- {event, recordedAt, _}: Reventless.StateViewSlice.consumed<string>,
147
- ): array<Reventless.Projection.action<string, JSON.t>> => [Set(event, str(recordedAt))]
151
+ let project = ({event, recordedAt, _}: Reventless.StateViewSlice.consumed<string>): array<
152
+ Reventless.Projection.action<string, JSON.t>,
153
+ > => [Set(event, str(recordedAt))]
148
154
 
149
155
  test("decodes envelopes, projects, and runs actions against the ops", async () => {
150
156
  let saved = []
@@ -205,7 +211,12 @@ describe("StateViewSliceEntryPoint_Ops.makeJsonEventsHandler", () => {
205
211
  "row-1",
206
212
  obj([
207
213
  ("lifecycle", str("Placed")),
208
- ("trail", JSON.Encode.array([obj([("state", str("Placed")), ("at", str("2026-03-02T09:00:00Z"))])])),
214
+ (
215
+ "trail",
216
+ JSON.Encode.array([
217
+ obj([("state", str("Placed")), ("at", str("2026-03-02T09:00:00Z"))]),
218
+ ]),
219
+ ),
209
220
  ]),
210
221
  ),
211
222
  ])
@@ -11,7 +11,6 @@ open JestGlobals
11
11
  let str = JSON.Encode.string
12
12
  let obj = pairs => JSON.Encode.object(Dict.fromArray(pairs))
13
13
 
14
-
15
14
  describe("TaskBucketEntryPoint_Ops.parseHandlerConfig", () => {
16
15
  testSync("empty raw config decodes to empty defaults", () => {
17
16
  let c = TaskBucketEntryPoint_Ops.parseHandlerConfig("")
@@ -21,18 +20,19 @@ describe("TaskBucketEntryPoint_Ops.parseHandlerConfig", () => {
21
20
  })
22
21
 
23
22
  testSync("decodes callbackModule, publishToAggregates, and scheduler env names", () => {
24
- let config = obj([
25
- ("callbackModule", str("@x/plugin/src/Task/ImportCatalog.res.mjs")),
26
- ("publishToAggregates", obj([("Product", str("PTA_Product_QUEUE_URL"))])),
27
- (
28
- "scheduler",
29
- obj([
30
- ("roleArnEnv", str("SCHEDULER_ROLE_ARN")),
31
- ("targetArnEnv", str("SCHEDULER_TARGET_ARN")),
32
- ("targetNameEnv", str("SCHEDULER_TARGET_NAME")),
33
- ]),
34
- ),
35
- ])->JSON.stringify
23
+ let config =
24
+ obj([
25
+ ("callbackModule", str("@x/plugin/src/Task/ImportCatalog.res.mjs")),
26
+ ("publishToAggregates", obj([("Product", str("PTA_Product_QUEUE_URL"))])),
27
+ (
28
+ "scheduler",
29
+ obj([
30
+ ("roleArnEnv", str("SCHEDULER_ROLE_ARN")),
31
+ ("targetArnEnv", str("SCHEDULER_TARGET_ARN")),
32
+ ("targetNameEnv", str("SCHEDULER_TARGET_NAME")),
33
+ ]),
34
+ ),
35
+ ])->JSON.stringify
36
36
  let c = TaskBucketEntryPoint_Ops.parseHandlerConfig(config)
37
37
  expect(c.callbackModule)->toBe("@x/plugin/src/Task/ImportCatalog.res.mjs")
38
38
  expect(c.publishToAggregates->Dict.get("Product"))->toEqual(Some("PTA_Product_QUEUE_URL"))
@@ -29,9 +29,9 @@ describe("Upload_Claim_S3_Ops.tableNameFromEventSourceArn", () => {
29
29
  )
30
30
 
31
31
  testSync("returns None for an ARN that is not a table stream", () =>
32
- expect(Ops.tableNameFromEventSourceArn("arn:aws:sqs:eu-west-1:123456789012:SomeQueue"))->toEqual(
33
- None,
34
- )
32
+ expect(
33
+ Ops.tableNameFromEventSourceArn("arn:aws:sqs:eu-west-1:123456789012:SomeQueue"),
34
+ )->toEqual(None)
35
35
  )
36
36
  })
37
37
 
@@ -52,9 +52,7 @@ describe("Util_AwsError.isNotFound", () => {
52
52
  // the original guard tested, and it is false for the real error.
53
53
  testSync("...and its message does not carry the code, which is why", () =>
54
54
  expect(
55
- AwsError.describe(dynamoNotFound)->String.includes(
56
- "Requested resource not found",
57
- ),
55
+ AwsError.describe(dynamoNotFound)->String.includes("Requested resource not found"),
58
56
  )->toBe(true)
59
57
  )
60
58
 
@@ -118,10 +116,9 @@ describe("Util_AwsError.describe", () => {
118
116
  // failure with another.
119
117
  testSync("every shape yields something an operator can read", () =>
120
118
  expect(
121
- [
122
- awsError(~name="X", ~message="y"),
123
- Not_found,
124
- ]->Array.every(e => AwsError.describe(e)->String.length > 0),
119
+ [awsError(~name="X", ~message="y"), Not_found]->Array.every(
120
+ e => AwsError.describe(e)->String.length > 0,
121
+ ),
125
122
  )->toBe(true)
126
123
  )
127
124
  })
@@ -62,8 +62,17 @@ export const rule = () => Rules.check();
62
62
  ),
63
63
  ],
64
64
  )
65
- let _ = writePkg(~root=rulesRoot, ~name=rulesName, [("src/Rules.res.mjs", `export const check = () => true;
66
- `)])
65
+ let _ = writePkg(
66
+ ~root=rulesRoot,
67
+ ~name=rulesName,
68
+ [
69
+ (
70
+ "src/Rules.res.mjs",
71
+ `export const check = () => true;
72
+ `,
73
+ ),
74
+ ],
75
+ )
67
76
 
68
77
  let closureOf = (packageDirs: dict<string>) => {
69
78
  Util_Bundle.addImportedPackageClosure(packageDirs)
@@ -130,7 +139,10 @@ describe("Util_Bundle — bundled user packages carry their imports", () => {
130
139
  // Walking reventless-aws would reach its deploy-time-only imports (the
131
140
  // @pulumi bindings) and add tens of megabytes to every archive.
132
141
  let packageDirs = Dict.fromArray([
133
- ("@reventlessdev/reventless-aws", Util_Bundle.resolvePackageRoot("@reventlessdev/reventless-aws")),
142
+ (
143
+ "@reventlessdev/reventless-aws",
144
+ Util_Bundle.resolvePackageRoot("@reventlessdev/reventless-aws"),
145
+ ),
134
146
  ])
135
147
  expect(closureOf(packageDirs)->Dict.keysToArray->Array.length)->toBe(1)
136
148
  })