@reventlessdev/reventless-aws 3.0.0-alpha.343 → 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 (234) hide show
  1. package/CHANGELOG.md +15 -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 +144 -67
  134. package/src/util/Util_Bundle.res.mjs +64 -13
  135. package/src/util/Util_CognitoGroupUser_Runtime.res +32 -34
  136. package/src/util/Util_Cognito_Runtime.res +11 -7
  137. package/src/util/Util_DeadLetterQueue.res +12 -2
  138. package/src/util/Util_DynamoDb.res +5 -3
  139. package/src/util/Util_DynamoDbStream.res +7 -3
  140. package/src/util/Util_DynamoDbStream_Runtime.res +1 -2
  141. package/src/util/Util_DynamoDb_Runtime.res +23 -41
  142. package/src/util/Util_HostUiDomain.res +6 -1
  143. package/src/util/Util_Kinesis_Runtime.res +10 -11
  144. package/src/util/Util_Lambda.res +12 -5
  145. package/src/util/Util_LambdaEnvBudget.res +5 -5
  146. package/src/util/Util_LambdaLogging.res +1 -2
  147. package/src/util/Util_LogGroup_Adopting.res +1 -4
  148. package/src/util/Util_ResourceNaming.res +1 -2
  149. package/src/util/Util_SNS.res +8 -3
  150. package/src/util/Util_SNS_FIFO.res +1 -1
  151. package/src/util/Util_SNS_Runtime.res +11 -10
  152. package/src/util/Util_SQS.res +4 -2
  153. package/src/util/Util_SQS_FIFO.res +5 -2
  154. package/src/util/Util_SQS_Runtime.res +37 -36
  155. package/src/util/Util_ShellConfig.res +3 -2
  156. package/src/util/Util_StaticBundle.res +1 -3
  157. package/src/util/Util_StoreLayout.res +4 -1
  158. package/tests/AWS_TagsTest.res +16 -5
  159. package/tests/AppSyncEventsSigner_OpsTest.res +11 -2
  160. package/tests/AppSync_AdapterTest.res +203 -224
  161. package/tests/AppSync_Resolver_RetryingTest.res +64 -44
  162. package/tests/AppSync_RetirementNarrowingTest.res +59 -46
  163. package/tests/AppSync_SdlDecorateTest.res +22 -20
  164. package/tests/AppSync_SourceApiAssociation_RetryingTest.res +40 -22
  165. package/tests/Auth_ActiveRolePoolAttachmentTest.res +114 -107
  166. package/tests/Auth_ActiveRoleStoreTest.res +12 -9
  167. package/tests/Auth_ActiveRoleStore_SchemaTest.res +2 -1
  168. package/tests/Auth_ActiveRoleTrigger_OpsTest.res +20 -16
  169. package/tests/Auth_CognitoTest.res +31 -46
  170. package/tests/AutomationSliceEntryPoint_OpsTest.res +69 -67
  171. package/tests/BakeConvergenceTest.res +22 -25
  172. package/tests/Capability_MessagingTest.res +28 -12
  173. package/tests/CommandTopicQueuePolicyTest.res +1 -2
  174. package/tests/CounterEntryPoint_OpsTest.res +3 -7
  175. package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res +306 -210
  176. package/tests/EventCollectorConnectLambdaPreviewTest.res +14 -7
  177. package/tests/EventCollectorEntryPoint_OpsTest.res +12 -4
  178. package/tests/EventCollectorPluginDefinitionAssetTest.res +18 -11
  179. package/tests/EventCollectorReadyGateTest.res +5 -4
  180. package/tests/EventLogStorage_DynamoDb_RuntimeTest.res +1 -2
  181. package/tests/EventMapperEntryPoint_OpsTest.res +1 -3
  182. package/tests/ExtensionPointEntryPoint_OpsTest.res +1 -4
  183. package/tests/HandlerFactoryDispatchTest.res +97 -70
  184. package/tests/MCP_LambdaTest.res +16 -27
  185. package/tests/PgChangeFeedRelay_IntegrationTest.res +123 -93
  186. package/tests/PgChangeFeedRelay_RuntimeTest.res +13 -10
  187. package/tests/PgMigrationEntryPoint_IntegrationTest.res +0 -1
  188. package/tests/PgPipeline_IntegrationTest.res +80 -66
  189. package/tests/PgQueryDbUnion_IntegrationTest.res +1 -2
  190. package/tests/PgQueryResolverEntryPoint_OpsTest.res +2 -6
  191. package/tests/PgQueryResolver_LambdaTest.res +41 -24
  192. package/tests/Platform_AdminScan_OpsTest.res +4 -1
  193. package/tests/Platform_ComponentDefinitions_Lambda_OpsTest.res +137 -129
  194. package/tests/ProjectionEntryPoint_DisplayNameTest.res +7 -3
  195. package/tests/ProjectionEntryPoint_UnionStampTest.res +3 -2
  196. package/tests/ProvisionIdentityTest.res +2 -6
  197. package/tests/QueryDbOwnerIndexTableTest.res +6 -4
  198. package/tests/QueryDbResolvers_AppSyncTest.res +23 -16
  199. package/tests/QueryInterceptor_LambdaTest.res +11 -13
  200. package/tests/ReadModelEntryPoint_OpsTest.res +43 -41
  201. package/tests/RuntimeExtensionEntryPoint_OpsTest.res +4 -3
  202. package/tests/SideEffectEntryPoint_OpsTest.res +23 -18
  203. package/tests/StateChangeDescriptorParityTest.res +28 -26
  204. package/tests/StateTopicKeySchemaTest.res +18 -15
  205. package/tests/StateViewSliceEntryPoint_OpsTest.res +55 -44
  206. package/tests/TaskBucketEntryPoint_OpsTest.res +13 -13
  207. package/tests/Upload_ClaimTest.res +3 -3
  208. package/tests/Util_AwsErrorTest.res +4 -7
  209. package/tests/Util_BundleDependencyClosureTest.res +41 -3
  210. package/tests/Util_BundleDependencyClosureTest.res.mjs +11 -0
  211. package/tests/Util_BundleEsmLoaderTest.res +3 -3
  212. package/tests/Util_BundleResolveTest.res +4 -6
  213. package/tests/Util_BundleRuntimeExtensionTest.res +17 -18
  214. package/tests/Util_DcbMetricsTest.res +6 -6
  215. package/tests/Util_DynamoDbStreamTest.res +4 -5
  216. package/tests/Util_DynamoDbTest.res +3 -2
  217. package/tests/Util_LambdaEnvBudgetTest.res +22 -18
  218. package/tests/Util_LambdaLoggingTest.res +9 -8
  219. package/tests/Util_LogGroup_AdoptingTest.res +10 -5
  220. package/tests/Util_LogRetentionTest.res +6 -2
  221. package/tests/Util_OwnerScopeEnvTest.res +10 -8
  222. package/tests/Util_SQS_RuntimeTest.res +5 -7
  223. package/tests/Util_ShellConfigTest.res +7 -17
  224. package/tests/Util_StaticBundleTest.res +3 -8
  225. package/tests/Util_StoreLayoutTest.res +17 -12
  226. package/tests/integration/AggregateEntryPoint_IntegrationTest.res +1 -4
  227. package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res +15 -15
  228. package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res +296 -232
  229. package/tests/integration/DcbIntegrationHarness.res +8 -8
  230. package/tests/integration/EpCompositeSlice.res +16 -8
  231. package/tests/integration/QueryDbUnion_DynamoDb_IntegrationTest.res +8 -10
  232. package/tests/integration/StateViewSliceEntryPoint_IntegrationTest.res +10 -10
  233. package/tests/integration/SvsTestSlice_Projection.res +1 -3
  234. package/tests/util/Util_AlarmSpecTest.res +62 -49
