@reventlessdev/reventless-aws 3.0.0-alpha.387 → 3.0.0-alpha.389
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 +32 -0
- package/README.md +1 -1
- package/package.json +12 -12
- package/scripts/ProvisionIdentity.res +1 -1
- package/src/Platform.res +14 -14
- package/src/Platform.res.mjs +30 -30
- package/src/Platform_Stack.res +3 -3
- package/src/adapter/AWS_Tags.res +1 -1
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +1 -1
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +7 -7
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res.mjs +5 -5
- package/src/adapter/Auth/Auth_ActiveRolePoolAttachment.res +1 -1
- package/src/adapter/Auth/Auth_ActiveRoleStore_Ops.res +2 -2
- package/src/adapter/Auth/Auth_ActiveRoleStore_Schema.res +1 -1
- package/src/adapter/Auth/Auth_Cognito.res +1 -1
- package/src/adapter/Auth/Auth_LoginIdentifier.res +1 -1
- package/src/adapter/Auth/Auth_SignUpMode.res +1 -1
- package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +2 -2
- package/src/adapter/EventLog/EventLogBackend.res +1 -1
- package/src/adapter/QueryDb/PgQueryResolver_Lambda.res +2 -2
- package/src/adapter/Runtime/AggregateEntryPoint.mjs +6 -6
- package/src/adapter/Runtime/AggregateEntryPoint_Ops.res +1 -1
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +20 -10
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res.mjs +7 -7
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res +20 -10
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res.mjs +7 -7
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +19 -9
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res.mjs +6 -6
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res +19 -9
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res.mjs +6 -6
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +19 -9
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res.mjs +6 -6
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res +19 -9
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res.mjs +6 -6
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +1 -1
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res +8 -3
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint.mjs +7 -7
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res +7 -7
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res.mjs +2 -2
- package/src/adapter/Runtime/EventCollectorEntryPoint.mjs +1 -1
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +6 -1
- package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +6 -1
- package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +4 -4
- package/src/adapter/Runtime/RuntimeExtensionEntryPoint_Ops.res +2 -2
- package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res +6 -1
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +10 -10
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res.mjs +3 -3
- package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res +6 -1
- package/src/adapter/StateTopic/StateTopic_AppSync.res +2 -2
- package/src/capability/Capability_Messaging.res +2 -2
- package/src/components/Aggregate_Builder_Micro.res +3 -3
- package/src/components/Aggregate_Builder_Micro.res.mjs +3 -3
- package/src/components/Aggregate_Builder_NoResolver.res +3 -3
- package/src/components/Aggregate_Builder_NoResolver.res.mjs +3 -3
- package/src/components/Aggregate_Builder_PerAggregate.res +3 -3
- package/src/components/Aggregate_Builder_PerAggregate.res.mjs +3 -3
- package/src/components/Aggregate_Builder_Single.res +3 -3
- package/src/components/Aggregate_Builder_Single.res.mjs +3 -3
- package/src/components/Aggregate_Builder_Single_Async.res +3 -3
- package/src/components/Aggregate_Builder_Single_Async.res.mjs +3 -3
- package/src/components/Api/AppSync_Adapter.res +3 -3
- package/src/components/Api/AppSync_SdlDecorate.res +3 -3
- package/src/components/SideEffectHandler_PerSideEffectHandler.res +1 -1
- package/src/components/StateChangeSlice_Builder.res +4 -4
- package/src/components/StateChangeSlice_Builder.res.mjs +4 -4
- package/src/plugin/runtime/PluginRuntime_Builder.res +7 -7
- package/src/plugin/runtime/PluginRuntime_Builder.res.mjs +3 -3
- package/src/plugin/stack/Plugin_Stack.res +1 -1
- package/src/util/Util_Bundle.res +1 -1
- package/tests/AppSync_AdapterTest.res +1 -1
- package/tests/AppSync_RetirementNarrowingTest.res +1 -1
- package/tests/AppSync_SdlDecorateTest.res +1 -1
- package/tests/Auth_LoginIdentifierTest.res +1 -1
- package/tests/Auth_SignUpModeTest.res +1 -1
- package/tests/BakeConvergenceTest.res +11 -11
- package/tests/BakeConvergenceTest.res.mjs +13 -13
- package/tests/QueryDbResolvers_AppSyncTest.res +1 -1
- package/tests/Upload_ClaimTest.res +1 -1
- package/tests/Util_AwsErrorTest.res +1 -1
- package/tests/Util_StoreLayoutTest.res +1 -1
- package/tests/dcbColdStartPartition.mjs +3 -3
- package/tests/integration/{AggTestAggregateBehavior.res → AggTestAggregateDecision.res} +2 -2
- package/tests/integration/{AggTestAggregateBehavior.res.mjs → AggTestAggregateDecision.res.mjs} +1 -1
- package/tests/integration/AggregateEntryPoint_IntegrationTest.res +3 -3
- package/tests/integration/AggregateEntryPoint_IntegrationTest.res.mjs +2 -2
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res +5 -5
- package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res.mjs +4 -4
- package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res +1 -1
- package/tests/integration/{EpCompositeSliceBehavior.res → EpCompositeSliceDecision.res} +2 -2
- package/tests/integration/{EpCompositeSliceBehavior.res.mjs → EpCompositeSliceDecision.res.mjs} +1 -1
- package/tests/integration/{EpTestSliceBehavior.res → EpTestSliceDecision.res} +2 -2
- package/tests/integration/{EpTestSliceBehavior.res.mjs → EpTestSliceDecision.res.mjs} +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
// The "typed core, thin shell" split (docs/plans/done/minimize-lambda-entrypoint-mjs-shell.md).
|
|
4
4
|
// The `.mjs` shell owns the untyped seams — reading `HANDLER_CONFIG`, the dynamic
|
|
5
|
-
// `import()` of user Spec/
|
|
5
|
+
// `import()` of user Spec/Decision modules, and the functor wiring that consumes
|
|
6
6
|
// those runtime-loaded modules (`EventLog_Operations.Make`, `Aggregate_Callback.Make`,
|
|
7
7
|
// `CommandTopic_Callback.Make`). This module owns the one piece that is pure
|
|
8
8
|
// typed framework wiring: selecting and building the EventLog storage operations.
|
|
@@ -9,7 +9,7 @@ type runtimeParts = Util.Lambda.runtimeParts
|
|
|
9
9
|
|
|
10
10
|
type aggregateInfo = {
|
|
11
11
|
specModulePath: string,
|
|
12
|
-
|
|
12
|
+
decisionModulePath: string,
|
|
13
13
|
eventLogTableName: Pulumi.Output.t<string>,
|
|
14
14
|
mappingsModulePath: option<string>,
|
|
15
15
|
}
|
|
@@ -19,13 +19,13 @@ let aggregateInfos: dict<aggregateInfo> = Dict.make()
|
|
|
19
19
|
let registerAggregate = (
|
|
20
20
|
~aggregateName,
|
|
21
21
|
~specModulePath,
|
|
22
|
-
~
|
|
22
|
+
~decisionModulePath,
|
|
23
23
|
~eventLogTableName,
|
|
24
24
|
~mappingsModulePath=?,
|
|
25
25
|
) =>
|
|
26
26
|
aggregateInfos->Dict.set(
|
|
27
27
|
aggregateName,
|
|
28
|
-
{specModulePath,
|
|
28
|
+
{specModulePath, decisionModulePath, eventLogTableName, mappingsModulePath},
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
type storedSpec = {
|
|
@@ -95,7 +95,12 @@ let forCommandGenerator: ReventlessCore.Runtime.forComponent<
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
98
|
-
ReventlessCore.Runtime.
|
|
98
|
+
ReventlessCore.Runtime.effectInvocationHandler<
|
|
99
|
+
CommandTopicChannel.callbackEvent,
|
|
100
|
+
context,
|
|
101
|
+
unit,
|
|
102
|
+
string,
|
|
103
|
+
>,
|
|
99
104
|
runtimeParts,
|
|
100
105
|
ReventlessCore.CommandTopic.component<'op>,
|
|
101
106
|
> = (~handler as _, ~connect, ~memorySize=1024, ~timeout=30, commandTopic) => {
|
|
@@ -126,7 +131,12 @@ let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
|
126
131
|
}
|
|
127
132
|
|
|
128
133
|
let forEventCollector: ReventlessCore.Runtime.forEventCollector<
|
|
129
|
-
ReventlessCore.Runtime.
|
|
134
|
+
ReventlessCore.Runtime.effectInvocationHandler<
|
|
135
|
+
EventCollectorChannel.callbackEvent,
|
|
136
|
+
context,
|
|
137
|
+
unit,
|
|
138
|
+
string,
|
|
139
|
+
>,
|
|
130
140
|
ReventlessCore.EventCollector.component,
|
|
131
141
|
> = (~handler as _, ~eventTopics, ~resources, ~memorySize=2048, ~timeout=180, eventCollector) => {
|
|
132
142
|
let eventCollectorResource = eventCollector->ReventlessCore.Component.toPulumiResource
|
|
@@ -172,12 +182,12 @@ let finish = () =>
|
|
|
172
182
|
// Collect user packages (shared by CmdTopic and CmdGen)
|
|
173
183
|
let packageDirs: dict<string> = Dict.make()
|
|
174
184
|
let specPkg = Util_Bundle.extractPackageName(info.specModulePath)
|
|
175
|
-
let
|
|
185
|
+
let decisionPkg = Util_Bundle.extractPackageName(info.decisionModulePath)
|
|
176
186
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
177
|
-
packageDirs->Dict.set(
|
|
187
|
+
packageDirs->Dict.set(decisionPkg, Util_Bundle.resolvePackageRoot(decisionPkg))
|
|
178
188
|
|
|
179
189
|
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
180
|
-
let
|
|
190
|
+
let decisionModule = info.decisionModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
181
191
|
|
|
182
192
|
// --- CommandTopic Lambda ---
|
|
183
193
|
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
@@ -193,7 +203,7 @@ let finish = () =>
|
|
|
193
203
|
spec.queueUrl,
|
|
194
204
|
spec.queueArn,
|
|
195
205
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn)) =>
|
|
196
|
-
`{"handlers":[{"specModule":${specModule},"
|
|
206
|
+
`{"handlers":[{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}}]}`
|
|
197
207
|
)
|
|
198
208
|
|
|
199
209
|
let cmdTopicEnvVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
@@ -240,7 +250,7 @@ let finish = () =>
|
|
|
240
250
|
spec.queueUrl,
|
|
241
251
|
spec.queueArn,
|
|
242
252
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn)) =>
|
|
243
|
-
`{"handlers":[{"specModule":${specModule},"
|
|
253
|
+
`{"handlers":[{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}}]}`
|
|
244
254
|
)
|
|
245
255
|
|
|
246
256
|
let cmdGenEnvVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
@@ -16,10 +16,10 @@ let log = Logger$ReventlessCore.fromEnv();
|
|
|
16
16
|
|
|
17
17
|
let aggregateInfos = {};
|
|
18
18
|
|
|
19
|
-
function registerAggregate(aggregateName, specModulePath,
|
|
19
|
+
function registerAggregate(aggregateName, specModulePath, decisionModulePath, eventLogTableName, mappingsModulePath) {
|
|
20
20
|
aggregateInfos[aggregateName] = {
|
|
21
21
|
specModulePath: specModulePath,
|
|
22
|
-
|
|
22
|
+
decisionModulePath: decisionModulePath,
|
|
23
23
|
eventLogTableName: eventLogTableName,
|
|
24
24
|
mappingsModulePath: mappingsModulePath
|
|
25
25
|
};
|
|
@@ -160,17 +160,17 @@ function finish() {
|
|
|
160
160
|
let baseName = ComponentType$ReventlessCore.name(spec.aggregateName, Aggregate$ReventlessCore.componentType);
|
|
161
161
|
let packageDirs = {};
|
|
162
162
|
let specPkg = Util_Bundle$ReventlessAws.extractPackageName(info.specModulePath);
|
|
163
|
-
let
|
|
163
|
+
let decisionPkg = Util_Bundle$ReventlessAws.extractPackageName(info.decisionModulePath);
|
|
164
164
|
packageDirs[specPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, specPkg);
|
|
165
|
-
packageDirs[
|
|
165
|
+
packageDirs[decisionPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, decisionPkg);
|
|
166
166
|
let specModule = Stdlib_Option.getOr(JSON.stringify(info.specModulePath), `""`);
|
|
167
|
-
let
|
|
167
|
+
let decisionModule = Stdlib_Option.getOr(JSON.stringify(info.decisionModulePath), `""`);
|
|
168
168
|
let pluginFragment = Util_LogAttribution$ReventlessAws.pluginFragment(`AggregateRuntime(` + spec.aggregateName + `)`);
|
|
169
169
|
let cmdTopicHandlerConfigOutput = Pulumi.all([
|
|
170
170
|
info.eventLogTableName,
|
|
171
171
|
spec.queueUrl,
|
|
172
172
|
spec.queueArn
|
|
173
|
-
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"
|
|
173
|
+
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"decisionModule":` + decisionModule + `,"eventLogTable":"` + param[0] + `","queueUrl":"` + param[1] + `","queueArn":"` + param[2] + `"` + pluginFragment + `}]}`);
|
|
174
174
|
let cmdTopicEnvVars = {};
|
|
175
175
|
cmdTopicEnvVars["HANDLER_CONFIG"] = cmdTopicHandlerConfigOutput;
|
|
176
176
|
let match = Util_Bundle$ReventlessAws.buildCodeArchive("@reventlessdev/reventless-aws/src/adapter/Runtime/AggregateEntryPoint.mjs", packageDirs, undefined, undefined);
|
|
@@ -183,7 +183,7 @@ function finish() {
|
|
|
183
183
|
info.eventLogTableName,
|
|
184
184
|
spec.queueUrl,
|
|
185
185
|
spec.queueArn
|
|
186
|
-
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"
|
|
186
|
+
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"decisionModule":` + decisionModule + `,"eventLogTable":"` + param[0] + `","queueUrl":"` + param[1] + `","queueArn":"` + param[2] + `"` + pluginFragment$1 + `}]}`);
|
|
187
187
|
let cmdGenEnvVars = {};
|
|
188
188
|
cmdGenEnvVars["HANDLER_CONFIG"] = cmdGenHandlerConfigOutput;
|
|
189
189
|
let match$1 = Util_Bundle$ReventlessAws.buildCodeArchive("@reventlessdev/reventless-aws/src/adapter/Runtime/AggregateEntryPoint.mjs", packageDirs, undefined, undefined);
|
|
@@ -13,7 +13,7 @@ type runtimeParts = Util.Lambda.runtimeParts
|
|
|
13
13
|
|
|
14
14
|
type aggregateInfo = {
|
|
15
15
|
specModulePath: string,
|
|
16
|
-
|
|
16
|
+
decisionModulePath: string,
|
|
17
17
|
eventLogTableName: Pulumi.Output.t<string>,
|
|
18
18
|
mappingsModulePath: option<string>,
|
|
19
19
|
}
|
|
@@ -23,13 +23,13 @@ let aggregateInfos: dict<aggregateInfo> = Dict.make()
|
|
|
23
23
|
let registerAggregate = (
|
|
24
24
|
~aggregateName,
|
|
25
25
|
~specModulePath,
|
|
26
|
-
~
|
|
26
|
+
~decisionModulePath,
|
|
27
27
|
~eventLogTableName,
|
|
28
28
|
~mappingsModulePath=?,
|
|
29
29
|
) =>
|
|
30
30
|
aggregateInfos->Dict.set(
|
|
31
31
|
aggregateName,
|
|
32
|
-
{specModulePath,
|
|
32
|
+
{specModulePath, decisionModulePath, eventLogTableName, mappingsModulePath},
|
|
33
33
|
)
|
|
34
34
|
|
|
35
35
|
type storedSpec = {
|
|
@@ -99,7 +99,12 @@ let forCommandGenerator: ReventlessCore.Runtime.forComponent<
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
102
|
-
ReventlessCore.Runtime.
|
|
102
|
+
ReventlessCore.Runtime.effectInvocationHandler<
|
|
103
|
+
CommandTopicChannel.callbackEvent,
|
|
104
|
+
context,
|
|
105
|
+
unit,
|
|
106
|
+
string,
|
|
107
|
+
>,
|
|
103
108
|
runtimeParts,
|
|
104
109
|
ReventlessCore.CommandTopic.component<'op>,
|
|
105
110
|
> = (~handler as _, ~connect, ~memorySize=1024, ~timeout=30, commandTopic) => {
|
|
@@ -132,7 +137,12 @@ let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
|
132
137
|
}
|
|
133
138
|
|
|
134
139
|
let forEventCollector: ReventlessCore.Runtime.forEventCollector<
|
|
135
|
-
ReventlessCore.Runtime.
|
|
140
|
+
ReventlessCore.Runtime.effectInvocationHandler<
|
|
141
|
+
EventCollectorChannel.callbackEvent,
|
|
142
|
+
context,
|
|
143
|
+
unit,
|
|
144
|
+
string,
|
|
145
|
+
>,
|
|
136
146
|
ReventlessCore.EventCollector.component,
|
|
137
147
|
> = (~handler as _, ~eventTopics, ~resources, ~memorySize=2048, ~timeout=180, eventCollector) => {
|
|
138
148
|
let eventCollectorResource = eventCollector->ReventlessCore.Component.toPulumiResource
|
|
@@ -177,12 +187,12 @@ let finish = () =>
|
|
|
177
187
|
|
|
178
188
|
let packageDirs: dict<string> = Dict.make()
|
|
179
189
|
let specPkg = Util_Bundle.extractPackageName(info.specModulePath)
|
|
180
|
-
let
|
|
190
|
+
let decisionPkg = Util_Bundle.extractPackageName(info.decisionModulePath)
|
|
181
191
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
182
|
-
packageDirs->Dict.set(
|
|
192
|
+
packageDirs->Dict.set(decisionPkg, Util_Bundle.resolvePackageRoot(decisionPkg))
|
|
183
193
|
|
|
184
194
|
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
185
|
-
let
|
|
195
|
+
let decisionModule = info.decisionModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
186
196
|
|
|
187
197
|
// --- CommandTopic Lambda ---
|
|
188
198
|
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
@@ -198,7 +208,7 @@ let finish = () =>
|
|
|
198
208
|
spec.queueUrl,
|
|
199
209
|
spec.queueArn,
|
|
200
210
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn)) =>
|
|
201
|
-
`{"handlers":[{"specModule":${specModule},"
|
|
211
|
+
`{"handlers":[{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}}]}`
|
|
202
212
|
)
|
|
203
213
|
|
|
204
214
|
let cmdTopicEnvVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
@@ -245,7 +255,7 @@ let finish = () =>
|
|
|
245
255
|
spec.queueUrl,
|
|
246
256
|
spec.queueArn,
|
|
247
257
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn)) =>
|
|
248
|
-
`{"handlers":[{"specModule":${specModule},"
|
|
258
|
+
`{"handlers":[{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}}]}`
|
|
249
259
|
)
|
|
250
260
|
|
|
251
261
|
let cmdGenEnvVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
@@ -16,10 +16,10 @@ let log = Logger$ReventlessCore.fromEnv();
|
|
|
16
16
|
|
|
17
17
|
let aggregateInfos = {};
|
|
18
18
|
|
|
19
|
-
function registerAggregate(aggregateName, specModulePath,
|
|
19
|
+
function registerAggregate(aggregateName, specModulePath, decisionModulePath, eventLogTableName, mappingsModulePath) {
|
|
20
20
|
aggregateInfos[aggregateName] = {
|
|
21
21
|
specModulePath: specModulePath,
|
|
22
|
-
|
|
22
|
+
decisionModulePath: decisionModulePath,
|
|
23
23
|
eventLogTableName: eventLogTableName,
|
|
24
24
|
mappingsModulePath: mappingsModulePath
|
|
25
25
|
};
|
|
@@ -160,17 +160,17 @@ function finish() {
|
|
|
160
160
|
let baseName = ComponentType$ReventlessCore.name(spec.aggregateName, Aggregate$ReventlessCore.componentType);
|
|
161
161
|
let packageDirs = {};
|
|
162
162
|
let specPkg = Util_Bundle$ReventlessAws.extractPackageName(info.specModulePath);
|
|
163
|
-
let
|
|
163
|
+
let decisionPkg = Util_Bundle$ReventlessAws.extractPackageName(info.decisionModulePath);
|
|
164
164
|
packageDirs[specPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, specPkg);
|
|
165
|
-
packageDirs[
|
|
165
|
+
packageDirs[decisionPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, decisionPkg);
|
|
166
166
|
let specModule = Stdlib_Option.getOr(JSON.stringify(info.specModulePath), `""`);
|
|
167
|
-
let
|
|
167
|
+
let decisionModule = Stdlib_Option.getOr(JSON.stringify(info.decisionModulePath), `""`);
|
|
168
168
|
let pluginFragment = Util_LogAttribution$ReventlessAws.pluginFragment(`AggregateRuntime(` + spec.aggregateName + `)`);
|
|
169
169
|
let cmdTopicHandlerConfigOutput = Pulumi.all([
|
|
170
170
|
info.eventLogTableName,
|
|
171
171
|
spec.queueUrl,
|
|
172
172
|
spec.queueArn
|
|
173
|
-
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"
|
|
173
|
+
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"decisionModule":` + decisionModule + `,"eventLogTable":"` + param[0] + `","queueUrl":"` + param[1] + `","queueArn":"` + param[2] + `"` + pluginFragment + `}]}`);
|
|
174
174
|
let cmdTopicEnvVars = {};
|
|
175
175
|
cmdTopicEnvVars["HANDLER_CONFIG"] = cmdTopicHandlerConfigOutput;
|
|
176
176
|
let match = Util_Bundle$ReventlessAws.buildCodeArchive("@reventlessdev/reventless-aws/src/adapter/Runtime/AggregateEntryPoint.mjs", packageDirs, undefined, undefined);
|
|
@@ -183,7 +183,7 @@ function finish() {
|
|
|
183
183
|
info.eventLogTableName,
|
|
184
184
|
spec.queueUrl,
|
|
185
185
|
spec.queueArn
|
|
186
|
-
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"
|
|
186
|
+
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"decisionModule":` + decisionModule + `,"eventLogTable":"` + param[0] + `","queueUrl":"` + param[1] + `","queueArn":"` + param[2] + `"` + pluginFragment$1 + `}]}`);
|
|
187
187
|
let cmdGenEnvVars = {};
|
|
188
188
|
cmdGenEnvVars["HANDLER_CONFIG"] = cmdGenHandlerConfigOutput;
|
|
189
189
|
cmdGenEnvVars["DISPATCH_MODE"] = "async";
|
|
@@ -9,7 +9,7 @@ type runtimeParts = Util.Lambda.runtimeParts
|
|
|
9
9
|
|
|
10
10
|
type aggregateInfo = {
|
|
11
11
|
specModulePath: string,
|
|
12
|
-
|
|
12
|
+
decisionModulePath: string,
|
|
13
13
|
eventLogTableName: Pulumi.Output.t<string>,
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -18,10 +18,10 @@ let aggregateInfos: dict<aggregateInfo> = Dict.make()
|
|
|
18
18
|
let registerAggregate = (
|
|
19
19
|
~aggregateName,
|
|
20
20
|
~specModulePath,
|
|
21
|
-
~
|
|
21
|
+
~decisionModulePath,
|
|
22
22
|
~eventLogTableName,
|
|
23
23
|
) =>
|
|
24
|
-
aggregateInfos->Dict.set(aggregateName, {specModulePath,
|
|
24
|
+
aggregateInfos->Dict.set(aggregateName, {specModulePath, decisionModulePath, eventLogTableName})
|
|
25
25
|
|
|
26
26
|
type storedSpec = {
|
|
27
27
|
aggregateName: string,
|
|
@@ -80,7 +80,12 @@ let forCommandGenerator: ReventlessCore.Runtime.forComponent<
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
83
|
-
ReventlessCore.Runtime.
|
|
83
|
+
ReventlessCore.Runtime.effectInvocationHandler<
|
|
84
|
+
CommandTopicChannel.callbackEvent,
|
|
85
|
+
context,
|
|
86
|
+
unit,
|
|
87
|
+
string,
|
|
88
|
+
>,
|
|
84
89
|
runtimeParts,
|
|
85
90
|
ReventlessCore.CommandTopic.component<'op>,
|
|
86
91
|
> = (~handler as _, ~connect, ~memorySize=1024, ~timeout=30, commandTopic) => {
|
|
@@ -113,7 +118,12 @@ let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
|
113
118
|
}
|
|
114
119
|
|
|
115
120
|
let forEventCollector: ReventlessCore.Runtime.forEventCollector<
|
|
116
|
-
ReventlessCore.Runtime.
|
|
121
|
+
ReventlessCore.Runtime.effectInvocationHandler<
|
|
122
|
+
EventCollectorChannel.callbackEvent,
|
|
123
|
+
context,
|
|
124
|
+
unit,
|
|
125
|
+
string,
|
|
126
|
+
>,
|
|
117
127
|
ReventlessCore.EventCollector.component,
|
|
118
128
|
> = (~handler as _, ~eventTopics, ~resources, ~memorySize=1024, ~timeout=30, eventCollector) => {
|
|
119
129
|
let eventCollectorResource = eventCollector->ReventlessCore.Component.toPulumiResource
|
|
@@ -166,7 +176,7 @@ let finish = () =>
|
|
|
166
176
|
|
|
167
177
|
// Build HANDLER_CONFIG with single handler
|
|
168
178
|
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
169
|
-
let
|
|
179
|
+
let decisionModule = info.decisionModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
170
180
|
|
|
171
181
|
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
172
182
|
// deploy-time structure, and the Lambda-name fallback yields nothing for a
|
|
@@ -181,7 +191,7 @@ let finish = () =>
|
|
|
181
191
|
spec.queueUrl,
|
|
182
192
|
spec.queueArn,
|
|
183
193
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn)) =>
|
|
184
|
-
`{"handlers":[{"specModule":${specModule},"
|
|
194
|
+
`{"handlers":[{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}}]}`
|
|
185
195
|
)
|
|
186
196
|
|
|
187
197
|
let envVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
@@ -190,9 +200,9 @@ let finish = () =>
|
|
|
190
200
|
// Collect user packages
|
|
191
201
|
let packageDirs: dict<string> = Dict.make()
|
|
192
202
|
let specPkg = Util_Bundle.extractPackageName(info.specModulePath)
|
|
193
|
-
let
|
|
203
|
+
let decisionPkg = Util_Bundle.extractPackageName(info.decisionModulePath)
|
|
194
204
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
195
|
-
packageDirs->Dict.set(
|
|
205
|
+
packageDirs->Dict.set(decisionPkg, Util_Bundle.resolvePackageRoot(decisionPkg))
|
|
196
206
|
|
|
197
207
|
// Build AssetArchive: static re-export + user packages
|
|
198
208
|
let {code, sourceCodeHash} = Util_Bundle.buildCodeArchive(
|
|
@@ -16,10 +16,10 @@ let log = Logger$ReventlessCore.fromEnv();
|
|
|
16
16
|
|
|
17
17
|
let aggregateInfos = {};
|
|
18
18
|
|
|
19
|
-
function registerAggregate(aggregateName, specModulePath,
|
|
19
|
+
function registerAggregate(aggregateName, specModulePath, decisionModulePath, eventLogTableName) {
|
|
20
20
|
aggregateInfos[aggregateName] = {
|
|
21
21
|
specModulePath: specModulePath,
|
|
22
|
-
|
|
22
|
+
decisionModulePath: decisionModulePath,
|
|
23
23
|
eventLogTableName: eventLogTableName
|
|
24
24
|
};
|
|
25
25
|
}
|
|
@@ -139,20 +139,20 @@ function finish() {
|
|
|
139
139
|
let name = ComponentType$ReventlessCore.name(spec.aggregateName, Aggregate$ReventlessCore.componentType);
|
|
140
140
|
let lambdaName = name + "CmdHandler";
|
|
141
141
|
let specModule = Stdlib_Option.getOr(JSON.stringify(info.specModulePath), `""`);
|
|
142
|
-
let
|
|
142
|
+
let decisionModule = Stdlib_Option.getOr(JSON.stringify(info.decisionModulePath), `""`);
|
|
143
143
|
let pluginFragment = Util_LogAttribution$ReventlessAws.pluginFragment(`AggregateRuntime(` + spec.aggregateName + `)`);
|
|
144
144
|
let handlerConfigOutput = Pulumi.all([
|
|
145
145
|
info.eventLogTableName,
|
|
146
146
|
spec.queueUrl,
|
|
147
147
|
spec.queueArn
|
|
148
|
-
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"
|
|
148
|
+
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"decisionModule":` + decisionModule + `,"eventLogTable":"` + param[0] + `","queueUrl":"` + param[1] + `","queueArn":"` + param[2] + `"` + pluginFragment + `}]}`);
|
|
149
149
|
let envVars = {};
|
|
150
150
|
envVars["HANDLER_CONFIG"] = handlerConfigOutput;
|
|
151
151
|
let packageDirs = {};
|
|
152
152
|
let specPkg = Util_Bundle$ReventlessAws.extractPackageName(info.specModulePath);
|
|
153
|
-
let
|
|
153
|
+
let decisionPkg = Util_Bundle$ReventlessAws.extractPackageName(info.decisionModulePath);
|
|
154
154
|
packageDirs[specPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, specPkg);
|
|
155
|
-
packageDirs[
|
|
155
|
+
packageDirs[decisionPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, decisionPkg);
|
|
156
156
|
let match = Util_Bundle$ReventlessAws.buildCodeArchive("@reventlessdev/reventless-aws/src/adapter/Runtime/AggregateEntryPoint.mjs", packageDirs, undefined, undefined);
|
|
157
157
|
let runtime = RuntimeEnvironment_Lambda$ReventlessAws.makeFromCodeAsset(lambdaName, "CommandHandler", "Aggregate", match.code, match.sourceCodeHash, envVars, spec.memorySize, spec.timeout, undefined, undefined, undefined, undefined, undefined, aggregateOpts);
|
|
158
158
|
spec.connects.forEach(connect => connect(runtime));
|
|
@@ -13,7 +13,7 @@ type runtimeParts = Util.Lambda.runtimeParts
|
|
|
13
13
|
|
|
14
14
|
type aggregateInfo = {
|
|
15
15
|
specModulePath: string,
|
|
16
|
-
|
|
16
|
+
decisionModulePath: string,
|
|
17
17
|
eventLogTableName: Pulumi.Output.t<string>,
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -22,10 +22,10 @@ let aggregateInfos: dict<aggregateInfo> = Dict.make()
|
|
|
22
22
|
let registerAggregate = (
|
|
23
23
|
~aggregateName,
|
|
24
24
|
~specModulePath,
|
|
25
|
-
~
|
|
25
|
+
~decisionModulePath,
|
|
26
26
|
~eventLogTableName,
|
|
27
27
|
) =>
|
|
28
|
-
aggregateInfos->Dict.set(aggregateName, {specModulePath,
|
|
28
|
+
aggregateInfos->Dict.set(aggregateName, {specModulePath, decisionModulePath, eventLogTableName})
|
|
29
29
|
|
|
30
30
|
type storedSpec = {
|
|
31
31
|
aggregateName: string,
|
|
@@ -84,7 +84,12 @@ let forCommandGenerator: ReventlessCore.Runtime.forComponent<
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
87
|
-
ReventlessCore.Runtime.
|
|
87
|
+
ReventlessCore.Runtime.effectInvocationHandler<
|
|
88
|
+
CommandTopicChannel.callbackEvent,
|
|
89
|
+
context,
|
|
90
|
+
unit,
|
|
91
|
+
string,
|
|
92
|
+
>,
|
|
88
93
|
runtimeParts,
|
|
89
94
|
ReventlessCore.CommandTopic.component<'op>,
|
|
90
95
|
> = (~handler as _, ~connect, ~memorySize=1024, ~timeout=30, commandTopic) => {
|
|
@@ -117,7 +122,12 @@ let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
|
117
122
|
}
|
|
118
123
|
|
|
119
124
|
let forEventCollector: ReventlessCore.Runtime.forEventCollector<
|
|
120
|
-
ReventlessCore.Runtime.
|
|
125
|
+
ReventlessCore.Runtime.effectInvocationHandler<
|
|
126
|
+
EventCollectorChannel.callbackEvent,
|
|
127
|
+
context,
|
|
128
|
+
unit,
|
|
129
|
+
string,
|
|
130
|
+
>,
|
|
121
131
|
ReventlessCore.EventCollector.component,
|
|
122
132
|
> = (~handler as _, ~eventTopics, ~resources, ~memorySize=1024, ~timeout=30, eventCollector) => {
|
|
123
133
|
let eventCollectorResource = eventCollector->ReventlessCore.Component.toPulumiResource
|
|
@@ -164,7 +174,7 @@ let finish = () =>
|
|
|
164
174
|
)
|
|
165
175
|
|
|
166
176
|
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
167
|
-
let
|
|
177
|
+
let decisionModule = info.decisionModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
168
178
|
|
|
169
179
|
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
170
180
|
// deploy-time structure, and the Lambda-name fallback yields nothing for a
|
|
@@ -179,7 +189,7 @@ let finish = () =>
|
|
|
179
189
|
spec.queueUrl,
|
|
180
190
|
spec.queueArn,
|
|
181
191
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn)) =>
|
|
182
|
-
`{"handlers":[{"specModule":${specModule},"
|
|
192
|
+
`{"handlers":[{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}}]}`
|
|
183
193
|
)
|
|
184
194
|
|
|
185
195
|
let envVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
@@ -188,9 +198,9 @@ let finish = () =>
|
|
|
188
198
|
|
|
189
199
|
let packageDirs: dict<string> = Dict.make()
|
|
190
200
|
let specPkg = Util_Bundle.extractPackageName(info.specModulePath)
|
|
191
|
-
let
|
|
201
|
+
let decisionPkg = Util_Bundle.extractPackageName(info.decisionModulePath)
|
|
192
202
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
193
|
-
packageDirs->Dict.set(
|
|
203
|
+
packageDirs->Dict.set(decisionPkg, Util_Bundle.resolvePackageRoot(decisionPkg))
|
|
194
204
|
|
|
195
205
|
let {code, sourceCodeHash} = Util_Bundle.buildCodeArchive(
|
|
196
206
|
~entryPointModule="@reventlessdev/reventless-aws/src/adapter/Runtime/AggregateEntryPoint.mjs",
|
|
@@ -16,10 +16,10 @@ let log = Logger$ReventlessCore.fromEnv();
|
|
|
16
16
|
|
|
17
17
|
let aggregateInfos = {};
|
|
18
18
|
|
|
19
|
-
function registerAggregate(aggregateName, specModulePath,
|
|
19
|
+
function registerAggregate(aggregateName, specModulePath, decisionModulePath, eventLogTableName) {
|
|
20
20
|
aggregateInfos[aggregateName] = {
|
|
21
21
|
specModulePath: specModulePath,
|
|
22
|
-
|
|
22
|
+
decisionModulePath: decisionModulePath,
|
|
23
23
|
eventLogTableName: eventLogTableName
|
|
24
24
|
};
|
|
25
25
|
}
|
|
@@ -138,21 +138,21 @@ function finish() {
|
|
|
138
138
|
};
|
|
139
139
|
let name = ComponentType$ReventlessCore.name(spec.aggregateName, Aggregate$ReventlessCore.componentType);
|
|
140
140
|
let specModule = Stdlib_Option.getOr(JSON.stringify(info.specModulePath), `""`);
|
|
141
|
-
let
|
|
141
|
+
let decisionModule = Stdlib_Option.getOr(JSON.stringify(info.decisionModulePath), `""`);
|
|
142
142
|
let pluginFragment = Util_LogAttribution$ReventlessAws.pluginFragment(`AggregateRuntime(` + spec.aggregateName + `)`);
|
|
143
143
|
let handlerConfigOutput = Pulumi.all([
|
|
144
144
|
info.eventLogTableName,
|
|
145
145
|
spec.queueUrl,
|
|
146
146
|
spec.queueArn
|
|
147
|
-
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"
|
|
147
|
+
]).apply(param => `{"handlers":[{"specModule":` + specModule + `,"decisionModule":` + decisionModule + `,"eventLogTable":"` + param[0] + `","queueUrl":"` + param[1] + `","queueArn":"` + param[2] + `"` + pluginFragment + `}]}`);
|
|
148
148
|
let envVars = {};
|
|
149
149
|
envVars["HANDLER_CONFIG"] = handlerConfigOutput;
|
|
150
150
|
envVars["DISPATCH_MODE"] = "async";
|
|
151
151
|
let packageDirs = {};
|
|
152
152
|
let specPkg = Util_Bundle$ReventlessAws.extractPackageName(info.specModulePath);
|
|
153
|
-
let
|
|
153
|
+
let decisionPkg = Util_Bundle$ReventlessAws.extractPackageName(info.decisionModulePath);
|
|
154
154
|
packageDirs[specPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, specPkg);
|
|
155
|
-
packageDirs[
|
|
155
|
+
packageDirs[decisionPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, decisionPkg);
|
|
156
156
|
let match = Util_Bundle$ReventlessAws.buildCodeArchive("@reventlessdev/reventless-aws/src/adapter/Runtime/AggregateEntryPoint.mjs", packageDirs, undefined, undefined);
|
|
157
157
|
let runtime = RuntimeEnvironment_Lambda$ReventlessAws.makeFromCodeAsset(name, "CommandHandler", "Aggregate", match.code, match.sourceCodeHash, envVars, spec.memorySize, spec.timeout, undefined, undefined, undefined, undefined, undefined, aggregateOpts);
|
|
158
158
|
spec.connects.forEach(connect => connect(runtime));
|
|
@@ -9,7 +9,7 @@ type runtimeParts = Util.Lambda.runtimeParts
|
|
|
9
9
|
|
|
10
10
|
type aggregateInfo = {
|
|
11
11
|
specModulePath: string,
|
|
12
|
-
|
|
12
|
+
decisionModulePath: string,
|
|
13
13
|
eventLogTableName: Pulumi.Output.t<string>,
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -26,10 +26,10 @@ let setConfig = (c: ReventlessCore.Runtime.commandHandlerConfig) => configRef :=
|
|
|
26
26
|
let registerAggregate = (
|
|
27
27
|
~aggregateName,
|
|
28
28
|
~specModulePath,
|
|
29
|
-
~
|
|
29
|
+
~decisionModulePath,
|
|
30
30
|
~eventLogTableName,
|
|
31
31
|
) =>
|
|
32
|
-
aggregateInfos->Dict.set(aggregateName, {specModulePath,
|
|
32
|
+
aggregateInfos->Dict.set(aggregateName, {specModulePath, decisionModulePath, eventLogTableName})
|
|
33
33
|
|
|
34
34
|
// Plugin RM table name for the resolver-level plugin status gate (Part 2.3 of
|
|
35
35
|
// the resolver plan). Set by the platform after Admin.construct returns; consumed
|
|
@@ -102,7 +102,12 @@ let forCommandGenerator: ReventlessCore.Runtime.forComponent<
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
105
|
-
ReventlessCore.Runtime.
|
|
105
|
+
ReventlessCore.Runtime.effectInvocationHandler<
|
|
106
|
+
CommandTopicChannel.callbackEvent,
|
|
107
|
+
context,
|
|
108
|
+
unit,
|
|
109
|
+
string,
|
|
110
|
+
>,
|
|
106
111
|
runtimeParts,
|
|
107
112
|
ReventlessCore.CommandTopic.component<'op>,
|
|
108
113
|
> = (~handler as _, ~connect, ~memorySize=1024, ~timeout=30, commandTopic) => {
|
|
@@ -136,7 +141,12 @@ let forCommandTopic: ReventlessCore.Runtime.forComponent<
|
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
let forEventCollector: ReventlessCore.Runtime.forEventCollector<
|
|
139
|
-
ReventlessCore.Runtime.
|
|
144
|
+
ReventlessCore.Runtime.effectInvocationHandler<
|
|
145
|
+
EventCollectorChannel.callbackEvent,
|
|
146
|
+
context,
|
|
147
|
+
unit,
|
|
148
|
+
string,
|
|
149
|
+
>,
|
|
140
150
|
ReventlessCore.EventCollector.component,
|
|
141
151
|
> = (~handler as _, ~eventTopics, ~resources, ~memorySize=1024, ~timeout=30, eventCollector) => {
|
|
142
152
|
let eventCollectorResource = eventCollector->ReventlessCore.Component.toPulumiResource
|
|
@@ -218,13 +228,13 @@ let finish = () =>
|
|
|
218
228
|
| Some(info) =>
|
|
219
229
|
// Collect unique user packages for the code asset
|
|
220
230
|
let specPkg = Util_Bundle.extractPackageName(info.specModulePath)
|
|
221
|
-
let
|
|
231
|
+
let decisionPkg = Util_Bundle.extractPackageName(info.decisionModulePath)
|
|
222
232
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
223
|
-
packageDirs->Dict.set(
|
|
233
|
+
packageDirs->Dict.set(decisionPkg, Util_Bundle.resolvePackageRoot(decisionPkg))
|
|
224
234
|
|
|
225
235
|
// Combine the three Output values into a JSON object string
|
|
226
236
|
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
227
|
-
let
|
|
237
|
+
let decisionModule = info.decisionModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
228
238
|
|
|
229
239
|
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
230
240
|
// deploy-time structure, and the Lambda-name fallback yields nothing for a
|
|
@@ -240,7 +250,7 @@ let finish = () =>
|
|
|
240
250
|
spec.queueArn,
|
|
241
251
|
pgConnectionFragment,
|
|
242
252
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn, pgFragment)) =>
|
|
243
|
-
`{"specModule":${specModule},"
|
|
253
|
+
`{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}${pgFragment}}`
|
|
244
254
|
)
|
|
245
255
|
let _ = handlerOutputs->Array.push(handlerJson)
|
|
246
256
|
| None =>
|
|
@@ -31,10 +31,10 @@ function setConfig(c) {
|
|
|
31
31
|
configRef.contents = c;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function registerAggregate(aggregateName, specModulePath,
|
|
34
|
+
function registerAggregate(aggregateName, specModulePath, decisionModulePath, eventLogTableName) {
|
|
35
35
|
aggregateInfos[aggregateName] = {
|
|
36
36
|
specModulePath: specModulePath,
|
|
37
|
-
|
|
37
|
+
decisionModulePath: decisionModulePath,
|
|
38
38
|
eventLogTableName: eventLogTableName
|
|
39
39
|
};
|
|
40
40
|
}
|
|
@@ -171,18 +171,18 @@ function finish() {
|
|
|
171
171
|
return log.warn("AggregateRuntime_Builder_Single", undefined, `no handler registered for ` + spec.aggregateName);
|
|
172
172
|
}
|
|
173
173
|
let specPkg = Util_Bundle$ReventlessAws.extractPackageName(info.specModulePath);
|
|
174
|
-
let
|
|
174
|
+
let decisionPkg = Util_Bundle$ReventlessAws.extractPackageName(info.decisionModulePath);
|
|
175
175
|
packageDirs[specPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, specPkg);
|
|
176
|
-
packageDirs[
|
|
176
|
+
packageDirs[decisionPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, decisionPkg);
|
|
177
177
|
let specModule = Stdlib_Option.getOr(JSON.stringify(info.specModulePath), `""`);
|
|
178
|
-
let
|
|
178
|
+
let decisionModule = Stdlib_Option.getOr(JSON.stringify(info.decisionModulePath), `""`);
|
|
179
179
|
let pluginFragment = Util_LogAttribution$ReventlessAws.pluginFragment(`AggregateRuntime(` + spec.aggregateName + `)`);
|
|
180
180
|
let handlerJson = Pulumi.all([
|
|
181
181
|
info.eventLogTableName,
|
|
182
182
|
spec.queueUrl,
|
|
183
183
|
spec.queueArn,
|
|
184
184
|
pgConnectionFragment
|
|
185
|
-
]).apply(param => `{"specModule":` + specModule + `,"
|
|
185
|
+
]).apply(param => `{"specModule":` + specModule + `,"decisionModule":` + decisionModule + `,"eventLogTable":"` + param[0] + `","queueUrl":"` + param[1] + `","queueArn":"` + param[2] + `"` + pluginFragment + param[3] + `}`);
|
|
186
186
|
handlerOutputs.push(handlerJson);
|
|
187
187
|
});
|
|
188
188
|
let handlerConfigOutput = Pulumi.all(handlerOutputs).apply(handlers => {
|