@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,32 +1,30 @@
|
|
|
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 DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
6
6
|
import * as CommandGenerator_Callback$ReventlessCore from "../../src/components/CommandGenerator/CommandGenerator_Callback.res.mjs";
|
|
7
7
|
|
|
8
|
-
S.enableJson();
|
|
9
|
-
|
|
10
8
|
let name = "TestCmdGenAgg";
|
|
11
9
|
|
|
12
|
-
let commandSchema =
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
let commandSchema = Sury.union([
|
|
11
|
+
Sury.literal("Create"),
|
|
12
|
+
Sury.$schema(s => ({
|
|
15
13
|
TAG: "CreateWithName",
|
|
16
|
-
name: s.m(
|
|
14
|
+
name: s.m(Sury.string)
|
|
17
15
|
})),
|
|
18
|
-
|
|
16
|
+
Sury.literal("Invalid")
|
|
19
17
|
]);
|
|
20
18
|
|
|
21
|
-
let eventSchema =
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
let eventSchema = Sury.union([
|
|
20
|
+
Sury.literal("Created"),
|
|
21
|
+
Sury.$schema(s => ({
|
|
24
22
|
TAG: "CreatedWithName",
|
|
25
|
-
name: s.m(
|
|
23
|
+
name: s.m(Sury.string)
|
|
26
24
|
}))
|
|
27
25
|
]);
|
|
28
26
|
|
|
29
|
-
let errorSchema =
|
|
27
|
+
let errorSchema = Sury.literal("InvalidCommand");
|
|
30
28
|
|
|
31
29
|
let moduleUrl = import.meta.url;
|
|
32
30
|
|
|
@@ -111,24 +109,24 @@ let TestGenerator = CommandGenerator_Callback$ReventlessCore.Make(MockPublishSpe
|
|
|
111
109
|
commandAuthorization: commandAuthorization
|
|
112
110
|
});
|
|
113
111
|
|
|
114
|
-
let singleTagCommandSchema =
|
|
112
|
+
let singleTagCommandSchema = Sury.$schema(s => ({
|
|
115
113
|
TAG: "CreateItem",
|
|
116
114
|
itemId: s.m(DcbTag$Reventless.string),
|
|
117
|
-
name: s.m(
|
|
115
|
+
name: s.m(Sury.string)
|
|
118
116
|
}));
|
|
119
117
|
|
|
120
|
-
let compositeTagCommandSchema =
|
|
118
|
+
let compositeTagCommandSchema = Sury.$schema(s => ({
|
|
121
119
|
TAG: "DeployVersion",
|
|
122
120
|
environment: s.m(DcbTag$Reventless.compositePartitionMember(0, "-")),
|
|
123
121
|
service: s.m(DcbTag$Reventless.compositePartitionMember(1, undefined)),
|
|
124
|
-
version: s.m(
|
|
122
|
+
version: s.m(Sury.string)
|
|
125
123
|
}));
|
|
126
124
|
|
|
127
|
-
let optionalFieldCommandSchema =
|
|
125
|
+
let optionalFieldCommandSchema = Sury.$schema(s => ({
|
|
128
126
|
TAG: "StoreItem",
|
|
129
127
|
itemId: s.m(DcbTag$Reventless.string),
|
|
130
|
-
data: s.m(
|
|
131
|
-
note: s.m(
|
|
128
|
+
data: s.m(Sury.json),
|
|
129
|
+
note: s.m(Sury.$option(Sury.string))
|
|
132
130
|
}));
|
|
133
131
|
|
|
134
132
|
let optionalFieldSliceGen = CommandGenerator_Callback$ReventlessCore.makeGenerateCommand(publishJsons, undefined, "OptionalFieldSlice", optionalFieldCommandSchema, "StateChangeSlice", false);
|
|
@@ -205,4 +203,4 @@ export {
|
|
|
205
203
|
makeOneParamPayload,
|
|
206
204
|
reset,
|
|
207
205
|
}
|
|
208
|
-
/*
|
|
206
|
+
/* commandSchema Not a pure module */
|
|
@@ -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_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
|
|
5
5
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
6
6
|
import * as Effect from "effect/Effect";
|
|
@@ -12,19 +12,17 @@ import * as OwnerScope$Reventless from "@reventlessdev/reventless-spec/src/types
|
|
|
12
12
|
import * as Plugin_ResolverError$ReventlessCore from "../../src/plugin/component/Plugin_ResolverError.res.mjs";
|
|
13
13
|
import * as CommandGenerator_Callback$ReventlessCore from "../../src/components/CommandGenerator/CommandGenerator_Callback.res.mjs";
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let commandSchema = S.union([
|
|
18
|
-
S.schema(s => ({
|
|
15
|
+
let commandSchema = Sury.union([
|
|
16
|
+
Sury.$schema(s => ({
|
|
19
17
|
TAG: "PlaceOrder",
|
|
20
18
|
orderId: s.m(DcbTag$Reventless.string),
|
|
21
19
|
customerId: s.m(Owner$Reventless.string),
|
|
22
|
-
note: s.m(
|
|
20
|
+
note: s.m(Sury.string)
|
|
23
21
|
})),
|
|
24
|
-
|
|
22
|
+
Sury.$schema(s => ({
|
|
25
23
|
TAG: "ImportProducts",
|
|
26
24
|
batchId: s.m(DcbTag$Reventless.string),
|
|
27
|
-
source: s.m(
|
|
25
|
+
source: s.m(Sury.string)
|
|
28
26
|
}))
|
|
29
27
|
]);
|
|
30
28
|
|
|
@@ -195,7 +193,7 @@ globalThis.describe("@owner stamping on the command path:", () => {
|
|
|
195
193
|
globalThis.describe("the schema a generator is built with must answer for its commands:", () => {
|
|
196
194
|
let permissive = CommandGenerator_Callback$ReventlessCore.makeGenerateCommand(async cmds => {
|
|
197
195
|
published.contents = published.contents.concat(cmds);
|
|
198
|
-
}, undefined, "Ordering",
|
|
196
|
+
}, undefined, "Ordering", Sury.json, "StateChangeSlice", false);
|
|
199
197
|
globalThis.test("a permissive schema silently stamps nothing — the defect, pinned", async () => {
|
|
200
198
|
await Effect.runPromise(permissive(placeOrder("cust-B", cognito("cust-A", ["User"]))));
|
|
201
199
|
globalThis.expect(fieldOf(published.contents[published.contents.length - 1 | 0], "customerId")).toEqual("cust-B");
|
|
@@ -207,7 +205,7 @@ globalThis.describe("the schema a generator is built with must answer for its co
|
|
|
207
205
|
globalThis.test("every command of a spec resolves its owner fields through that spec's schema", async () => {
|
|
208
206
|
globalThis.expect(Owner$Reventless.variantFieldNames(commandSchema, "PlaceOrder")).toEqual(["customerId"]);
|
|
209
207
|
globalThis.expect(Owner$Reventless.variantFieldNames(commandSchema, "ImportProducts")).toEqual([]);
|
|
210
|
-
globalThis.expect(Owner$Reventless.variantFieldNames(
|
|
208
|
+
globalThis.expect(Owner$Reventless.variantFieldNames(Sury.json, "PlaceOrder")).toEqual([]);
|
|
211
209
|
});
|
|
212
210
|
});
|
|
213
211
|
|
|
@@ -223,4 +221,4 @@ export {
|
|
|
223
221
|
fieldOf,
|
|
224
222
|
lastPublished,
|
|
225
223
|
}
|
|
226
|
-
/*
|
|
224
|
+
/* commandSchema Not a pure module */
|
|
@@ -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 Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
|
|
5
5
|
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
6
6
|
import * as Effect from "effect/Effect";
|
|
@@ -8,18 +8,16 @@ import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
|
8
8
|
import * as Message$ReventlessCore from "../../src/Message.res.mjs";
|
|
9
9
|
import * as CommandTopic_Callback$ReventlessCore from "../../src/components/CommandTopic/CommandTopic_Callback.res.mjs";
|
|
10
10
|
|
|
11
|
-
S.enableJson();
|
|
12
|
-
|
|
13
11
|
let name = "TestCommandTopic";
|
|
14
12
|
|
|
15
|
-
let commandSchema =
|
|
16
|
-
|
|
13
|
+
let commandSchema = Sury.union([
|
|
14
|
+
Sury.$schema(s => ({
|
|
17
15
|
TAG: "CreateItem",
|
|
18
|
-
itemId: s.m(
|
|
16
|
+
itemId: s.m(Sury.string)
|
|
19
17
|
})),
|
|
20
|
-
|
|
18
|
+
Sury.$schema(s => ({
|
|
21
19
|
TAG: "DeleteItem",
|
|
22
|
-
itemId: s.m(
|
|
20
|
+
itemId: s.m(Sury.string)
|
|
23
21
|
}))
|
|
24
22
|
]);
|
|
25
23
|
|
|
@@ -149,4 +147,4 @@ export {
|
|
|
149
147
|
makeTopicItem,
|
|
150
148
|
reset,
|
|
151
149
|
}
|
|
152
|
-
/*
|
|
150
|
+
/* commandSchema Not a pure module */
|
|
@@ -1,13 +1,10 @@
|
|
|
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 Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
|
|
5
4
|
import * as Effect from "effect/Effect";
|
|
6
5
|
import * as Message$ReventlessCore from "../../src/Message.res.mjs";
|
|
7
6
|
import * as Counter_Callback$ReventlessCore from "../../src/components/Counter/Counter_Callback.res.mjs";
|
|
8
7
|
|
|
9
|
-
S.enableJson();
|
|
10
|
-
|
|
11
8
|
let capturedCountCalls = {
|
|
12
9
|
contents: []
|
|
13
10
|
};
|
|
@@ -64,4 +61,4 @@ export {
|
|
|
64
61
|
makeCountsJson,
|
|
65
62
|
reset,
|
|
66
63
|
}
|
|
67
|
-
/*
|
|
64
|
+
/* TestCounterHandler Not a pure module */
|
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
|
|
5
5
|
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
6
6
|
import * as DcbDecode$Reventless from "@reventlessdev/reventless-spec/src/components/DcbDecode.res.mjs";
|
|
7
7
|
|
|
8
|
-
let eventSchema =
|
|
9
|
-
|
|
8
|
+
let eventSchema = Sury.union([
|
|
9
|
+
Sury.$schema(s => ({
|
|
10
10
|
TAG: "ItemCreated",
|
|
11
11
|
itemId: s.m(DcbTag$Reventless.string),
|
|
12
|
-
name: s.m(
|
|
12
|
+
name: s.m(Sury.string)
|
|
13
13
|
})),
|
|
14
|
-
|
|
14
|
+
Sury.$schema(s => ({
|
|
15
15
|
TAG: "ItemRenamed",
|
|
16
16
|
itemId: s.m(DcbTag$Reventless.string),
|
|
17
|
-
newName: s.m(
|
|
17
|
+
newName: s.m(Sury.string)
|
|
18
18
|
})),
|
|
19
|
-
|
|
19
|
+
Sury.$schema(s => ({
|
|
20
20
|
TAG: "ItemArchived",
|
|
21
21
|
itemId: s.m(DcbTag$Reventless.string)
|
|
22
22
|
}))
|
|
23
23
|
]);
|
|
24
24
|
|
|
25
|
-
let consumedPayloadLessSchema =
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
let consumedPayloadLessSchema = Sury.union([
|
|
26
|
+
Sury.literal("ItemCreated"),
|
|
27
|
+
Sury.literal("ItemArchived")
|
|
28
28
|
]);
|
|
29
29
|
|
|
30
|
-
let consumedPartialSchema =
|
|
31
|
-
|
|
30
|
+
let consumedPartialSchema = Sury.union([
|
|
31
|
+
Sury.$schema(s => ({
|
|
32
32
|
TAG: "ItemCreated",
|
|
33
|
-
itemId: s.m(
|
|
33
|
+
itemId: s.m(Sury.string)
|
|
34
34
|
})),
|
|
35
|
-
|
|
35
|
+
Sury.$schema(s => ({
|
|
36
36
|
TAG: "ItemRenamed",
|
|
37
|
-
itemId: s.m(
|
|
37
|
+
itemId: s.m(Sury.string)
|
|
38
38
|
}))
|
|
39
39
|
]);
|
|
40
40
|
|
|
41
|
-
let consumedFullSchema =
|
|
42
|
-
|
|
41
|
+
let consumedFullSchema = Sury.union([
|
|
42
|
+
Sury.$schema(s => ({
|
|
43
43
|
TAG: "ItemCreated",
|
|
44
|
-
itemId: s.m(
|
|
45
|
-
name: s.m(
|
|
44
|
+
itemId: s.m(Sury.string),
|
|
45
|
+
name: s.m(Sury.string)
|
|
46
46
|
})),
|
|
47
|
-
|
|
47
|
+
Sury.$schema(s => ({
|
|
48
48
|
TAG: "ItemRenamed",
|
|
49
|
-
itemId: s.m(
|
|
50
|
-
newName: s.m(
|
|
49
|
+
itemId: s.m(Sury.string),
|
|
50
|
+
newName: s.m(Sury.string)
|
|
51
51
|
})),
|
|
52
|
-
|
|
52
|
+
Sury.$schema(s => ({
|
|
53
53
|
TAG: "ItemArchived",
|
|
54
|
-
itemId: s.m(
|
|
54
|
+
itemId: s.m(Sury.string)
|
|
55
55
|
}))
|
|
56
56
|
]);
|
|
57
57
|
|
|
@@ -26,7 +26,7 @@ let _ = beforeEach(() => mock.reset())
|
|
|
26
26
|
|
|
27
27
|
// Helper to encode a TestEventLogSpec event to a rawEvent for testing
|
|
28
28
|
let encodeEvent = (event: DcbFixtures.TestEventLogSpec.event): ReventlessInfra.DcbEventLog.rawEvent => {
|
|
29
|
-
let json = event->
|
|
29
|
+
let json = event->Reventless.Util_Sury.toJson(DcbFixtures.TestEventLogSpec.eventSchema)
|
|
30
30
|
let (eventType, data) = json->Message.splitMessage
|
|
31
31
|
let tags = Reventless.DcbTag.extractTags(DcbFixtures.TestEventLogSpec.eventSchema, event)
|
|
32
32
|
let meta = Message.generateMeta(~service="test")
|
|
@@ -39,7 +39,7 @@ let decodeEvent = (raw: ReventlessInfra.DcbEventLog.rawSequencedEvent): DcbFixtu
|
|
|
39
39
|
raw.eventType,
|
|
40
40
|
raw.data->JSON.Decode.object->Option.getOr(Dict.make()),
|
|
41
41
|
)
|
|
42
|
-
json->
|
|
42
|
+
json->Reventless.Util_Sury.fromJson(DcbFixtures.TestEventLogSpec.eventSchema)
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
describe("DcbEventLog_Operations:", () => {
|
|
@@ -1,10 +1,10 @@
|
|
|
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_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
|
|
5
4
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
6
5
|
import * as Stdlib_Result from "@rescript/runtime/lib/es6/Stdlib_Result.js";
|
|
7
6
|
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
7
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
8
8
|
import * as Message$ReventlessCore from "../../src/Message.res.mjs";
|
|
9
9
|
import * as DcbFixtures$ReventlessCore from "./DcbFixtures.res.mjs";
|
|
10
10
|
import * as DcbEventLog_Operations$ReventlessCore from "../../src/components/DcbEventLog/DcbEventLog_Operations.res.mjs";
|
|
@@ -40,7 +40,7 @@ let OpsAlt = DcbEventLog_Operations$ReventlessCore.Make(TestOpsAlt);
|
|
|
40
40
|
globalThis.beforeEach(() => mock.reset());
|
|
41
41
|
|
|
42
42
|
function encodeEvent(event) {
|
|
43
|
-
let json =
|
|
43
|
+
let json = Util_Sury$Reventless.toJson(event, DcbFixtures$ReventlessCore.TestEventLogSpec.eventSchema);
|
|
44
44
|
let match = Message$ReventlessCore.splitMessage(json);
|
|
45
45
|
let tags = DcbTag$Reventless.extractTags(DcbFixtures$ReventlessCore.TestEventLogSpec.eventSchema, event);
|
|
46
46
|
let meta = Message$ReventlessCore.generateMeta("test", undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
@@ -54,7 +54,7 @@ function encodeEvent(event) {
|
|
|
54
54
|
|
|
55
55
|
function decodeEvent(raw) {
|
|
56
56
|
let json = Message$ReventlessCore.combineMessage(raw.eventType, Stdlib_Option.getOr(Stdlib_JSON.Decode.object(raw.data), {}));
|
|
57
|
-
return
|
|
57
|
+
return Util_Sury$Reventless.fromJson(json, DcbFixtures$ReventlessCore.TestEventLogSpec.eventSchema);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
globalThis.describe("DcbEventLog_Operations:", () => {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
5
5
|
import * as StorageRef$Reventless from "@reventlessdev/reventless-spec/src/semantic/StorageRef.res.mjs";
|
|
6
6
|
import * as Dcb_Builder$ReventlessCore from "../../src/components/Dcb/Dcb_Builder.res.mjs";
|
|
7
7
|
import * as StorageRefFields$ReventlessCore from "../../src/components/Api/StorageRefFields.res.mjs";
|
|
8
8
|
|
|
9
9
|
function variant(tag, fields) {
|
|
10
|
-
return
|
|
11
|
-
s.f("TAG",
|
|
10
|
+
return Sury.object(s => {
|
|
11
|
+
s.f("TAG", Sury.literal(tag));
|
|
12
12
|
fields.forEach(param => {
|
|
13
13
|
s.f(param[0], param[1]);
|
|
14
14
|
});
|
|
@@ -19,19 +19,19 @@ function ref_(store) {
|
|
|
19
19
|
return StorageRef$Reventless.forStore(undefined, store);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
let addCategory =
|
|
22
|
+
let addCategory = Sury.union([variant("CategoryAdded", [[
|
|
23
23
|
"imageUrl",
|
|
24
24
|
StorageRef$Reventless.forStore(undefined, "categoryImages")
|
|
25
25
|
]])]);
|
|
26
26
|
|
|
27
|
-
let addProduct =
|
|
27
|
+
let addProduct = Sury.union([variant("ProductAdded", [[
|
|
28
28
|
"imageUrl",
|
|
29
29
|
StorageRef$Reventless.forStore(undefined, "productImages")
|
|
30
30
|
]])]);
|
|
31
31
|
|
|
32
|
-
let renameCategory =
|
|
32
|
+
let renameCategory = Sury.union([variant("CategoryRenamed", [[
|
|
33
33
|
"name",
|
|
34
|
-
|
|
34
|
+
Sury.string
|
|
35
35
|
]])]);
|
|
36
36
|
|
|
37
37
|
globalThis.describe("Dcb_Builder.mergedEventSchema", () => {
|