@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
|
@@ -29,10 +29,7 @@ let registerAggregate = (
|
|
|
29
29
|
~behaviorModulePath,
|
|
30
30
|
~eventLogTableName,
|
|
31
31
|
) =>
|
|
32
|
-
aggregateInfos->Dict.set(
|
|
33
|
-
aggregateName,
|
|
34
|
-
{specModulePath, behaviorModulePath, eventLogTableName},
|
|
35
|
-
)
|
|
32
|
+
aggregateInfos->Dict.set(aggregateName, {specModulePath, behaviorModulePath, eventLogTableName})
|
|
36
33
|
|
|
37
34
|
// Plugin RM table name for the resolver-level plugin status gate (Part 2.3 of
|
|
38
35
|
// the resolver plan). Set by the platform after Admin.construct returns; consumed
|
|
@@ -85,44 +82,30 @@ let forCommandGenerator: ReventlessCore.Runtime.forComponent<
|
|
|
85
82
|
ReventlessCore.CommandGenerator.effectEventHandler<context>,
|
|
86
83
|
runtimeParts,
|
|
87
84
|
ReventlessCore.CommandGenerator.component,
|
|
88
|
-
> = (
|
|
89
|
-
~handler as _,
|
|
90
|
-
~connect,
|
|
91
|
-
~memorySize=1024,
|
|
92
|
-
~timeout=30,
|
|
93
|
-
commandGenerator,
|
|
94
|
-
) => {
|
|
85
|
+
> = (~handler as _, ~connect, ~memorySize=1024, ~timeout=30, commandGenerator) => {
|
|
95
86
|
let resource = commandGenerator->ReventlessCore.Component.toPulumiResource
|
|
96
87
|
switch resource.parent {
|
|
97
88
|
| Some(aggregateResource) =>
|
|
98
89
|
let aggregateName = aggregateResource.name->Option.getOr("Unnamed")
|
|
99
90
|
let spec = getStoredSpec(aggregateName, aggregateResource)
|
|
100
|
-
storedSpecs->Dict.set(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
91
|
+
storedSpecs->Dict.set(
|
|
92
|
+
aggregateName,
|
|
93
|
+
{
|
|
94
|
+
...spec,
|
|
95
|
+
connects: spec.connects->Array.concat([connect]),
|
|
96
|
+
memorySize: Math.Int.max(spec.memorySize, memorySize),
|
|
97
|
+
timeout: Math.Int.max(spec.timeout, timeout),
|
|
98
|
+
},
|
|
99
|
+
)
|
|
106
100
|
| None => ()
|
|
107
101
|
}
|
|
108
102
|
}
|
|
109
103
|
|
|
110
104
|
let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
111
|
-
ReventlessCore.Runtime.effectHandler<
|
|
112
|
-
CommandTopicChannel.callbackEvent,
|
|
113
|
-
context,
|
|
114
|
-
unit,
|
|
115
|
-
string,
|
|
116
|
-
>,
|
|
105
|
+
ReventlessCore.Runtime.effectHandler<CommandTopicChannel.callbackEvent, context, unit, string>,
|
|
117
106
|
runtimeParts,
|
|
118
107
|
ReventlessCore.CommandTopic.component<'op>,
|
|
119
|
-
> = (
|
|
120
|
-
~handler as _,
|
|
121
|
-
~connect,
|
|
122
|
-
~memorySize=1024,
|
|
123
|
-
~timeout=30,
|
|
124
|
-
commandTopic,
|
|
125
|
-
) => {
|
|
108
|
+
> = (~handler as _, ~connect, ~memorySize=1024, ~timeout=30, commandTopic) => {
|
|
126
109
|
let commandTopicResource = commandTopic->ReventlessCore.Component.toPulumiResource
|
|
127
110
|
switch commandTopicResource.parent {
|
|
128
111
|
| Some(aggregateResource) =>
|
|
@@ -133,14 +116,17 @@ let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
|
133
116
|
let queue = channelParts.queue
|
|
134
117
|
|
|
135
118
|
let spec = getStoredSpec(aggregateName, aggregateResource)
|
|
136
|
-
storedSpecs->Dict.set(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
119
|
+
storedSpecs->Dict.set(
|
|
120
|
+
aggregateName,
|
|
121
|
+
{
|
|
122
|
+
...spec,
|
|
123
|
+
queueUrl: queue.id,
|
|
124
|
+
queueArn: queue.arn,
|
|
125
|
+
connects: spec.connects->Array.concat([connect]),
|
|
126
|
+
memorySize: Math.Int.max(spec.memorySize, memorySize),
|
|
127
|
+
timeout: Math.Int.max(spec.timeout, timeout),
|
|
128
|
+
},
|
|
129
|
+
)
|
|
144
130
|
| None =>
|
|
145
131
|
let name = commandTopicResource.name->Option.getOr("Unnamed")
|
|
146
132
|
JsError.throwWithMessage(
|
|
@@ -150,33 +136,24 @@ let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
|
150
136
|
}
|
|
151
137
|
|
|
152
138
|
let forEventCollector: ReventlessCore.Runtime.forEventCollector<
|
|
153
|
-
ReventlessCore.Runtime.effectHandler<
|
|
154
|
-
EventCollectorChannel.callbackEvent,
|
|
155
|
-
context,
|
|
156
|
-
unit,
|
|
157
|
-
string,
|
|
158
|
-
>,
|
|
139
|
+
ReventlessCore.Runtime.effectHandler<EventCollectorChannel.callbackEvent, context, unit, string>,
|
|
159
140
|
ReventlessCore.EventCollector.component,
|
|
160
|
-
> = (
|
|
161
|
-
~handler as _,
|
|
162
|
-
~eventTopics,
|
|
163
|
-
~resources,
|
|
164
|
-
~memorySize=1024,
|
|
165
|
-
~timeout=30,
|
|
166
|
-
eventCollector,
|
|
167
|
-
) => {
|
|
141
|
+
> = (~handler as _, ~eventTopics, ~resources, ~memorySize=1024, ~timeout=30, eventCollector) => {
|
|
168
142
|
let eventCollectorResource = eventCollector->ReventlessCore.Component.toPulumiResource
|
|
169
143
|
let channel = eventCollector->ReventlessCore.EventCollector_Adapter.channel
|
|
170
144
|
switch eventCollectorResource.parent->Option.flatMap(parent => parent.parent) {
|
|
171
145
|
| Some(aggregateResource) =>
|
|
172
146
|
let aggregateName = aggregateResource.name->Option.getOr("Unnamed")
|
|
173
147
|
let spec = getStoredSpec(aggregateName, aggregateResource)
|
|
174
|
-
storedSpecs->Dict.set(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
148
|
+
storedSpecs->Dict.set(
|
|
149
|
+
aggregateName,
|
|
150
|
+
{
|
|
151
|
+
...spec,
|
|
152
|
+
eventCollectorChannelSpec: Some({channel, eventTopics, resources}),
|
|
153
|
+
memorySize: Math.Int.max(spec.memorySize, memorySize),
|
|
154
|
+
timeout: Math.Int.max(spec.timeout, timeout),
|
|
155
|
+
},
|
|
156
|
+
)
|
|
180
157
|
| None =>
|
|
181
158
|
let name = eventCollectorResource.name->Option.getOr("Unnamed")
|
|
182
159
|
JsError.throwWithMessage(
|
|
@@ -202,7 +179,8 @@ let finish = () =>
|
|
|
202
179
|
// operator's commandHandlerConfig (whichever is higher wins). An override
|
|
203
180
|
// on one aggregate raises the shared Lambda above the floor.
|
|
204
181
|
// See docs/plans/configurable-component-runtime-resources.md.
|
|
205
|
-
let specMemorySize =
|
|
182
|
+
let specMemorySize =
|
|
183
|
+
specs->Array.reduce(0, (acc, {memorySize}) => Math.Int.max(acc, memorySize))
|
|
206
184
|
let specTimeout = specs->Array.reduce(0, (acc, {timeout}) => Math.Int.max(acc, timeout))
|
|
207
185
|
let memorySize = Math.Int.max(
|
|
208
186
|
cfg.memorySize->Option.getOr(ReventlessCore.Runtime.CommandHandlerDefaults.memorySize),
|
|
@@ -245,12 +223,10 @@ let finish = () =>
|
|
|
245
223
|
packageDirs->Dict.set(behaviorPkg, Util_Bundle.resolvePackageRoot(behaviorPkg))
|
|
246
224
|
|
|
247
225
|
// Combine the three Output values into a JSON object string
|
|
248
|
-
let specModule =
|
|
249
|
-
|
|
250
|
-
let behaviorModule =
|
|
251
|
-
info.behaviorModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
226
|
+
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
227
|
+
let behaviorModule = info.behaviorModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
252
228
|
|
|
253
|
-
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
229
|
+
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
254
230
|
// deploy-time structure, and the Lambda-name fallback yields nothing for a
|
|
255
231
|
// shared or per-aggregate command handler. Resolve it here; the shell still
|
|
256
232
|
// derives `comp` itself from the spec name.
|
|
@@ -263,8 +239,7 @@ let finish = () =>
|
|
|
263
239
|
spec.queueUrl,
|
|
264
240
|
spec.queueArn,
|
|
265
241
|
pgConnectionFragment,
|
|
266
|
-
))
|
|
267
|
-
->Pulumi.Output.apply(((table, queueUrl, queueArn, pgFragment)) =>
|
|
242
|
+
))->Pulumi.Output.apply(((table, queueUrl, queueArn, pgFragment)) =>
|
|
268
243
|
`{"specModule":${specModule},"behaviorModule":${behaviorModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}${pgFragment}}`
|
|
269
244
|
)
|
|
270
245
|
let _ = handlerOutputs->Array.push(handlerJson)
|
|
@@ -276,13 +251,13 @@ let finish = () =>
|
|
|
276
251
|
}
|
|
277
252
|
})
|
|
278
253
|
|
|
279
|
-
let handlerConfigOutput =
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
254
|
+
let handlerConfigOutput = Pulumi.Output.all(
|
|
255
|
+
handlerOutputs,
|
|
256
|
+
)->Pulumi.Output.apply(handlers => {
|
|
257
|
+
let json = `{"handlers":[${handlers->Array.join(",")}]}`
|
|
258
|
+
Util_LambdaEnvBudget.check(~lambdaName="AllAggregatesCmdHandler", ~handlerConfigJson=json)
|
|
259
|
+
json
|
|
260
|
+
})
|
|
286
261
|
|
|
287
262
|
let envVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
288
263
|
envVars->Dict.set("HANDLER_CONFIG", handlerConfigOutput->Pulumi.Output.asInput)
|
|
@@ -325,14 +300,10 @@ let finish = () =>
|
|
|
325
300
|
| Some(sel) =>
|
|
326
301
|
Some(
|
|
327
302
|
sel.securityGroupId
|
|
328
|
-
->Pulumi.Output.apply(sgId =>
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
securityGroupIds: [sgId->Pulumi.Input.make]->Pulumi.Input.make,
|
|
333
|
-
}: PulumiAws.Lambda.Function.vpcConfig
|
|
334
|
-
)
|
|
335
|
-
)
|
|
303
|
+
->Pulumi.Output.apply((sgId): PulumiAws.Lambda.Function.vpcConfig => {
|
|
304
|
+
PulumiAws.Lambda.Function.subnetIds: sel.subnetIds->Pulumi.Input.make,
|
|
305
|
+
securityGroupIds: [sgId->Pulumi.Input.make]->Pulumi.Input.make,
|
|
306
|
+
})
|
|
336
307
|
->Pulumi.Output.asInput,
|
|
337
308
|
)
|
|
338
309
|
| None => None
|
|
@@ -350,7 +321,7 @@ let finish = () =>
|
|
|
350
321
|
~reservedConcurrency=?cfg.reservedConcurrency,
|
|
351
322
|
~ephemeralStorageMb=?cfg.ephemeralStorageMb,
|
|
352
323
|
~logRetentionDays=?cfg.logRetentionDays,
|
|
353
|
-
~vpcConfig
|
|
324
|
+
~vpcConfig?,
|
|
354
325
|
~opts,
|
|
355
326
|
)
|
|
356
327
|
|
|
@@ -32,10 +32,7 @@ let registerAggregate = (
|
|
|
32
32
|
~behaviorModulePath,
|
|
33
33
|
~eventLogTableName,
|
|
34
34
|
) =>
|
|
35
|
-
aggregateInfos->Dict.set(
|
|
36
|
-
aggregateName,
|
|
37
|
-
{specModulePath, behaviorModulePath, eventLogTableName},
|
|
38
|
-
)
|
|
35
|
+
aggregateInfos->Dict.set(aggregateName, {specModulePath, behaviorModulePath, eventLogTableName})
|
|
39
36
|
|
|
40
37
|
type storedSpec = {
|
|
41
38
|
aggregateName: string,
|
|
@@ -74,44 +71,30 @@ let forCommandGenerator: ReventlessCore.Runtime.forComponent<
|
|
|
74
71
|
ReventlessCore.CommandGenerator.effectEventHandler<context>,
|
|
75
72
|
runtimeParts,
|
|
76
73
|
ReventlessCore.CommandGenerator.component,
|
|
77
|
-
> = (
|
|
78
|
-
~handler as _,
|
|
79
|
-
~connect,
|
|
80
|
-
~memorySize=1024,
|
|
81
|
-
~timeout=30,
|
|
82
|
-
commandGenerator,
|
|
83
|
-
) => {
|
|
74
|
+
> = (~handler as _, ~connect, ~memorySize=1024, ~timeout=30, commandGenerator) => {
|
|
84
75
|
let resource = commandGenerator->ReventlessCore.Component.toPulumiResource
|
|
85
76
|
switch resource.parent {
|
|
86
77
|
| Some(aggregateResource) =>
|
|
87
78
|
let aggregateName = aggregateResource.name->Option.getOr("Unnamed")
|
|
88
79
|
let spec = getStoredSpec(aggregateName, aggregateResource)
|
|
89
|
-
storedSpecs->Dict.set(
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
storedSpecs->Dict.set(
|
|
81
|
+
aggregateName,
|
|
82
|
+
{
|
|
83
|
+
...spec,
|
|
84
|
+
connects: spec.connects->Array.concat([connect]),
|
|
85
|
+
memorySize: Math.Int.max(spec.memorySize, memorySize),
|
|
86
|
+
timeout: Math.Int.max(spec.timeout, timeout),
|
|
87
|
+
},
|
|
88
|
+
)
|
|
95
89
|
| None => ()
|
|
96
90
|
}
|
|
97
91
|
}
|
|
98
92
|
|
|
99
93
|
let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
100
|
-
ReventlessCore.Runtime.effectHandler<
|
|
101
|
-
CommandTopicChannel.callbackEvent,
|
|
102
|
-
context,
|
|
103
|
-
unit,
|
|
104
|
-
string,
|
|
105
|
-
>,
|
|
94
|
+
ReventlessCore.Runtime.effectHandler<CommandTopicChannel.callbackEvent, context, unit, string>,
|
|
106
95
|
runtimeParts,
|
|
107
96
|
ReventlessCore.CommandTopic.component<'op>,
|
|
108
|
-
> = (
|
|
109
|
-
~handler as _,
|
|
110
|
-
~connect,
|
|
111
|
-
~memorySize=1024,
|
|
112
|
-
~timeout=30,
|
|
113
|
-
commandTopic,
|
|
114
|
-
) => {
|
|
97
|
+
> = (~handler as _, ~connect, ~memorySize=1024, ~timeout=30, commandTopic) => {
|
|
115
98
|
let commandTopicResource = commandTopic->ReventlessCore.Component.toPulumiResource
|
|
116
99
|
switch commandTopicResource.parent {
|
|
117
100
|
| Some(aggregateResource) =>
|
|
@@ -122,14 +105,17 @@ let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
|
122
105
|
let queue = channelParts.queue
|
|
123
106
|
|
|
124
107
|
let spec = getStoredSpec(aggregateName, aggregateResource)
|
|
125
|
-
storedSpecs->Dict.set(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
108
|
+
storedSpecs->Dict.set(
|
|
109
|
+
aggregateName,
|
|
110
|
+
{
|
|
111
|
+
...spec,
|
|
112
|
+
queueUrl: queue.id,
|
|
113
|
+
queueArn: queue.arn,
|
|
114
|
+
connects: spec.connects->Array.concat([connect]),
|
|
115
|
+
memorySize: Math.Int.max(spec.memorySize, memorySize),
|
|
116
|
+
timeout: Math.Int.max(spec.timeout, timeout),
|
|
117
|
+
},
|
|
118
|
+
)
|
|
133
119
|
| None =>
|
|
134
120
|
let name = commandTopicResource.name->Option.getOr("Unnamed")
|
|
135
121
|
JsError.throwWithMessage(
|
|
@@ -139,33 +125,24 @@ let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
|
139
125
|
}
|
|
140
126
|
|
|
141
127
|
let forEventCollector: ReventlessCore.Runtime.forEventCollector<
|
|
142
|
-
ReventlessCore.Runtime.effectHandler<
|
|
143
|
-
EventCollectorChannel.callbackEvent,
|
|
144
|
-
context,
|
|
145
|
-
unit,
|
|
146
|
-
string,
|
|
147
|
-
>,
|
|
128
|
+
ReventlessCore.Runtime.effectHandler<EventCollectorChannel.callbackEvent, context, unit, string>,
|
|
148
129
|
ReventlessCore.EventCollector.component,
|
|
149
|
-
> = (
|
|
150
|
-
~handler as _,
|
|
151
|
-
~eventTopics,
|
|
152
|
-
~resources,
|
|
153
|
-
~memorySize=1024,
|
|
154
|
-
~timeout=30,
|
|
155
|
-
eventCollector,
|
|
156
|
-
) => {
|
|
130
|
+
> = (~handler as _, ~eventTopics, ~resources, ~memorySize=1024, ~timeout=30, eventCollector) => {
|
|
157
131
|
let eventCollectorResource = eventCollector->ReventlessCore.Component.toPulumiResource
|
|
158
132
|
let channel = eventCollector->ReventlessCore.EventCollector_Adapter.channel
|
|
159
133
|
switch eventCollectorResource.parent->Option.flatMap(parent => parent.parent) {
|
|
160
134
|
| Some(aggregateResource) =>
|
|
161
135
|
let aggregateName = aggregateResource.name->Option.getOr("Unnamed")
|
|
162
136
|
let spec = getStoredSpec(aggregateName, aggregateResource)
|
|
163
|
-
storedSpecs->Dict.set(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
137
|
+
storedSpecs->Dict.set(
|
|
138
|
+
aggregateName,
|
|
139
|
+
{
|
|
140
|
+
...spec,
|
|
141
|
+
eventCollectorChannelSpec: Some({channel, eventTopics, resources}),
|
|
142
|
+
memorySize: Math.Int.max(spec.memorySize, memorySize),
|
|
143
|
+
timeout: Math.Int.max(spec.timeout, timeout),
|
|
144
|
+
},
|
|
145
|
+
)
|
|
169
146
|
| None =>
|
|
170
147
|
let name = eventCollectorResource.name->Option.getOr("Unnamed")
|
|
171
148
|
JsError.throwWithMessage(
|
|
@@ -185,7 +162,8 @@ let finish = () =>
|
|
|
185
162
|
|
|
186
163
|
// Per-component runtime hints fold into the shared async command Lambda —
|
|
187
164
|
// see AggregateRuntime_Builder_Single.finish for the full rationale.
|
|
188
|
-
let specMemorySize =
|
|
165
|
+
let specMemorySize =
|
|
166
|
+
specs->Array.reduce(0, (acc, {memorySize}) => Math.Int.max(acc, memorySize))
|
|
189
167
|
let specTimeout = specs->Array.reduce(0, (acc, {timeout}) => Math.Int.max(acc, timeout))
|
|
190
168
|
let memorySize = Math.Int.max(
|
|
191
169
|
cfg.memorySize->Option.getOr(ReventlessCore.Runtime.CommandHandlerDefaults.memorySize),
|
|
@@ -226,12 +204,10 @@ let finish = () =>
|
|
|
226
204
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
227
205
|
packageDirs->Dict.set(behaviorPkg, Util_Bundle.resolvePackageRoot(behaviorPkg))
|
|
228
206
|
|
|
229
|
-
let specModule =
|
|
230
|
-
|
|
231
|
-
let behaviorModule =
|
|
232
|
-
info.behaviorModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
207
|
+
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
208
|
+
let behaviorModule = info.behaviorModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
233
209
|
|
|
234
|
-
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
210
|
+
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
235
211
|
// deploy-time structure, and the Lambda-name fallback yields nothing for a
|
|
236
212
|
// shared or per-aggregate command handler. Resolve it here; the shell still
|
|
237
213
|
// derives `comp` itself from the spec name.
|
|
@@ -244,8 +220,7 @@ let finish = () =>
|
|
|
244
220
|
spec.queueUrl,
|
|
245
221
|
spec.queueArn,
|
|
246
222
|
pgConnectionFragment,
|
|
247
|
-
))
|
|
248
|
-
->Pulumi.Output.apply(((table, queueUrl, queueArn, pgFragment)) =>
|
|
223
|
+
))->Pulumi.Output.apply(((table, queueUrl, queueArn, pgFragment)) =>
|
|
249
224
|
`{"specModule":${specModule},"behaviorModule":${behaviorModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}${pgFragment}}`
|
|
250
225
|
)
|
|
251
226
|
let _ = handlerOutputs->Array.push(handlerJson)
|
|
@@ -258,8 +233,7 @@ let finish = () =>
|
|
|
258
233
|
})
|
|
259
234
|
|
|
260
235
|
let handlerConfigOutput =
|
|
261
|
-
Pulumi.Output.all(handlerOutputs)
|
|
262
|
-
->Pulumi.Output.apply(handlers =>
|
|
236
|
+
Pulumi.Output.all(handlerOutputs)->Pulumi.Output.apply(handlers =>
|
|
263
237
|
`{"handlers":[${handlers->Array.join(",")}]}`
|
|
264
238
|
)
|
|
265
239
|
|
|
@@ -298,14 +272,10 @@ let finish = () =>
|
|
|
298
272
|
| Some(sel) =>
|
|
299
273
|
Some(
|
|
300
274
|
sel.securityGroupId
|
|
301
|
-
->Pulumi.Output.apply(sgId =>
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
securityGroupIds: [sgId->Pulumi.Input.make]->Pulumi.Input.make,
|
|
306
|
-
}: PulumiAws.Lambda.Function.vpcConfig
|
|
307
|
-
)
|
|
308
|
-
)
|
|
275
|
+
->Pulumi.Output.apply((sgId): PulumiAws.Lambda.Function.vpcConfig => {
|
|
276
|
+
PulumiAws.Lambda.Function.subnetIds: sel.subnetIds->Pulumi.Input.make,
|
|
277
|
+
securityGroupIds: [sgId->Pulumi.Input.make]->Pulumi.Input.make,
|
|
278
|
+
})
|
|
309
279
|
->Pulumi.Output.asInput,
|
|
310
280
|
)
|
|
311
281
|
| None => None
|
|
@@ -323,7 +293,7 @@ let finish = () =>
|
|
|
323
293
|
~reservedConcurrency=?cfg.reservedConcurrency,
|
|
324
294
|
~ephemeralStorageMb=?cfg.ephemeralStorageMb,
|
|
325
295
|
~logRetentionDays=?cfg.logRetentionDays,
|
|
326
|
-
~vpcConfig
|
|
296
|
+
~vpcConfig?,
|
|
327
297
|
~opts,
|
|
328
298
|
)
|
|
329
299
|
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
// `callback.phase1`. The `bodyModule` and `context` HANDLER_CONFIG fields
|
|
21
21
|
// exist for this wiring (AutomationSliceRuntime_Builder_Single).
|
|
22
22
|
|
|
23
|
-
|
|
24
23
|
type handlerEntry = {
|
|
25
24
|
specModule: string,
|
|
26
25
|
bodyModule: string,
|
|
@@ -129,7 +128,9 @@ let parseHandlerConfigWithModules = (modulesJson: string, rawJson: string): arra
|
|
|
129
128
|
| Some(h) =>
|
|
130
129
|
switch h->strOf("n") {
|
|
131
130
|
| Some(name) =>
|
|
132
|
-
Some(
|
|
131
|
+
Some(
|
|
132
|
+
decodeCompactEntry(~modules, ~sharedQueueUrl, ~sharedIsFifo, ~sharedUrns, h, name),
|
|
133
|
+
)
|
|
133
134
|
| None => decodeEntry(item)
|
|
134
135
|
}
|
|
135
136
|
}
|
|
@@ -164,7 +165,10 @@ let defaultContext = (sliceName: string): Reventless.AutomationSlice.context =>
|
|
|
164
165
|
// be hardcoded FIFO while the command topics are standard queues, and SQS rejects
|
|
165
166
|
// the MessageGroupId a FIFO publisher attaches — a failure nothing had reached,
|
|
166
167
|
// because the role had no sqs:SendMessage to get that far.
|
|
167
|
-
let makePublishJsons = (
|
|
168
|
+
let makePublishJsons = (
|
|
169
|
+
queueUrl: string,
|
|
170
|
+
~isFifo: bool,
|
|
171
|
+
): ReventlessCore.CommandTopic.publishJsons => {
|
|
168
172
|
let queue: Util_SQS_Runtime.resolvedQueue = {id: queueUrl, name: queueUrl, arn: ""}
|
|
169
173
|
queue->CommandTopicChannel_SQS_Runtime.publishJsons(isFifo ? AWS.SQS_FIFO : AWS.SQS)
|
|
170
174
|
}
|
|
@@ -185,13 +189,12 @@ let makeSyncTodoItems = (
|
|
|
185
189
|
}
|
|
186
190
|
let save = QueryDbStorage_DynamoDb_Runtime.save(table)
|
|
187
191
|
async () => {
|
|
188
|
-
let _ =
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
->Promise.all
|
|
192
|
+
let _ = await todoItems
|
|
193
|
+
->Dict.toArray
|
|
194
|
+
->Array.map(((id, row)) =>
|
|
195
|
+
save(id, row->Reventless.Util_Sury.toJson(rowSchema), ReventlessCore.QueryDb.Overwrite, None)
|
|
196
|
+
)
|
|
197
|
+
->Promise.all
|
|
195
198
|
}
|
|
196
199
|
}
|
|
197
200
|
|
|
@@ -248,7 +251,11 @@ let makeLoadTodoItems = (
|
|
|
248
251
|
->Effect.map(items =>
|
|
249
252
|
items->Array.reduce(0, (count, item) => {
|
|
250
253
|
let json = item->JSON.stringifyAny->Option.getOr("")->JSON.parseOrThrow
|
|
251
|
-
let id =
|
|
254
|
+
let id =
|
|
255
|
+
json
|
|
256
|
+
->JSON.Decode.object
|
|
257
|
+
->Option.flatMap(d => d->Dict.get("id"))
|
|
258
|
+
->Option.flatMap(JSON.Decode.string)
|
|
252
259
|
switch id {
|
|
253
260
|
| Some(id) if todoItems->Dict.get(id)->Option.isNone =>
|
|
254
261
|
switch json->Reventless.Util_Sury.fromJson(rowSchema) {
|