@reventlessdev/reventless-core 3.0.0-alpha.239 → 3.0.0-alpha.241
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 +35 -0
- package/package.json +11 -11
- package/src/Message.res +11 -11
- package/src/Message.res.mjs +15 -14
- package/src/Projection.res +2 -2
- package/src/Projection.res.mjs +5 -4
- package/src/adapter/Monitoring/Monitoring.res +24 -2
- package/src/adapter/Monitoring/Monitoring.res.mjs +3 -3
- package/src/admin/Platform_Admin.res +1 -16
- package/src/admin/Platform_Admin.res.mjs +2 -30
- package/src/admin/Platform_AdminApi.res.mjs +3 -3
- package/src/admin/Platform_Admin_Structure.res +58 -113
- package/src/admin/Platform_Admin_Structure.res.mjs +24 -139
- package/src/admin/UiFragmentRegistry/StateChangeSlice/UiFragmentRegistry.res.mjs +12 -12
- package/src/admin/UiFragmentRegistry/StateViewSlice/UiFragments.res.mjs +14 -14
- package/src/components/Aggregate/Aggregate_Callback.res +2 -2
- package/src/components/Aggregate/Aggregate_Callback.res.mjs +4 -4
- package/src/components/Api/ApiAllowedStatesHelpers.res.mjs +3 -3
- package/src/components/Api/ApiNoApiHelpers.res.mjs +5 -5
- package/src/components/Api/ApiTargetStateHelpers.res.mjs +3 -3
- package/src/components/Api/GraphQL_FragmentGenerator.res +18 -12
- package/src/components/Api/GraphQL_FragmentGenerator.res.mjs +7 -13
- package/src/components/Api/GraphQL_SchemaInspector.res +1 -1
- package/src/components/Api/GraphQL_SchemaInspector.res.mjs +1 -1
- package/src/components/Api/MCP_SchemaGenerator.res +1 -1
- package/src/components/Api/MCP_SchemaGenerator.res.mjs +1 -1
- package/src/components/Api/SchemaType.res +6 -10
- package/src/components/Api/SchemaType.res.mjs +4 -4
- package/src/components/Api/StorageRefFields.res +1 -1
- package/src/components/Api/StorageRefFields.res.mjs +1 -1
- package/src/components/Api/SuryToJsonSchema.res +11 -0
- package/src/components/Api/SuryToJsonSchema.res.mjs +2 -1
- package/src/components/AutomationSlice/AutomationSlice_Callback.res +3 -4
- package/src/components/AutomationSlice/AutomationSlice_Callback.res.mjs +22 -23
- package/src/components/CommandTopic/CommandTopic_Callback.res +1 -2
- package/src/components/CommandTopic/CommandTopic_Callback.res.mjs +3 -4
- package/src/components/CommandTopic/CommandTopic_Helpers.res +1 -1
- package/src/components/CommandTopic/CommandTopic_Helpers.res.mjs +3 -3
- package/src/components/Counter/Counter.res.mjs +2 -2
- package/src/components/Counter/Counter_Callback.res.mjs +4 -4
- package/src/components/Counter/Counter_Operations.res.mjs +4 -4
- package/src/components/Dcb/Dcb_Builder.res +1 -1
- package/src/components/Dcb/Dcb_Builder.res.mjs +8 -6
- package/src/components/DcbEventLog/DcbEventLog_Builder.res.mjs +4 -3
- package/src/components/EventCollector/EventCollector_Builder.res +1 -1
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res +1 -2
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +11 -12
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res +3 -4
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +24 -25
- package/src/components/SideEffectHandler/SideEffectHandler_Callback.res +1 -1
- package/src/components/SideEffectHandler/SideEffectHandler_Callback.res.mjs +3 -3
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res +2 -2
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +4 -4
- package/src/components/StateViewSlice/StateViewSlice_Builder.res +1 -1
- package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +3 -3
- package/src/plugin/api/PluginBaseFragment.res +12 -29
- package/src/plugin/api/PluginBaseFragment.res.mjs +3 -22
- package/src/plugin/component/Capability_Inference.res +118 -1
- package/src/plugin/component/Capability_Inference.res.mjs +128 -1
- package/src/plugin/component/Plugin_Builder.res +2 -2
- package/src/plugin/component/Plugin_Builder.res.mjs +2 -1
- package/src/plugin/component/Plugin_Helpers.res +11 -11
- package/src/plugin/component/Plugin_Helpers.res.mjs +11 -10
- package/src/plugin/component/Plugin_Structure.res +349 -274
- package/src/plugin/component/Plugin_Structure.res.mjs +212 -175
- package/src/plugin/component/Plugin_SubscriptionSchema.res +1 -1
- package/src/plugin/component/Plugin_SubscriptionSchema.res.mjs +1 -1
- package/src/plugin/component/SchemaWalker.res +11 -11
- package/src/plugin/component/SchemaWalker.res.mjs +8 -9
- package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +15 -15
- package/src/plugin/lifecycle/PluginBehavior.res.mjs +55 -55
- package/src/plugin/lifecycle/PluginSpec.res +22 -7
- package/src/plugin/lifecycle/PluginSpec.res.mjs +91 -36
- package/src/plugin/lifecycle/PluginsReadModelSpec.res +36 -9
- package/src/plugin/lifecycle/PluginsReadModelSpec.res.mjs +33 -22
- package/src/util/Interstack.res +3 -3
- package/src/util/LogFormat.res +1 -2
- package/src/util/LogFormat.res.mjs +2 -2
- package/tests/IdentityTest.res +6 -7
- package/tests/IdentityTest.res.mjs +7 -9
- package/tests/adapter/MonitoringTest.res +30 -3
- package/tests/adapter/MonitoringTest.res.mjs +31 -12
- package/tests/adapter/RuntimeExtensionHookReachTest.res +0 -1
- package/tests/adapter/RuntimeExtensionHookReachTest.res.mjs +5 -7
- package/tests/admin/Platform_Admin_StructureTest.res +254 -0
- package/tests/admin/Platform_Admin_StructureTest.res.mjs +219 -0
- package/tests/aggregate/AggregateCacheTest.res +0 -1
- package/tests/aggregate/AggregateCacheTest.res.mjs +13 -15
- package/tests/aggregate/AggregateConflictTest.res +0 -1
- package/tests/aggregate/AggregateConflictTest.res.mjs +7 -9
- package/tests/aggregate/AggregateFixtures.res +0 -1
- package/tests/aggregate/AggregateFixtures.res.mjs +19 -21
- package/tests/aggregate/AggregateSnapshotTest.res +1 -2
- package/tests/aggregate/AggregateSnapshotTest.res.mjs +15 -16
- package/tests/api/ApiNoApiTest.res.mjs +17 -9
- package/tests/api/GraphQL_FragmentGeneratorTest.res +62 -1
- package/tests/api/GraphQL_FragmentGeneratorTest.res.mjs +102 -58
- package/tests/api/PsInternalFieldsReadModel.res +21 -0
- package/tests/api/PsInternalFieldsReadModel.res.mjs +74 -0
- package/tests/api/StorageRefFieldsTest.res.mjs +13 -13
- package/tests/api/SuryToJsonSchemaTest.res +43 -0
- package/tests/api/SuryToJsonSchemaTest.res.mjs +352 -849
- package/tests/commandgenerator/CommandGeneratorFixtures.res +0 -1
- package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +19 -21
- package/tests/commandgenerator/OwnerStampingTest.res +0 -1
- package/tests/commandgenerator/OwnerStampingTest.res.mjs +9 -11
- package/tests/commandtopic/CommandTopicCallbackFixtures.res +0 -1
- package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +7 -9
- package/tests/counter/CounterFixtures.res +0 -1
- package/tests/counter/CounterFixtures.res.mjs +1 -4
- package/tests/dcb/DcbDecodeTest.res.mjs +24 -24
- package/tests/dcb/DcbEventLogOperationsTest.res +2 -2
- package/tests/dcb/DcbEventLogOperationsTest.res.mjs +3 -3
- package/tests/dcb/DcbEventLogSchemaTest.res.mjs +7 -7
- package/tests/dcb/DcbFixtures.res +0 -1
- package/tests/dcb/DcbFixtures.res.mjs +87 -89
- package/tests/dcb/DcbTagTest.res.mjs +6 -6
- package/tests/dcb/DcbValidationTest.res.mjs +52 -52
- package/tests/eventlog/EventLogFixtures.res +0 -1
- package/tests/eventlog/EventLogFixtures.res.mjs +7 -9
- package/tests/eventmapper/EventMapperFixtures.res +0 -1
- package/tests/eventmapper/EventMapperFixtures.res.mjs +24 -26
- package/tests/eventtopic/EventTopicFixtures.res +0 -1
- package/tests/eventtopic/EventTopicFixtures.res.mjs +7 -9
- package/tests/extensionpoint/ExtensionPointFixtures.res +0 -1
- package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +10 -12
- package/tests/extensionpoint/ExtensionPointOperationsTest.res +1 -2
- package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +9 -10
- package/tests/logger/LogFormatTest.res +3 -2
- package/tests/logger/LogFormatTest.res.mjs +7 -9
- package/tests/message/MessageTest.res +2 -2
- package/tests/message/MessageTest.res.mjs +8 -7
- package/tests/message/MetaEnvelopeTest.res +5 -5
- package/tests/message/MetaEnvelopeTest.res.mjs +12 -11
- package/tests/plugin/ManifestVisibilityTest.res.mjs +7 -7
- package/tests/plugin/PluginDefinitionScalars.res +5 -3
- package/tests/plugin/PluginDefinitionScalars.res.mjs +2 -2
- package/tests/plugin/PluginLifecycleCorpusTest.res +4 -3
- package/tests/plugin/PluginLifecycleCorpusTest.res.mjs +3 -6
- package/tests/plugin/PluginSpecExperiment.res +0 -1
- package/tests/plugin/PluginSpecExperiment.res.mjs +12 -14
- package/tests/plugin/PluginStructureTest.res +188 -1
- package/tests/plugin/PluginStructureTest.res.mjs +293 -102
- package/tests/plugin/Plugin_EventQuerySchemaTest.res.mjs +3 -3
- package/tests/plugin/SchemaWalkerTest.res +0 -1
- package/tests/plugin/SchemaWalkerTest.res.mjs +17 -19
- package/tests/plugin/StateChangeSlice/PsAttachInvoice.res.mjs +5 -5
- package/tests/plugin/StateChangeSlice/PsChangePhoto.res.mjs +8 -8
- package/tests/plugin/StateChangeSlice/PsDispatchShipment.res.mjs +5 -5
- package/tests/plugin/StateChangeSlice/PsGatedCommands.res.mjs +9 -9
- package/tests/plugin/StateChangeSlice/PsPlaceOrder.res.mjs +5 -5
- package/tests/plugin/StateChangeSlice/PsReserveStock.res.mjs +8 -8
- package/tests/plugin/StateChangeSlice/PsShipOrder.res.mjs +15 -15
- package/tests/plugin/StateChangeSlice/PsTypoStore.res +31 -0
- package/tests/plugin/StateChangeSlice/PsTypoStore.res.mjs +62 -0
- package/tests/plugin/StateChangeSlice/PsUploadAvatar.res.mjs +8 -8
- package/tests/plugin/StateChangeSlice/PsUploadImages.res +40 -0
- package/tests/plugin/StateChangeSlice/PsUploadImages.res.mjs +66 -0
- package/tests/plugin/StateViewSlice/PsAnnotatedView.res.mjs +13 -12
- package/tests/plugin/StateViewSlice/PsAvailableProductsView.res.mjs +8 -8
- package/tests/plugin/StateViewSlice/PsCategoriesView.res.mjs +6 -6
- package/tests/plugin/StateViewSlice/PsCustomersView.res.mjs +10 -10
- package/tests/plugin/StateViewSlice/PsGatedView.res.mjs +6 -6
- package/tests/plugin/StateViewSlice/PsOrdersView.res.mjs +9 -9
- package/tests/plugin/StateViewSlice/PsShipmentsView.res.mjs +11 -10
- package/tests/plugin/pluginDefinitionRequiredScalars.txt +15 -0
- package/tests/querydb/QueryDbFixtures.res +0 -1
- package/tests/querydb/QueryDbFixtures.res.mjs +5 -7
- package/tests/sideeffecthandler/SideEffectHandlerFixtures.res +0 -1
- package/tests/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +4 -6
- package/tests/util/CommandPublisherTest.res +0 -1
- package/tests/util/CommandPublisherTest.res.mjs +4 -6
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
4
4
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
5
|
import * as StorageRef$Reventless from "@reventlessdev/reventless-spec/src/semantic/StorageRef.res.mjs";
|
|
6
|
+
import * as Api_Naming$ReventlessCore from "../../components/Api/Api_Naming.res.mjs";
|
|
6
7
|
|
|
7
8
|
let refLikeNames = [
|
|
8
9
|
"file",
|
|
@@ -56,7 +57,7 @@ function scanSchema(component, schema) {
|
|
|
56
57
|
return [];
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
|
-
if (schema.type === "
|
|
60
|
+
if (schema.type === "anyOf") {
|
|
60
61
|
return schema.anyOf.flatMap(fromVariant);
|
|
61
62
|
} else {
|
|
62
63
|
return fromVariant(schema);
|
|
@@ -67,6 +68,127 @@ function message(w) {
|
|
|
67
68
|
return w.component + `.` + w.field + ` looks like a stored-object reference but declares no store — annotate it \`@storageRef("<store>")\` so the deployment provisions the store it needs, or rename the field if it holds an external URL. Heuristic matches are never provisioned.`;
|
|
68
69
|
}
|
|
69
70
|
|
|
71
|
+
function withinOneEdit(a, b) {
|
|
72
|
+
let la = a.length;
|
|
73
|
+
let lb = b.length;
|
|
74
|
+
if (la === lb) {
|
|
75
|
+
let diffs = [];
|
|
76
|
+
for (let i = 0; i < la; ++i) {
|
|
77
|
+
if (a.charAt(i) !== b.charAt(i)) {
|
|
78
|
+
diffs.push(i);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
let len = diffs.length;
|
|
82
|
+
if (len >= 3) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
switch (len) {
|
|
86
|
+
case 0 :
|
|
87
|
+
case 1 :
|
|
88
|
+
return true;
|
|
89
|
+
case 2 :
|
|
90
|
+
let i$1 = diffs[0];
|
|
91
|
+
let j = diffs[1];
|
|
92
|
+
if (j === (i$1 + 1 | 0) && a.charAt(i$1) === b.charAt(j)) {
|
|
93
|
+
return a.charAt(j) === b.charAt(i$1);
|
|
94
|
+
} else {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
} else {
|
|
99
|
+
if ((la - lb | 0) !== 1 && (lb - la | 0) !== 1) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
let match = la > lb ? [
|
|
103
|
+
a,
|
|
104
|
+
b
|
|
105
|
+
] : [
|
|
106
|
+
b,
|
|
107
|
+
a
|
|
108
|
+
];
|
|
109
|
+
let short = match[1];
|
|
110
|
+
let long = match[0];
|
|
111
|
+
let _li = 0;
|
|
112
|
+
let _si = 0;
|
|
113
|
+
let _skipped = false;
|
|
114
|
+
while (true) {
|
|
115
|
+
let skipped = _skipped;
|
|
116
|
+
let si = _si;
|
|
117
|
+
let li = _li;
|
|
118
|
+
if (si >= short.length) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
if (long.charAt(li) === short.charAt(si)) {
|
|
122
|
+
_si = si + 1 | 0;
|
|
123
|
+
_li = li + 1 | 0;
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
if (skipped) {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
_skipped = true;
|
|
130
|
+
_li = li + 1 | 0;
|
|
131
|
+
continue;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function sameStem(a, b) {
|
|
137
|
+
return Api_Naming$ReventlessCore.singularize(a) === Api_Naming$ReventlessCore.singularize(b);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function splitKey(key) {
|
|
141
|
+
let match = key.split(".");
|
|
142
|
+
if (match.length !== 2) {
|
|
143
|
+
return [
|
|
144
|
+
"",
|
|
145
|
+
key
|
|
146
|
+
];
|
|
147
|
+
}
|
|
148
|
+
let plugin = match[0];
|
|
149
|
+
let store = match[1];
|
|
150
|
+
return [
|
|
151
|
+
plugin,
|
|
152
|
+
store
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function collisions(declarations) {
|
|
157
|
+
let byStore = {};
|
|
158
|
+
declarations.forEach(d => {
|
|
159
|
+
let match = byStore[d.store];
|
|
160
|
+
if (match !== undefined) {
|
|
161
|
+
return;
|
|
162
|
+
} else {
|
|
163
|
+
byStore[d.store] = d;
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
let unique = Object.values(byStore);
|
|
168
|
+
let found = [];
|
|
169
|
+
for (let i = 0, i_finish = unique.length; i < i_finish; ++i) {
|
|
170
|
+
for (let j = i + 1 | 0, j_finish = unique.length; j < j_finish; ++j) {
|
|
171
|
+
let a = unique[i];
|
|
172
|
+
let b = unique[j];
|
|
173
|
+
let match = splitKey(a.store);
|
|
174
|
+
let storeA = match[1];
|
|
175
|
+
let match$1 = splitKey(b.store);
|
|
176
|
+
let storeB = match$1[1];
|
|
177
|
+
if (match[0] === match$1[0] && (withinOneEdit(storeA, storeB) || sameStem(storeA, storeB))) {
|
|
178
|
+
found.push({
|
|
179
|
+
a: a,
|
|
180
|
+
b: b
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return found;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function collisionMessage(c) {
|
|
189
|
+
return c.a.store + ` (` + c.a.component + `.` + c.a.field + `) and ` + c.b.store + ` ` + (`(` + c.b.component + `.` + c.b.field + `) differ by one edit — one is probably a typo for `) + `the other, and both would be provisioned, splitting objects across two stores. Fix the field name, or name the store explicitly with \`@storageRef("<store>")\` if the two really are separate stores.`;
|
|
190
|
+
}
|
|
191
|
+
|
|
70
192
|
export {
|
|
71
193
|
refLikeNames,
|
|
72
194
|
refLikeSuffixes,
|
|
@@ -75,5 +197,10 @@ export {
|
|
|
75
197
|
warningsFromProperties,
|
|
76
198
|
scanSchema,
|
|
77
199
|
message,
|
|
200
|
+
withinOneEdit,
|
|
201
|
+
sameStem,
|
|
202
|
+
splitKey,
|
|
203
|
+
collisions,
|
|
204
|
+
collisionMessage,
|
|
78
205
|
}
|
|
79
206
|
/* StorageRef-Reventless Not a pure module */
|
|
@@ -687,7 +687,7 @@ module Make = (
|
|
|
687
687
|
interstackAdminExtensionPoints
|
|
688
688
|
->Pulumi.StackReference.get(PluginExtensionPointSpec.name)
|
|
689
689
|
->Obj.magic: JSON.t
|
|
690
|
-
)->S.parseOrThrow(ReventlessInterop.ExtensionPoint.resolvedOutputsSchema)
|
|
690
|
+
)->S.parseOrThrow(~to=ReventlessInterop.ExtensionPoint.resolvedOutputsSchema)
|
|
691
691
|
let pluginExtensionPointCommandTopicRemoteChannel = PluginExtensionPointRemoteChannel.make(
|
|
692
692
|
pluginExtensionPointUnwrapped.commandTopic.resources->Array.map(
|
|
693
693
|
Adapter.fromInteropResolved,
|
|
@@ -1030,7 +1030,7 @@ module Make = (
|
|
|
1030
1030
|
builderOutputs->Pulumi.Output.apply(outputs =>
|
|
1031
1031
|
outputs
|
|
1032
1032
|
->toInteropMeta
|
|
1033
|
-
->
|
|
1033
|
+
->Reventless.Util_Sury.toJson(ReventlessInterop.ExportMeta.schema)
|
|
1034
1034
|
)
|
|
1035
1035
|
|
|
1036
1036
|
Logger.currentPluginName := _prevPluginName
|
|
@@ -9,6 +9,7 @@ import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
|
9
9
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
10
10
|
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
11
11
|
import * as Plugin$Reventless from "@reventlessdev/reventless-spec/src/components/Plugin.res.mjs";
|
|
12
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
12
13
|
import * as Logger$ReventlessCore from "../../util/Logger.res.mjs";
|
|
13
14
|
import * as Plugin$ReventlessCore from "./Plugin.res.mjs";
|
|
14
15
|
import * as StackReference$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/StackReference.res.mjs";
|
|
@@ -648,7 +649,7 @@ function Make(Spec) {
|
|
|
648
649
|
inboundTranslationSlices: pluginOutputs_inboundTranslationSlices
|
|
649
650
|
};
|
|
650
651
|
Component$ReventlessCore.setOutputs(extra, pluginOutputs);
|
|
651
|
-
Plugin_Helpers$ReventlessCore.interopMetaOutput.contents = builderOutputs.apply(outputs =>
|
|
652
|
+
Plugin_Helpers$ReventlessCore.interopMetaOutput.contents = builderOutputs.apply(outputs => Util_Sury$Reventless.toJson(Plugin_Helpers$ReventlessCore.toInteropMeta(outputs), ExportMeta$ReventlessInterop.schema));
|
|
652
653
|
Logger$ReventlessCore.currentPluginName.contents = _prevPluginName;
|
|
653
654
|
return ResourceAttribution$ReventlessCore.restore(_prevAttribution);
|
|
654
655
|
}, opts);
|
|
@@ -46,7 +46,7 @@ let getRemoteStorageResources = (pluginName, queryDbName) =>
|
|
|
46
46
|
| Some(rawReadModel) =>
|
|
47
47
|
try {
|
|
48
48
|
let readModel =
|
|
49
|
-
rawReadModel->S.parseOrThrow(ReventlessInterop.ReadModel.resolvedOutputsSchema)
|
|
49
|
+
rawReadModel->S.parseOrThrow(~to=ReventlessInterop.ReadModel.resolvedOutputsSchema)
|
|
50
50
|
readModel.queryDb.resources->Adapter.fromInteropResources
|
|
51
51
|
} catch {
|
|
52
52
|
| exn =>
|
|
@@ -607,12 +607,12 @@ module MakeEventCollectorHelper = (
|
|
|
607
607
|
ecResource.name->ComponentType.nameOpt(EventCollector.componentType)
|
|
608
608
|
let pluginDefinitionJson =
|
|
609
609
|
pluginDefinition
|
|
610
|
-
->
|
|
610
|
+
->Reventless.Util_Sury.toJson(Reventless.Plugin.pluginDefinitionSchema)
|
|
611
611
|
->JSON.stringify
|
|
612
612
|
->Pulumi.Output.make
|
|
613
613
|
let uiFragmentsJson =
|
|
614
614
|
uiFragments
|
|
615
|
-
->
|
|
615
|
+
->Reventless.Util_Sury.toJson(Reventless.Plugin.uiFragmentManifestOptionSchema)
|
|
616
616
|
->JSON.stringify
|
|
617
617
|
->Pulumi.Output.make
|
|
618
618
|
let pluginExtensionPointCmdTopicUrl = switch pluginExtensionPointUnwrapped {
|
|
@@ -824,7 +824,7 @@ let offloadPayload = (value: 'a, ~schema: S.t<'a>, ~store: string): Reventless.O
|
|
|
824
824
|
switch offloadHook.contents {
|
|
825
825
|
| Some(hook) =>
|
|
826
826
|
Reventless.Offload.Offloaded(
|
|
827
|
-
hook(~store, ~bytes=value->
|
|
827
|
+
hook(~store, ~bytes=value->Reventless.Util_Sury.toJsonString(schema)),
|
|
828
828
|
)
|
|
829
829
|
| None => Reventless.Offload.Inline(value)
|
|
830
830
|
}
|
|
@@ -1250,7 +1250,7 @@ let serializePlainDictExport = (
|
|
|
1250
1250
|
->toResolved
|
|
1251
1251
|
->Pulumi.Output.apply(resolved => (
|
|
1252
1252
|
name,
|
|
1253
|
-
resolved->
|
|
1253
|
+
resolved->Reventless.Util_Sury.toJson(schema),
|
|
1254
1254
|
))
|
|
1255
1255
|
)
|
|
1256
1256
|
->Pulumi.Output.all
|
|
@@ -1269,7 +1269,7 @@ let serializeDictExport = (
|
|
|
1269
1269
|
->toResolved
|
|
1270
1270
|
->Pulumi.Output.apply(resolved => (
|
|
1271
1271
|
name,
|
|
1272
|
-
resolved->
|
|
1272
|
+
resolved->Reventless.Util_Sury.toJson(schema),
|
|
1273
1273
|
))
|
|
1274
1274
|
)
|
|
1275
1275
|
->Pulumi.Output.all
|
|
@@ -1285,7 +1285,7 @@ let serializeTasksOutputs = (pluginOutputs: Plugin.outputs): Pulumi.Output.t<JSO
|
|
|
1285
1285
|
task
|
|
1286
1286
|
->Task.toResolvedOutputs
|
|
1287
1287
|
->Pulumi.Output.apply(resolved =>
|
|
1288
|
-
resolved->
|
|
1288
|
+
resolved->Reventless.Util_Sury.toJson(ReventlessInterop.Task.resolvedOutputsSchema)
|
|
1289
1289
|
)
|
|
1290
1290
|
)
|
|
1291
1291
|
->Pulumi.Output.all
|
|
@@ -1310,7 +1310,7 @@ let serializeEventMappersOutputs = (pluginOutputs: Plugin.outputs): Pulumi.Outpu
|
|
|
1310
1310
|
->EventMapper.toResolvedOutputs
|
|
1311
1311
|
->Pulumi.Output.apply(resolved =>
|
|
1312
1312
|
Some(
|
|
1313
|
-
resolved->
|
|
1313
|
+
resolved->Reventless.Util_Sury.toJson(
|
|
1314
1314
|
ReventlessInterop.EventMapper.resolvedOutputsSchema,
|
|
1315
1315
|
),
|
|
1316
1316
|
)
|
|
@@ -1350,7 +1350,7 @@ let exportPlatformOutputs = (
|
|
|
1350
1350
|
->ExtensionPoint.toResolvedOutputs
|
|
1351
1351
|
->Pulumi.Output.apply(resolved => (
|
|
1352
1352
|
ep.name,
|
|
1353
|
-
resolved->
|
|
1353
|
+
resolved->Reventless.Util_Sury.toJson(
|
|
1354
1354
|
ReventlessInterop.ExtensionPoint.resolvedOutputsSchema,
|
|
1355
1355
|
),
|
|
1356
1356
|
))
|
|
@@ -1392,7 +1392,7 @@ let exportPlatformOutputs = (
|
|
|
1392
1392
|
dcbOutputs
|
|
1393
1393
|
->DcbEventLog.toResolvedOutputs
|
|
1394
1394
|
->Pulumi.Output.apply(resolved =>
|
|
1395
|
-
resolved->
|
|
1395
|
+
resolved->Reventless.Util_Sury.toJson(
|
|
1396
1396
|
ReventlessInterop.DcbEventLog.resolvedOutputsSchema,
|
|
1397
1397
|
)
|
|
1398
1398
|
),
|
|
@@ -1545,7 +1545,7 @@ let exportPluginOutputs = (pluginOutputs: Plugin.outputs) => {
|
|
|
1545
1545
|
dcbOutputs
|
|
1546
1546
|
->DcbEventLog.toResolvedOutputs
|
|
1547
1547
|
->Pulumi.Output.apply(resolved =>
|
|
1548
|
-
resolved->
|
|
1548
|
+
resolved->Reventless.Util_Sury.toJson(
|
|
1549
1549
|
ReventlessInterop.DcbEventLog.resolvedOutputsSchema,
|
|
1550
1550
|
)
|
|
1551
1551
|
)
|
|
@@ -16,6 +16,7 @@ import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/component
|
|
|
16
16
|
import * as Plugin$Reventless from "@reventlessdev/reventless-spec/src/components/Plugin.res.mjs";
|
|
17
17
|
import * as Task$ReventlessCore from "../../components/Task/Task.res.mjs";
|
|
18
18
|
import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
|
|
19
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
19
20
|
import * as Logger$ReventlessCore from "../../util/Logger.res.mjs";
|
|
20
21
|
import * as Adapter$ReventlessCore from "../../adapter/Adapter.res.mjs";
|
|
21
22
|
import * as Task$ReventlessInterop from "@reventlessdev/reventless-interop/src/components/Task.res.mjs";
|
|
@@ -321,8 +322,8 @@ function MakeEventCollectorHelper(RuntimeEnvironment) {
|
|
|
321
322
|
let handler = PluginEventCollector.makeHandler(eventCollector, Callback.handleJsonEvents);
|
|
322
323
|
let ecResource = Component$ReventlessCore.toPulumiResource(eventCollector);
|
|
323
324
|
let ecName = ComponentType$ReventlessCore.nameOpt(ecResource.__name, EventCollector$ReventlessCore.componentType);
|
|
324
|
-
let pluginDefinitionJson = Pulumi.output(JSON.stringify(
|
|
325
|
-
let uiFragmentsJson = Pulumi.output(JSON.stringify(
|
|
325
|
+
let pluginDefinitionJson = Pulumi.output(JSON.stringify(Util_Sury$Reventless.toJson(pluginDefinition, Plugin$Reventless.pluginDefinitionSchema)));
|
|
326
|
+
let uiFragmentsJson = Pulumi.output(JSON.stringify(Util_Sury$Reventless.toJson(uiFragments, Plugin$Reventless.uiFragmentManifestOptionSchema)));
|
|
326
327
|
let pluginExtensionPointCmdTopicUrl;
|
|
327
328
|
if (pluginExtensionPointUnwrapped !== undefined) {
|
|
328
329
|
let r = pluginExtensionPointUnwrapped.commandTopic.resources[0];
|
|
@@ -436,7 +437,7 @@ function offloadPayload(value, schema, store) {
|
|
|
436
437
|
if (hook !== undefined) {
|
|
437
438
|
return {
|
|
438
439
|
TAG: "Offloaded",
|
|
439
|
-
_0: hook(store,
|
|
440
|
+
_0: hook(store, Util_Sury$Reventless.toJsonString(value, schema, undefined))
|
|
440
441
|
};
|
|
441
442
|
} else {
|
|
442
443
|
return {
|
|
@@ -636,7 +637,7 @@ function serializePlainDictExport(dict, toResolved, schema) {
|
|
|
636
637
|
let name = param[0];
|
|
637
638
|
return toResolved(param[1]).apply(resolved => [
|
|
638
639
|
name,
|
|
639
|
-
|
|
640
|
+
Util_Sury$Reventless.toJson(resolved, schema)
|
|
640
641
|
]);
|
|
641
642
|
})).apply(pairs => Object.fromEntries(pairs));
|
|
642
643
|
}
|
|
@@ -646,19 +647,19 @@ function serializeDictExport(dictOutput, toResolved, schema) {
|
|
|
646
647
|
let name = param[0];
|
|
647
648
|
return toResolved(param[1]).apply(resolved => [
|
|
648
649
|
name,
|
|
649
|
-
|
|
650
|
+
Util_Sury$Reventless.toJson(resolved, schema)
|
|
650
651
|
]);
|
|
651
652
|
})).apply(pairs => Object.fromEntries(pairs)));
|
|
652
653
|
}
|
|
653
654
|
|
|
654
655
|
function serializeTasksOutputs(pluginOutputs) {
|
|
655
|
-
return Output$Pulumi.flatMap(pluginOutputs.tasks, tasks => Pulumi.all(Object.values(tasks).map(task => Task$ReventlessCore.toResolvedOutputs(task).apply(resolved =>
|
|
656
|
+
return Output$Pulumi.flatMap(pluginOutputs.tasks, tasks => Pulumi.all(Object.values(tasks).map(task => Task$ReventlessCore.toResolvedOutputs(task).apply(resolved => Util_Sury$Reventless.toJson(resolved, Task$ReventlessInterop.resolvedOutputsSchema)))).apply(arr => arr));
|
|
656
657
|
}
|
|
657
658
|
|
|
658
659
|
function serializeEventMappersOutputs(pluginOutputs) {
|
|
659
660
|
return Output$Pulumi.flatMap(pluginOutputs.aggregates, aggregates => Pulumi.all(Object.values(aggregates).map(agg => Output$Pulumi.flatMap(agg.eventMapper, em => {
|
|
660
661
|
if (em !== undefined) {
|
|
661
|
-
return EventMapper$ReventlessCore.toResolvedOutputs(em).apply(resolved =>
|
|
662
|
+
return EventMapper$ReventlessCore.toResolvedOutputs(em).apply(resolved => Util_Sury$Reventless.toJson(resolved, EventMapper$ReventlessInterop.resolvedOutputsSchema));
|
|
662
663
|
} else {
|
|
663
664
|
return Pulumi.output(undefined);
|
|
664
665
|
}
|
|
@@ -669,7 +670,7 @@ function exportPlatformOutputs(extensionPointsOutputs, aggregatesOutputs, readMo
|
|
|
669
670
|
exportDeploymentMetadata();
|
|
670
671
|
Pulumi$Pulumi.$$export("extensionPoints", Output$Pulumi.flatMap(extensionPointsOutputs, eps => Pulumi.all(eps.map(ep => ExtensionPoint$ReventlessCore.toResolvedOutputs(ep).apply(resolved => [
|
|
671
672
|
ep.name,
|
|
672
|
-
|
|
673
|
+
Util_Sury$Reventless.toJson(resolved, ExtensionPoint$ReventlessInterop.resolvedOutputsSchema)
|
|
673
674
|
]))).apply(pairs => Object.fromEntries(pairs))));
|
|
674
675
|
if (Object.keys(aggregatesOutputs).length !== 0) {
|
|
675
676
|
Pulumi$Pulumi.$$export("aggregates", serializePlainDictExport(aggregatesOutputs, Aggregate$ReventlessCore.toResolvedOutputs, Aggregate$ReventlessInterop.resolvedOutputsSchema));
|
|
@@ -678,7 +679,7 @@ function exportPlatformOutputs(extensionPointsOutputs, aggregatesOutputs, readMo
|
|
|
678
679
|
Pulumi$Pulumi.$$export("readModels", serializePlainDictExport(readModelsOutputs, ReadModel$ReventlessCore.toResolvedOutputs, ReadModel$ReventlessInterop.resolvedOutputsSchema));
|
|
679
680
|
}
|
|
680
681
|
if (dcbEventLogOutputs !== undefined) {
|
|
681
|
-
Pulumi$Pulumi.$$export("dcbEventLog", DcbEventLog$ReventlessCore.toResolvedOutputs(dcbEventLogOutputs).apply(resolved =>
|
|
682
|
+
Pulumi$Pulumi.$$export("dcbEventLog", DcbEventLog$ReventlessCore.toResolvedOutputs(dcbEventLogOutputs).apply(resolved => Util_Sury$Reventless.toJson(resolved, DcbEventLog$ReventlessInterop.resolvedOutputsSchema)));
|
|
682
683
|
}
|
|
683
684
|
if (Object.keys(stateChangeSlicesOutputs).length !== 0) {
|
|
684
685
|
Pulumi$Pulumi.$$export("stateChangeSlices", serializePlainDictExport(stateChangeSlicesOutputs, StateChangeSlice$ReventlessCore.toResolvedOutputs, StateChangeSlice$ReventlessInterop.resolvedOutputsSchema));
|
|
@@ -711,7 +712,7 @@ function exportPluginOutputs(pluginOutputs) {
|
|
|
711
712
|
Pulumi$Pulumi.$$export("inboundTranslationSlices", serializeDictExport(pluginOutputs.inboundTranslationSlices, InboundTranslationSlice$ReventlessCore.toResolvedOutputs, InboundTranslationSlice$ReventlessInterop.resolvedOutputsSchema));
|
|
712
713
|
Pulumi$Pulumi.$$export("dcbEventLog", Output$Pulumi.flatMap(pluginOutputs.dcbEventLog, opt => {
|
|
713
714
|
if (opt !== undefined) {
|
|
714
|
-
return DcbEventLog$ReventlessCore.toResolvedOutputs(opt).apply(resolved =>
|
|
715
|
+
return DcbEventLog$ReventlessCore.toResolvedOutputs(opt).apply(resolved => Util_Sury$Reventless.toJson(resolved, DcbEventLog$ReventlessInterop.resolvedOutputsSchema));
|
|
715
716
|
} else {
|
|
716
717
|
return Pulumi.output(null);
|
|
717
718
|
}
|