@reventlessdev/reventless-core 3.0.0-alpha.176 → 3.0.0-alpha.177
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 +15 -0
- package/package.json +6 -6
- package/src/admin/Platform_Admin.res +21 -19
- package/src/admin/Platform_Admin.res.mjs +26 -26
- package/src/admin/{Admin_Callback.res → Platform_Admin_Callback.res} +1 -1
- package/src/admin/{Admin_Callback.res.mjs → Platform_Admin_Callback.res.mjs} +2 -1
- package/src/plugin/component/Plugin_Helpers.res +2 -2
- package/src/plugin/connect/PluginConnectExtension_Mapping.res +1 -1
- package/tests/api/GraphQL_StitcherTest.res +1 -1
- /package/src/admin/{AdminApi.res → Platform_AdminApi.res} +0 -0
- /package/src/admin/{AdminApi.res.mjs → Platform_AdminApi.res.mjs} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 3.0.0-alpha.177 (2026-07-22)
|
|
7
|
+
|
|
8
|
+
* refactor!: retire the stale "Admin" vocabulary for platform-owned resources ([2770bd9](https://github.com/ReventlessDev/reventless-core/commit/2770bd96f309142bdfc65b9f36bd1a3ef60641bd))
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* platform-owned resources are renamed Admin* -> Platform*
|
|
13
|
+
(PlatformDcbEventLog, PlatformDcbCmdTopic, PlatformEventColl). This replaces
|
|
14
|
+
a DynamoDB table, an SQS queue and an SNS topic — wipe and redeploy rather
|
|
15
|
+
than migrate. Both alpha AdminDcbEventLog tables held 0 items at the time of
|
|
16
|
+
the rename. MCP resource URI templates change from Admin/<field>/{id} to
|
|
17
|
+
Platform/<field>/{id}; MCP tool names are unaffected.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
# 3.0.0-alpha.176 (2026-07-22)
|
|
7
22
|
|
|
8
23
|
* refactor!: retire the stale "core" vocabulary for platform things ([34e7480](https://github.com/ReventlessDev/reventless-core/commit/34e7480992bd58906a250b0a1ce6ff2c5ba45260))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.177",
|
|
4
4
|
"description": "Core package for Reventless framework",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"sury": "11.0.0-alpha.4",
|
|
30
30
|
"uuid": "^13.0.0",
|
|
31
31
|
"@reventlessdev/rescript-effect": "0.1.0-alpha.30",
|
|
32
|
-
"@reventlessdev/rescript-fast-csv": "1.2.0-alpha.14",
|
|
33
|
-
"@reventlessdev/rescript-jest": "1.0.0-alpha.9",
|
|
34
32
|
"@reventlessdev/rescript-hash-object": "1.2.0-alpha.13",
|
|
33
|
+
"@reventlessdev/rescript-fast-csv": "1.2.0-alpha.14",
|
|
35
34
|
"@reventlessdev/rescript-node-streams": "1.1.0-alpha.13",
|
|
35
|
+
"@reventlessdev/rescript-jest": "1.0.0-alpha.9",
|
|
36
36
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.17",
|
|
37
37
|
"@reventlessdev/rescript-ssh2": "1.1.0-alpha.14",
|
|
38
|
-
"@reventlessdev/
|
|
39
|
-
"@reventlessdev/reventless-interop": "3.0.0-alpha.29",
|
|
38
|
+
"@reventlessdev/rescript-uuid": "1.1.0-alpha.17",
|
|
40
39
|
"@reventlessdev/reventless-spec": "3.0.0-alpha.80",
|
|
41
|
-
"@reventlessdev/
|
|
40
|
+
"@reventlessdev/reventless-interop": "3.0.0-alpha.29",
|
|
41
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.104"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"rescript": "12.3.0",
|
|
@@ -35,7 +35,7 @@ module Make = (
|
|
|
35
35
|
with type runtimeParts = RuntimeEnvironment.parts,
|
|
36
36
|
QueryEngineAdapter: QueryDb_Adapter.QueryEngineAdapter,
|
|
37
37
|
ClonerRunner: Cloner.Adapter.Runner,
|
|
38
|
-
|
|
38
|
+
PlatformRuntimeBuilder: PluginRuntime_Builder.T
|
|
39
39
|
with module EventCollectorChannel = EventCollectorChannel
|
|
40
40
|
and type runtimeParts = RuntimeEnvironment.parts,
|
|
41
41
|
DcbEventLogStorage: DcbEventLog_Adapter.Storage,
|
|
@@ -51,9 +51,9 @@ module Make = (
|
|
|
51
51
|
ECC: EventCollector_Adapter.Channel with type runtimeParts = RE.parts,
|
|
52
52
|
RB: PluginRuntime_Builder.T with module EventCollectorChannel = ECC,
|
|
53
53
|
) => {
|
|
54
|
-
module
|
|
54
|
+
module PlatformEventCollector = EventCollector_Builder.Make(RE, ECC)
|
|
55
55
|
let make = (~name, ~eventTopics, ~opts) => {
|
|
56
|
-
let eventCollector =
|
|
56
|
+
let eventCollector = PlatformEventCollector.make(~name, ~eventTopics, ~owner={kind: ComponentType.Plugin, name}, ~opts)
|
|
57
57
|
let eventCollectorOutputs = eventCollector->Component.outputs
|
|
58
58
|
(eventCollector, eventCollectorOutputs)
|
|
59
59
|
}
|
|
@@ -76,8 +76,8 @@ module Make = (
|
|
|
76
76
|
|
|
77
77
|
resources->Pulumi.Output.apply(resources => {
|
|
78
78
|
let fakePluginDefinition: Reventless.Plugin.pluginDefinition = {
|
|
79
|
-
id: "
|
|
80
|
-
name:
|
|
79
|
+
id: Platform_Admin_Structure.pluginId ++ "@INTERNAL",
|
|
80
|
+
name: Platform_Admin_Structure.pluginId,
|
|
81
81
|
version: "INTERNAL",
|
|
82
82
|
extensionPoints: [],
|
|
83
83
|
extensions: [],
|
|
@@ -90,11 +90,11 @@ module Make = (
|
|
|
90
90
|
kind: Domain,
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
module Callback =
|
|
93
|
+
module Callback = Platform_Admin_Callback.Make({
|
|
94
94
|
let pluginDefinition = fakePluginDefinition
|
|
95
95
|
let outgoingExtensionPointJsonEventsHandlers = extensionPointsOutgoingJsonEventsHandlers
|
|
96
96
|
})
|
|
97
|
-
let handler =
|
|
97
|
+
let handler = PlatformEventCollector.makeHandler(
|
|
98
98
|
~eventCollector,
|
|
99
99
|
~jsonEventsHandler=Callback.handleJsonEvents,
|
|
100
100
|
)
|
|
@@ -120,7 +120,9 @@ module Make = (
|
|
|
120
120
|
~outboundTranslationSlices: array<module(ReventlessInfra.OutboundTranslationSlice.T)>,
|
|
121
121
|
~inboundTranslationSlices: array<module(ReventlessInfra.InboundTranslationSlice.T)>,
|
|
122
122
|
) => {
|
|
123
|
-
|
|
123
|
+
// Names every platform-owned resource — the DCB substrate via DcbBuilder and the
|
|
124
|
+
// EventCollector below. Bound to pluginId so the two can't drift apart again.
|
|
125
|
+
let name = Platform_Admin_Structure.pluginId
|
|
124
126
|
let opts: Pulumi.ComponentResource.options = {}
|
|
125
127
|
|
|
126
128
|
// Construct DCB components and derive DCB-specific API schema entries
|
|
@@ -129,7 +131,7 @@ module Make = (
|
|
|
129
131
|
DcbEventTopicPublisher,
|
|
130
132
|
DcbCommandTopicChannel,
|
|
131
133
|
DcbCommandTopicChannelAsync,
|
|
132
|
-
|
|
134
|
+
PlatformRuntimeBuilder,
|
|
133
135
|
Config,
|
|
134
136
|
)
|
|
135
137
|
// Aggregates constructed early so multi-source AutomationSlices created
|
|
@@ -142,15 +144,15 @@ module Make = (
|
|
|
142
144
|
// `mutationResolverHook` and populate `aggregateMutationFieldsRegistry`.
|
|
143
145
|
// The matching SDL entries are owned by
|
|
144
146
|
// `PluginBaseFragment.pluginAggregateMutationEntries` (picked up via
|
|
145
|
-
// `
|
|
146
|
-
// `
|
|
147
|
+
// `Platform_AdminApi.mutationEntries`) so the AWS path that pushes
|
|
148
|
+
// `Platform_AdminApi.baseFragment` directly stays aligned with the in-memory path.
|
|
147
149
|
aggregates->Plugin_Helpers.registerAdminAggregateMutations(~hooks=Config.hooks)
|
|
148
150
|
|
|
149
151
|
let dcbResult = DcbBuilder.construct(
|
|
150
152
|
~name,
|
|
151
153
|
~childName=name,
|
|
152
154
|
// Admin slice command mutations render `Platform_*` (not `Admin_*`), byte-aligned with the
|
|
153
|
-
// hand-declared admin SDL (`
|
|
155
|
+
// hand-declared admin SDL (`Platform_AdminApi.baseFragment`, via `Api_Naming.adminField`) so the
|
|
154
156
|
// auto-bound DCB resolver targets the exact field name that is pushed to the schema.
|
|
155
157
|
~apiNamePrefix="Platform",
|
|
156
158
|
// Admin DCB mutation resolvers bind to the Platform API (split mode), not the deploy-target
|
|
@@ -178,13 +180,13 @@ module Make = (
|
|
|
178
180
|
| None => ()
|
|
179
181
|
}
|
|
180
182
|
|
|
181
|
-
// Admin schema — composed from actual config. `
|
|
183
|
+
// Admin schema — composed from actual config. `Platform_AdminApi.mutationEntries`
|
|
182
184
|
// already includes the auto-derived `Platform_Plugin_Activate`/`Deactivate`
|
|
183
185
|
// entries (via `PluginBaseFragment.pluginAggregateMutationEntries`) so the
|
|
184
186
|
// SDL stays in sync with the resolver wiring fired above.
|
|
185
|
-
let adminMutationEntries =
|
|
187
|
+
let adminMutationEntries = Platform_AdminApi.mutationEntries(~cloner=Config.cloner)
|
|
186
188
|
let allMutationEntries = Array.concat(adminMutationEntries, dcbResult.mutationEntries)
|
|
187
|
-
let allQueryEntries = Array.concat(
|
|
189
|
+
let allQueryEntries = Array.concat(Platform_AdminApi.queryEntries, dcbResult.queryEntries)
|
|
188
190
|
let adminFragment = GraphQL_FragmentGenerator.generate(
|
|
189
191
|
~mutationEntries=allMutationEntries,
|
|
190
192
|
~queryEntries=allQueryEntries,
|
|
@@ -202,7 +204,7 @@ module Make = (
|
|
|
202
204
|
switch Config.hooks.mcpSchemaRegistrationHook {
|
|
203
205
|
| Some(registerMcp) =>
|
|
204
206
|
registerMcp({
|
|
205
|
-
pluginName:
|
|
207
|
+
pluginName: name,
|
|
206
208
|
mutationEntries: allMutationEntries,
|
|
207
209
|
queryEntries: allQueryEntries,
|
|
208
210
|
eventLogEntries: dcbResult.eventLogEntries,
|
|
@@ -227,7 +229,7 @@ module Make = (
|
|
|
227
229
|
// match the `Platform_Plugin`/`Platform_Plugins` SDL fields declared by
|
|
228
230
|
// PluginBaseFragment.queryEntries — leaving the SDL fields without a
|
|
229
231
|
// resolver and producing "Cannot return null for non-nullable type" errors.
|
|
230
|
-
|
|
232
|
+
Platform_AdminApi.queryEntries->Array.forEach(entry => {
|
|
231
233
|
let prefix = "Platform_"
|
|
232
234
|
let entityName = if entry.returnTypeName->String.startsWith(prefix) {
|
|
233
235
|
entry.returnTypeName->String.slice(
|
|
@@ -278,7 +280,7 @@ module Make = (
|
|
|
278
280
|
//
|
|
279
281
|
// BUT skip the StateViewSlice merge on a static-schema-push platform (AWS, where
|
|
280
282
|
// preAdminResolversSchemaHook is Some): there the pushed schema is the static
|
|
281
|
-
//
|
|
283
|
+
// Platform_AdminApi.baseFragment, which does NOT declare the auto `<prefix>_<Slice>` query
|
|
282
284
|
// fields — so creating their resolvers would fail CreateResolver with
|
|
283
285
|
// "No field named Admin_<Slice> on type Query". The admin StateView slices are
|
|
284
286
|
// internal registries whose real query surface is served by dedicated Lambda
|
|
@@ -401,7 +403,7 @@ module Make = (
|
|
|
401
403
|
module EventCollectorHelper = MakeEventCollectorHelper(
|
|
402
404
|
RuntimeEnvironment,
|
|
403
405
|
EventCollectorChannel,
|
|
404
|
-
|
|
406
|
+
PlatformRuntimeBuilder,
|
|
405
407
|
)
|
|
406
408
|
let (eventCollector, _eventCollectorOutputs) = EventCollectorHelper.make(
|
|
407
409
|
~name,
|
|
@@ -6,25 +6,26 @@ import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
|
6
6
|
import * as Pulumi from "@pulumi/pulumi";
|
|
7
7
|
import * as Belt_SetString from "@rescript/runtime/lib/es6/Belt_SetString.js";
|
|
8
8
|
import * as Cloner$ReventlessCore from "../components/Cloner.res.mjs";
|
|
9
|
-
import * as AdminApi$ReventlessCore from "./AdminApi.res.mjs";
|
|
10
9
|
import * as Aggregate$ReventlessCore from "../components/Aggregate/Aggregate.res.mjs";
|
|
11
10
|
import * as Component$ReventlessCore from "../components/Component.res.mjs";
|
|
12
11
|
import * as ReadModel$ReventlessCore from "../components/ReadModel/ReadModel.res.mjs";
|
|
13
12
|
import * as Dcb_Builder$ReventlessCore from "../components/Dcb/Dcb_Builder.res.mjs";
|
|
14
|
-
import * as Admin_Callback$ReventlessCore from "./Admin_Callback.res.mjs";
|
|
15
13
|
import * as Plugin_Helpers$ReventlessCore from "../plugin/component/Plugin_Helpers.res.mjs";
|
|
16
14
|
import * as Builder_Helpers$ReventlessCore from "../components/Builder_Helpers.res.mjs";
|
|
17
15
|
import * as GraphQL_Stitcher$ReventlessCore from "../components/Api/GraphQL_Stitcher.res.mjs";
|
|
18
16
|
import * as Plugin_Structure$ReventlessCore from "../plugin/component/Plugin_Structure.res.mjs";
|
|
17
|
+
import * as Platform_AdminApi$ReventlessCore from "./Platform_AdminApi.res.mjs";
|
|
19
18
|
import * as EventCollector_Builder$ReventlessCore from "../components/EventCollector/EventCollector_Builder.res.mjs";
|
|
19
|
+
import * as Platform_Admin_Callback$ReventlessCore from "./Platform_Admin_Callback.res.mjs";
|
|
20
|
+
import * as Platform_Admin_Structure$ReventlessCore from "./Platform_Admin_Structure.res.mjs";
|
|
20
21
|
import * as GraphQL_FragmentGenerator$ReventlessCore from "../components/Api/GraphQL_FragmentGenerator.res.mjs";
|
|
21
22
|
|
|
22
23
|
function Make(RuntimeEnvironment) {
|
|
23
|
-
return EventCollectorChannel => (QueryEngineAdapter => (ClonerRunner => (
|
|
24
|
+
return EventCollectorChannel => (QueryEngineAdapter => (ClonerRunner => (PlatformRuntimeBuilder => (DcbEventLogStorage => (DcbEventTopicPublisher => (DcbCommandTopicChannel => (DcbCommandTopicChannelAsync => (Config => {
|
|
24
25
|
let MakeEventCollectorHelper = RE => (ECC => (RB => {
|
|
25
|
-
let
|
|
26
|
+
let PlatformEventCollector = EventCollector_Builder$ReventlessCore.Make(RE)(ECC);
|
|
26
27
|
let make = (name, eventTopics, opts) => {
|
|
27
|
-
let eventCollector =
|
|
28
|
+
let eventCollector = PlatformEventCollector.make(name, eventTopics, {
|
|
28
29
|
kind: "Plugin",
|
|
29
30
|
name: name
|
|
30
31
|
}, opts);
|
|
@@ -38,8 +39,8 @@ function Make(RuntimeEnvironment) {
|
|
|
38
39
|
let resources = Pulumi.all(extensionPointsOutputs.map(extensionPoint => extensionPoint.eventTopic)).apply(eventTopics => eventTopics.map(eventTopic => eventTopic.resources).flat());
|
|
39
40
|
return resources.apply(resources => {
|
|
40
41
|
let fakePluginDefinition = {
|
|
41
|
-
id: "
|
|
42
|
-
name:
|
|
42
|
+
id: Platform_Admin_Structure$ReventlessCore.pluginId + "@INTERNAL",
|
|
43
|
+
name: Platform_Admin_Structure$ReventlessCore.pluginId,
|
|
43
44
|
version: "INTERNAL",
|
|
44
45
|
extensionPoints: [],
|
|
45
46
|
extensions: [],
|
|
@@ -51,39 +52,38 @@ function Make(RuntimeEnvironment) {
|
|
|
51
52
|
dcbEventLog: undefined,
|
|
52
53
|
kind: "Domain"
|
|
53
54
|
};
|
|
54
|
-
let Callback =
|
|
55
|
+
let Callback = Platform_Admin_Callback$ReventlessCore.Make({
|
|
55
56
|
pluginDefinition: fakePluginDefinition,
|
|
56
57
|
outgoingExtensionPointJsonEventsHandlers: extensionPointsOutgoingJsonEventsHandlers
|
|
57
58
|
});
|
|
58
|
-
let handler =
|
|
59
|
+
let handler = PlatformEventCollector.makeHandler(eventCollector, Callback.handleJsonEvents);
|
|
59
60
|
RB.forPluginEventCollector(handler, eventTopics, resources, undefined, undefined, eventCollector);
|
|
60
61
|
});
|
|
61
62
|
};
|
|
62
63
|
return {
|
|
63
|
-
|
|
64
|
+
PlatformEventCollector: PlatformEventCollector,
|
|
64
65
|
make: make,
|
|
65
66
|
connect: connect
|
|
66
67
|
};
|
|
67
68
|
}));
|
|
68
69
|
let construct = (param, extensionPoints, aggregates, readModels, scheduler, resourceNaming, api, apiRole, stateChangeSlices, stateViewSlices, automationSlices, outboundTranslationSlices, inboundTranslationSlices) => {
|
|
69
|
-
let name = "Admin";
|
|
70
70
|
let opts = {};
|
|
71
|
-
let DcbBuilder = Dcb_Builder$ReventlessCore.Make(DcbEventLogStorage)(DcbEventTopicPublisher)(DcbCommandTopicChannel)(DcbCommandTopicChannelAsync)(
|
|
71
|
+
let DcbBuilder = Dcb_Builder$ReventlessCore.Make(DcbEventLogStorage)(DcbEventTopicPublisher)(DcbCommandTopicChannel)(DcbCommandTopicChannelAsync)(PlatformRuntimeBuilder)({
|
|
72
72
|
hooks: Config.hooks
|
|
73
73
|
});
|
|
74
74
|
let aggregatesWithoutEventMappers = Builder_Helpers$ReventlessCore.createAggregatesWithoutEventMappers(aggregates, api, {}, opts);
|
|
75
75
|
let aggregateEventTopics = Aggregate$ReventlessCore.allEventTopics(aggregatesWithoutEventMappers);
|
|
76
76
|
Plugin_Helpers$ReventlessCore.registerAdminAggregateMutations(aggregates, Config.hooks);
|
|
77
|
-
let dcbResult = DcbBuilder.construct(
|
|
77
|
+
let dcbResult = DcbBuilder.construct(Platform_Admin_Structure$ReventlessCore.pluginId, Platform_Admin_Structure$ReventlessCore.pluginId, "Platform", true, undefined, undefined, aggregateEventTopics, stateChangeSlices, stateViewSlices, automationSlices, outboundTranslationSlices, inboundTranslationSlices, undefined, undefined, undefined, opts);
|
|
78
78
|
let slicePublishJsons = dcbResult.dcbPublishJsons;
|
|
79
79
|
if (slicePublishJsons !== undefined) {
|
|
80
80
|
stateChangeSlices.forEach(Sc => {
|
|
81
81
|
Builder_Helpers$ReventlessCore.publishToAggregates[Sc.Spec.name] = slicePublishJsons;
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
let adminMutationEntries =
|
|
84
|
+
let adminMutationEntries = Platform_AdminApi$ReventlessCore.mutationEntries(Config.cloner);
|
|
85
85
|
let allMutationEntries = adminMutationEntries.concat(dcbResult.mutationEntries);
|
|
86
|
-
let allQueryEntries =
|
|
86
|
+
let allQueryEntries = Platform_AdminApi$ReventlessCore.queryEntries.concat(dcbResult.queryEntries);
|
|
87
87
|
let adminFragment = GraphQL_FragmentGenerator$ReventlessCore.generate(allMutationEntries, allQueryEntries);
|
|
88
88
|
if (dcbResult.mutationEntries.length !== 0 || dcbResult.queryEntries.length !== 0) {
|
|
89
89
|
let registerTypes = Config.hooks.schemaTypeRegistrationHook;
|
|
@@ -94,7 +94,7 @@ function Make(RuntimeEnvironment) {
|
|
|
94
94
|
let registerMcp = Config.hooks.mcpSchemaRegistrationHook;
|
|
95
95
|
if (registerMcp !== undefined) {
|
|
96
96
|
registerMcp({
|
|
97
|
-
pluginName:
|
|
97
|
+
pluginName: Platform_Admin_Structure$ReventlessCore.pluginId,
|
|
98
98
|
mutationEntries: allMutationEntries,
|
|
99
99
|
queryEntries: allQueryEntries,
|
|
100
100
|
eventLogEntries: dcbResult.eventLogEntries,
|
|
@@ -104,9 +104,9 @@ function Make(RuntimeEnvironment) {
|
|
|
104
104
|
}
|
|
105
105
|
let dcbOutputs = dcbResult.dcbEventLogOutputs;
|
|
106
106
|
if (dcbOutputs !== undefined) {
|
|
107
|
-
aggregateEventTopics[
|
|
107
|
+
aggregateEventTopics[Platform_Admin_Structure$ReventlessCore.pluginId + "DcbEventLog"] = dcbOutputs.eventTopic;
|
|
108
108
|
}
|
|
109
|
-
|
|
109
|
+
Platform_AdminApi$ReventlessCore.queryEntries.forEach(entry => {
|
|
110
110
|
let prefix = "Platform_";
|
|
111
111
|
let entityName = entry.returnTypeName.startsWith(prefix) ? entry.returnTypeName.slice(prefix.length, entry.returnTypeName.length) : entry.returnTypeName;
|
|
112
112
|
let registryKey = Stdlib_Option.getOr(entry.specName, entityName);
|
|
@@ -175,9 +175,9 @@ function Make(RuntimeEnvironment) {
|
|
|
175
175
|
let aggregateNames = Stdlib_Array.reduce(extensionPointsOutputs.map(extensionPointOutputs => Belt_SetString.fromArray(extensionPointOutputs.aggregateNames)), undefined, Belt_SetString.union);
|
|
176
176
|
let aggregatesOutputs = Builder_Helpers$ReventlessCore.addEventMappers(aggregateEventTopics, queryEngine);
|
|
177
177
|
let eventTopics = Aggregate$ReventlessCore.filterEventTopics(aggregatesOutputs, aggregateNames);
|
|
178
|
-
let
|
|
178
|
+
let PlatformEventCollector = EventCollector_Builder$ReventlessCore.Make(RuntimeEnvironment)(EventCollectorChannel);
|
|
179
179
|
let make = (name, eventTopics, opts) => {
|
|
180
|
-
let eventCollector =
|
|
180
|
+
let eventCollector = PlatformEventCollector.make(name, eventTopics, {
|
|
181
181
|
kind: "Plugin",
|
|
182
182
|
name: name
|
|
183
183
|
}, opts);
|
|
@@ -191,8 +191,8 @@ function Make(RuntimeEnvironment) {
|
|
|
191
191
|
let resources = Pulumi.all(extensionPointsOutputs.map(extensionPoint => extensionPoint.eventTopic)).apply(eventTopics => eventTopics.map(eventTopic => eventTopic.resources).flat());
|
|
192
192
|
return resources.apply(resources => {
|
|
193
193
|
let fakePluginDefinition = {
|
|
194
|
-
id: "
|
|
195
|
-
name:
|
|
194
|
+
id: Platform_Admin_Structure$ReventlessCore.pluginId + "@INTERNAL",
|
|
195
|
+
name: Platform_Admin_Structure$ReventlessCore.pluginId,
|
|
196
196
|
version: "INTERNAL",
|
|
197
197
|
extensionPoints: [],
|
|
198
198
|
extensions: [],
|
|
@@ -204,15 +204,15 @@ function Make(RuntimeEnvironment) {
|
|
|
204
204
|
dcbEventLog: undefined,
|
|
205
205
|
kind: "Domain"
|
|
206
206
|
};
|
|
207
|
-
let Callback =
|
|
207
|
+
let Callback = Platform_Admin_Callback$ReventlessCore.Make({
|
|
208
208
|
pluginDefinition: fakePluginDefinition,
|
|
209
209
|
outgoingExtensionPointJsonEventsHandlers: extensionPointsOutgoingJsonEventsHandlers
|
|
210
210
|
});
|
|
211
|
-
let handler =
|
|
212
|
-
|
|
211
|
+
let handler = PlatformEventCollector.makeHandler(eventCollector, Callback.handleJsonEvents);
|
|
212
|
+
PlatformRuntimeBuilder.forPluginEventCollector(handler, eventTopics, resources, undefined, undefined, eventCollector);
|
|
213
213
|
});
|
|
214
214
|
};
|
|
215
|
-
let match$1 = make(
|
|
215
|
+
let match$1 = make(Platform_Admin_Structure$ReventlessCore.pluginId, eventTopics, opts);
|
|
216
216
|
let eventCollector = match$1[0];
|
|
217
217
|
Output$Pulumi.flatMap(Pulumi.all(match[1]), extensionPointsOutgoingJsonEventsHandlers => connect(eventCollector, eventTopics, extensionPointsOutputs, extensionPointsOutgoingJsonEventsHandlers));
|
|
218
218
|
Stdlib_Option.forEach(dcbResult.dcbRuntimeSetup, dcbRuntimeSetup => dcbRuntimeSetup());
|
|
@@ -12,7 +12,7 @@ module Make = (Spec: Spec): T => {
|
|
|
12
12
|
stream
|
|
13
13
|
->Stream.mapEffect(eventJson' =>
|
|
14
14
|
EffectLogger.logInfo(
|
|
15
|
-
~comp=
|
|
15
|
+
~comp=Platform_Admin_Structure.pluginId,
|
|
16
16
|
`handleJsonEvents: outgoing event: ${LogFormat.event'JsonToLogMessage(eventJson')}`,
|
|
17
17
|
)->Effect.zipRight(
|
|
18
18
|
Effect.all(
|
|
@@ -4,9 +4,10 @@ import * as Effect from "effect/Effect";
|
|
|
4
4
|
import * as Stream from "effect/Stream";
|
|
5
5
|
import * as LogFormat$ReventlessCore from "../util/LogFormat.res.mjs";
|
|
6
6
|
import * as EffectLogger$ReventlessCore from "../util/EffectLogger.res.mjs";
|
|
7
|
+
import * as Platform_Admin_Structure$ReventlessCore from "./Platform_Admin_Structure.res.mjs";
|
|
7
8
|
|
|
8
9
|
function Make(Spec) {
|
|
9
|
-
let handleJsonEvents = stream => Stream.runDrain(Stream.mapEffect(stream, eventJson$p => Effect.zipRight(EffectLogger$ReventlessCore.logInfo(
|
|
10
|
+
let handleJsonEvents = stream => Stream.runDrain(Stream.mapEffect(stream, eventJson$p => Effect.zipRight(EffectLogger$ReventlessCore.logInfo(Platform_Admin_Structure$ReventlessCore.pluginId, undefined, `handleJsonEvents: outgoing event: ` + LogFormat$ReventlessCore.event$pJsonToLogMessage(eventJson$p)), Effect.map(Effect.all(Spec.outgoingExtensionPointJsonEventsHandlers.map(handleEvent => Effect.promise(() => handleEvent(eventJson$p, Spec.pluginDefinition))), {
|
|
10
11
|
concurrency: "unbounded"
|
|
11
12
|
}), param => {}))));
|
|
12
13
|
return {
|
|
@@ -88,7 +88,7 @@ let getStorageResources = (allQueryDbs, pluginName, queryDbName) =>
|
|
|
88
88
|
// ---------------------------------------------------------------------------
|
|
89
89
|
// Plugin EventCollector context registry.
|
|
90
90
|
//
|
|
91
|
-
// Adapter runtime entry points (e.g.
|
|
91
|
+
// Adapter runtime entry points (e.g. EventCollectorEntryPoint.mjs) read
|
|
92
92
|
// HANDLER_CONFIG to reconstruct Plugin_Callback at cold start. The JSON payload
|
|
93
93
|
// is assembled at deploy time inside `forPluginEventCollector` (AWS), but the
|
|
94
94
|
// plugin-specific data (pluginDefinition, the auto-included Connect extension
|
|
@@ -1024,7 +1024,7 @@ module NoopHooksConfig: HooksConfig = {
|
|
|
1024
1024
|
// and fire `mutationResolverHook` so adapter-side SDL stubs get registered
|
|
1025
1025
|
// synchronously. The matching `mutationSchemaEntry` records — needed to keep the
|
|
1026
1026
|
// SDL aligned — live in `PluginBaseFragment.pluginAggregateMutationEntries` so the
|
|
1027
|
-
// AWS path (which pushes `
|
|
1027
|
+
// AWS path (which pushes `Platform_AdminApi.baseFragment` directly, not Admin.construct's
|
|
1028
1028
|
// adminFragment) picks them up too. This helper is side-effect only.
|
|
1029
1029
|
let registerAdminAggregateMutations = (
|
|
1030
1030
|
type a,
|
|
@@ -78,7 +78,7 @@ module Make = (Spec: Spec) => {
|
|
|
78
78
|
// plugins used to call DoConnectPlugin / DoDisconnectPlugin here so
|
|
79
79
|
// each plugin's EC Lambda could subscribe / unsubscribe its own
|
|
80
80
|
// queue to peer EP topics. Admin owns that work now
|
|
81
|
-
// (manageSubscriptions in
|
|
81
|
+
// (manageSubscriptions in EventCollectorEntryPoint.mjs) — these
|
|
82
82
|
// cases drop to no-ops.
|
|
83
83
|
| _ => []
|
|
84
84
|
}
|
|
@@ -53,7 +53,7 @@ describe("GraphQL_Stitcher.subscriptionSources", () => {
|
|
|
53
53
|
})
|
|
54
54
|
|
|
55
55
|
testSync("core-emitted admin base fragment carries no provider directives", () => {
|
|
56
|
-
let base =
|
|
56
|
+
let base = Platform_AdminApi.baseFragment(~cloner=true)
|
|
57
57
|
expect(base.encoded->String.includes("@aws_subscribe"))->toBe(false)
|
|
58
58
|
expect(base.encoded->String.includes("@aws_auth"))->toBe(false)
|
|
59
59
|
// The subscription→mutation fan-in rides the structured metadata instead.
|
|
File without changes
|
|
File without changes
|