@reventlessdev/reventless-local 3.0.0-alpha.227 → 3.0.0-alpha.229

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/package.json +10 -10
  3. package/src/LocalPlatformRegistry.res +2 -2
  4. package/src/LocalPlatformRegistry.res.mjs +14 -13
  5. package/src/Platform.res +10 -10
  6. package/src/Platform.res.mjs +17 -16
  7. package/src/adapter/Auth/LocalAuth.res +3 -3
  8. package/src/adapter/Auth/LocalAuth.res.mjs +3 -2
  9. package/src/adapter/Auth/UserStore.res +1 -1
  10. package/src/adapter/Auth/UserStore.res.mjs +7 -6
  11. package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res +1 -1
  12. package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res.mjs +1 -1
  13. package/src/adapter/CommandTopic/LocalCommandTopicRemoteChannel.res +1 -1
  14. package/src/adapter/CommandTopic/LocalCommandTopicRemoteChannel.res.mjs +3 -3
  15. package/src/adapter/DcbEventLog/DcbEventLogStorage_Sqlite.res +2 -2
  16. package/src/adapter/DcbEventLog/DcbEventLogStorage_Sqlite.res.mjs +4 -4
  17. package/src/adapter/DomainGraphQL_Server.res +2 -2
  18. package/src/adapter/DomainGraphQL_Server.res.mjs +3 -3
  19. package/src/adapter/DomainMCP_Server.res +1 -1
  20. package/src/adapter/MCP_ServerInstance.res +1 -1
  21. package/tests/BakedManifestFilesTest.res +0 -1
  22. package/tests/PluginEventDecodeTest.res +3 -3
  23. package/tests/PluginEventDecodeTest.res.mjs +4 -4
  24. package/tests/ShellConfigTest.res +0 -1
  25. package/tests/adapter/CommandAuthorizationTest.res.mjs +7 -7
  26. package/tests/adapter/GraphQL_SchemaInspectorTest.res.mjs +59 -59
  27. package/tests/adapter/LocalAuthHttpTest.res +1 -1
  28. package/tests/adapter/LocalAuthHttpTest.res.mjs +2 -2
  29. package/tests/adapter/QueryDbListResolverTest.res.mjs +5 -5
  30. package/tests/components/aggregate/AggregateFixtures.res.mjs +6 -6
  31. package/tests/components/automationslice/AutomationSliceFixtures.res +4 -4
  32. package/tests/components/automationslice/AutomationSliceFixtures.res.mjs +20 -19
  33. package/tests/components/automationslice/AutomationSliceSelfDeadlockFixtures.res +2 -2
  34. package/tests/components/automationslice/AutomationSliceSelfDeadlockFixtures.res.mjs +23 -22
  35. package/tests/components/automationslice/MixedSourceAutomationSliceFixtures.res +4 -4
  36. package/tests/components/automationslice/MixedSourceAutomationSliceFixtures.res.mjs +21 -20
  37. package/tests/components/commandgenerator/CommandGeneratorFixtures.res +0 -1
  38. package/tests/components/commandgenerator/CommandGeneratorFixtures.res.mjs +6 -8
  39. package/tests/components/commandgenerator/CommandGeneratorTest.res +1 -1
  40. package/tests/components/commandgenerator/CommandGeneratorTest.res.mjs +2 -2
  41. package/tests/components/commandtopic/CommandTopicFixtures.res.mjs +9 -9
  42. package/tests/components/commandtopic/CommandTopicStreamFixtures.res.mjs +9 -9
  43. package/tests/components/dcb/DcbCrossPartitionFixtures.res +3 -3
  44. package/tests/components/dcb/DcbCrossPartitionFixtures.res.mjs +22 -21
  45. package/tests/components/dcb/DcbEventLogAppendStreamTest.res +1 -1
  46. package/tests/components/dcb/DcbEventLogAppendStreamTest.res.mjs +2 -2
  47. package/tests/components/dcb/DcbFixtures.res +2 -2
  48. package/tests/components/dcb/DcbFixtures.res.mjs +12 -11
  49. package/tests/components/eventlog/EventLogFixtures.res.mjs +6 -6
  50. package/tests/components/eventlog/EventLogProvisioningSeamTest.res.mjs +3 -3
  51. package/tests/components/eventtopic/EventTopicFixtures.res.mjs +6 -6
  52. package/tests/components/eventtopic/EventTopicStreamFixtures.res.mjs +6 -6
  53. package/tests/components/extensionpoint/ExtensionPointFixtures.res +0 -1
  54. package/tests/components/extensionpoint/ExtensionPointFixtures.res.mjs +11 -13
  55. package/tests/components/extensionpoint/ExtensionPointTest.res +3 -3
  56. package/tests/components/extensionpoint/ExtensionPointTest.res.mjs +4 -4
  57. package/tests/components/inboundtranslationslice/InboundTranslationSliceCallbackTest.res.mjs +10 -10
  58. package/tests/components/inboundtranslationslice/InboundTranslationSliceFixtures.res.mjs +9 -9
  59. package/tests/components/outboundtranslationslice/OutboundTranslationSliceFixtures.res.mjs +23 -21
  60. package/tests/components/outboundtranslationslice/OutboundTranslationSlicePlatformFixtures.res +2 -2
  61. package/tests/components/outboundtranslationslice/OutboundTranslationSlicePlatformFixtures.res.mjs +17 -14
  62. package/tests/components/querydb/QueryDbFixtures.res.mjs +4 -4
  63. package/tests/components/querydb/QueryDbSubIdFixtures.res.mjs +6 -6
  64. package/tests/components/readmodel/DcbReadModelE2EFixtures.res +3 -3
  65. package/tests/components/readmodel/DcbReadModelE2EFixtures.res.mjs +17 -16
  66. package/tests/components/readmodel/DcbReadModelTypoFailFastTest.res.mjs +7 -7
  67. package/tests/components/readmodel/MixedSourceReadModelFixtures.res +5 -5
  68. package/tests/components/readmodel/MixedSourceReadModelFixtures.res.mjs +20 -19
  69. package/tests/components/readmodel/ReadModelFixtures.res +3 -3
  70. package/tests/components/readmodel/ReadModelFixtures.res.mjs +9 -8
  71. package/tests/components/sideeffecthandler/SideEffectHandlerFixtures.res +2 -3
  72. package/tests/components/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +7 -8
  73. package/tests/components/stateviewslice/StateViewSliceFixtures.res +2 -2
  74. package/tests/components/stateviewslice/StateViewSliceFixtures.res.mjs +22 -21
  75. package/tests/components/stateviewslice/StateViewSliceSubIdFixtures.res +2 -2
  76. package/tests/components/stateviewslice/StateViewSliceSubIdFixtures.res.mjs +27 -26
  77. package/tests/components/task/TaskFixtures.res +0 -1
  78. package/tests/components/task/TaskFixtures.res.mjs +0 -3
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
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 LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
6
6
  import * as TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
