@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
5
5
|
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
6
6
|
import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
|
|
@@ -8,21 +8,19 @@ import * as ReadModel$Reventless from "@reventlessdev/reventless-spec/src/compon
|
|
|
8
8
|
import * as Projection$Reventless from "@reventlessdev/reventless-spec/src/types/Projection.res.mjs";
|
|
9
9
|
import * as EventMapper_Callback$ReventlessCore from "../../src/components/EventMapper/EventMapper_Callback.res.mjs";
|
|
10
10
|
|
|
11
|
-
S.enableJson();
|
|
12
|
-
|
|
13
11
|
let name = "SourceAggregate";
|
|
14
12
|
|
|
15
|
-
let eventSchema =
|
|
16
|
-
|
|
13
|
+
let eventSchema = Sury.union([
|
|
14
|
+
Sury.$schema(s => ({
|
|
17
15
|
TAG: "ItemCreated",
|
|
18
|
-
name: s.m(
|
|
19
|
-
price: s.m(
|
|
16
|
+
name: s.m(Sury.string),
|
|
17
|
+
price: s.m(Sury.float)
|
|
20
18
|
})),
|
|
21
|
-
|
|
19
|
+
Sury.$schema(s => ({
|
|
22
20
|
TAG: "ItemPriceUpdated",
|
|
23
|
-
newPrice: s.m(
|
|
21
|
+
newPrice: s.m(Sury.float)
|
|
24
22
|
})),
|
|
25
|
-
|
|
23
|
+
Sury.literal("ItemRemoved")
|
|
26
24
|
]);
|
|
27
25
|
|
|
28
26
|
let moduleUrl = import.meta.url;
|
|
@@ -36,9 +34,9 @@ let SourceSpec = {
|
|
|
36
34
|
|
|
37
35
|
let name$1 = "ItemCatalog";
|
|
38
36
|
|
|
39
|
-
let stateSchema =
|
|
40
|
-
name: s.m(
|
|
41
|
-
price: s.m(
|
|
37
|
+
let stateSchema = Sury.$schema(s => ({
|
|
38
|
+
name: s.m(Sury.string),
|
|
39
|
+
price: s.m(Sury.float)
|
|
42
40
|
}));
|
|
43
41
|
|
|
44
42
|
let config = ReadModel$Reventless.config(undefined, undefined, undefined);
|
|
@@ -114,15 +112,15 @@ function makeSourceEvent$p(id, event) {
|
|
|
114
112
|
|
|
115
113
|
let name$2 = "TestCmdSource";
|
|
116
114
|
|
|
117
|
-
let eventSchema$1 =
|
|
118
|
-
|
|
115
|
+
let eventSchema$1 = Sury.union([
|
|
116
|
+
Sury.$schema(s => ({
|
|
119
117
|
TAG: "OrderPlaced",
|
|
120
|
-
orderId: s.m(
|
|
121
|
-
amount: s.m(
|
|
118
|
+
orderId: s.m(Sury.string),
|
|
119
|
+
amount: s.m(Sury.float)
|
|
122
120
|
})),
|
|
123
|
-
|
|
121
|
+
Sury.$schema(s => ({
|
|
124
122
|
TAG: "OrderShipped",
|
|
125
|
-
orderId: s.m(
|
|
123
|
+
orderId: s.m(Sury.string)
|
|
126
124
|
}))
|
|
127
125
|
]);
|
|
128
126
|
|
|
@@ -137,15 +135,15 @@ let CmdSourceSpec = {
|
|
|
137
135
|
|
|
138
136
|
let name$3 = "TestCmdTarget";
|
|
139
137
|
|
|
140
|
-
let commandSchema =
|
|
141
|
-
|
|
138
|
+
let commandSchema = Sury.union([
|
|
139
|
+
Sury.$schema(s => ({
|
|
142
140
|
TAG: "ProcessOrder",
|
|
143
|
-
orderId: s.m(
|
|
144
|
-
amount: s.m(
|
|
141
|
+
orderId: s.m(Sury.string),
|
|
142
|
+
amount: s.m(Sury.float)
|
|
145
143
|
})),
|
|
146
|
-
|
|
144
|
+
Sury.$schema(s => ({
|
|
147
145
|
TAG: "ShipOrder",
|
|
148
|
-
orderId: s.m(
|
|
146
|
+
orderId: s.m(Sury.string)
|
|
149
147
|
}))
|
|
150
148
|
]);
|
|
151
149
|
|
|
@@ -437,4 +435,4 @@ export {
|
|
|
437
435
|
makeEventJson,
|
|
438
436
|
resetMocks,
|
|
439
437
|
}
|
|
440
|
-
/*
|
|
438
|
+
/* eventSchema Not a pure module */
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let eventSchema = S.union([
|
|
8
|
-
S.schema(s => ({
|
|
5
|
+
let eventSchema = Sury.union([
|
|
6
|
+
Sury.$schema(s => ({
|
|
9
7
|
TAG: "ItemPublished",
|
|
10
|
-
name: s.m(
|
|
8
|
+
name: s.m(Sury.string)
|
|
11
9
|
})),
|
|
12
|
-
|
|
10
|
+
Sury.$schema(s => ({
|
|
13
11
|
TAG: "ItemRemoved",
|
|
14
|
-
id: s.m(
|
|
12
|
+
id: s.m(Sury.string)
|
|
15
13
|
}))
|
|
16
14
|
]);
|
|
17
15
|
|
|
@@ -62,4 +60,4 @@ export {
|
|
|
62
60
|
makeEvent$p,
|
|
63
61
|
reset,
|
|
64
62
|
}
|
|
65
|
-
/*
|
|
63
|
+
/* eventSchema Not a pure module */
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
5
5
|
import * as ExtensionPoint_Callback$ReventlessCore from "../../src/components/ExtensionPoint/ExtensionPoint_Callback.res.mjs";
|
|
6
6
|
|
|
7
|
-
S.enableJson();
|
|
8
|
-
|
|
9
7
|
let name = "TestExtensionPoint";
|
|
10
8
|
|
|
11
|
-
let commandSchema =
|
|
12
|
-
|
|
9
|
+
let commandSchema = Sury.union([
|
|
10
|
+
Sury.$schema(s => ({
|
|
13
11
|
TAG: "RouteToAgg",
|
|
14
|
-
aggId: s.m(
|
|
12
|
+
aggId: s.m(Sury.string)
|
|
15
13
|
})),
|
|
16
|
-
|
|
14
|
+
Sury.$schema(s => ({
|
|
17
15
|
TAG: "TriggerDirective",
|
|
18
|
-
value: s.m(
|
|
16
|
+
value: s.m(Sury.string)
|
|
19
17
|
}))
|
|
20
18
|
]);
|
|
21
19
|
|
|
22
|
-
let eventSchema =
|
|
20
|
+
let eventSchema = Sury.$schema(s => ({
|
|
23
21
|
TAG: "Done",
|
|
24
|
-
result: s.m(
|
|
22
|
+
result: s.m(Sury.string)
|
|
25
23
|
}));
|
|
26
24
|
|
|
27
|
-
let directiveSchema =
|
|
25
|
+
let directiveSchema = Sury.literal("DirectiveA");
|
|
28
26
|
|
|
29
27
|
let moduleUrl = import.meta.url;
|
|
30
28
|
|
|
@@ -202,4 +200,4 @@ export {
|
|
|
202
200
|
makeTopicItem,
|
|
203
201
|
reset,
|
|
204
202
|
}
|
|
205
|
-
/*
|
|
203
|
+
/* commandSchema Not a pure module */
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
open JestGlobals
|
|
5
5
|
|
|
6
|
-
S.enableJson()
|
|
7
6
|
|
|
8
7
|
// ─────────────────────────────────────────────────────────────
|
|
9
8
|
// EP Spec — minimal types for operations tests
|
|
@@ -189,7 +188,7 @@ let makeEventJsonForAgg = (aggregateName: string): JSON.t => {
|
|
|
189
188
|
}
|
|
190
189
|
JSON.Encode.object(
|
|
191
190
|
Dict.fromArray([
|
|
192
|
-
("meta", meta->
|
|
191
|
+
("meta", meta->Reventless.Util_Sury.toJson(Reventless.Message.metaSchema)),
|
|
193
192
|
("event", JSON.Encode.string("SomeEvent")),
|
|
194
193
|
]),
|
|
195
194
|
)
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
|
|
5
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
5
6
|
import * as ExtensionPoint_Operations$ReventlessCore from "../../src/components/ExtensionPoint/ExtensionPoint_Operations.res.mjs";
|
|
6
7
|
|
|
7
|
-
S.enableJson();
|
|
8
|
-
|
|
9
8
|
let name = "OpsTestEP";
|
|
10
9
|
|
|
11
|
-
let commandSchema =
|
|
10
|
+
let commandSchema = Sury.$schema(s => ({
|
|
12
11
|
TAG: "OpsEPCmd",
|
|
13
|
-
id: s.m(
|
|
12
|
+
id: s.m(Sury.string)
|
|
14
13
|
}));
|
|
15
14
|
|
|
16
|
-
let eventSchema =
|
|
15
|
+
let eventSchema = Sury.$schema(s => ({
|
|
17
16
|
TAG: "OpsEPEvent",
|
|
18
|
-
result: s.m(
|
|
17
|
+
result: s.m(Sury.string)
|
|
19
18
|
}));
|
|
20
19
|
|
|
21
|
-
let directiveSchema =
|
|
20
|
+
let directiveSchema = Sury.literal("OpsEPNoDirective");
|
|
22
21
|
|
|
23
22
|
let moduleUrl = import.meta.url;
|
|
24
23
|
|
|
@@ -225,7 +224,7 @@ function makeEventJsonForAgg(aggregateName) {
|
|
|
225
224
|
return Object.fromEntries([
|
|
226
225
|
[
|
|
227
226
|
"meta",
|
|
228
|
-
|
|
227
|
+
Util_Sury$Reventless.toJson(meta, Message$Reventless.metaSchema)
|
|
229
228
|
],
|
|
230
229
|
[
|
|
231
230
|
"event",
|
|
@@ -301,4 +300,4 @@ export {
|
|
|
301
300
|
makeEventJsonForAgg,
|
|
302
301
|
reset,
|
|
303
302
|
}
|
|
304
|
-
/*
|
|
303
|
+
/* commandSchema Not a pure module */
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
open JestGlobals
|
|
2
2
|
open LogFormat
|
|
3
3
|
|
|
4
|
-
S.enableJson()
|
|
5
4
|
|
|
6
5
|
// Sink detection (Reventless.AnsiStyle) defaults a non-TTY stdout — Jest
|
|
7
6
|
// included — to JSON, which no-ops `bold`/`fmtComp`. The human-format
|
|
@@ -121,7 +120,9 @@ describe("LogFormat", () => {
|
|
|
121
120
|
let eventJson' = event'->Message.encodeEvent'(S.string, eventSchema)
|
|
122
121
|
let msg = event'JsonToLogMessage(eventJson')
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
// sury 11 (alpha.8) serialises meta keys in a different order than alpha.4
|
|
124
|
+
// (msgId/correlationId before ip/user) — same data, JSON-equivalent.
|
|
125
|
+
let expected = `\x1b[1mVersionDetected\x1b[0m(testId): {"event":{"TAG":"VersionDetected","_0":"0.0.0"},"meta":{"service":"testService","time":"testTime","msgId":"testMsgId","correlationId":"testCorrelationId","ip":"testIp","user":"testUser"},"id":"testId"}`
|
|
125
126
|
|
|
126
127
|
expect(msg)->toEqual(expected)
|
|
127
128
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
|
|
5
5
|
import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
|
|
6
6
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
@@ -15,8 +15,6 @@ import * as LogFormat$ReventlessCore from "../../src/util/LogFormat.res.mjs";
|
|
|
15
15
|
import * as PluginSpec$ReventlessCore from "../../src/plugin/lifecycle/PluginSpec.res.mjs";
|
|
16
16
|
import * as EffectLogger$ReventlessCore from "../../src/util/EffectLogger.res.mjs";
|
|
17
17
|
|
|
18
|
-
S.enableJson();
|
|
19
|
-
|
|
20
18
|
process.env["REVENTLESS_LOG_FORMAT"] = "text";
|
|
21
19
|
|
|
22
20
|
AnsiStyle$Reventless.reload();
|
|
@@ -119,17 +117,17 @@ globalThis.describe("LogFormat", () => {
|
|
|
119
117
|
TAG: "VersionDetected",
|
|
120
118
|
_0: "0.0.0"
|
|
121
119
|
}
|
|
122
|
-
},
|
|
120
|
+
}, Sury.string, PluginSpec$ReventlessCore.eventSchema);
|
|
123
121
|
let msg = LogFormat$ReventlessCore.event$pJsonToLogMessage(eventJson$p);
|
|
124
|
-
globalThis.expect(msg).toEqual(`\x1b[1mVersionDetected\x1b[0m(testId): {"event":{"TAG":"VersionDetected","_0":"0.0.0"},"meta":{"service":"testService","time":"testTime","
|
|
122
|
+
globalThis.expect(msg).toEqual(`\x1b[1mVersionDetected\x1b[0m(testId): {"event":{"TAG":"VersionDetected","_0":"0.0.0"},"meta":{"service":"testService","time":"testTime","msgId":"testMsgId","correlationId":"testCorrelationId","ip":"testIp","user":"testUser"},"id":"testId"}`);
|
|
125
123
|
});
|
|
126
124
|
});
|
|
127
125
|
globalThis.describe("variantFields", () => {
|
|
128
|
-
let commandSchema =
|
|
126
|
+
let commandSchema = Sury.$schema(s => ({
|
|
129
127
|
TAG: "AddProduct",
|
|
130
|
-
productId: s.m(
|
|
131
|
-
name: s.m(
|
|
132
|
-
imageUrl: s.m(
|
|
128
|
+
productId: s.m(Sury.string),
|
|
129
|
+
name: s.m(Sury.string),
|
|
130
|
+
imageUrl: s.m(Sury.$option(Sury.string))
|
|
133
131
|
}));
|
|
134
132
|
globalThis.test("omits an absent optional field", () => {
|
|
135
133
|
let json = Message$ReventlessCore.encode({
|
|
@@ -167,7 +167,7 @@ describe("Message should", () => {
|
|
|
167
167
|
}`)(json)
|
|
168
168
|
|
|
169
169
|
// Strict decode must reject the stale JSON — the tolerance is what saves it.
|
|
170
|
-
let strictThrew = switch oldJson->
|
|
170
|
+
let strictThrew = switch oldJson->Reventless.Util_Sury.fromJson(
|
|
171
171
|
Message.toEventSchema'(S.string, PluginSpec.eventSchema),
|
|
172
172
|
) {
|
|
173
173
|
| _ => false
|
|
@@ -222,7 +222,7 @@ describe("Message should", () => {
|
|
|
222
222
|
)
|
|
223
223
|
|
|
224
224
|
// Strict decode of the stale variant throws (reproduces the production brick).
|
|
225
|
-
let strictThrew = switch staleJson->
|
|
225
|
+
let strictThrew = switch staleJson->Reventless.Util_Sury.fromJson(PluginSpec.eventSchema) {
|
|
226
226
|
| _ => false
|
|
227
227
|
| exception _ => true
|
|
228
228
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
5
|
import * as Offload$Reventless from "@reventlessdev/reventless-spec/src/semantic/Offload.res.mjs";
|
|
6
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
6
7
|
import * as Message$ReventlessCore from "../../src/Message.res.mjs";
|
|
7
8
|
import * as PluginSpec$ReventlessCore from "../../src/plugin/lifecycle/PluginSpec.res.mjs";
|
|
8
9
|
|
|
@@ -66,7 +67,7 @@ globalThis.describe("Message should", () => {
|
|
|
66
67
|
TAG: "VersionDetected",
|
|
67
68
|
_0: "0.0.0"
|
|
68
69
|
}
|
|
69
|
-
},
|
|
70
|
+
}, Sury.string, PluginSpec$ReventlessCore.eventSchema);
|
|
70
71
|
let eventName = Message$ReventlessCore.eventNameOfEvent$pJson(eventJson$p);
|
|
71
72
|
globalThis.expect(eventName).toBe("VersionDetected");
|
|
72
73
|
});
|
|
@@ -85,7 +86,7 @@ globalThis.describe("Message should", () => {
|
|
|
85
86
|
TAG: "VersionDetected",
|
|
86
87
|
_0: "0.0.0"
|
|
87
88
|
}
|
|
88
|
-
},
|
|
89
|
+
}, Sury.string, PluginSpec$ReventlessCore.eventSchema);
|
|
89
90
|
let eventId = Stdlib_Option.getOrThrow(Message$ReventlessCore.idOfEvent$pJson(eventJson$p), undefined);
|
|
90
91
|
globalThis.expect(eventId).toBe("testId");
|
|
91
92
|
});
|
|
@@ -146,7 +147,7 @@ globalThis.describe("Message should", () => {
|
|
|
146
147
|
meta: event$p_meta,
|
|
147
148
|
event: event$p_event
|
|
148
149
|
};
|
|
149
|
-
let json = Message$ReventlessCore.encodeEvent$p(event$p,
|
|
150
|
+
let json = Message$ReventlessCore.encodeEvent$p(event$p, Sury.string, PluginSpec$ReventlessCore.eventSchema);
|
|
150
151
|
let oldJson = (function(j){
|
|
151
152
|
var c = JSON.parse(JSON.stringify(j));
|
|
152
153
|
var d = c.event._0;
|
|
@@ -159,13 +160,13 @@ globalThis.describe("Message should", () => {
|
|
|
159
160
|
})(json);
|
|
160
161
|
let strictThrew;
|
|
161
162
|
try {
|
|
162
|
-
|
|
163
|
+
Util_Sury$Reventless.fromJson(oldJson, Message$ReventlessCore.toEventSchema$p(Sury.string, PluginSpec$ReventlessCore.eventSchema));
|
|
163
164
|
strictThrew = false;
|
|
164
165
|
} catch (exn) {
|
|
165
166
|
strictThrew = true;
|
|
166
167
|
}
|
|
167
168
|
globalThis.expect(strictThrew).toBe(true);
|
|
168
|
-
let decoded = Message$ReventlessCore.decodeEvent$p(oldJson,
|
|
169
|
+
let decoded = Message$ReventlessCore.decodeEvent$p(oldJson, Sury.string, PluginSpec$ReventlessCore.eventSchema);
|
|
169
170
|
let d = decoded.event;
|
|
170
171
|
if (d.TAG === "VersionConnected") {
|
|
171
172
|
let d$1 = d._0;
|
|
@@ -204,7 +205,7 @@ globalThis.describe("Message should", () => {
|
|
|
204
205
|
let staleJson = (function(j){ var c = JSON.parse(JSON.stringify(j)); delete c._0.kind; return c; })(variantJson);
|
|
205
206
|
let strictThrew;
|
|
206
207
|
try {
|
|
207
|
-
|
|
208
|
+
Util_Sury$Reventless.fromJson(staleJson, PluginSpec$ReventlessCore.eventSchema);
|
|
208
209
|
strictThrew = false;
|
|
209
210
|
} catch (exn) {
|
|
210
211
|
strictThrew = true;
|
|
@@ -15,7 +15,7 @@ open Message
|
|
|
15
15
|
describe("Message.meta optional fields:", () => {
|
|
16
16
|
testSync("generateMeta() with no ~ip/~user omits those keys from JSON", () => {
|
|
17
17
|
let meta = generateMeta(~service="svc")
|
|
18
|
-
let json = meta->
|
|
18
|
+
let json = meta->Reventless.Util_Sury.toJson(metaSchema)
|
|
19
19
|
let obj = json->JSON.Decode.object->Option.getOrThrow
|
|
20
20
|
expect(obj->Dict.get("ip"))->toEqual(None)->ignore
|
|
21
21
|
expect(obj->Dict.get("user"))->toEqual(None)->ignore
|
|
@@ -37,8 +37,8 @@ describe("Message.meta optional fields:", () => {
|
|
|
37
37
|
|
|
38
38
|
testSync("generateMeta(~user=alice) round-trips Some(alice)", () => {
|
|
39
39
|
let meta = generateMeta(~service="svc", ~user="alice")
|
|
40
|
-
let json = meta->
|
|
41
|
-
let decoded = json->
|
|
40
|
+
let json = meta->Reventless.Util_Sury.toJson(metaSchema)
|
|
41
|
+
let decoded = json->Reventless.Util_Sury.fromJson(metaSchema)
|
|
42
42
|
expect(decoded.user)->toEqual(Some("alice"))
|
|
43
43
|
})
|
|
44
44
|
|
|
@@ -54,8 +54,8 @@ describe("Message.meta optional fields:", () => {
|
|
|
54
54
|
~schemaVersion="1.2.0",
|
|
55
55
|
~headers,
|
|
56
56
|
)
|
|
57
|
-
let json = meta->
|
|
58
|
-
let decoded = json->
|
|
57
|
+
let json = meta->Reventless.Util_Sury.toJson(metaSchema)
|
|
58
|
+
let decoded = json->Reventless.Util_Sury.fromJson(metaSchema)
|
|
59
59
|
expect(decoded.ip)->toEqual(Some("10.0.0.1"))->ignore
|
|
60
60
|
expect(decoded.user)->toEqual(Some("bob"))->ignore
|
|
61
61
|
expect(decoded.causationId)->toEqual(Some("parent-msg-id"))->ignore
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
|
|
5
5
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
6
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
6
7
|
import * as Message$ReventlessCore from "../../src/Message.res.mjs";
|
|
7
8
|
|
|
8
9
|
globalThis.describe("Message.meta optional fields:", () => {
|
|
9
10
|
globalThis.test("generateMeta() with no ~ip/~user omits those keys from JSON", () => {
|
|
10
11
|
let meta = Message$ReventlessCore.generateMeta("svc", undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
11
|
-
let json =
|
|
12
|
+
let json = Util_Sury$Reventless.toJson(meta, Message$ReventlessCore.metaSchema);
|
|
12
13
|
let obj = Stdlib_Option.getOrThrow(Stdlib_JSON.Decode.object(json), undefined);
|
|
13
14
|
globalThis.expect(obj["ip"]).toEqual(undefined);
|
|
14
15
|
globalThis.expect(obj["user"]).toEqual(undefined);
|
|
@@ -27,8 +28,8 @@ globalThis.describe("Message.meta optional fields:", () => {
|
|
|
27
28
|
});
|
|
28
29
|
globalThis.test("generateMeta(~user=alice) round-trips Some(alice)", () => {
|
|
29
30
|
let meta = Message$ReventlessCore.generateMeta("svc", undefined, "alice", undefined, undefined, undefined, undefined, undefined);
|
|
30
|
-
let json =
|
|
31
|
-
let decoded =
|
|
31
|
+
let json = Util_Sury$Reventless.toJson(meta, Message$ReventlessCore.metaSchema);
|
|
32
|
+
let decoded = Util_Sury$Reventless.fromJson(json, Message$ReventlessCore.metaSchema);
|
|
32
33
|
globalThis.expect(decoded.user).toEqual("alice");
|
|
33
34
|
});
|
|
34
35
|
globalThis.test("all new optional fields round-trip when set", () => {
|
|
@@ -43,8 +44,8 @@ globalThis.describe("Message.meta optional fields:", () => {
|
|
|
43
44
|
]
|
|
44
45
|
]);
|
|
45
46
|
let meta = Message$ReventlessCore.generateMeta("svc", "10.0.0.1", "bob", "parent-msg-id", "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01", "root-msg-id", "1.2.0", headers);
|
|
46
|
-
let json =
|
|
47
|
-
let decoded =
|
|
47
|
+
let json = Util_Sury$Reventless.toJson(meta, Message$ReventlessCore.metaSchema);
|
|
48
|
+
let decoded = Util_Sury$Reventless.fromJson(json, Message$ReventlessCore.metaSchema);
|
|
48
49
|
globalThis.expect(decoded.ip).toEqual("10.0.0.1");
|
|
49
50
|
globalThis.expect(decoded.user).toEqual("bob");
|
|
50
51
|
globalThis.expect(decoded.causationId).toEqual("parent-msg-id");
|
|
@@ -116,8 +117,8 @@ globalThis.describe("StoredEvent encode/decode round-trip:", () => {
|
|
|
116
117
|
meta: meta,
|
|
117
118
|
recordedAt: "2026-05-13T10:00:00.000Z"
|
|
118
119
|
};
|
|
119
|
-
let flat = Message$ReventlessCore.storedEventToFlatJson(stored,
|
|
120
|
-
let roundTrip = Message$ReventlessCore.flatJsonToStoredEvent(flat,
|
|
120
|
+
let flat = Message$ReventlessCore.storedEventToFlatJson(stored, Sury.string);
|
|
121
|
+
let roundTrip = Message$ReventlessCore.flatJsonToStoredEvent(flat, Sury.string);
|
|
121
122
|
globalThis.expect(roundTrip.id).toBe("agg-1");
|
|
122
123
|
globalThis.expect(roundTrip.position).toBe("000000001");
|
|
123
124
|
globalThis.expect(roundTrip.event).toBe("ItemCreated");
|
|
@@ -151,8 +152,8 @@ globalThis.describe("StoredEvent encode/decode round-trip:", () => {
|
|
|
151
152
|
recordedAt: "2026-05-13T10:00:00.000Z",
|
|
152
153
|
tags: stored_tags
|
|
153
154
|
};
|
|
154
|
-
let flat = Message$ReventlessCore.storedEventToFlatJson(stored,
|
|
155
|
-
let roundTrip = Message$ReventlessCore.flatJsonToStoredEvent(flat,
|
|
155
|
+
let flat = Message$ReventlessCore.storedEventToFlatJson(stored, Sury.string);
|
|
156
|
+
let roundTrip = Message$ReventlessCore.flatJsonToStoredEvent(flat, Sury.string);
|
|
156
157
|
globalThis.expect(roundTrip.id).toBe("productId:p-1");
|
|
157
158
|
globalThis.expect(roundTrip.position).toBe("1736782800000-abc-uuid");
|
|
158
159
|
globalThis.expect(roundTrip.event).toBe("ProductAdded");
|
|
@@ -174,7 +175,7 @@ globalThis.describe("StoredEvent encode/decode round-trip:", () => {
|
|
|
174
175
|
meta: meta,
|
|
175
176
|
recordedAt: "2026-05-13T10:00:00.000Z"
|
|
176
177
|
};
|
|
177
|
-
let flat = Message$ReventlessCore.storedEventToFlatJson(stored,
|
|
178
|
+
let flat = Message$ReventlessCore.storedEventToFlatJson(stored, Sury.string);
|
|
178
179
|
let obj = Stdlib_Option.getOrThrow(Stdlib_JSON.Decode.object(flat), undefined);
|
|
179
180
|
globalThis.expect(obj["meta"]).toEqual(undefined);
|
|
180
181
|
globalThis.expect(obj["service"]).toEqual("catalog");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
5
5
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
6
6
|
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
@@ -11,9 +11,9 @@ let name = "PublicView";
|
|
|
11
11
|
|
|
12
12
|
let moduleUrl = "";
|
|
13
13
|
|
|
14
|
-
let stateSchema =
|
|
15
|
-
id: s.m(
|
|
16
|
-
name: s.m(
|
|
14
|
+
let stateSchema = Sury.$schema(s => ({
|
|
15
|
+
id: s.m(Sury.string),
|
|
16
|
+
name: s.m(Sury.string)
|
|
17
17
|
}));
|
|
18
18
|
|
|
19
19
|
let config = ReadModel$Reventless.config(undefined, undefined, undefined);
|
|
@@ -33,9 +33,9 @@ let name$1 = "InternalView";
|
|
|
33
33
|
|
|
34
34
|
let moduleUrl$1 = "";
|
|
35
35
|
|
|
36
|
-
let stateSchema$1 =
|
|
37
|
-
id: s.m(
|
|
38
|
-
name: s.m(
|
|
36
|
+
let stateSchema$1 = Sury.$schema(s => ({
|
|
37
|
+
id: s.m(Sury.string),
|
|
38
|
+
name: s.m(Sury.string)
|
|
39
39
|
}));
|
|
40
40
|
|
|
41
41
|
let config$1 = ReadModel$Reventless.config(undefined, undefined, undefined);
|
|
@@ -41,14 +41,16 @@ let collect = (root: S.t<'a>): array<string> => {
|
|
|
41
41
|
|
|
42
42
|
let rec walk = (schema: S.t<unknown>, path: string) =>
|
|
43
43
|
switch schema {
|
|
44
|
-
| Object({
|
|
44
|
+
| Object({properties}) =>
|
|
45
45
|
if !(seen->Set.has(schema)) {
|
|
46
46
|
seen->Set.add(schema)
|
|
47
|
-
|
|
47
|
+
properties
|
|
48
|
+
->Dict.toArray
|
|
49
|
+
->Array.forEach(((name, fieldSchema)) => walk(fieldSchema, `${path}.${name}`))
|
|
48
50
|
seen->Set.delete(schema)->ignore
|
|
49
51
|
}
|
|
50
52
|
| Array({additionalItems: Schema(element)}) => walk(element, `${path}[]`)
|
|
51
|
-
|
|
|
53
|
+
| AnyOf({anyOf, has}) =>
|
|
52
54
|
// A union of literals is an enum: absent heals to the first variant.
|
|
53
55
|
let isEnum = anyOf->Array.every(member =>
|
|
54
56
|
switch member {
|
|
@@ -59,13 +59,13 @@ function collect(root) {
|
|
|
59
59
|
case "object" :
|
|
60
60
|
if (!seen.has(schema)) {
|
|
61
61
|
seen.add(schema);
|
|
62
|
-
schema.
|
|
62
|
+
Object.entries(schema.properties).forEach(param => walk(param[1], path + `.` + param[0]));
|
|
63
63
|
seen.delete(schema);
|
|
64
64
|
return;
|
|
65
65
|
} else {
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
|
-
case "
|
|
68
|
+
case "anyOf" :
|
|
69
69
|
let anyOf = schema.anyOf;
|
|
70
70
|
let isEnum = anyOf.every(member => {
|
|
71
71
|
switch (member.type) {
|
|
@@ -36,12 +36,13 @@ describe("The stored plugin-lifecycle payload corpus", () => {
|
|
|
36
36
|
|
|
37
37
|
entries->Array.forEach(entry =>
|
|
38
38
|
testSync(`still decodes: ${entry.name}`, () => {
|
|
39
|
-
// Sury's own
|
|
39
|
+
// Sury's own error carries the field path, which is the whole value of
|
|
40
40
|
// this suite's failure message — report it verbatim rather than "it threw".
|
|
41
|
+
// sury 11 throws a plain JS `SuryError` with no ReScript exception
|
|
42
|
+
// constructor to match on, so the message comes off the JS exception.
|
|
41
43
|
let outcome = switch decodeStored(entry) {
|
|
42
44
|
| _ => "decodes"
|
|
43
|
-
| exception
|
|
44
|
-
| exception JsExn(e) => `threw: ${JsExn.message(e)->Option.getOr("no message")}`
|
|
45
|
+
| exception JsExn(e) => JsExn.message(e)->Option.getOr("threw: no message")
|
|
45
46
|
| exception _ => "threw a non-JS exception"
|
|
46
47
|
}
|
|
47
48
|
expect(outcome)->toBe("decodes")
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as S from "sury/src/S.res.mjs";
|
|
4
3
|
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
5
4
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
6
5
|
import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
|
|
@@ -22,11 +21,9 @@ globalThis.describe("The stored plugin-lifecycle payload corpus", () => {
|
|
|
22
21
|
try {
|
|
23
22
|
decodeStored(entry);
|
|
24
23
|
outcome = "decodes";
|
|
25
|
-
} catch (
|
|
26
|
-
let
|
|
27
|
-
outcome =
|
|
28
|
-
err.RE_EXN_ID === "JsExn" ? `threw: ` + Stdlib_Option.getOr(Stdlib_JsExn.message(err._1), "no message") : "threw a non-JS exception"
|
|
29
|
-
);
|
|
24
|
+
} catch (raw_e) {
|
|
25
|
+
let e = Primitive_exceptions.internalToException(raw_e);
|
|
26
|
+
outcome = e.RE_EXN_ID === "JsExn" ? Stdlib_Option.getOr(Stdlib_JsExn.message(e._1), "threw: no message") : "threw a non-JS exception";
|
|
30
27
|
}
|
|
31
28
|
globalThis.expect(outcome).toBe("decodes");
|
|
32
29
|
});
|