@reventlessdev/reventless-aws 3.0.0-alpha.387 → 3.0.0-alpha.388
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 +14 -0
- package/README.md +1 -1
- package/package.json +12 -12
- package/scripts/ProvisionIdentity.res +1 -1
- package/src/Platform.res +13 -13
- package/src/Platform.res.mjs +28 -28
- package/src/Platform_Stack.res +3 -3
- package/src/adapter/AWS_Tags.res +1 -1
- 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 +8 -8
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res.mjs +7 -7
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res +8 -8
- package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res.mjs +7 -7
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +7 -7
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res.mjs +6 -6
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res +7 -7
- package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res.mjs +6 -6
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +7 -7
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res.mjs +6 -6
- package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res +7 -7
- 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 +2 -2
- 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/RuntimeEnvironment_Lambda.res +2 -2
- package/src/adapter/Runtime/RuntimeExtensionEntryPoint_Ops.res +2 -2
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +10 -10
- package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res.mjs +3 -3
- package/src/adapter/StateTopic/StateTopic_AppSync.res +1 -1
- 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 +4 -4
- 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
|
@@ -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 = {
|
|
@@ -177,12 +177,12 @@ let finish = () =>
|
|
|
177
177
|
|
|
178
178
|
let packageDirs: dict<string> = Dict.make()
|
|
179
179
|
let specPkg = Util_Bundle.extractPackageName(info.specModulePath)
|
|
180
|
-
let
|
|
180
|
+
let decisionPkg = Util_Bundle.extractPackageName(info.decisionModulePath)
|
|
181
181
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
182
|
-
packageDirs->Dict.set(
|
|
182
|
+
packageDirs->Dict.set(decisionPkg, Util_Bundle.resolvePackageRoot(decisionPkg))
|
|
183
183
|
|
|
184
184
|
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
185
|
-
let
|
|
185
|
+
let decisionModule = info.decisionModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
186
186
|
|
|
187
187
|
// --- CommandTopic Lambda ---
|
|
188
188
|
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
@@ -198,7 +198,7 @@ let finish = () =>
|
|
|
198
198
|
spec.queueUrl,
|
|
199
199
|
spec.queueArn,
|
|
200
200
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn)) =>
|
|
201
|
-
`{"handlers":[{"specModule":${specModule},"
|
|
201
|
+
`{"handlers":[{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}}]}`
|
|
202
202
|
)
|
|
203
203
|
|
|
204
204
|
let cmdTopicEnvVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
@@ -245,7 +245,7 @@ let finish = () =>
|
|
|
245
245
|
spec.queueUrl,
|
|
246
246
|
spec.queueArn,
|
|
247
247
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn)) =>
|
|
248
|
-
`{"handlers":[{"specModule":${specModule},"
|
|
248
|
+
`{"handlers":[{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}}]}`
|
|
249
249
|
)
|
|
250
250
|
|
|
251
251
|
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,
|
|
@@ -166,7 +166,7 @@ let finish = () =>
|
|
|
166
166
|
|
|
167
167
|
// Build HANDLER_CONFIG with single handler
|
|
168
168
|
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
169
|
-
let
|
|
169
|
+
let decisionModule = info.decisionModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
170
170
|
|
|
171
171
|
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
172
172
|
// deploy-time structure, and the Lambda-name fallback yields nothing for a
|
|
@@ -181,7 +181,7 @@ let finish = () =>
|
|
|
181
181
|
spec.queueUrl,
|
|
182
182
|
spec.queueArn,
|
|
183
183
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn)) =>
|
|
184
|
-
`{"handlers":[{"specModule":${specModule},"
|
|
184
|
+
`{"handlers":[{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}}]}`
|
|
185
185
|
)
|
|
186
186
|
|
|
187
187
|
let envVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
@@ -190,9 +190,9 @@ let finish = () =>
|
|
|
190
190
|
// Collect user packages
|
|
191
191
|
let packageDirs: dict<string> = Dict.make()
|
|
192
192
|
let specPkg = Util_Bundle.extractPackageName(info.specModulePath)
|
|
193
|
-
let
|
|
193
|
+
let decisionPkg = Util_Bundle.extractPackageName(info.decisionModulePath)
|
|
194
194
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
195
|
-
packageDirs->Dict.set(
|
|
195
|
+
packageDirs->Dict.set(decisionPkg, Util_Bundle.resolvePackageRoot(decisionPkg))
|
|
196
196
|
|
|
197
197
|
// Build AssetArchive: static re-export + user packages
|
|
198
198
|
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,
|
|
@@ -164,7 +164,7 @@ let finish = () =>
|
|
|
164
164
|
)
|
|
165
165
|
|
|
166
166
|
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
167
|
-
let
|
|
167
|
+
let decisionModule = info.decisionModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
168
168
|
|
|
169
169
|
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
170
170
|
// deploy-time structure, and the Lambda-name fallback yields nothing for a
|
|
@@ -179,7 +179,7 @@ let finish = () =>
|
|
|
179
179
|
spec.queueUrl,
|
|
180
180
|
spec.queueArn,
|
|
181
181
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn)) =>
|
|
182
|
-
`{"handlers":[{"specModule":${specModule},"
|
|
182
|
+
`{"handlers":[{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}}]}`
|
|
183
183
|
)
|
|
184
184
|
|
|
185
185
|
let envVars: dict<Pulumi.Input.t<string>> = Dict.make()
|
|
@@ -188,9 +188,9 @@ let finish = () =>
|
|
|
188
188
|
|
|
189
189
|
let packageDirs: dict<string> = Dict.make()
|
|
190
190
|
let specPkg = Util_Bundle.extractPackageName(info.specModulePath)
|
|
191
|
-
let
|
|
191
|
+
let decisionPkg = Util_Bundle.extractPackageName(info.decisionModulePath)
|
|
192
192
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
193
|
-
packageDirs->Dict.set(
|
|
193
|
+
packageDirs->Dict.set(decisionPkg, Util_Bundle.resolvePackageRoot(decisionPkg))
|
|
194
194
|
|
|
195
195
|
let {code, sourceCodeHash} = Util_Bundle.buildCodeArchive(
|
|
196
196
|
~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
|
|
@@ -218,13 +218,13 @@ let finish = () =>
|
|
|
218
218
|
| Some(info) =>
|
|
219
219
|
// Collect unique user packages for the code asset
|
|
220
220
|
let specPkg = Util_Bundle.extractPackageName(info.specModulePath)
|
|
221
|
-
let
|
|
221
|
+
let decisionPkg = Util_Bundle.extractPackageName(info.decisionModulePath)
|
|
222
222
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
223
|
-
packageDirs->Dict.set(
|
|
223
|
+
packageDirs->Dict.set(decisionPkg, Util_Bundle.resolvePackageRoot(decisionPkg))
|
|
224
224
|
|
|
225
225
|
// Combine the three Output values into a JSON object string
|
|
226
226
|
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
227
|
-
let
|
|
227
|
+
let decisionModule = info.decisionModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
228
228
|
|
|
229
229
|
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
230
230
|
// deploy-time structure, and the Lambda-name fallback yields nothing for a
|
|
@@ -240,7 +240,7 @@ let finish = () =>
|
|
|
240
240
|
spec.queueArn,
|
|
241
241
|
pgConnectionFragment,
|
|
242
242
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn, pgFragment)) =>
|
|
243
|
-
`{"specModule":${specModule},"
|
|
243
|
+
`{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}${pgFragment}}`
|
|
244
244
|
)
|
|
245
245
|
let _ = handlerOutputs->Array.push(handlerJson)
|
|
246
246
|
| 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 => {
|
|
@@ -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
|
|
|
@@ -29,10 +29,10 @@ let setConfig = (c: ReventlessCore.Runtime.commandHandlerConfig) => configRef :=
|
|
|
29
29
|
let registerAggregate = (
|
|
30
30
|
~aggregateName,
|
|
31
31
|
~specModulePath,
|
|
32
|
-
~
|
|
32
|
+
~decisionModulePath,
|
|
33
33
|
~eventLogTableName,
|
|
34
34
|
) =>
|
|
35
|
-
aggregateInfos->Dict.set(aggregateName, {specModulePath,
|
|
35
|
+
aggregateInfos->Dict.set(aggregateName, {specModulePath, decisionModulePath, eventLogTableName})
|
|
36
36
|
|
|
37
37
|
type storedSpec = {
|
|
38
38
|
aggregateName: string,
|
|
@@ -200,12 +200,12 @@ let finish = () =>
|
|
|
200
200
|
switch aggregateInfos->Dict.get(spec.aggregateName) {
|
|
201
201
|
| Some(info) =>
|
|
202
202
|
let specPkg = Util_Bundle.extractPackageName(info.specModulePath)
|
|
203
|
-
let
|
|
203
|
+
let decisionPkg = Util_Bundle.extractPackageName(info.decisionModulePath)
|
|
204
204
|
packageDirs->Dict.set(specPkg, Util_Bundle.resolvePackageRoot(specPkg))
|
|
205
|
-
packageDirs->Dict.set(
|
|
205
|
+
packageDirs->Dict.set(decisionPkg, Util_Bundle.resolvePackageRoot(decisionPkg))
|
|
206
206
|
|
|
207
207
|
let specModule = info.specModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
208
|
-
let
|
|
208
|
+
let decisionModule = info.decisionModulePath->JSON.stringifyAny->Option.getOr(`""`)
|
|
209
209
|
|
|
210
210
|
// `plugin` cannot be resolved inside the Lambda — LogPrefix's registry is a
|
|
211
211
|
// deploy-time structure, and the Lambda-name fallback yields nothing for a
|
|
@@ -221,7 +221,7 @@ let finish = () =>
|
|
|
221
221
|
spec.queueArn,
|
|
222
222
|
pgConnectionFragment,
|
|
223
223
|
))->Pulumi.Output.apply(((table, queueUrl, queueArn, pgFragment)) =>
|
|
224
|
-
`{"specModule":${specModule},"
|
|
224
|
+
`{"specModule":${specModule},"decisionModule":${decisionModule},"eventLogTable":"${table}","queueUrl":"${queueUrl}","queueArn":"${queueArn}"${pluginFragment}${pgFragment}}`
|
|
225
225
|
)
|
|
226
226
|
let _ = handlerOutputs->Array.push(handlerJson)
|
|
227
227
|
| None =>
|
|
@@ -30,10 +30,10 @@ function setConfig(c) {
|
|
|
30
30
|
configRef.contents = c;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
function registerAggregate(aggregateName, specModulePath,
|
|
33
|
+
function registerAggregate(aggregateName, specModulePath, decisionModulePath, eventLogTableName) {
|
|
34
34
|
aggregateInfos[aggregateName] = {
|
|
35
35
|
specModulePath: specModulePath,
|
|
36
|
-
|
|
36
|
+
decisionModulePath: decisionModulePath,
|
|
37
37
|
eventLogTableName: eventLogTableName
|
|
38
38
|
};
|
|
39
39
|
}
|
|
@@ -162,18 +162,18 @@ function finish() {
|
|
|
162
162
|
return log.warn("AggregateRuntime_Builder_Single_Async", undefined, `no handler registered for ` + spec.aggregateName);
|
|
163
163
|
}
|
|
164
164
|
let specPkg = Util_Bundle$ReventlessAws.extractPackageName(info.specModulePath);
|
|
165
|
-
let
|
|
165
|
+
let decisionPkg = Util_Bundle$ReventlessAws.extractPackageName(info.decisionModulePath);
|
|
166
166
|
packageDirs[specPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, specPkg);
|
|
167
|
-
packageDirs[
|
|
167
|
+
packageDirs[decisionPkg] = Util_Bundle$ReventlessAws.resolvePackageRoot(undefined, decisionPkg);
|
|
168
168
|
let specModule = Stdlib_Option.getOr(JSON.stringify(info.specModulePath), `""`);
|
|
169
|
-
let
|
|
169
|
+
let decisionModule = Stdlib_Option.getOr(JSON.stringify(info.decisionModulePath), `""`);
|
|
170
170
|
let pluginFragment = Util_LogAttribution$ReventlessAws.pluginFragment(`AggregateRuntime(` + spec.aggregateName + `)`);
|
|
171
171
|
let handlerJson = Pulumi.all([
|
|
172
172
|
info.eventLogTableName,
|
|
173
173
|
spec.queueUrl,
|
|
174
174
|
spec.queueArn,
|
|
175
175
|
pgConnectionFragment
|
|
176
|
-
]).apply(param => `{"specModule":` + specModule + `,"
|
|
176
|
+
]).apply(param => `{"specModule":` + specModule + `,"decisionModule":` + decisionModule + `,"eventLogTable":"` + param[0] + `","queueUrl":"` + param[1] + `","queueArn":"` + param[2] + `"` + pluginFragment + param[3] + `}`);
|
|
177
177
|
handlerOutputs.push(handlerJson);
|
|
178
178
|
});
|
|
179
179
|
let handlerConfigOutput = Pulumi.all(handlerOutputs).apply(handlers => `{"handlers":[` + handlers.join(",") + `]}`);
|
|
@@ -399,7 +399,7 @@ channel it cannot send on.
|
|
|
399
399
|
/** The email transport this deployment chose.
|
|
400
400
|
|
|
401
401
|
Read per call like the sender beside it, and defaulting to SES on anything it
|
|
402
|
-
does not
|
|
402
|
+
does not recognize — including the empty string a platform that named nothing
|
|
403
403
|
exports. The deploy already refuses an unknown value (`Capability_Messaging`
|
|
404
404
|
parses it there, where a human is watching); defaulting again here is for the
|
|
405
405
|
case that cannot be refused, a Lambda whose variable was edited by hand. SES
|
|
@@ -533,7 +533,7 @@ let finish = () =>
|
|
|
533
533
|
// HANDLER_CONFIG: this is one shared Lambda and every slice on it reaches
|
|
534
534
|
// the same capability. A capability the platform did not provision arrives
|
|
535
535
|
// as "", which its client reads as "not configured" and reports as a
|
|
536
|
-
// retryable `Unavailable` — a
|
|
536
|
+
// retryable `Unavailable` — a modeled outcome rather than a missing
|
|
537
537
|
// variable that fails as a crash.
|
|
538
538
|
PluginRuntime_Builder.capabilityEnv()->Array.forEach(((name, value)) =>
|
|
539
539
|
envVars->Dict.set(name, value->Pulumi.Output.asInput)
|
|
@@ -782,7 +782,7 @@ let finishWithDcbEventLog = (
|
|
|
782
782
|
// HANDLER_CONFIG: this is one shared Lambda and every slice on it reaches
|
|
783
783
|
// the same capability. A capability the platform did not provision arrives
|
|
784
784
|
// as "", which its client reads as "not configured" and reports as a
|
|
785
|
-
// retryable `Unavailable` — a
|
|
785
|
+
// retryable `Unavailable` — a modeled outcome rather than a missing
|
|
786
786
|
// variable that fails as a crash.
|
|
787
787
|
PluginRuntime_Builder.capabilityEnv()->Array.forEach(((name, value)) =>
|
|
788
788
|
envVars->Dict.set(name, value->Pulumi.Output.asInput)
|
|
@@ -64,19 +64,19 @@ const dcbComp = (plugin) => `DcbCommandTopicRuntime(${plugin})`;
|
|
|
64
64
|
// already-parsed `HANDLER_CONFIG` shape, with an injectable module loader.
|
|
65
65
|
// In production, `buildHandler` below wraps this with the env-config + the
|
|
66
66
|
// Lambda's `/var/task/node_modules` dynamic-import; integration tests inject
|
|
67
|
-
// their own loader that returns pre-imported spec/
|
|
67
|
+
// their own loader that returns pre-imported spec/decision modules so the test
|
|
68
68
|
// can drive the real `cmdGenHandler` end-to-end against DynamoDB Local.
|
|
69
69
|
export async function buildHandlersForConfig(config, opts = {}) {
|
|
70
70
|
const loadModule = opts.loadModule ?? dynamicImport;
|
|
71
71
|
|
|
72
|
-
// Untyped boundary: dynamically import + id-patch the user Spec/
|
|
72
|
+
// Untyped boundary: dynamically import + id-patch the user Spec/Decision
|
|
73
73
|
// modules. Their types are unknowable here — this is the one seam the typed
|
|
74
74
|
// core (below) cannot own, so it stays in the shell.
|
|
75
75
|
const loadedSlices = await Promise.all(
|
|
76
|
-
config.stateChangeSliceModules.map(async ({ spec,
|
|
76
|
+
config.stateChangeSliceModules.map(async ({ spec, decision }) => {
|
|
77
77
|
const specModule = await loadModule(spec);
|
|
78
|
-
const
|
|
79
|
-
return { patchedSpec: patchSpecId(specModule),
|
|
78
|
+
const decisionModule = await loadModule(decision);
|
|
79
|
+
return { patchedSpec: patchSpecId(specModule), decisionModule };
|
|
80
80
|
})
|
|
81
81
|
);
|
|
82
82
|
|
|
@@ -108,14 +108,14 @@ export async function buildHandlersForConfig(config, opts = {}) {
|
|
|
108
108
|
publishJson: async (_name, _meta, _json) => {},
|
|
109
109
|
});
|
|
110
110
|
|
|
111
|
-
loadedSlices.forEach(({ patchedSpec,
|
|
111
|
+
loadedSlices.forEach(({ patchedSpec, decisionModule }) => {
|
|
112
112
|
// Typed core: builds the slice callback (functor), the JSON→command decode,
|
|
113
113
|
// and the handleCommands invocation — all compiler-checked (was the fragile
|
|
114
114
|
// positional call this file's line-146 comment warned about; see the
|
|
115
115
|
// 2026-06-21 arity-drift incident referenced in the _Ops header).
|
|
116
116
|
const jsonHandler = buildSliceHandler(
|
|
117
117
|
patchedSpec,
|
|
118
|
-
|
|
118
|
+
decisionModule,
|
|
119
119
|
scope,
|
|
120
120
|
sharedDcbEventLogOps,
|
|
121
121
|
);
|
|
@@ -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 one boundary that is inherently untyped: reading
|
|
5
|
-
// `HANDLER_CONFIG` and dynamically `import()`-ing user Spec/
|
|
5
|
+
// `HANDLER_CONFIG` and dynamically `import()`-ing user Spec/Decision modules at
|
|
6
6
|
// cold start, whose types are unknowable here. Everything below is compiler-
|
|
7
7
|
// checked against the *real* framework signatures, so the invariants that used
|
|
8
8
|
// to live only in `.mjs` comments are now enforced by the build:
|
|
@@ -165,18 +165,18 @@ let makeStorageOps = (
|
|
|
165
165
|
// (a labelled arg added before the positional ones shifts `stream` to
|
|
166
166
|
// undefined, crashing inside `Stream.mapEffect`). Moving the functor call, the
|
|
167
167
|
// JSON→command decode, and the `handleCommands` invocation here makes all three
|
|
168
|
-
// compiler-checked. The loaded Spec/
|
|
168
|
+
// compiler-checked. The loaded Spec/Decision modules enter opaque (a clean
|
|
169
169
|
// pass-through to the functor — not poked at); `dcbEventLog` enters as a
|
|
170
170
|
// boundary-typed parameter (the shell still builds it).
|
|
171
171
|
|
|
172
172
|
// The loaded slice's `command` type — opaque; flows from the decode straight
|
|
173
173
|
// into `handleCommands`, so decode and consume share one abstract type.
|
|
174
174
|
type command
|
|
175
|
-
type
|
|
175
|
+
type decisionModule
|
|
176
176
|
|
|
177
177
|
@get external specCommandSchemaTyped: specModule => S.t<command> = "commandSchema"
|
|
178
178
|
|
|
179
|
-
// `StateChangeSlice_Callback.Make(Spec)(
|
|
179
|
+
// `StateChangeSlice_Callback.Make(Spec)(Decision)` — curried in compiled form.
|
|
180
180
|
type sliceCallback = {
|
|
181
181
|
handleCommands: (
|
|
182
182
|
~tagKeysByEventType: dict<array<string>>=?,
|
|
@@ -195,7 +195,7 @@ type sliceCallback = {
|
|
|
195
195
|
@module(
|
|
196
196
|
"@reventlessdev/reventless-core/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs"
|
|
197
197
|
)
|
|
198
|
-
external makeSliceCallback: specModule =>
|
|
198
|
+
external makeSliceCallback: specModule => decisionModule => sliceCallback = "Make"
|
|
199
199
|
|
|
200
200
|
// Builds the per-slice JSON-command handler: decode each topic item's JSON
|
|
201
201
|
// command against the slice's schema (dropping undecodable ones), then dispatch
|
|
@@ -203,11 +203,11 @@ external makeSliceCallback: specModule => behaviorModule => sliceCallback = "Mak
|
|
|
203
203
|
// `Stream.t<topicItem<JSON>> => Effect` the shell's routing map keys on.
|
|
204
204
|
let buildSliceHandler = (
|
|
205
205
|
spec: specModule,
|
|
206
|
-
|
|
206
|
+
decision: decisionModule,
|
|
207
207
|
scope: derivedScope,
|
|
208
208
|
dcbEventLog: ReventlessInfra.DcbEventLog.operations,
|
|
209
209
|
) => {
|
|
210
|
-
let callback = makeSliceCallback(spec)(
|
|
210
|
+
let callback = makeSliceCallback(spec)(decision)
|
|
211
211
|
let commandSchema = spec->specCommandSchemaTyped
|
|
212
212
|
(jsonStream: Stream.t<ReventlessInfra.CommandTopic.topicItem<JSON.t>, string, unit>): Effect.t<
|
|
213
213
|
array<result<string, string>>,
|
|
@@ -94,8 +94,8 @@ function makeStorageOps(tableName, pgConnection, scope) {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
function buildSliceHandler(spec,
|
|
98
|
-
let callback = StateChangeSlice_CallbackResMjs.Make(spec)(
|
|
97
|
+
function buildSliceHandler(spec, decision, scope, dcbEventLog) {
|
|
98
|
+
let callback = StateChangeSlice_CallbackResMjs.Make(spec)(decision);
|
|
99
99
|
let commandSchema = spec.commandSchema;
|
|
100
100
|
return jsonStream => {
|
|
101
101
|
let decodedStream = Stream.flatMap(Stream.mapEffect(jsonStream, topicItem => Effect.sync(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Plugin EventCollector Lambda entry point — shared between the platform and every
|
|
2
|
-
// per-plugin EventCollector Lambda. This module is plugin-agnostic:
|
|
2
|
+
// per-plugin EventCollector Lambda. This module is plugin-agnostic: behavior is
|
|
3
3
|
// driven entirely by HANDLER_CONFIG.
|
|
4
4
|
//
|
|
5
5
|
// Thin untyped shell ("typed core, thin shell" —
|
|
@@ -105,7 +105,7 @@ let makeFromCodeAsset: (
|
|
|
105
105
|
kind; `makeFromCodeAsset` announces the provisioned Lambda to the
|
|
106
106
|
`Monitoring` registry (no-op unless an extension registered a backend). */
|
|
107
107
|
~unitKind: ReventlessCore.Monitoring.unitKind,
|
|
108
|
-
/** The
|
|
108
|
+
/** The modeling kind of the component this Lambda runs, for resource
|
|
109
109
|
attribution (`reventless:kind`). Distinct from `~unitKind`, which grades
|
|
110
110
|
the unit by what its failure means — `CommandHandler` covers aggregates,
|
|
111
111
|
state-change slices and extension points alike, so it cannot identify the
|
|
@@ -251,7 +251,7 @@ let makeFromCodeAsset: (
|
|
|
251
251
|
// ESM self-containment (Option C): every code archive built by
|
|
252
252
|
// Util_Bundle.buildCodeArchive ships register-hook.mjs + layer-resolver.mjs at
|
|
253
253
|
// /var/task. --import registers the resolve hook so the ESM entry point (and the
|
|
254
|
-
// user spec/
|
|
254
|
+
// user spec/decision modules it dynamically imports) can resolve bare specifiers
|
|
255
255
|
// — @reventlessdev/*, effect, sury from the layer, @aws-sdk/* from the runtime —
|
|
256
256
|
// that ESM `import` would otherwise not find outside /var/task. Framework
|
|
257
257
|
// invariant: set last so it wins over any caller-supplied value.
|