@@ -21,30 +21,31 @@ describe("AutomationSliceEntryPoint_Ops.parseHandlerConfig", () => {
21
21
  })
22
22
 
23
23
  testSync("decodes a full entry incl. bodyModule and context", () => {
24
- let config = obj([
25
- (
26
- "handlers",
27
- JSON.Encode.array([
28
- obj([
29
- ("specModule", str("@x/plugin/src/Order/AutomationSlice/Restock.res.mjs")),
30
- ("bodyModule", str("@x/plugin/src/Order/AutomationSlice/Restock_Automation.res.mjs")),
31
- ("callbackType", str("automation")),
32
- ("queryDbTableName", str("RestockTodo-abc")),
33
- ("dcbQueueUrl", str("https://sqs/queue.fifo")),
34
- ("sourceUrn", str("arn:aws:dynamodb:eu-west-1:1:table/log/stream/x")),
35
- (
36
- "context",
37
- obj([
38
- ("environment", str("alpha")),
39
- ("platformName", str("OnlineShop")),
40
- ("pluginName", str("Ordering")),
41
- ("sliceName", str("Restock")),
42
- ]),
43
- ),
24
+ let config =
25
+ obj([
26
+ (
27
+ "handlers",
28
+ JSON.Encode.array([
29
+ obj([
30
+ ("specModule", str("@x/plugin/src/Order/AutomationSlice/Restock.res.mjs")),
31
+ ("bodyModule", str("@x/plugin/src/Order/AutomationSlice/Restock_Automation.res.mjs")),
32
+ ("callbackType", str("automation")),
33
+ ("queryDbTableName", str("RestockTodo-abc")),
34
+ ("dcbQueueUrl", str("https://sqs/queue.fifo")),
35
+ ("sourceUrn", str("arn:aws:dynamodb:eu-west-1:1:table/log/stream/x")),
36
+ (
37
+ "context",
38
+ obj([
39
+ ("environment", str("alpha")),
40
+ ("platformName", str("OnlineShop")),
41
+ ("pluginName", str("Ordering")),
42
+ ("sliceName", str("Restock")),
43
+ ]),
44
+ ),
45
+ ]),
44
46
  ]),
45
- ]),
46
- ),
47
- ])->JSON.stringify
47
+ ),
48
+ ])->JSON.stringify
48
49
  let entries = AutomationSliceEntryPoint_Ops.parseHandlerConfig(config)
49
50
  expect(entries->Array.length)->toBe(1)
50
51
  let e = entries->Array.getUnsafe(0)
@@ -63,20 +64,21 @@ describe("AutomationSliceEntryPoint_Ops.parseHandlerConfig", () => {
63
64
  })
64
65
 
65
66
  testSync("a stale entry without bodyModule/context decodes with defaults", () => {
66
- let config = obj([
67
- (
68
- "handlers",
69
- JSON.Encode.array([
70
- obj([
71
- ("specModule", str("a.res.mjs")),
72
- ("callbackType", str("outbound")),
73
- ("queryDbTableName", str("t")),
74
- ("dcbQueueUrl", str("u")),
75
- ("sourceUrn", str("arn")),
67
+ let config =
68
+ obj([
69
+ (
70
+ "handlers",
71
+ JSON.Encode.array([
72
+ obj([
73
+ ("specModule", str("a.res.mjs")),
74
+ ("callbackType", str("outbound")),
75
+ ("queryDbTableName", str("t")),
76
+ ("dcbQueueUrl", str("u")),
77
+ ("sourceUrn", str("arn")),
78
+ ]),
76
79
  ]),
77
- ]),
78
- ),
79
- ])->JSON.stringify
80
+ ),
81
+ ])->JSON.stringify
80
82
  let e = AutomationSliceEntryPoint_Ops.parseHandlerConfig(config)->Array.getUnsafe(0)
81
83
  expect(e.bodyModule)->toBe("")
82
84
  expect(e.context->Option.isNone)->toBe(true)
@@ -111,7 +113,10 @@ describe("AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules", () => {
111
113
  "Ship",
112
114
  obj([
113
115
  ("specModule", str("@x/plugin/src/Order/OutboundTranslationSlice/Ship.res.mjs")),
114
- ("bodyModule", str("@x/plugin/src/Order/OutboundTranslationSlice/Ship_Translation.res.mjs")),
116
+ (
117
+ "bodyModule",
118
+ str("@x/plugin/src/Order/OutboundTranslationSlice/Ship_Translation.res.mjs"),
119
+ ),
115
120
  ("callbackType", str("outbound")),
116
121
  ]),
117
122
  ),
@@ -128,10 +133,9 @@ describe("AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules", () => {
128
133
  testSync("a compact entry takes its modules from the registry and the shared defaults", () => {
129
134
  let config = compactConfig([obj([("n", str("Restock")), ("q", str("RestockTodo-abc"))])])
130
135
  let e =
131
- AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules(
132
- modules,
133
- config,
134
- )->Array.getUnsafe(0)
136
+ AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules(modules, config)->Array.getUnsafe(
137
+ 0,
138
+ )
135
139
  expect(e.specModule)->toBe("@x/plugin/src/Order/AutomationSlice/Restock.res.mjs")
136
140
  expect(e.bodyModule)->toBe("@x/plugin/src/Order/AutomationSlice/Restock_Automation.res.mjs")
137
141
  expect(e.callbackType)->toBe("automation")
@@ -156,10 +160,9 @@ describe("AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules", () => {
156
160
  ]),
157
161
  ])
158
162
  let e =
159
- AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules(
160
- modules,
161
- config,
162
- )->Array.getUnsafe(0)
163
+ AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules(modules, config)->Array.getUnsafe(
164
+ 0,
165
+ )
163
166
  expect(e.callbackType)->toBe("outbound")
164
167
  expect(e.dcbQueueUrl)->toBe("https://sqs/orders.fifo")
165
168
  expect(e.commandQueueIsFifo)->toEqual(Some(true))
@@ -171,35 +174,34 @@ describe("AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules", () => {
171
174
  testSync("a compact entry with no registry match yields no bodyModule to skip on", () => {
172
175
  let config = compactConfig([obj([("n", str("Gone")), ("q", str("GoneTodo-abc"))])])
173
176
  let e =
174
- AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules(
175
- modules,
176
- config,
177
- )->Array.getUnsafe(0)
177
+ AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules(modules, config)->Array.getUnsafe(
178
+ 0,
179
+ )
178
180
  expect(e.specModule)->toBe("")
179
181
  expect(e.bodyModule)->toBe("")
180
182
  })
181
183
 
182
184
  testSync("full-key entries still decode when a registry is present", () => {
183
- let config = obj([
184
- (
185
- "handlers",
186
- JSON.Encode.array([
187
- obj([
188
- ("specModule", str("a.res.mjs")),
189
- ("bodyModule", str("b.res.mjs")),
190
- ("callbackType", str("outbound")),
191
- ("queryDbTableName", str("t")),
192
- ("dcbQueueUrl", str("u")),
193
- ("sourceUrn", str("arn")),
185
+ let config =
186
+ obj([
187
+ (
188
+ "handlers",
189
+ JSON.Encode.array([
190
+ obj([
191
+ ("specModule", str("a.res.mjs")),
192
+ ("bodyModule", str("b.res.mjs")),
193
+ ("callbackType", str("outbound")),
194
+ ("queryDbTableName", str("t")),
195
+ ("dcbQueueUrl", str("u")),
196
+ ("sourceUrn", str("arn")),
197
+ ]),
194
198
  ]),
195
- ]),
196
- ),
197
- ])->JSON.stringify
199
+ ),
200
+ ])->JSON.stringify
198
201
  let e =
199
- AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules(
200
- modules,
201
- config,
202
- )->Array.getUnsafe(0)
202
+ AutomationSliceEntryPoint_Ops.parseHandlerConfigWithModules(modules, config)->Array.getUnsafe(
203
+ 0,
204
+ )
203
205
  expect(e.specModule)->toBe("a.res.mjs")
204
206
  expect(e.dcbQueueUrl)->toBe("u")
205
207
  })
@@ -17,9 +17,10 @@ open JestGlobals
17
17
 
18
18
  // Mirrors the deploy-time hook in aws/src/Platform.res: content-addressed key, and
19
19
  // the key the stack exports as `pluginStructureRef` is the one the hook returned.
20
- let deployStructure = (
21
- structure: Reventless.Plugin.pluginStructure,
22
- ): (string, Reventless.Offload.payload<Reventless.Plugin.pluginStructure>) => {
20
+ let deployStructure = (structure: Reventless.Plugin.pluginStructure): (
21
+ string,
22
+ Reventless.Offload.payload<Reventless.Plugin.pluginStructure>,
23
+ ) => {
23
24
  let exported = ref("")
24
25
  ReventlessCore.Plugin_Helpers.registerOffload((~store, ~bytes) => {
25
26
  let hash = NodeCrypto.sha256Hex(bytes)
@@ -125,9 +126,7 @@ describe("the bake converges when a plugin's structure changes", () => {
125
126
 
126
127
  // If this ever stops holding, the two keys can never converge and every retry is
127
128
  // spent waiting for something that cannot happen.
128
- testSync("a changed structure hashes to a different key", () =>
129
- expect(keyA == keyB)->toBe(false)
130
- )
129
+ testSync("a changed structure hashes to a different key", () => expect(keyA == keyB)->toBe(false))
131
130
 
132
131
  // The invariant convergence rests on: the structure the deploy hashes and the
133
132
  // structure the plugin's registration carries are the same bytes, because they
@@ -135,9 +134,7 @@ describe("the bake converges when a plugin's structure changes", () => {
135
134
  // deploy's reference and hands it back.
136
135
  testSync("the key the deploy exported is the key the registration carries", () =>
137
136
  expect(
138
- Platform_ComponentDefinitions_Lambda_Ops.structureRefKey(
139
- row(shipped(defB), ~at=afterDeploy),
140
- ),
137
+ Platform_ComponentDefinitions_Lambda_Ops.structureRefKey(row(shipped(defB), ~at=afterDeploy)),
141
138
  )->toEqual(Some(keyB))
142
139
  )
143
140
 
@@ -155,18 +152,18 @@ describe("the bake converges when a plugin's structure changes", () => {
155
152
  // definition must re-emit VersionConnected. `decide` is idempotent on an
156
153
  // unchanged one, so this is the step a broken chain silently skips.
157
154
  testSync("a redeploy with a changed structure re-emits VersionConnected", () => {
158
- let connected = ReventlessCore.PluginBehavior.initialState->apply(connect(
159
- ReventlessCore.PluginBehavior.initialState,
160
- shipped(defA),
161
- ))
155
+ let connected =
156
+ ReventlessCore.PluginBehavior.initialState->apply(
157
+ connect(ReventlessCore.PluginBehavior.initialState, shipped(defA)),
158
+ )
162
159
  expect(connect(connected, shipped(defB))->Array.length)->toBe(1)
163
160
  })
164
161
 
165
162
  testSync("once it lands, the plugin reads as registered by this deploy", () => {
166
- let connected = ReventlessCore.PluginBehavior.initialState->apply(connect(
167
- ReventlessCore.PluginBehavior.initialState,
168
- shipped(defA),
169
- ))
163
+ let connected =
164
+ ReventlessCore.PluginBehavior.initialState->apply(
165
+ connect(ReventlessCore.PluginBehavior.initialState, shipped(defA)),
166
+ )
170
167
  let redeployed = connected->apply(connect(connected, shipped(defB)))
171
168
  let def = switch redeployed.known->Dict.get("1.0.0") {
172
169
  | Some({definition}) => definition
@@ -182,10 +179,10 @@ describe("the bake converges when a plugin's structure changes", () => {
182
179
  // exercising the chain at all. Correct, and no evidence — which is why the bake
183
180
  // counts it apart from a plugin that did register.
184
181
  testSync("an unchanged structure passes without re-registering", () => {
185
- let connected = ReventlessCore.PluginBehavior.initialState->apply(connect(
186
- ReventlessCore.PluginBehavior.initialState,
187
- shipped(defA),
188
- ))
182
+ let connected =
183
+ ReventlessCore.PluginBehavior.initialState->apply(
184
+ connect(ReventlessCore.PluginBehavior.initialState, shipped(defA)),
185
+ )
189
186
  expect(connect(connected, shipped(defA)))->toEqual([])
190
187
  expect(
191
188
  stateOf(
@@ -200,10 +197,10 @@ describe("the bake converges when a plugin's structure changes", () => {
200
197
  // version; without it a redeploy of the same version never re-runs the handshake
201
198
  // and the changed structure never reaches the read model.
202
199
  testSync("a redeploy re-detects an already-connected version", () => {
203
- let connected = ReventlessCore.PluginBehavior.initialState->apply(connect(
204
- ReventlessCore.PluginBehavior.initialState,
205
- shipped(defA),
206
- ))
200
+ let connected =
201
+ ReventlessCore.PluginBehavior.initialState->apply(
202
+ connect(ReventlessCore.PluginBehavior.initialState, shipped(defA)),
203
+ )
207
204
  expect(
208
205
  ReventlessCore.PluginBehavior.decide(connected, ReventlessCore.PluginSpec.Redetect("1.0.0")),
209
206
  )->toEqual(Ok([ReventlessCore.PluginSpec.VersionDetected("1.0.0")]))
@@ -19,8 +19,10 @@ describe("Capability_Messaging — reading a configured value", () => {
19
19
  // `Pulumi.Config`, which needs a deploy-time runtime this suite does not have.
20
20
  // `configured` returns before touching it whenever the variable is set.
21
21
  testSync("an address set in the environment is the sender", () => {
22
- let sender = withEnv("REVENTLESS_MESSAGING_EMAIL_SENDER", "mail@shop.test", () =>
23
- Messaging.configured(Messaging.emailSenderKey)
22
+ let sender = withEnv(
23
+ "REVENTLESS_MESSAGING_EMAIL_SENDER",
24
+ "mail@shop.test",
25
+ () => Messaging.configured(Messaging.emailSenderKey),
24
26
  )
25
27
  expect(sender)->toEqual(Some("mail@shop.test"))
26
28
  })
@@ -28,8 +30,10 @@ describe("Capability_Messaging — reading a configured value", () => {
28
30
  // A stray `REVENTLESS_MESSAGING_EMAIL_SENDER=` in CI, or a blank line in the
29
31
  // sidecar. Reading it as an address asks SES for an identity with none.
30
32
  testSync("an empty value is not an address", () => {
31
- let sender = withEnv("REVENTLESS_MESSAGING_EMAIL_SENDER", "", () =>
32
- Messaging.configured(Messaging.emailSenderKey)
33
+ let sender = withEnv(
34
+ "REVENTLESS_MESSAGING_EMAIL_SENDER",
35
+ "",
36
+ () => Messaging.configured(Messaging.emailSenderKey),
33
37
  )
34
38
  expect(sender)->toEqual(None)
35
39
  })
@@ -37,22 +41,28 @@ describe("Capability_Messaging — reading a configured value", () => {
37
41
  // The one that is not obviously empty: a key left with a space after the colon.
38
42
  // It reached SES as an identity request for " " before this was trimmed.
39
43
  testSync("a whitespace-only value is not an address either", () => {
40
- let sender = withEnv("REVENTLESS_MESSAGING_EMAIL_SENDER", " ", () =>
41
- Messaging.configured(Messaging.emailSenderKey)
44
+ let sender = withEnv(
45
+ "REVENTLESS_MESSAGING_EMAIL_SENDER",
46
+ " ",
47
+ () => Messaging.configured(Messaging.emailSenderKey),
42
48
  )
43
49
  expect(sender)->toEqual(None)
44
50
  })
45
51
 
46
52
  testSync("a surviving value is the trimmed one", () => {
47
- let sender = withEnv("REVENTLESS_MESSAGING_EMAIL_SENDER", " mail@shop.test ", () =>
48
- Messaging.configured(Messaging.emailSenderKey)
53
+ let sender = withEnv(
54
+ "REVENTLESS_MESSAGING_EMAIL_SENDER",
55
+ " mail@shop.test ",
56
+ () => Messaging.configured(Messaging.emailSenderKey),
49
57
  )
50
58
  expect(sender)->toEqual(Some("mail@shop.test"))
51
59
  })
52
60
 
53
61
  testSync("the sms sender reads off its own key", () => {
54
- let sender = withEnv("REVENTLESS_MESSAGING_SMS_SENDER", "+15550100", () =>
55
- Messaging.configured(Messaging.smsSenderKey)
62
+ let sender = withEnv(
63
+ "REVENTLESS_MESSAGING_SMS_SENDER",
64
+ "+15550100",
65
+ () => Messaging.configured(Messaging.smsSenderKey),
56
66
  )
57
67
  expect(sender)->toEqual(Some("+15550100"))
58
68
  })
@@ -61,7 +71,9 @@ describe("Capability_Messaging — reading a configured value", () => {
61
71
  describe("Capability_Messaging — choosing a transport", () => {
62
72
  testSync("ses and log are the two a stack can name", () => {
63
73
  let pair: (Messaging.emailProvider, Messaging.emailProvider) = (Ses, Log)
64
- expect((Messaging.parseEmailProvider("ses"), Messaging.parseEmailProvider("log")))->toEqual(pair)
74
+ expect((Messaging.parseEmailProvider("ses"), Messaging.parseEmailProvider("log")))->toEqual(
75
+ pair,
76
+ )
65
77
  })
66
78
 
67
79
  // Config files are written by hand; a capitalised or padded value means what it
@@ -85,7 +97,11 @@ describe("Capability_Messaging — choosing a transport", () => {
85
97
  // SES is the default so that a deployment saying nothing still mails: a stack
86
98
  // that means not to send says so, rather than silence meaning it.
87
99
  testSync("a named transport wins over the default", () => {
88
- let chosen = withEnv("REVENTLESS_MESSAGING_EMAIL_PROVIDER", "log", () => Messaging.emailProvider())
100
+ let chosen = withEnv(
101
+ "REVENTLESS_MESSAGING_EMAIL_PROVIDER",
102
+ "log",
103
+ () => Messaging.emailProvider(),
104
+ )
89
105
  let expected: Messaging.emailProvider = Log
90
106
  expect(chosen)->toEqual(expected)
91
107
  })
@@ -16,8 +16,7 @@ let policy =
16
16
  ~lambdaArn,
17
17
  )->JSON.parseOrThrow
18
18
 
19
- let field = (json, key) =>
20
- json->JSON.Decode.object->Option.flatMap(o => o->Dict.get(key))
19
+ let field = (json, key) => json->JSON.Decode.object->Option.flatMap(o => o->Dict.get(key))
21
20
 
22
21
  let statement = sid =>
23
22
  policy
@@ -26,8 +26,8 @@ let mkRecord = (
26
26
  awsRegion: "eu-west-1",
27
27
  dynamodb: {
28
28
  keys: {id: attrS(keysId)},
29
- newImage: ?newImage,
30
- oldImage: ?oldImage,
29
+ ?newImage,
30
+ ?oldImage,
31
31
  },
32
32
  eventID: "e1",
33
33
  eventName: INSERT,
@@ -83,11 +83,7 @@ describe("CounterEntryPoint_Ops.splitRecords", () => {
83
83
  ~oldImage=Dict.fromArray([("id", attrS("c2")), ("count", attrN("4"))]),
84
84
  ),
85
85
  // foreign stream / foreign source → dropped
86
- mkRecord(
87
- ~arn="arn:other",
88
- ~keysId="x",
89
- ~newImage=Dict.fromArray([("id", attrS("x"))]),
90
- ),
86
+ mkRecord(~arn="arn:other", ~keysId="x", ~newImage=Dict.fromArray([("id", attrS("x"))])),
91
87
  mkRecord(
92
88
  ~arn=refsArn,
93
89
  ~source="aws:sqs",