@@ -11,14 +11,14 @@ import * as LocalEventTopicPublisher$ReventlessLocal from "../../../src/adapter/
11
11
 
12
12
  let name = "TestItemEventLog";
13
13
 
14
- let eventSchema = S.union([
15
- S.schema(s => ({
14
+ let eventSchema = Sury.union([
15
+ Sury.$schema(s => ({
16
16
  TAG: "ItemCreated",
17
- name: s.m(S.string)
17
+ name: s.m(Sury.string)
18
18
  })),
19
- S.schema(s => ({
19
+ Sury.$schema(s => ({
20
20
  TAG: "ItemDeleted",
21
- id: s.m(S.string)
21
+ id: s.m(Sury.string)
22
22
  }))
23
23
  ]);
24
24
 
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
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 Component$ReventlessCore from "@reventlessdev/reventless-core/src/components/Component.res.mjs";
6
6
  import * as LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
@@ -36,9 +36,9 @@ TestRunner$ReventlessLocal.setup();
36
36
 
37
37
  let name = "SeamItemEventLog";
38
38
 
39
- let eventSchema = S.schema(s => ({
39
+ let eventSchema = Sury.$schema(s => ({
40
40
  TAG: "SeamItemCreated",
41
- name: s.m(S.string)
41
+ name: s.m(Sury.string)
42
42
  }));
43
43
 
44
44
  let SeamItemSpec = {
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
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 LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
6
6
  import * as TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
@@ -10,14 +10,14 @@ import * as LocalEventTopicPublisher$ReventlessLocal from "../../../src/adapter/
10
10
 
11
11
  let name = "TestItemEventTopic";
12
12
 
13
- let eventSchema = S.union([
14
- S.schema(s => ({
13
+ let eventSchema = Sury.union([
14
+ Sury.$schema(s => ({
15
15
  TAG: "ItemPublished",
16
- name: s.m(S.string)
16
+ name: s.m(Sury.string)
17
17
  })),
18
- S.schema(s => ({
18
+ Sury.$schema(s => ({
19
19
  TAG: "ItemRemoved",
20
- id: s.m(S.string)
20
+ id: s.m(Sury.string)
21
21
  }))
22
22
  ]);
23
23
 
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
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 LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
6
6
  import * as TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
@@ -9,14 +9,14 @@ import * as LocalEventTopicPublisher$ReventlessLocal from "../../../src/adapter/
9
9
 
10
10
  let name = "StreamEvtItem";
11
11
 
12
- let eventSchema = S.union([
13
- S.schema(s => ({
12
+ let eventSchema = Sury.union([
13
+ Sury.$schema(s => ({
14
14
  TAG: "ItemPublished",
15
- name: s.m(S.string)
15
+ name: s.m(Sury.string)
16
16
  })),
17
- S.schema(s => ({
17
+ Sury.$schema(s => ({
18
18
  TAG: "ItemRemoved",
19
- id: s.m(S.string)
19
+ id: s.m(Sury.string)
20
20
  }))
21
21
  ]);
22
22
 
@@ -3,7 +3,6 @@
3
3
 
4
4
  open TestFixtures
5
5
 
6
- S.enableJson()
7
6
 
8
7
  // ─────────────────────────────────────────────────────────────
9
8
  // Isolated bus + Pulumi mock mode
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
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 LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
6
6
  import * as TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
@@ -8,22 +8,20 @@ import * as TestFixtures$ReventlessLocal from "../../TestFixtures.res.mjs";
8
8
  import * as ExtensionPointMapping$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/ExtensionPointMapping.res.mjs";
9
9
  import * as ExtensionPoint_Builder$ReventlessLocal from "../../../src/components/ExtensionPoint_Builder.res.mjs";
10
10
 
11
- S.enableJson();
12
-
13
11
  let Bus = LocalBus$ReventlessLocal.Make({});
14
12
 
15
13
  TestRunner$ReventlessLocal.setup();
16
14
 
17
15
  let name = "TestEP";
18
16
 
19
- let commandSchema = S.schema(s => ({
17
+ let commandSchema = Sury.$schema(s => ({
20
18
  TAG: "Forward",
21
- targetId: s.m(S.string)
19
+ targetId: s.m(Sury.string)
22
20
  }));
23
21
 
24
- let eventSchema = S.literal("TEPNoEvent");
22
+ let eventSchema = Sury.literal("TEPNoEvent");
25
23
 
26
- let directiveSchema = S.literal("TEPNoDirective");
24
+ let directiveSchema = Sury.literal("TEPNoDirective");
27
25
 
28
26
  let moduleUrl = import.meta.url;
29
27
 
@@ -42,17 +40,17 @@ let TestEPSpec = {
42
40
 
43
41
  let name$1 = "TargetAgg";
44
42
 
45
- let commandSchema$1 = S.schema(s => ({
43
+ let commandSchema$1 = Sury.$schema(s => ({
46
44
  TAG: "Execute",
47
- targetId: s.m(S.string)
45
+ targetId: s.m(Sury.string)
48
46
  }));
49
47
 
50
- let eventSchema$1 = S.schema(s => ({
48
+ let eventSchema$1 = Sury.$schema(s => ({
51
49
  TAG: "Executed",
52
- targetId: s.m(S.string)
50
+ targetId: s.m(Sury.string)
53
51
  }));
54
52
 
55
- let errorSchema = S.literal("TEAggNoError");
53
+ let errorSchema = Sury.literal("TEAggNoError");
56
54
 
57
55
  let moduleUrl$1 = import.meta.url;
58
56
 
@@ -185,4 +183,4 @@ export {
185
183
  testMeta,
186
184
  resetMocks,
187
185
  }
188
- /* Not a pure module */
186
+ /* Bus Not a pure module */
@@ -30,11 +30,11 @@ describe("ExtensionPoint (in-memory)", () => {
30
30
  // Build the full command body: {id, meta, command}
31
31
  let forwardCmdJson =
32
32
  TestEPSpec.Forward({targetId: "target-1"})
33
- ->S.reverseConvertToJsonOrThrow(TestEPSpec.commandSchema)
33
+ ->Reventless.Util_Sury.toJson(TestEPSpec.commandSchema)
34
34
  let body = JSON.Encode.object(
35
35
  Dict.fromArray([
36
36
  ("id", JSON.Encode.string("ep-id-1")),
37
- ("meta", testMeta->S.reverseConvertToJsonOrThrow(Reventless.Message.metaSchema)),
37
+ ("meta", testMeta->Reventless.Util_Sury.toJson(Reventless.Message.metaSchema)),
38
38
  ("command", forwardCmdJson),
39
39
  ]),
40
40
  )
@@ -49,7 +49,7 @@ describe("ExtensionPoint (in-memory)", () => {
49
49
  expect(cmd.id)->toBe("target-1")
50
50
 
51
51
  // commandJson should decode to Execute({targetId: "target-1"})
52
- let decoded = cmd.commandJson->S.parseJsonOrThrow(DelegateAggSpec.commandSchema)
52
+ let decoded = cmd.commandJson->Reventless.Util_Sury.fromJson(DelegateAggSpec.commandSchema)
53
53
  expect(decoded)->toEqual(DelegateAggSpec.Execute({targetId: "target-1"}))
54
54
  },
55
55
  )
@@ -1,7 +1,7 @@
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 Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
4
+ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
5
5
  import * as TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
6
6
  import * as ExtensionPointFixtures$ReventlessLocal from "./ExtensionPointFixtures.res.mjs";
7
7
 
@@ -14,7 +14,7 @@ globalThis.beforeAll(async () => {
14
14
  globalThis.describe("ExtensionPoint (in-memory)", () => {
15
15
  globalThis.beforeEach(() => ExtensionPointFixtures$ReventlessLocal.resetMocks());
16
16
  globalThis.test("dispatching Forward command calls publishToAggregates with Execute command", async () => {
17
- let forwardCmdJson = S.reverseConvertToJsonOrThrow({
17
+ let forwardCmdJson = Util_Sury$Reventless.toJson({
18
18
  TAG: "Forward",
19
19
  targetId: "target-1"
20
20
  }, ExtensionPointFixtures$ReventlessLocal.TestEPSpec.commandSchema);
@@ -25,7 +25,7 @@ globalThis.describe("ExtensionPoint (in-memory)", () => {
25
25
  ],
26
26
  [
27
27
  "meta",
28
- S.reverseConvertToJsonOrThrow(ExtensionPointFixtures$ReventlessLocal.testMeta, Message$Reventless.metaSchema)
28
+ Util_Sury$Reventless.toJson(ExtensionPointFixtures$ReventlessLocal.testMeta, Message$Reventless.metaSchema)
29
29
  ],
30
30
  [
31
31
  "command",
@@ -36,7 +36,7 @@ globalThis.describe("ExtensionPoint (in-memory)", () => {
36
36
  globalThis.expect(ExtensionPointFixtures$ReventlessLocal.capturedCmds.contents.length).toBe(1);
37
37
  let cmd = ExtensionPointFixtures$ReventlessLocal.capturedCmds.contents[0];
38
38
  globalThis.expect(cmd.id).toBe("target-1");
39
- let decoded = S.parseJsonOrThrow(cmd.commandJson, ExtensionPointFixtures$ReventlessLocal.DelegateAggSpec.commandSchema);
39
+ let decoded = Util_Sury$Reventless.fromJson(cmd.commandJson, ExtensionPointFixtures$ReventlessLocal.DelegateAggSpec.commandSchema);
40
40
  globalThis.expect(decoded).toEqual({
41
41
  TAG: "Execute",
42
42
  targetId: "target-1"
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
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_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
6
  import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
@@ -164,14 +164,14 @@ globalThis.describe("InboundTranslationSlice Callback", () => {
164
164
  globalThis.describe("multi-command", () => {
165
165
  globalThis.test("translate returning multiple pairs publishes all commands", async () => {
166
166
  let moduleUrl = import.meta.url;
167
- let externalInputSchema = S.schema(s => ({
168
- orderId: s.m(S.string),
169
- items: s.m(S.array(S.string))
167
+ let externalInputSchema = Sury.$schema(s => ({
168
+ orderId: s.m(Sury.string),
169
+ items: s.m(Sury.array(Sury.string))
170
170
  }));
171
- let commandSchema = S.schema(s => ({
171
+ let commandSchema = Sury.$schema(s => ({
172
172
  TAG: "ConfirmPayment",
173
173
  orderId: s.m(DcbTag$Reventless.string),
174
- paymentId: s.m(S.string)
174
+ paymentId: s.m(Sury.string)
175
175
  }));
176
176
  let translate = input => ({
177
177
  TAG: "Ok",
@@ -234,13 +234,13 @@ globalThis.describe("InboundTranslationSlice Callback", () => {
234
234
  });
235
235
  globalThis.test("translate returning empty array publishes nothing", async () => {
236
236
  let moduleUrl = import.meta.url;
237
- let externalInputSchema = S.schema(s => ({
238
- orderId: s.m(S.string)
237
+ let externalInputSchema = Sury.$schema(s => ({
238
+ orderId: s.m(Sury.string)
239
239
  }));
240
- let commandSchema = S.schema(s => ({
240
+ let commandSchema = Sury.$schema(s => ({
241
241
  TAG: "ConfirmPayment",
242
242
  orderId: s.m(DcbTag$Reventless.string),
243
- paymentId: s.m(S.string)
243
+ paymentId: s.m(Sury.string)
244
244
  }));
245
245
  let translate = _input => ({
246
246
  TAG: "Ok",
@@ -1,14 +1,14 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
3
+ import * as Sury from "sury";
4
4
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
5
5
 
6
6
  let moduleUrl = import.meta.url;
7
7
 
8
- let eventSchema = S.schema(s => ({
8
+ let eventSchema = Sury.$schema(s => ({
9
9
  TAG: "PaymentConfirmed",
10
10
  orderId: s.m(DcbTag$Reventless.string),
11
- paymentId: s.m(S.string)
11
+ paymentId: s.m(Sury.string)
12
12
  }));
13
13
 
14
14
  let OrderEventLog = {
@@ -18,16 +18,16 @@ let OrderEventLog = {
18
18
 
19
19
  let moduleUrl$1 = import.meta.url;
20
20
 
21
- let externalInputSchema = S.schema(s => ({
22
- paymentId: s.m(S.string),
23
- orderId: s.m(S.string),
24
- status: s.m(S.string)
21
+ let externalInputSchema = Sury.$schema(s => ({
22
+ paymentId: s.m(Sury.string),
23
+ orderId: s.m(Sury.string),
24
+ status: s.m(Sury.string)
25
25
  }));
26
26
 
27
- let commandSchema = S.schema(s => ({
27
+ let commandSchema = Sury.$schema(s => ({
28
28
  TAG: "ConfirmPayment",
29
29
  orderId: s.m(DcbTag$Reventless.string),
30
- paymentId: s.m(S.string)
30
+ paymentId: s.m(Sury.string)
31
31
  }));
32
32
 
33
33
  function translate(input) {
@@ -1,20 +1,20 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
3
+ import * as Sury from "sury";
4
4
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
5
5
 
6
6
  let moduleUrl = import.meta.url;
7
7
 
8
- let eventSchema = S.union([
9
- S.schema(s => ({
8
+ let eventSchema = Sury.union([
9
+ Sury.$schema(s => ({
10
10
  TAG: "OrderShipped",
11
11
  orderId: s.m(DcbTag$Reventless.string),
12
- email: s.m(S.string)
12
+ email: s.m(Sury.string)
13
13
  })),
14
- S.schema(s => ({
14
+ Sury.$schema(s => ({
15
15
  TAG: "PaymentReceived",
16
16
  orderId: s.m(DcbTag$Reventless.string),
17
- amount: s.m(S.float)
17
+ amount: s.m(Sury.float)
18
18
  }))
19
19
  ]);
20
20
 
@@ -25,17 +25,19 @@ let OrderEventLog = {
25
25
 
26
26
  let moduleUrl$1 = import.meta.url;
27
27
 
28
- let consumedEventSchema = S.schema(s => ({
28
+ let consumedEventSchema = Sury.$schema(s => ({
29
29
  TAG: "OrderShipped",
30
- orderId: s.m(S.string),
31
- email: s.m(S.string)
30
+ orderId: s.m(Sury.string),
31
+ email: s.m(Sury.string)
32
32
  }));
33
33
 
34
- let outboundItemSchema = S.schema(s => ({
35
- orderId: s.m(S.string),
36
- email: s.m(S.string)
34
+ let outboundItemSchema = Sury.$schema(s => ({
35
+ orderId: s.m(Sury.string),
36
+ email: s.m(Sury.string)
37
37
  }));
38
38
 
39
+ let inboundCommandSchema = Sury.$unit;
40
+
39
41
  function collect(event, param) {
40
42
  let orderId = event.orderId;
41
43
  return [[
@@ -61,7 +63,7 @@ let SendTrackingEmailSpec = {
61
63
  moduleUrl: moduleUrl$1,
62
64
  consumedEventSchema: consumedEventSchema,
63
65
  outboundItemSchema: outboundItemSchema,
64
- inboundCommandSchema: S.unit,
66
+ inboundCommandSchema: inboundCommandSchema,
65
67
  collect: collect,
66
68
  translate: translate,
67
69
  maxRetries: 3,
@@ -73,18 +75,18 @@ let SendTrackingEmailSpec = {
73
75
 
74
76
  let moduleUrl$2 = import.meta.url;
75
77
 
76
- let consumedEventSchema$1 = S.schema(s => ({
78
+ let consumedEventSchema$1 = Sury.$schema(s => ({
77
79
  TAG: "PaymentReceived",
78
- orderId: s.m(S.string),
79
- amount: s.m(S.float)
80
+ orderId: s.m(Sury.string),
81
+ amount: s.m(Sury.float)
80
82
  }));
81
83
 
82
- let outboundItemSchema$1 = S.schema(s => ({
83
- orderId: s.m(S.string),
84
- amount: s.m(S.float)
84
+ let outboundItemSchema$1 = Sury.$schema(s => ({
85
+ orderId: s.m(Sury.string),
86
+ amount: s.m(Sury.float)
85
87
  }));
86
88
 
87
- let inboundCommandSchema = S.schema(s => ({
89
+ let inboundCommandSchema$1 = Sury.$schema(s => ({
88
90
  TAG: "ConfirmPayment",
89
91
  orderId: s.m(DcbTag$Reventless.string)
90
92
  }));
@@ -126,7 +128,7 @@ let ProcessPaymentSpec = {
126
128
  moduleUrl: moduleUrl$2,
127
129
  consumedEventSchema: consumedEventSchema$1,
128
130
  outboundItemSchema: outboundItemSchema$1,
129
- inboundCommandSchema: inboundCommandSchema,
131
+ inboundCommandSchema: inboundCommandSchema$1,
130
132
  collect: collect$1,
131
133
  translateFn: translateFn,
132
134
  translate: translate$1,
@@ -152,7 +152,7 @@ let publishJsons: ReventlessInfra.CommandTopic.publishJsons = async cmdJsons =>
152
152
  let fullBody = JSON.Encode.object(
153
153
  Dict.fromArray([
154
154
  ("id", JSON.Encode.string(cmdJson.id)),
155
- ("meta", cmdJson.meta->S.reverseConvertToJsonOrThrow(Reventless.Message.metaSchema)),
155
+ ("meta", cmdJson.meta->Reventless.Util_Sury.toJson(Reventless.Message.metaSchema)),
156
156
  ("command", cmdJson.commandJson),
157
157
  ]),
158
158
  )
@@ -196,7 +196,7 @@ let placeCmdJson = (orderId: string): Reventless.Message.commandJson => {
196
196
  id: orderId,
197
197
  meta: testMeta,
198
198
  commandJson: PlaceSpec.Place({orderId, customerId: "cust-" ++ orderId})
199
- ->S.reverseConvertToJsonOrThrow(PlaceSpec.commandSchema),
199
+ ->Reventless.Util_Sury.toJson(PlaceSpec.commandSchema),
200
200
  }
201
201
 
202
202
  let readEventTypes = async (orderId: string) => {
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
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 Effect from "effect/Effect";
@@ -8,6 +8,7 @@ import * as Stream from "effect/Stream";
8
8
  import * as Pulumi from "@pulumi/pulumi";
9
9
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
10
10
  import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
11
+ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
11
12
  import * as LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
12
13
  import * as Component$ReventlessInfra from "@reventlessdev/reventless-infra/src/components/Component.res.mjs";
13
14
  import * as TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
@@ -21,21 +22,21 @@ let name = "Place";
21
22
 
22
23
  let moduleUrl = import.meta.url;
23
24
 
24
- let eventSchema = S.schema(s => ({
25
+ let eventSchema = Sury.$schema(s => ({
25
26
  TAG: "Placed",
26
27
  orderId: s.m(DcbTag$Reventless.string),
27
- customerId: s.m(S.string)
28
+ customerId: s.m(Sury.string)
28
29
  }));
29
30
 
30
- let consumedEventSchema = S.literal("Placed");
31
+ let consumedEventSchema = Sury.literal("Placed");
31
32
 
32
- let commandSchema = S.schema(s => ({
33
+ let commandSchema = Sury.$schema(s => ({
33
34
  TAG: "Place",
34
35
  orderId: s.m(DcbTag$Reventless.string),
35
- customerId: s.m(S.string)
36
+ customerId: s.m(Sury.string)
36
37
  }));
37
38
 
38
- let errorSchema = S.literal("AlreadyPlaced");
39
+ let errorSchema = Sury.literal("AlreadyPlaced");
39
40
 
40
41
  function commandAuthorization(param) {
41
42
  return "AllowAuthenticated";
@@ -87,15 +88,17 @@ let PlaceBehavior = {
87
88
 
88
89
  let moduleUrl$2 = import.meta.url;
89
90
 
90
- let consumedEventSchema$1 = S.schema(s => ({
91
+ let consumedEventSchema$1 = Sury.$schema(s => ({
91
92
  TAG: "Placed",
92
- orderId: s.m(S.string)
93
+ orderId: s.m(Sury.string)
93
94
  }));
94
95
 
95
- let outboundItemSchema = S.schema(s => ({
96
- orderId: s.m(S.string)
96
+ let outboundItemSchema = Sury.$schema(s => ({
97
+ orderId: s.m(Sury.string)
97
98
  }));
98
99
 
100
+ let inboundCommandSchema = Sury.$unit;
101
+
99
102
  let sourceNames = [];
100
103
 
101
104
  let SendConfirmSpec_externalSystem = "EmailService";
@@ -105,7 +108,7 @@ let SendConfirmSpec = {
105
108
  moduleUrl: moduleUrl$2,
106
109
  consumedEventSchema: consumedEventSchema$1,
107
110
  outboundItemSchema: outboundItemSchema,
108
- inboundCommandSchema: S.unit,
111
+ inboundCommandSchema: inboundCommandSchema,
109
112
  maxRetries: 3,
110
113
  heartbeatInterval: 60,
111
114
  targetName: undefined,
@@ -173,7 +176,7 @@ async function publishJsons(cmdJsons) {
173
176
  ],
174
177
  [
175
178
  "meta",
176
- S.reverseConvertToJsonOrThrow(cmdJson.meta, Message$Reventless.metaSchema)
179
+ Util_Sury$Reventless.toJson(cmdJson.meta, Message$Reventless.metaSchema)
177
180
  ],
178
181
  [
179
182
  "command",
@@ -225,7 +228,7 @@ function placeCmdJson(orderId) {
225
228
  return {
226
229
  id: orderId,
227
230
  meta: TestFixtures$ReventlessLocal.testMeta,
228
- commandJson: S.reverseConvertToJsonOrThrow({
231
+ commandJson: Util_Sury$Reventless.toJson({
229
232
  TAG: "Place",
230
233
  orderId: orderId,
231
234
  customerId: "cust-" + orderId
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
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 ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
6
6
  import * as LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
@@ -13,9 +13,9 @@ let name = "TestItemQueryDb";
13
13
 
14
14
  let moduleUrl = import.meta.url;
15
15
 
16
- let stateSchema = S.schema(s => ({
17
- name: s.m(S.string),
18
- count: s.m(S.int)
16
+ let stateSchema = Sury.$schema(s => ({
17
+ name: s.m(Sury.string),
18
+ count: s.m(Sury.int)
19
19
  }));
20
20
 
21
21
  let config = ReadModel$Reventless.config(undefined, undefined, undefined);
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as S from "sury/src/S.res.mjs";
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 ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
6
6
  import * as LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
@@ -13,11 +13,11 @@ let name = "TestMetricQueryDb";
13
13
 
14
14
  let moduleUrl = import.meta.url;
15
15
 
16
- let stateSchema = S.schema(s => ({
17
- userId: s.m(S.string),
18
- region: s.m(S.string),
19
- date: s.m(S.string),
20
- value: s.m(S.float)
16
+ let stateSchema = Sury.$schema(s => ({
17
+ userId: s.m(Sury.string),
18
+ region: s.m(Sury.string),
19
+ date: s.m(Sury.string),
20
+ value: s.m(Sury.float)
21
21
  }));
22
22
 
23
23
  let config = ReadModel$Reventless.config(undefined, undefined, undefined);
@@ -153,7 +153,7 @@ let publishJsons: ReventlessInfra.CommandTopic.publishJsons = async cmdJsons =>
153
153
  let fullBody = JSON.Encode.object(
154
154
  Dict.fromArray([
155
155
  ("id", JSON.Encode.string(cmdJson.id)),
156
- ("meta", cmdJson.meta->S.reverseConvertToJsonOrThrow(Reventless.Message.metaSchema)),
156
+ ("meta", cmdJson.meta->Reventless.Util_Sury.toJson(Reventless.Message.metaSchema)),
157
157
  ("command", cmdJson.commandJson),
158
158
  ]),
159
159
  )
@@ -199,7 +199,7 @@ let dispatch = async (commandJson, id) =>
199
199
 
200
200
  let addProductCmd = (productId, name) =>
201
201
  AddProductSpec.AddProduct({productId, name})
202
- ->S.reverseConvertToJsonOrThrow(AddProductSpec.commandSchema)
202
+ ->Reventless.Util_Sury.toJson(AddProductSpec.commandSchema)
203
203
 
204
204
  let loadState = async productId => {
205
205
  switch Bus.getQueryDb("TestProductsReadModel") {
@@ -210,6 +210,6 @@ let loadState = async productId => {
210
210
  ->Stream.runCollect
211
211
  ->Effect.catchAll(_ => Effect.succeed([]))
212
212
  ->Effect.runPromise
213
- states->Array.map(json => json->S.parseJsonOrThrow(ProductsReadModelSpec.stateSchema))
213
+ states->Array.map(json => json->Reventless.Util_Sury.fromJson(ProductsReadModelSpec.stateSchema))
214
214
  }
215
215
  }