@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.
- package/CHANGELOG.md +8 -0
- package/package.json +11 -11
- package/scripts/ProvisionIdentity.res +8 -3
- package/src/Platform.res +327 -328
- package/src/Platform.res.mjs +4 -2
- package/src/Platform_Casts.res +13 -4
- package/src/adapter/Api/AppSyncEventsSigner_Ops.res +8 -4
- package/src/adapter/Api/AppSync_EventsApi.res +12 -14
- package/src/adapter/Api/AppSync_Resolver_Native.res +3 -4
- package/src/adapter/Api/AppSync_Resolver_Retrying.res +78 -70
- package/src/adapter/Api/AppSync_SourceApiAssociation_Retrying.res +11 -8
- package/src/adapter/Api/Platform_AdminScan_Ops.res +15 -14
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +10 -2
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +40 -50
- package/src/adapter/Api/Platform_UIFragments_Lambda.res +39 -32
- package/src/adapter/Api/Platform_UIFragments_Lambda_Ops.res +5 -2
- package/src/adapter/Auth/Auth_ActiveRolePoolAttachment.res +0 -1
- package/src/adapter/Auth/Auth_ActiveRoleStore.res +1 -2
- package/src/adapter/Auth/Auth_ActiveRoleStore_Schema.res +1 -4
- package/src/adapter/Auth/Auth_ActiveRoleTrigger_Ops.res +5 -2
- package/src/adapter/Auth/Auth_Cognito.res +3 -9
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res +1 -4
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res +3 -1
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res +1 -4
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res +7 -4
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res +6 -1
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res +7 -4
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res +24 -18
- package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res +9 -4
- package/src/adapter/CommandTopic/CommandTopicRegistry.res +1 -4
- package/src/adapter/Counter/CounterHandler_DynamoDbStream.res +15 -15
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res +9 -5
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +179 -213
- package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res +5 -5
- package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res +6 -2
- package/src/adapter/EventCollector/EventCollectorChannel_SQS.res +14 -7
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res +14 -7
- package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res +6 -3
- package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res +6 -1
- package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res +13 -17
- package/src/adapter/EventLog/EventLogStorage_Postgres.res +7 -4
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res +12 -7
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync_Ops.res +4 -2
- package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res +3 -2
- package/src/adapter/EventTopic/EventTopicPublisher_SNS.res +20 -12
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res +21 -9
- package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res +5 -3
- package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver.res +6 -3
- package/src/adapter/Mcp/MCP_Lambda.res +31 -46
- package/src/adapter/Messaging/Messaging_Ses_Backend.res +11 -7
- package/src/adapter/Messaging/Messaging_Ses_Backend.res.mjs +2 -4
- package/src/adapter/Monitoring/Monitoring_CloudWatch.res +16 -16
- package/src/adapter/Postgres/PgChangeFeedRelay_Builder.res +5 -10
- package/src/adapter/Postgres/PgChangeFeedRelay_Runtime.res +4 -2
- package/src/adapter/Postgres/PgConnection.res +6 -5
- package/src/adapter/Postgres/PgMigration_Builder.res +4 -8
- package/src/adapter/Postgres/PgRuntime.res +4 -7
- package/src/adapter/QueryDb/PgQueryResolver_Builder.res +9 -11
- package/src/adapter/QueryDb/PgQueryResolver_Lambda.res +22 -21
- package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res +114 -111
- package/src/adapter/QueryDb/QueryDbResolvers_Lambda.res +1 -7
- package/src/adapter/QueryDb/QueryDbStorage.res +4 -2
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res +23 -24
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res +8 -2
- package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res +71 -73
- package/src/adapter/QueryDb/QueryDbStorage_Postgres.res +5 -2
- package/src/adapter/QueryDb/QueryInterceptor_Provisioning.res +1 -4
- package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res +8 -2
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +73 -81
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res +72 -78
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +44 -67
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res +44 -67
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +53 -82
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res +47 -77
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +18 -11
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res +80 -97
- package/src/adapter/Runtime/CounterEntryPoint_Ops.res +2 -7
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res +16 -10
- package/src/adapter/Runtime/EventCollectorEntryPoint_Ops.res +24 -15
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +17 -37
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +31 -57
- package/src/adapter/Runtime/EventMapperEntryPoint_Ops.res +18 -24
- package/src/adapter/Runtime/ExtensionPointEntryPoint_Ops.res +1 -5
- package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res +4 -3
- package/src/adapter/Runtime/HeartbeatEntryPoint.res +0 -1
- package/src/adapter/Runtime/PgChangeFeedRelayEntryPoint.res +4 -2
- package/src/adapter/Runtime/PgMigrationEntryPoint.res +0 -1
- package/src/adapter/Runtime/PgQueryResolverEntryPoint_Ops.res +3 -2
- package/src/adapter/Runtime/PluginExtensionPointEntryPoint.res +1 -2
- package/src/adapter/Runtime/ProjectionEntryPoint_Ops.res +4 -5
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +22 -10
- package/src/adapter/Runtime/RuntimeExtensionEntryPoint_Ops.res +8 -2
- package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res +14 -31
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +16 -17
- package/src/adapter/Runtime/StateViewSliceEntryPoint_Ops.res +10 -9
- package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res +46 -52
- package/src/adapter/Runtime/StreamRoutedEntryPoint_Ops.res +36 -41
- package/src/adapter/Runtime/TaskBucketEntryPoint_Ops.res +31 -37
- package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res +6 -7
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res +4 -6
- package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res +2 -6
- package/src/adapter/StateTopic/StateTopic_AppSync.res +21 -16
- package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res +36 -32
- package/src/adapter/Task/TaskBucket_S3.res +6 -1
- package/src/adapter/Upload/Upload_Claim_S3.res +17 -20
- package/src/adapter/Upload/Upload_Claim_S3_Ops.res +5 -2
- package/src/adapter/Upload/Upload_Presign_S3.res +51 -49
- package/src/capability/Capability_Geocoding_AwsLocation.res +4 -1
- package/src/capability/Capability_Messaging.res +4 -5
- package/src/capability/Capability_Messaging_Ses.res +3 -1
- package/src/capability/Capability_ObjectStore_S3.res +1 -7
- package/src/components/Api/AppSync_Adapter.res +28 -41
- package/src/components/Api/AppSync_SdlDecorate.res +38 -30
- package/src/components/AutomationSlice_Builder.res +6 -4
- package/src/components/ExtensionPoint_Builder.res +9 -10
- package/src/components/InboundTranslationSlice_Builder.res +7 -8
- package/src/components/OutboundTranslationSlice_Builder.res +14 -8
- package/src/components/OutboundTranslationSlice_Builder.res.mjs +1 -1
- package/src/components/SideEffectHandler_Single.res +4 -4
- package/src/components/StateViewSlice_Builder.res +6 -4
- package/src/components/StateViewSlice_Builder_Stream.res +6 -4
- package/src/components/Task_Builder_PerBucket.res +10 -11
- package/src/plugin/cloner/ClonerRunner_Fargate.res +3 -10
- package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res +1 -4
- package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res +5 -5
- package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res +19 -21
- package/src/plugin/runtime/PluginRuntime_Builder.res +167 -188
- package/src/plugin/runtime/Util_PluginMessage_Runtime.res +6 -5
- package/src/plugin/stack/Plugin_Stack.res +104 -103
- package/src/util/Util_AlarmSpec.res +2 -1
- package/src/util/Util_AppSync.res +8 -2
- package/src/util/Util_AppSync_Caller.res +15 -14
- package/src/util/Util_Bundle.res +46 -42
- package/src/util/Util_CognitoGroupUser_Runtime.res +32 -34
- package/src/util/Util_Cognito_Runtime.res +11 -7
- package/src/util/Util_DeadLetterQueue.res +12 -2
- package/src/util/Util_DynamoDb.res +5 -3
- package/src/util/Util_DynamoDbStream.res +7 -3
- package/src/util/Util_DynamoDbStream_Runtime.res +1 -2
- package/src/util/Util_DynamoDb_Runtime.res +23 -41
- package/src/util/Util_HostUiDomain.res +6 -1
- package/src/util/Util_Kinesis_Runtime.res +10 -11
- package/src/util/Util_Lambda.res +12 -5
- package/src/util/Util_LambdaEnvBudget.res +5 -5
- package/src/util/Util_LambdaLogging.res +1 -2
- package/src/util/Util_LogGroup_Adopting.res +1 -4
- package/src/util/Util_ResourceNaming.res +1 -2
- package/src/util/Util_SNS.res +8 -3
- package/src/util/Util_SNS_FIFO.res +1 -1
- package/src/util/Util_SNS_Runtime.res +11 -10
- package/src/util/Util_SQS.res +4 -2
- package/src/util/Util_SQS_FIFO.res +5 -2
- package/src/util/Util_SQS_Runtime.res +37 -36
- package/src/util/Util_ShellConfig.res +3 -2
- package/src/util/Util_StaticBundle.res +1 -3
- package/src/util/Util_StoreLayout.res +4 -1
- package/tests/AWS_TagsTest.res +16 -5
- package/tests/AppSyncEventsSigner_OpsTest.res +11 -2
- package/tests/AppSync_AdapterTest.res +203 -224
- package/tests/AppSync_Resolver_RetryingTest.res +64 -44
- package/tests/AppSync_RetirementNarrowingTest.res +59 -46
- package/tests/AppSync_SdlDecorateTest.res +22 -20
- package/tests/AppSync_SourceApiAssociation_RetryingTest.res +40 -22
- package/tests/Auth_ActiveRolePoolAttachmentTest.res +114 -107
- package/tests/Auth_ActiveRoleStoreTest.res +12 -9
- package/tests/Auth_ActiveRoleStore_SchemaTest.res +2 -1
- package/tests/Auth_ActiveRoleTrigger_OpsTest.res +20 -16
- package/tests/Auth_CognitoTest.res +31 -46
- package/tests/AutomationSliceEntryPoint_OpsTest.res +69 -67
- package/tests/BakeConvergenceTest.res +22 -25
- package/tests/Capability_MessagingTest.res +28 -12
- package/tests/CommandTopicQueuePolicyTest.res +1 -2
- package/tests/CounterEntryPoint_OpsTest.res +3 -7
- package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res +306 -210
- package/tests/EventCollectorConnectLambdaPreviewTest.res +14 -7
- package/tests/EventCollectorEntryPoint_OpsTest.res +12 -4
- package/tests/EventCollectorPluginDefinitionAssetTest.res +18 -11
- package/tests/EventCollectorReadyGateTest.res +5 -4
- package/tests/EventLogStorage_DynamoDb_RuntimeTest.res +1 -2
- package/tests/EventMapperEntryPoint_OpsTest.res +1 -3
- package/tests/ExtensionPointEntryPoint_OpsTest.res +1 -4
- package/tests/HandlerFactoryDispatchTest.res +97 -70
- package/tests/MCP_LambdaTest.res +16 -27
- package/tests/PgChangeFeedRelay_IntegrationTest.res +123 -93
- package/tests/PgChangeFeedRelay_RuntimeTest.res +13 -10
- package/tests/PgMigrationEntryPoint_IntegrationTest.res +0 -1
- package/tests/PgPipeline_IntegrationTest.res +80 -66
- package/tests/PgQueryDbUnion_IntegrationTest.res +1 -2
- package/tests/PgQueryResolverEntryPoint_OpsTest.res +2 -6
- package/tests/PgQueryResolver_LambdaTest.res +41 -24
- package/tests/Platform_AdminScan_OpsTest.res +4 -1
- package/tests/Platform_ComponentDefinitions_Lambda_OpsTest.res +137 -129
- package/tests/ProjectionEntryPoint_DisplayNameTest.res +7 -3
- package/tests/ProjectionEntryPoint_UnionStampTest.res +3 -2
- package/tests/ProvisionIdentityTest.res +2 -6
- package/tests/QueryDbOwnerIndexTableTest.res +6 -4
- package/tests/QueryDbResolvers_AppSyncTest.res +23 -16
- package/tests/QueryInterceptor_LambdaTest.res +11 -13
- package/tests/ReadModelEntryPoint_OpsTest.res +43 -41
- package/tests/RuntimeExtensionEntryPoint_OpsTest.res +4 -3
- package/tests/SideEffectEntryPoint_OpsTest.res +23 -18
- package/tests/StateChangeDescriptorParityTest.res +28 -26
- package/tests/StateTopicKeySchemaTest.res +18 -15
- package/tests/StateViewSliceEntryPoint_OpsTest.res +55 -44
- package/tests/TaskBucketEntryPoint_OpsTest.res +13 -13
- package/tests/Upload_ClaimTest.res +3 -3
- package/tests/Util_AwsErrorTest.res +4 -7
- package/tests/Util_BundleDependencyClosureTest.res +15 -3
- package/tests/Util_BundleEsmLoaderTest.res +3 -3
- package/tests/Util_BundleResolveTest.res +4 -6
- package/tests/Util_BundleRuntimeExtensionTest.res +17 -18
- package/tests/Util_DcbMetricsTest.res +6 -6
- package/tests/Util_DynamoDbStreamTest.res +4 -5
- package/tests/Util_DynamoDbTest.res +3 -2
- package/tests/Util_LambdaEnvBudgetTest.res +22 -18
- package/tests/Util_LambdaLoggingTest.res +9 -8
- package/tests/Util_LogGroup_AdoptingTest.res +10 -5
- package/tests/Util_LogRetentionTest.res +6 -2
- package/tests/Util_OwnerScopeEnvTest.res +10 -8
- package/tests/Util_SQS_RuntimeTest.res +5 -7
- package/tests/Util_ShellConfigTest.res +7 -17
- package/tests/Util_StaticBundleTest.res +3 -8
- package/tests/Util_StoreLayoutTest.res +17 -12
- package/tests/integration/AggregateEntryPoint_IntegrationTest.res +1 -4
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res +15 -15
- package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res +296 -232
- package/tests/integration/DcbIntegrationHarness.res +8 -8
- package/tests/integration/EpCompositeSlice.res +16 -8
- package/tests/integration/QueryDbUnion_DynamoDb_IntegrationTest.res +8 -10
- package/tests/integration/StateViewSliceEntryPoint_IntegrationTest.res +10 -10
- package/tests/integration/SvsTestSlice_Projection.res +1 -3
- 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 =
|
|
25
|
-
(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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 =
|
|
67
|
-
(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
(
|
|
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
|
-
|
|
133
|
-
|
|
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
|
-
|
|
161
|
-
|
|
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
|
-
|
|
176
|
-
|
|
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 =
|
|
184
|
-
(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
201
|
-
|
|
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
|
-
|
|
22
|
-
|
|
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 =
|
|
159
|
-
ReventlessCore.PluginBehavior.initialState
|
|
160
|
-
|
|
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 =
|
|
167
|
-
ReventlessCore.PluginBehavior.initialState
|
|
168
|
-
|
|
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 =
|
|
186
|
-
ReventlessCore.PluginBehavior.initialState
|
|
187
|
-
|
|
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 =
|
|
204
|
-
ReventlessCore.PluginBehavior.initialState
|
|
205
|
-
|
|
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(
|
|
23
|
-
|
|
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(
|
|
32
|
-
|
|
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(
|
|
41
|
-
|
|
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(
|
|
48
|
-
|
|
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(
|
|
55
|
-
|
|
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(
|
|
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(
|
|
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
|
-
|
|
30
|
-
|
|
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",
|