@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 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 AutomationSlice$Reventless from "@reventlessdev/reventless-spec/src/components/AutomationSlice.res.mjs";
@@ -22,19 +23,19 @@ let name = "Place";
22
23
 
23
24
  let moduleUrl = import.meta.url;
24
25
 
25
- let eventSchema = S.schema(s => ({
26
+ let eventSchema = Sury.$schema(s => ({
26
27
  TAG: "Placed",
27
28
  orderId: s.m(DcbTag$Reventless.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
36
  }));
36
37
 
37
- let errorSchema = S.literal("AlreadyPlaced");
38
+ let errorSchema = Sury.literal("AlreadyPlaced");
38
39
 
39
40
  function commandAuthorization(param) {
40
41
  return "AllowAuthenticated";
@@ -87,25 +88,25 @@ let name$1 = "Ship";
87
88
 
88
89
  let moduleUrl$2 = import.meta.url;
89
90
 
90
- let eventSchema$1 = S.schema(s => ({
91
+ let eventSchema$1 = Sury.$schema(s => ({
91
92
  TAG: "Shipped",
92
93
  orderId: s.m(DcbTag$Reventless.string)
93
94
  }));
94
95
 
95
- let consumedEventSchema$1 = S.union([
96
- S.schema(s => ({
96
+ let consumedEventSchema$1 = Sury.union([
97
+ Sury.$schema(s => ({
97
98
  TAG: "Placed",
98
- orderId: s.m(S.string)
99
+ orderId: s.m(Sury.string)
99
100
  })),
100
- S.literal("Shipped")
101
+ Sury.literal("Shipped")
101
102
  ]);
102
103
 
103
- let commandSchema$1 = S.schema(s => ({
104
+ let commandSchema$1 = Sury.$schema(s => ({
104
105
  TAG: "Ship",
105
106
  orderId: s.m(DcbTag$Reventless.string)
106
107
  }));
107
108
 
108
- let errorSchema$1 = S.literal("NotPlaced");
109
+ let errorSchema$1 = Sury.literal("NotPlaced");
109
110
 
110
111
  function commandAuthorization$1(param) {
111
112
  return "AllowAuthenticated";
@@ -178,14 +179,14 @@ let ShipBehavior = {
178
179
 
179
180
  let name$2 = "TestLogDcbEventLog";
180
181
 
181
- let eventSchema$2 = S.union([
182
- S.schema(s => ({
182
+ let eventSchema$2 = Sury.union([
183
+ Sury.$schema(s => ({
183
184
  TAG: "Placed",
184
- orderId: s.m(S.string)
185
+ orderId: s.m(Sury.string)
185
186
  })),
186
- S.schema(s => ({
187
+ Sury.$schema(s => ({
187
188
  TAG: "Shipped",
188
- orderId: s.m(S.string)
189
+ orderId: s.m(Sury.string)
189
190
  }))
190
191
  ]);
191
192
 
@@ -199,11 +200,11 @@ let name$3 = "AutoShip";
199
200
 
200
201
  let moduleUrl$4 = import.meta.url;
201
202
 
202
- let todoItemSchema = S.schema(s => ({
203
- orderId: s.m(S.string)
203
+ let todoItemSchema = Sury.$schema(s => ({
204
+ orderId: s.m(Sury.string)
204
205
  }));
205
206
 
206
- let commandSchema$2 = S.schema(s => ({
207
+ let commandSchema$2 = Sury.$schema(s => ({
207
208
  TAG: "Ship",
208
209
  orderId: s.m(DcbTag$Reventless.string)
209
210
  }));
@@ -304,7 +305,7 @@ async function publishJsons(cmdJsons) {
304
305
  ],
305
306
  [
306
307
  "meta",
307
- S.reverseConvertToJsonOrThrow(cmdJson.meta, Message$Reventless.metaSchema)
308
+ Util_Sury$Reventless.toJson(cmdJson.meta, Message$Reventless.metaSchema)
308
309
  ],
309
310
  [
310
311
  "command",
@@ -387,7 +388,7 @@ function placeCmdJson(orderId) {
387
388
  return {
388
389
  id: orderId,
389
390
  meta: TestFixtures$ReventlessLocal.testMeta,
390
- commandJson: S.reverseConvertToJsonOrThrow({
391
+ commandJson: Util_Sury$Reventless.toJson({
391
392
  TAG: "Place",
392
393
  orderId: orderId
393
394
  }, commandSchema)
@@ -193,8 +193,8 @@ let publishAggregateEvent = async (id, event: OrderAggregateSource.event) => {
193
193
  let eventJson = JSON.Encode.object(
194
194
  Dict.fromArray([
195
195
  ("id", id->JSON.Encode.string),
196
- ("meta", meta->S.reverseConvertToJsonOrThrow(Message.metaSchema)),
197
- ("event", event->S.reverseConvertToJsonOrThrow(OrderAggregateSource.eventSchema)),
196
+ ("meta", meta->Reventless.Util_Sury.toJson(Message.metaSchema)),
197
+ ("event", event->Reventless.Util_Sury.toJson(OrderAggregateSource.eventSchema)),
198
198
  ]),
199
199
  )
200
200
  await Bus.publishEvent(OrderAggregateSource.name, "test", meta, eventJson)
@@ -205,8 +205,8 @@ let publishDcbEvent = async (id, event: InventoryDcbSource.event) => {
205
205
  let eventJson = JSON.Encode.object(
206
206
  Dict.fromArray([
207
207
  ("id", id->JSON.Encode.string),
208
- ("meta", meta->S.reverseConvertToJsonOrThrow(Message.metaSchema)),
209
- ("event", event->S.reverseConvertToJsonOrThrow(InventoryDcbSource.eventSchema)),
208
+ ("meta", meta->Reventless.Util_Sury.toJson(Message.metaSchema)),
209
+ ("event", event->Reventless.Util_Sury.toJson(InventoryDcbSource.eventSchema)),
210
210
  ]),
211
211
  )
212
212
  await Bus.publishEvent(InventoryDcbSource.name, "test", meta, eventJson)
@@ -1,10 +1,11 @@
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 Pulumi from "@pulumi/pulumi";
6
6
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
7
7
  import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
8
+ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
8
9
  import * as Adapter$ReventlessInfra from "@reventlessdev/reventless-infra/src/adapter/Adapter.res.mjs";
9
10
  import * as LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
10
11
  import * as AutomationSlice$Reventless from "@reventlessdev/reventless-spec/src/components/AutomationSlice.res.mjs";
@@ -14,10 +15,10 @@ import * as AutomationSlice_Builder$ReventlessLocal from "../../../src/component
14
15
 
15
16
  let name = "OrderAggregateEventTopic";
16
17
 
17
- let eventSchema = S.schema(s => ({
18
+ let eventSchema = Sury.$schema(s => ({
18
19
  TAG: "OrderShipped",
19
- orderId: s.m(S.string),
20
- productId: s.m(S.string)
20
+ orderId: s.m(Sury.string),
21
+ productId: s.m(Sury.string)
21
22
  }));
22
23
 
23
24
  let OrderAggregateSource = {
@@ -28,16 +29,16 @@ let OrderAggregateSource = {
28
29
 
29
30
  let name$1 = "InventoryDcbEventLog";
30
31
 
31
- let eventSchema$1 = S.union([
32
- S.schema(s => ({
32
+ let eventSchema$1 = Sury.union([
33
+ Sury.$schema(s => ({
33
34
  TAG: "StockReserved",
34
- orderId: s.m(S.string),
35
- productId: s.m(S.string)
35
+ orderId: s.m(Sury.string),
36
+ productId: s.m(Sury.string)
36
37
  })),
37
- S.schema(s => ({
38
+ Sury.$schema(s => ({
38
39
  TAG: "StockReleased",
39
- orderId: s.m(S.string),
40
- productId: s.m(S.string)
40
+ orderId: s.m(Sury.string),
41
+ productId: s.m(Sury.string)
41
42
  }))
42
43
  ]);
43
44
 
@@ -51,13 +52,13 @@ let name$2 = "AutoFulfill";
51
52
 
52
53
  let moduleUrl = import.meta.url;
53
54
 
54
- let todoItemSchema = S.schema(s => ({
55
- orderId: s.m(S.string),
56
- productId: s.m(S.string),
57
- fromAggregate: s.m(S.bool)
55
+ let todoItemSchema = Sury.$schema(s => ({
56
+ orderId: s.m(Sury.string),
57
+ productId: s.m(Sury.string),
58
+ fromAggregate: s.m(Sury.bool)
58
59
  }));
59
60
 
60
- let commandSchema = S.schema(s => ({
61
+ let commandSchema = Sury.$schema(s => ({
61
62
  TAG: "MarkFulfilled",
62
63
  orderId: s.m(DcbTag$Reventless.string),
63
64
  productId: s.m(DcbTag$Reventless.string)
@@ -216,11 +217,11 @@ async function publishAggregateEvent(id, event) {
216
217
  ],
217
218
  [
218
219
  "meta",
219
- S.reverseConvertToJsonOrThrow(meta, Message$Reventless.metaSchema)
220
+ Util_Sury$Reventless.toJson(meta, Message$Reventless.metaSchema)
220
221
  ],
221
222
  [
222
223
  "event",
223
- S.reverseConvertToJsonOrThrow(event, eventSchema)
224
+ Util_Sury$Reventless.toJson(event, eventSchema)
224
225
  ]
225
226
  ]);
226
227
  return await Bus.publishEvent(name, "test", meta, eventJson);
@@ -235,11 +236,11 @@ async function publishDcbEvent(id, event) {
235
236
  ],
236
237
  [
237
238
  "meta",
238
- S.reverseConvertToJsonOrThrow(meta, Message$Reventless.metaSchema)
239
+ Util_Sury$Reventless.toJson(meta, Message$Reventless.metaSchema)
239
240
  ],
240
241
  [
241
242
  "event",
242
- S.reverseConvertToJsonOrThrow(event, eventSchema$1)
243
+ Util_Sury$Reventless.toJson(event, eventSchema$1)
243
244
  ]
244
245
  ]);
245
246
  return await Bus.publishEvent(name$1, "test", meta, eventJson);
@@ -1,7 +1,6 @@
1
1
  // Fixtures for CommandGenerator integration tests.
2
2
  // Verifies that makeHandler builds a resolver that publishes the correct commandJson.
3
3
 
4
- S.enableJson()
5
4
 
6
5
  // Activate Pulumi mock mode (must be called before any Component.make)
7
6
  let _ = TestRunner.setup()
@@ -1,28 +1,26 @@
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 TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
6
6
  import * as CommandGenerator_Builder$ReventlessCore from "@reventlessdev/reventless-core/src/components/CommandGenerator/CommandGenerator_Builder.res.mjs";
7
7
  import * as LocalCommandGeneratorResolvers$ReventlessLocal from "../../../src/adapter/CommandGenerator/LocalCommandGeneratorResolvers.res.mjs";
8
8
 
9
- S.enableJson();
10
-
11
9
  TestRunner$ReventlessLocal.setup();
12
10
 
13
11
  let name = "TestCGAggregate";
14
12
 
15
- let commandSchema = S.schema(s => ({
13
+ let commandSchema = Sury.$schema(s => ({
16
14
  TAG: "CreateCGItem",
17
- name: s.m(S.string)
15
+ name: s.m(Sury.string)
18
16
  }));
19
17
 
20
- let eventSchema = S.schema(s => ({
18
+ let eventSchema = Sury.$schema(s => ({
21
19
  TAG: "CGItemCreated",
22
- name: s.m(S.string)
20
+ name: s.m(Sury.string)
23
21
  }));
24
22
 
25
- let errorSchema = S.literal("CGAlreadyExists");
23
+ let errorSchema = Sury.literal("CGAlreadyExists");
26
24
 
27
25
  let moduleUrl = import.meta.url;
28
26
 
@@ -30,7 +30,7 @@ describe("CommandGenerator_Builder.Make:", () => {
30
30
  expect(cmd.id)->toBe("item-1")
31
31
 
32
32
  // commandJson should decode to CreateCGItem({name: "widget"})
33
- let decoded = cmd.commandJson->S.parseJsonOrThrow(CGSpec.commandSchema)
33
+ let decoded = cmd.commandJson->Reventless.Util_Sury.fromJson(CGSpec.commandSchema)
34
34
  expect(decoded)->toEqual(CGSpec.CreateCGItem({name: "widget"}))
35
35
  })
36
36
 
@@ -1,8 +1,8 @@
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 Effect from "effect/Effect";
5
4
  import * as Identity$Reventless from "@reventlessdev/reventless-spec/src/types/Identity.res.mjs";
5
+ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
6
6
  import * as TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
7
7
  import * as CommandGeneratorFixtures$ReventlessLocal from "./CommandGeneratorFixtures.res.mjs";
8
8
 
@@ -30,7 +30,7 @@ globalThis.describe("CommandGenerator_Builder.Make:", () => {
30
30
  globalThis.expect(CommandGeneratorFixtures$ReventlessLocal.capturedCmds.contents.length).toBe(1);
31
31
  let cmd = CommandGeneratorFixtures$ReventlessLocal.capturedCmds.contents[0];
32
32
  globalThis.expect(cmd.id).toBe("item-1");
33
- let decoded = S.parseJsonOrThrow(cmd.commandJson, CommandGeneratorFixtures$ReventlessLocal.CGSpec.commandSchema);
33
+ let decoded = Util_Sury$Reventless.fromJson(cmd.commandJson, CommandGeneratorFixtures$ReventlessLocal.CGSpec.commandSchema);
34
34
  globalThis.expect(decoded).toEqual({
35
35
  TAG: "CreateCGItem",
36
36
  name: "widget"
@@ -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,23 +9,23 @@ import * as LocalCommandTopicChannel$ReventlessLocal from "../../../src/adapter/
9
9
 
10
10
  let name = "TestCommandTopicItem";
11
11
 
12
- let commandSchema = S.union([
13
- S.schema(s => ({
12
+ let commandSchema = Sury.union([
13
+ Sury.$schema(s => ({
14
14
  TAG: "CreateItem",
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: "DeleteItem",
19
- id: s.m(S.string)
19
+ id: s.m(Sury.string)
20
20
  }))
21
21
  ]);
22
22
 
23
- let eventSchema = S.schema(s => ({
23
+ let eventSchema = Sury.$schema(s => ({
24
24
  TAG: "ItemCreated",
25
- name: s.m(S.string)
25
+ name: s.m(Sury.string)
26
26
  }));
27
27
 
28
- let errorSchema = S.literal("AlreadyExists");
28
+ let errorSchema = Sury.literal("AlreadyExists");
29
29
 
30
30
  let moduleUrl = import.meta.url;
31
31
 
@@ -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 Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
6
6
  import * as LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
@@ -11,23 +11,23 @@ import * as LocalCommandTopicChannel$ReventlessLocal from "../../../src/adapter/
11
11
 
12
12
  let name = "StreamCmdItem";
13
13
 
14
- let commandSchema = S.union([
15
- S.schema(s => ({
14
+ let commandSchema = Sury.union([
15
+ Sury.$schema(s => ({
16
16
  TAG: "CreateItem",
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: "DeleteItem",
21
- id: s.m(S.string)
21
+ id: s.m(Sury.string)
22
22
  }))
23
23
  ]);
24
24
 
25
- let eventSchema = S.schema(s => ({
25
+ let eventSchema = Sury.$schema(s => ({
26
26
  TAG: "ItemCreated",
27
- name: s.m(S.string)
27
+ name: s.m(Sury.string)
28
28
  }));
29
29
 
30
- let errorSchema = S.literal("AlreadyExists");
30
+ let errorSchema = Sury.literal("AlreadyExists");
31
31
 
32
32
  let moduleUrl = import.meta.url;
33
33
 
@@ -125,7 +125,7 @@ let publishJsons: ReventlessInfra.CommandTopic.publishJsons = async cmdJsons =>
125
125
  let fullBody = JSON.Encode.object(
126
126
  Dict.fromArray([
127
127
  ("id", JSON.Encode.string(cmdJson.id)),
128
- ("meta", cmdJson.meta->S.reverseConvertToJsonOrThrow(Reventless.Message.metaSchema)),
128
+ ("meta", cmdJson.meta->Reventless.Util_Sury.toJson(Reventless.Message.metaSchema)),
129
129
  ("command", cmdJson.commandJson),
130
130
  ]),
131
131
  )
@@ -157,7 +157,7 @@ let dispatch = async (commandJson, id) =>
157
157
  await publishJsons([{Reventless.Message.id, meta: testMeta, commandJson}])
158
158
 
159
159
  let encodeEvent = (event: CatalogLog.event): ReventlessInfra.DcbEventLog.rawEvent => {
160
- let json = event->S.reverseConvertToJsonOrThrow(CatalogLog.eventSchema)
160
+ let json = event->Reventless.Util_Sury.toJson(CatalogLog.eventSchema)
161
161
  let (eventType, data) = json->ReventlessCore.Message.splitMessage
162
162
  let tags = Reventless.DcbTag.extractTags(CatalogLog.eventSchema, event)
163
163
  let meta = ReventlessCore.Message.generateMeta(~service="test")
@@ -165,6 +165,6 @@ let encodeEvent = (event: CatalogLog.event): ReventlessInfra.DcbEventLog.rawEven
165
165
  }
166
166
 
167
167
  let addProductJson = (productId, categoryId, name) =>
168
- AddProductSpec.AddProduct({productId, categoryId, name})->S.reverseConvertToJsonOrThrow(
168
+ AddProductSpec.AddProduct({productId, categoryId, name})->Reventless.Util_Sury.toJson(
169
169
  AddProductSpec.commandSchema,
170
170
  )
@@ -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 Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
12
13
  import * as LocalBus$ReventlessLocal from "../../../src/adapter/LocalBus.res.mjs";
13
14
  import * as TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
@@ -16,17 +17,17 @@ import * as TestFixtures$ReventlessLocal from "../../TestFixtures.res.mjs";
16
17
  import * as DcbEventLog_Builder$ReventlessLocal from "../../../src/components/DcbEventLog_Builder.res.mjs";
17
18
  import * as StateChangeSlice_Builder$ReventlessLocal from "../../../src/components/StateChangeSlice_Builder.res.mjs";
18
19
 
19
- let eventSchema = S.union([
20
- S.schema(s => ({
20
+ let eventSchema = Sury.union([
21
+ Sury.$schema(s => ({
21
22
  TAG: "ProductAdded",
22
23
  productId: s.m(DcbTag$Reventless.partition),
23
24
  categoryId: s.m(DcbTag$Reventless.string),
24
- name: s.m(S.string)
25
+ name: s.m(Sury.string)
25
26
  })),
26
- S.schema(s => ({
27
+ Sury.$schema(s => ({
27
28
  TAG: "CategoryAdded",
28
29
  categoryId: s.m(DcbTag$Reventless.string),
29
- name: s.m(S.string)
30
+ name: s.m(Sury.string)
30
31
  }))
31
32
  ]);
32
33
 
@@ -38,34 +39,34 @@ let name = "AddProduct";
38
39
 
39
40
  let moduleUrl = import.meta.url;
40
41
 
41
- let eventSchema$1 = S.schema(s => ({
42
+ let eventSchema$1 = Sury.$schema(s => ({
42
43
  TAG: "ProductAdded",
43
44
  productId: s.m(DcbTag$Reventless.partition),
44
45
  categoryId: s.m(DcbTag$Reventless.string),
45
- name: s.m(S.string)
46
+ name: s.m(Sury.string)
46
47
  }));
47
48
 
48
- let consumedEventSchema = S.union([
49
- S.schema(s => ({
49
+ let consumedEventSchema = Sury.union([
50
+ Sury.$schema(s => ({
50
51
  TAG: "ProductAdded",
51
- productId: s.m(S.string)
52
+ productId: s.m(Sury.string)
52
53
  })),
53
- S.schema(s => ({
54
+ Sury.$schema(s => ({
54
55
  TAG: "CategoryAdded",
55
- categoryId: s.m(S.string)
56
+ categoryId: s.m(Sury.string)
56
57
  }))
57
58
  ]);
58
59
 
59
- let commandSchema = S.schema(s => ({
60
+ let commandSchema = Sury.$schema(s => ({
60
61
  TAG: "AddProduct",
61
62
  productId: s.m(DcbTag$Reventless.partition),
62
63
  categoryId: s.m(DcbTag$Reventless.string),
63
- name: s.m(S.string)
64
+ name: s.m(Sury.string)
64
65
  }));
65
66
 
66
- let errorSchema = S.union([
67
- S.literal("ProductAlreadyExists"),
68
- S.literal("CategoryNotFound")
67
+ let errorSchema = Sury.union([
68
+ Sury.literal("ProductAlreadyExists"),
69
+ Sury.literal("CategoryNotFound")
69
70
  ]);
70
71
 
71
72
  function commandAuthorization(param) {
@@ -195,7 +196,7 @@ async function publishJsons(cmdJsons) {
195
196
  ],
196
197
  [
197
198
  "meta",
198
- S.reverseConvertToJsonOrThrow(cmdJson.meta, Message$Reventless.metaSchema)
199
+ Util_Sury$Reventless.toJson(cmdJson.meta, Message$Reventless.metaSchema)
199
200
  ],
200
201
  [
201
202
  "command",
@@ -236,7 +237,7 @@ async function dispatch(commandJson, id) {
236
237
  }
237
238
 
238
239
  function encodeEvent(event) {
239
- let json = S.reverseConvertToJsonOrThrow(event, eventSchema);
240
+ let json = Util_Sury$Reventless.toJson(event, eventSchema);
240
241
  let match = Message$ReventlessCore.splitMessage(json);
241
242
  let tags = DcbTag$Reventless.extractTags(eventSchema, event);
242
243
  let meta = Message$ReventlessCore.generateMeta("test", undefined, undefined, undefined, undefined, undefined, undefined, undefined);
@@ -249,7 +250,7 @@ function encodeEvent(event) {
249
250
  }
250
251
 
251
252
  function addProductJson(productId, categoryId, name) {
252
- return S.reverseConvertToJsonOrThrow({
253
+ return Util_Sury$Reventless.toJson({
253
254
  TAG: "AddProduct",
254
255
  productId: productId,
255
256
  categoryId: categoryId,
@@ -7,7 +7,7 @@ open DcbFixtures
7
7
 
8
8
  // Helper to encode a typed event into a raw event for appending to the DcbEventLog
9
9
  let encodeEvent = (event: DcbFixtures.ItemEventLog.event): ReventlessInfra.DcbEventLog.rawEvent => {
10
- let json = event->S.reverseConvertToJsonOrThrow(DcbFixtures.ItemEventLog.eventSchema)
10
+ let json = event->Reventless.Util_Sury.toJson(DcbFixtures.ItemEventLog.eventSchema)
11
11
  let (eventType, data) = json->ReventlessCore.Message.splitMessage
12
12
  let tags = Reventless.DcbTag.extractTags(DcbFixtures.ItemEventLog.eventSchema, event)
13
13
  let meta = ReventlessCore.Message.generateMeta(~service="test")
@@ -1,16 +1,16 @@
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 Effect from "effect/Effect";
5
4
  import * as Stream from "effect/Stream";
6
5
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
6
+ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
7
7
  import * as Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
8
8
  import * as Component$ReventlessCore from "@reventlessdev/reventless-core/src/components/Component.res.mjs";
9
9
  import * as TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
10
10
  import * as DcbFixtures$ReventlessLocal from "./DcbFixtures.res.mjs";
11
11
 
12
12
  function encodeEvent(event) {
13
- let json = S.reverseConvertToJsonOrThrow(event, DcbFixtures$ReventlessLocal.ItemEventLog.eventSchema);
13
+ let json = Util_Sury$Reventless.toJson(event, DcbFixtures$ReventlessLocal.ItemEventLog.eventSchema);
14
14
  let match = Message$ReventlessCore.splitMessage(json);
15
15
  let tags = DcbTag$Reventless.extractTags(DcbFixtures$ReventlessLocal.ItemEventLog.eventSchema, event);
16
16
  let meta = Message$ReventlessCore.generateMeta("test", undefined, undefined, undefined, undefined, undefined, undefined, undefined);
@@ -106,7 +106,7 @@ let publishJsons: ReventlessInfra.CommandTopic.publishJsons = async cmdJsons =>
106
106
  let fullBody = JSON.Encode.object(
107
107
  Dict.fromArray([
108
108
  ("id", JSON.Encode.string(cmdJson.id)),
109
- ("meta", cmdJson.meta->S.reverseConvertToJsonOrThrow(Reventless.Message.metaSchema)),
109
+ ("meta", cmdJson.meta->Reventless.Util_Sury.toJson(Reventless.Message.metaSchema)),
110
110
  ("command", cmdJson.commandJson),
111
111
  ]),
112
112
  )
@@ -142,4 +142,4 @@ let tagQuery = (id: string): Reventless.DcbTag.query => [
142
142
  let typeQuery = (eventType: string): Reventless.DcbTag.query => [{eventTypes: [eventType]}]
143
143
 
144
144
  let addItemJson = (id, name) =>
145
- AddItemSpec.AddItem({id, name})->S.reverseConvertToJsonOrThrow(AddItemSpec.commandSchema)
145
+ AddItemSpec.AddItem({id, name})->Reventless.Util_Sury.toJson(AddItemSpec.commandSchema)
@@ -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 TestRunner$ReventlessLocal from "../../../src/test/TestRunner.res.mjs";
13
14
  import * as CommandTopic$ReventlessCore from "@reventlessdev/reventless-core/src/components/CommandTopic/CommandTopic.res.mjs";
@@ -15,10 +16,10 @@ import * as TestFixtures$ReventlessLocal from "../../TestFixtures.res.mjs";
15
16
  import * as DcbEventLog_Builder$ReventlessLocal from "../../../src/components/DcbEventLog_Builder.res.mjs";
16
17
  import * as StateChangeSlice_Builder$ReventlessLocal from "../../../src/components/StateChangeSlice_Builder.res.mjs";
17
18
 
18
- let eventSchema = S.schema(s => ({
19
+ let eventSchema = Sury.$schema(s => ({
19
20
  TAG: "ItemAdded",
20
21
  id: s.m(DcbTag$Reventless.string),
21
- name: s.m(S.string)
22
+ name: s.m(Sury.string)
22
23
  }));
23
24
 
24
25
  let ItemEventLog = {
@@ -29,21 +30,21 @@ let name = "AddItem";
29
30
 
30
31
  let moduleUrl = import.meta.url;
31
32
 
32
- let eventSchema$1 = S.schema(s => ({
33
+ let eventSchema$1 = Sury.$schema(s => ({
33
34
  TAG: "ItemAdded",
34
35
  id: s.m(DcbTag$Reventless.string),
35
- name: s.m(S.string)
36
+ name: s.m(Sury.string)
36
37
  }));
37
38
 
38
- let consumedEventSchema = S.literal("ItemAdded");
39
+ let consumedEventSchema = Sury.literal("ItemAdded");
39
40
 
40
- let commandSchema = S.schema(s => ({
41
+ let commandSchema = Sury.$schema(s => ({
41
42
  TAG: "AddItem",
42
43
  id: s.m(DcbTag$Reventless.string),
43
- name: s.m(S.string)
44
+ name: s.m(Sury.string)
44
45
  }));
45
46
 
46
- let errorSchema = S.literal("ItemAlreadyExists");
47
+ let errorSchema = Sury.literal("ItemAlreadyExists");
47
48
 
48
49
  function commandAuthorization(param) {
49
50
  return "AllowAuthenticated";
@@ -147,7 +148,7 @@ async function publishJsons(cmdJsons) {
147
148
  ],
148
149
  [
149
150
  "meta",
150
- S.reverseConvertToJsonOrThrow(cmdJson.meta, Message$Reventless.metaSchema)
151
+ Util_Sury$Reventless.toJson(cmdJson.meta, Message$Reventless.metaSchema)
151
152
  ],
152
153
  [
153
154
  "command",
@@ -194,7 +195,7 @@ function typeQuery(eventType) {
194
195
  }
195
196
 
196
197
  function addItemJson(id, name) {
197
- return S.reverseConvertToJsonOrThrow({
198
+ return Util_Sury$Reventless.toJson({
198
199
  TAG: "AddItem",
199
200
  id: id,
200
201
  name: name