@reventlessdev/reventless-core 3.0.0-alpha.175 → 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 +31 -0
- package/package.json +5 -5
- package/src/ComponentType.res +0 -7
- package/src/ComponentType.res.mjs +0 -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_Builder.res +2 -2
- package/src/plugin/component/Plugin_Builder.res.mjs +1 -1
- package/src/plugin/component/Plugin_Helpers.res +2 -2
- package/src/plugin/connect/PluginConnectExtension_Mapping.res +1 -1
- package/src/plugin/connect/PluginExtensionPoint_Plugin.res +26 -12
- package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +8 -8
- package/src/util/Interstack.res +1 -1
- package/src/util/Interstack.res.mjs +3 -3
- package/src/util/Interstack.resi +1 -1
- package/src/util/Util_StackRefs.res +2 -2
- package/src/util/Util_StackRefs.res.mjs +4 -4
- 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,37 @@
|
|
|
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
|
+
|
|
21
|
+
# 3.0.0-alpha.176 (2026-07-22)
|
|
22
|
+
|
|
23
|
+
* refactor!: retire the stale "core" vocabulary for platform things ([34e7480](https://github.com/ReventlessDev/reventless-core/commit/34e7480992bd58906a250b0a1ce6ff2c5ba45260))
|
|
24
|
+
|
|
25
|
+
### BREAKING CHANGES
|
|
26
|
+
|
|
27
|
+
* the built-in extension point is renamed Core.Plugin ->
|
|
28
|
+
Platform.Plugin. This replaces the CorePluginExtPointCmdTopic SQS queue
|
|
29
|
+
with PlatformPluginExtPointCmdTopic (a replacement, not an update) and
|
|
30
|
+
breaks every already-deployed plugin's connection until redeployed.
|
|
31
|
+
Wipe the alpha stack and redeploy fresh rather than migrating.
|
|
32
|
+
|
|
33
|
+
Build clean; 1349 tests green (interop 50, core 518, local 501, aws 280).
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
6
37
|
# 3.0.0-alpha.175 (2026-07-22)
|
|
7
38
|
|
|
8
39
|
### Features
|
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": {
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"@reventlessdev/rescript-effect": "0.1.0-alpha.30",
|
|
32
32
|
"@reventlessdev/rescript-hash-object": "1.2.0-alpha.13",
|
|
33
33
|
"@reventlessdev/rescript-fast-csv": "1.2.0-alpha.14",
|
|
34
|
-
"@reventlessdev/rescript-jest": "1.0.0-alpha.9",
|
|
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
38
|
"@reventlessdev/rescript-uuid": "1.1.0-alpha.17",
|
|
39
|
-
"@reventlessdev/reventless-
|
|
40
|
-
"@reventlessdev/reventless-interop": "3.0.0-alpha.
|
|
41
|
-
"@reventlessdev/reventless-
|
|
39
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.80",
|
|
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",
|
package/src/ComponentType.res
CHANGED
|
@@ -18,10 +18,6 @@ type t =
|
|
|
18
18
|
| SideEffectHandler
|
|
19
19
|
| Task
|
|
20
20
|
| Vpc
|
|
21
|
-
| /** Vestigial: predates the platform/plugin split and names nothing the
|
|
22
|
-
framework builds. Do not reach for it — platform-level things are
|
|
23
|
-
`Platform`, and the built-in core PLUGIN is a `Plugin`. */
|
|
24
|
-
Core
|
|
25
21
|
| Heartbeat
|
|
26
22
|
| Cloner
|
|
27
23
|
| DcbEventLog
|
|
@@ -52,7 +48,6 @@ let toString = componentType =>
|
|
|
52
48
|
| SideEffectHandler => "SideEffectHandler"
|
|
53
49
|
| Task => "Task"
|
|
54
50
|
| Vpc => "Vpc"
|
|
55
|
-
| Core => "Core"
|
|
56
51
|
| Heartbeat => "Heartbeat"
|
|
57
52
|
| Cloner => "Cloner"
|
|
58
53
|
| DcbEventLog => "DcbEventLog"
|
|
@@ -84,7 +79,6 @@ let ofString = str =>
|
|
|
84
79
|
| "SideEffectHandler" => SideEffectHandler->Some
|
|
85
80
|
| "Task" => Task->Some
|
|
86
81
|
| "Vpc" => Vpc->Some
|
|
87
|
-
| "Core" => Core->Some
|
|
88
82
|
| "Heartbeat" => Heartbeat->Some
|
|
89
83
|
| "Cloner" => Cloner->Some
|
|
90
84
|
| "DcbEventLog" => DcbEventLog->Some
|
|
@@ -117,7 +111,6 @@ let toName = componentType =>
|
|
|
117
111
|
| SideEffectHandler => "SideEffectHandler"
|
|
118
112
|
| Task => "Task"
|
|
119
113
|
| Vpc => "Vpc"
|
|
120
|
-
| Core => "Core"
|
|
121
114
|
| Heartbeat => "Heartbeat"
|
|
122
115
|
| Cloner => "Cloner"
|
|
123
116
|
| DcbEventLog => "DcbEventLog"
|
|
@@ -42,8 +42,6 @@ function toString(componentType) {
|
|
|
42
42
|
return "Task";
|
|
43
43
|
case "Vpc" :
|
|
44
44
|
return "Vpc";
|
|
45
|
-
case "Core" :
|
|
46
|
-
return "Core";
|
|
47
45
|
case "Heartbeat" :
|
|
48
46
|
return "Heartbeat";
|
|
49
47
|
case "Cloner" :
|
|
@@ -75,8 +73,6 @@ function ofString(str) {
|
|
|
75
73
|
return "CommandGenerator";
|
|
76
74
|
case "CommandTopic" :
|
|
77
75
|
return "CommandTopic";
|
|
78
|
-
case "Core" :
|
|
79
|
-
return "Core";
|
|
80
76
|
case "Counter" :
|
|
81
77
|
return "Counter";
|
|
82
78
|
case "DcbEventLog" :
|
|
@@ -166,8 +162,6 @@ function toName(componentType) {
|
|
|
166
162
|
return "Task";
|
|
167
163
|
case "Vpc" :
|
|
168
164
|
return "Vpc";
|
|
169
|
-
case "Core" :
|
|
170
|
-
return "Core";
|
|
171
165
|
case "Heartbeat" :
|
|
172
166
|
return "Heartbeat";
|
|
173
167
|
case "Cloner" :
|
|
@@ -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 {
|
|
@@ -575,8 +575,8 @@ module Make = (
|
|
|
575
575
|
let builderOutputs = {
|
|
576
576
|
// Resolve admin extension point data — from Interstack (AWS cross-stack reference).
|
|
577
577
|
let interstackAdminExtensionPoints =
|
|
578
|
-
Interstack.
|
|
579
|
-
|
|
578
|
+
Interstack.platformStackReference->Option.mapOr(Pulumi.Output.make(None), platformStack =>
|
|
579
|
+
platformStack->Pulumi.StackReference.getOutput("extensionPoints")
|
|
580
580
|
)
|
|
581
581
|
|
|
582
582
|
// Derive local admin extension point resolved data (passed from makePlatform).
|
|
@@ -399,7 +399,7 @@ function Make(Spec) {
|
|
|
399
399
|
components: components
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
|
-
let interstackAdminExtensionPoints = Stdlib_Option.mapOr(Interstack$ReventlessCore.
|
|
402
|
+
let interstackAdminExtensionPoints = Stdlib_Option.mapOr(Interstack$ReventlessCore.platformStackReference, Pulumi.output(undefined), platformStack => platformStack.getOutput("extensionPoints"));
|
|
403
403
|
let localAdminResolvedEP = Output$Pulumi.flatMap(Spec.hooks.adminExtensionPoints.contents, eps => {
|
|
404
404
|
let ep = eps[PluginExtensionPointSpec$ReventlessInfra.name];
|
|
405
405
|
if (ep !== undefined) {
|
|
@@ -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
|
}
|
|
@@ -47,7 +47,7 @@ module Make = (Spec: Spec) => {
|
|
|
47
47
|
switch jsons {
|
|
48
48
|
| [] =>
|
|
49
49
|
EffectLogger.logWarn(
|
|
50
|
-
~comp=
|
|
50
|
+
~comp=PluginExtensionPointSpec.name,
|
|
51
51
|
`ForwardCommand: Couldn't find Plugin with ExtensionPoint ${extensionPointName}`,
|
|
52
52
|
)->Effect.runSync
|
|
53
53
|
| plugins =>
|
|
@@ -66,28 +66,31 @@ module Make = (Spec: Spec) => {
|
|
|
66
66
|
) {
|
|
67
67
|
| _ =>
|
|
68
68
|
EffectLogger.logInfo(
|
|
69
|
-
~comp=
|
|
69
|
+
~comp=PluginExtensionPointSpec.name,
|
|
70
70
|
`ForwardCommand: published command to ${plugin.name} ${extensionPoint.commandTopic}`,
|
|
71
71
|
)->Effect.runSync
|
|
72
72
|
| exception err =>
|
|
73
73
|
let errMsg =
|
|
74
74
|
err->JsExn.fromException->Option.flatMap(JsExn.message)->Option.getOr("unknown")
|
|
75
75
|
EffectLogger.logError(
|
|
76
|
-
~comp=
|
|
76
|
+
~comp=PluginExtensionPointSpec.name,
|
|
77
77
|
`ForwardCommand: Error on publish command: ${errMsg}`,
|
|
78
78
|
)->Effect.runSync
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
| None =>
|
|
82
82
|
EffectLogger.logWarn(
|
|
83
|
-
~comp=
|
|
83
|
+
~comp=PluginExtensionPointSpec.name,
|
|
84
84
|
`ForwardCommand: Couldn't find ExtensionPoint ${extensionPointName} in ${plugin.name}`,
|
|
85
85
|
)->Effect.runSync
|
|
86
86
|
}
|
|
87
87
|
| exception err =>
|
|
88
88
|
let errMsg =
|
|
89
89
|
err->JsExn.fromException->Option.flatMap(JsExn.message)->Option.getOr("unknown")
|
|
90
|
-
EffectLogger.logError(
|
|
90
|
+
EffectLogger.logError(
|
|
91
|
+
~comp=PluginExtensionPointSpec.name,
|
|
92
|
+
`ForwardCommand: Couldn't decode Plugin: ${errMsg}`,
|
|
93
|
+
)->Effect.runSync
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
}
|
|
@@ -105,7 +108,7 @@ module Make = (Spec: Spec) => {
|
|
|
105
108
|
rate: timeout->ScheduleOps.minutesFromNow,
|
|
106
109
|
payload: {
|
|
107
110
|
Message.id,
|
|
108
|
-
meta: Message.generateMeta(~service=
|
|
111
|
+
meta: Message.generateMeta(~service=PluginExtensionPointSpec.name, ~user="Scheduler"),
|
|
109
112
|
command: PluginExtensionPointSpec.DisconnectPlugin,
|
|
110
113
|
}
|
|
111
114
|
->Message.encodeCommand'(S.string, PluginExtensionPointSpec.commandSchema)
|
|
@@ -155,7 +158,10 @@ module Make = (Spec: Spec) => {
|
|
|
155
158
|
PublishCommand(Plugin.name(id), Delegate.Heartbeat(Plugin.version(id))),
|
|
156
159
|
// Re-arm the disconnect schedule with an interval-scaled grace so a
|
|
157
160
|
// single late beat doesn't trip a spurious disconnect (see disconnectGrace).
|
|
158
|
-
HandleDirective(
|
|
161
|
+
HandleDirective(
|
|
162
|
+
directiveHandler,
|
|
163
|
+
CreateDisconnectSchedule(id, disconnectGrace(interval)),
|
|
164
|
+
),
|
|
159
165
|
]
|
|
160
166
|
| RedetectPlugin(interval) => [
|
|
161
167
|
// Deploy-time re-detect: drive Redetect (not Heartbeat) so an already-connected
|
|
@@ -163,7 +169,10 @@ module Make = (Spec: Spec) => {
|
|
|
163
169
|
// re-arm the disconnect schedule exactly like a heartbeat so liveness tracking
|
|
164
170
|
// continues from the deploy moment.
|
|
165
171
|
PublishCommand(Plugin.name(id), Delegate.Redetect(Plugin.version(id))),
|
|
166
|
-
HandleDirective(
|
|
172
|
+
HandleDirective(
|
|
173
|
+
directiveHandler,
|
|
174
|
+
CreateDisconnectSchedule(id, disconnectGrace(interval)),
|
|
175
|
+
),
|
|
167
176
|
]
|
|
168
177
|
| ConnectPlugin(pluginDefinition) =>
|
|
169
178
|
// Validate protocol versions declared by the connecting plugin.
|
|
@@ -172,7 +181,7 @@ module Make = (Spec: Spec) => {
|
|
|
172
181
|
let protocolErrors =
|
|
173
182
|
pluginDefinition.extensionProtocols->Array.flatMap(proto =>
|
|
174
183
|
ReventlessInterop.Compat.validateProtocol(
|
|
175
|
-
~host=ReventlessInterop.CompatMatrix.
|
|
184
|
+
~host=ReventlessInterop.CompatMatrix.platformPlugin,
|
|
176
185
|
~extensionPointName=proto.extensionPointName,
|
|
177
186
|
~commandVersion=proto.commandVersion,
|
|
178
187
|
~eventVersion=proto.eventVersion,
|
|
@@ -180,7 +189,7 @@ module Make = (Spec: Spec) => {
|
|
|
180
189
|
)
|
|
181
190
|
let reportAction = if protocolErrors->Array.length > 0 {
|
|
182
191
|
EffectLogger.logWarn(
|
|
183
|
-
~comp=
|
|
192
|
+
~comp=PluginExtensionPointSpec.name,
|
|
184
193
|
`Protocol version mismatch for plugin ${pluginDefinition.id}: ${protocolErrors
|
|
185
194
|
->JSON.stringifyAny
|
|
186
195
|
->Option.getOr("[]")}`,
|
|
@@ -197,7 +206,9 @@ module Make = (Spec: Spec) => {
|
|
|
197
206
|
PublishCommand(Plugin.name(id), Delegate.Disconnect(Plugin.version(id))),
|
|
198
207
|
HandleDirective(directiveHandler, DeleteDisconnectSchedule(id)),
|
|
199
208
|
]
|
|
200
|
-
| ForwardCommand(forwardCommand) => [
|
|
209
|
+
| ForwardCommand(forwardCommand) => [
|
|
210
|
+
HandleDirective(directiveHandler, ForwardCommand(forwardCommand)),
|
|
211
|
+
]
|
|
201
212
|
// Routed to the UiFragmentRegistry slice by the sibling UI-fragment mapping, not the
|
|
202
213
|
// Plugin aggregate — a no-op here.
|
|
203
214
|
| RegisterUiFragment(_) => []
|
|
@@ -212,7 +223,10 @@ module Make = (Spec: Spec) => {
|
|
|
212
223
|
// definition publish with `def.id` (= name@version), preserving the prior
|
|
213
224
|
// cross-plugin wire id.
|
|
214
225
|
| Delegate.VersionDetected(version) => [
|
|
215
|
-
PublishEvent(
|
|
226
|
+
PublishEvent(
|
|
227
|
+
Plugin.makeId(id, version),
|
|
228
|
+
PluginExtensionPointSpec.UnknownPluginDetected,
|
|
229
|
+
),
|
|
216
230
|
]
|
|
217
231
|
| VersionConnected(pluginDefinition)
|
|
218
232
|
| VersionPromoted(pluginDefinition) => [
|
|
@@ -43,7 +43,7 @@ function Make(Spec) {
|
|
|
43
43
|
]
|
|
44
44
|
], 1000);
|
|
45
45
|
if (jsons.length === 0) {
|
|
46
|
-
return Effect.runSync(EffectLogger$ReventlessCore.logWarn(
|
|
46
|
+
return Effect.runSync(EffectLogger$ReventlessCore.logWarn(PluginExtensionPointSpec$ReventlessInfra.name, undefined, `ForwardCommand: Couldn't find Plugin with ExtensionPoint ` + extensionPointName));
|
|
47
47
|
}
|
|
48
48
|
let plugin = jsons[0];
|
|
49
49
|
let exit = 0;
|
|
@@ -54,12 +54,12 @@ function Make(Spec) {
|
|
|
54
54
|
} catch (raw_err) {
|
|
55
55
|
let err = Primitive_exceptions.internalToException(raw_err);
|
|
56
56
|
let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message), "unknown");
|
|
57
|
-
return Effect.runSync(EffectLogger$ReventlessCore.logError(
|
|
57
|
+
return Effect.runSync(EffectLogger$ReventlessCore.logError(PluginExtensionPointSpec$ReventlessInfra.name, undefined, `ForwardCommand: Couldn't decode Plugin: ` + errMsg));
|
|
58
58
|
}
|
|
59
59
|
if (exit === 1) {
|
|
60
60
|
let extensionPoint = plugin$1.extensionPoints.find(extensionPoint => extensionPoint.name === extensionPointName);
|
|
61
61
|
if (extensionPoint === undefined) {
|
|
62
|
-
return Effect.runSync(EffectLogger$ReventlessCore.logWarn(
|
|
62
|
+
return Effect.runSync(EffectLogger$ReventlessCore.logWarn(PluginExtensionPointSpec$ReventlessInfra.name, undefined, `ForwardCommand: Couldn't find ExtensionPoint ` + extensionPointName + ` in ` + plugin$1.name));
|
|
63
63
|
}
|
|
64
64
|
let exit$1 = 0;
|
|
65
65
|
let val;
|
|
@@ -69,10 +69,10 @@ function Make(Spec) {
|
|
|
69
69
|
} catch (raw_err$1) {
|
|
70
70
|
let err$1 = Primitive_exceptions.internalToException(raw_err$1);
|
|
71
71
|
let errMsg$1 = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err$1), Stdlib_JsExn.message), "unknown");
|
|
72
|
-
return Effect.runSync(EffectLogger$ReventlessCore.logError(
|
|
72
|
+
return Effect.runSync(EffectLogger$ReventlessCore.logError(PluginExtensionPointSpec$ReventlessInfra.name, undefined, `ForwardCommand: Error on publish command: ` + errMsg$1));
|
|
73
73
|
}
|
|
74
74
|
if (exit$1 === 2) {
|
|
75
|
-
return Effect.runSync(EffectLogger$ReventlessCore.logInfo(
|
|
75
|
+
return Effect.runSync(EffectLogger$ReventlessCore.logInfo(PluginExtensionPointSpec$ReventlessInfra.name, undefined, `ForwardCommand: published command to ` + plugin$1.name + ` ` + extensionPoint.commandTopic));
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
};
|
|
@@ -85,7 +85,7 @@ function Make(Spec) {
|
|
|
85
85
|
rate: ScheduleOps$ReventlessCore.minutesFromNow(directive._1),
|
|
86
86
|
payload: JSON.stringify(Message$ReventlessCore.encodeCommand$p({
|
|
87
87
|
id: id,
|
|
88
|
-
meta: Message$ReventlessCore.generateMeta(
|
|
88
|
+
meta: Message$ReventlessCore.generateMeta(PluginExtensionPointSpec$ReventlessInfra.name, undefined, "Scheduler", undefined, undefined, undefined, undefined, undefined),
|
|
89
89
|
command: "DisconnectPlugin"
|
|
90
90
|
}, S.string, PluginExtensionPointSpec$ReventlessInfra.commandSchema))
|
|
91
91
|
});
|
|
@@ -162,8 +162,8 @@ function Make(Spec) {
|
|
|
162
162
|
];
|
|
163
163
|
case "ConnectPlugin" :
|
|
164
164
|
let pluginDefinition = cmd._0;
|
|
165
|
-
let protocolErrors = pluginDefinition.extensionProtocols.flatMap(proto => Compat$ReventlessInterop.validateProtocol(CompatMatrix$ReventlessInterop.
|
|
166
|
-
let reportAction = protocolErrors.length !== 0 ? (Effect.runSync(EffectLogger$ReventlessCore.logWarn(
|
|
165
|
+
let protocolErrors = pluginDefinition.extensionProtocols.flatMap(proto => Compat$ReventlessInterop.validateProtocol(CompatMatrix$ReventlessInterop.platformPlugin, proto.extensionPointName, proto.commandVersion, proto.eventVersion));
|
|
166
|
+
let reportAction = protocolErrors.length !== 0 ? (Effect.runSync(EffectLogger$ReventlessCore.logWarn(PluginExtensionPointSpec$ReventlessInfra.name, undefined, `Protocol version mismatch for plugin ` + pluginDefinition.id + `: ` + Stdlib_Option.getOr(JSON.stringify(protocolErrors), "[]"))), [{
|
|
167
167
|
TAG: "PublishCommand",
|
|
168
168
|
_0: Plugin$ReventlessCore.name(id),
|
|
169
169
|
_1: {
|
package/src/util/Interstack.res
CHANGED
|
@@ -10,7 +10,7 @@ import * as Query$ReventlessInterop from "@reventlessdev/reventless-interop/src/
|
|
|
10
10
|
import * as EventMapper$ReventlessInterop from "@reventlessdev/reventless-interop/src/components/EventMapper.res.mjs";
|
|
11
11
|
import * as ExtensionPoint$ReventlessInterop from "@reventlessdev/reventless-interop/src/components/ExtensionPoint.res.mjs";
|
|
12
12
|
|
|
13
|
-
let
|
|
13
|
+
let platformStackReference = Stdlib_Option.map(new Pulumi.Config("platform").get("stack"), stack => new Pulumi.StackReference(stack + "-interstack", {
|
|
14
14
|
name: stack
|
|
15
15
|
}));
|
|
16
16
|
|
|
@@ -115,7 +115,7 @@ let mergeEventMappers = DefaultEventMapperQuery.mergeWith;
|
|
|
115
115
|
let mergeExtensionPoints = DefaultExtensionPointQuery.mergeWith;
|
|
116
116
|
|
|
117
117
|
export {
|
|
118
|
-
|
|
118
|
+
platformStackReference,
|
|
119
119
|
stackDependenciesTasks,
|
|
120
120
|
stackDependenciesEventMappers,
|
|
121
121
|
stackDependenciesExtensionPoints,
|
|
@@ -123,4 +123,4 @@ export {
|
|
|
123
123
|
mergeEventMappers,
|
|
124
124
|
mergeExtensionPoints,
|
|
125
125
|
}
|
|
126
|
-
/*
|
|
126
|
+
/* platformStackReference Not a pure module */
|
package/src/util/Interstack.resi
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
let stackRefs: dict<Pulumi.StackReference.t> = Dict.make()
|
|
2
2
|
|
|
3
|
-
let
|
|
3
|
+
let platformStackName = Pulumi.Config.make(Some("platform"))->Pulumi.Config.get("stack")
|
|
4
4
|
|
|
5
5
|
let stackName = pluginName =>
|
|
6
|
-
|
|
6
|
+
platformStackName->Option.map(name => {
|
|
7
7
|
let parts = name->String.split("/")
|
|
8
8
|
parts->Array.set(1, pluginName)
|
|
9
9
|
parts->Array.joinUnsafe("/")
|
|
@@ -6,10 +6,10 @@ import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js
|
|
|
6
6
|
|
|
7
7
|
let stackRefs = {};
|
|
8
8
|
|
|
9
|
-
let
|
|
9
|
+
let platformStackName = new Pulumi.Config("platform").get("stack");
|
|
10
10
|
|
|
11
11
|
function stackName(pluginName) {
|
|
12
|
-
return Stdlib_Option.map(
|
|
12
|
+
return Stdlib_Option.map(platformStackName, name => {
|
|
13
13
|
let parts = name.split("/");
|
|
14
14
|
parts[1] = pluginName;
|
|
15
15
|
return parts.join("/");
|
|
@@ -32,8 +32,8 @@ function get(pluginName) {
|
|
|
32
32
|
|
|
33
33
|
export {
|
|
34
34
|
stackRefs,
|
|
35
|
-
|
|
35
|
+
platformStackName,
|
|
36
36
|
stackName,
|
|
37
37
|
get,
|
|
38
38
|
}
|
|
39
|
-
/*
|
|
39
|
+
/* platformStackName Not a pure module */
|
|
@@ -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
|