@reventlessdev/reventless-core 3.0.0-alpha.238 → 3.0.0-alpha.240

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 (178) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/package.json +12 -12
  3. package/src/Message.res +11 -11
  4. package/src/Message.res.mjs +15 -14
  5. package/src/Projection.res +2 -2
  6. package/src/Projection.res.mjs +5 -4
  7. package/src/adapter/Monitoring/Monitoring.res +24 -2
  8. package/src/adapter/Monitoring/Monitoring.res.mjs +3 -3
  9. package/src/admin/Platform_AdminApi.res.mjs +3 -3
  10. package/src/admin/Platform_Admin_Structure.res +33 -112
  11. package/src/admin/Platform_Admin_Structure.res.mjs +8 -138
  12. package/src/admin/Platform_ComponentDefinitionsApi.res +2 -1
  13. package/src/admin/Platform_ComponentDefinitionsApi.res.mjs +5 -1
  14. package/src/admin/UiFragmentRegistry/StateChangeSlice/UiFragmentRegistry.res.mjs +12 -12
  15. package/src/admin/UiFragmentRegistry/StateViewSlice/UiFragments.res.mjs +14 -14
  16. package/src/components/Aggregate/Aggregate_Callback.res +2 -2
  17. package/src/components/Aggregate/Aggregate_Callback.res.mjs +4 -4
  18. package/src/components/Api/ApiAllowedStatesHelpers.res.mjs +3 -3
  19. package/src/components/Api/ApiNoApiHelpers.res.mjs +5 -5
  20. package/src/components/Api/ApiTargetStateHelpers.res.mjs +3 -3
  21. package/src/components/Api/GraphQL_FragmentGenerator.res +140 -24
  22. package/src/components/Api/GraphQL_FragmentGenerator.res.mjs +48 -21
  23. package/src/components/Api/GraphQL_SchemaInspector.res +1 -1
  24. package/src/components/Api/GraphQL_SchemaInspector.res.mjs +1 -1
  25. package/src/components/Api/MCP_SchemaGenerator.res +1 -1
  26. package/src/components/Api/MCP_SchemaGenerator.res.mjs +1 -1
  27. package/src/components/Api/SchemaType.res +6 -10
  28. package/src/components/Api/SchemaType.res.mjs +4 -4
  29. package/src/components/Api/StorageRefFields.res +1 -1
  30. package/src/components/Api/StorageRefFields.res.mjs +1 -1
  31. package/src/components/Api/SuryToJsonSchema.res +19 -0
  32. package/src/components/Api/SuryToJsonSchema.res.mjs +10 -5
  33. package/src/components/AutomationSlice/AutomationSlice_Callback.res +3 -4
  34. package/src/components/AutomationSlice/AutomationSlice_Callback.res.mjs +22 -23
  35. package/src/components/CommandTopic/CommandTopic_Callback.res +1 -2
  36. package/src/components/CommandTopic/CommandTopic_Callback.res.mjs +3 -4
  37. package/src/components/CommandTopic/CommandTopic_Helpers.res +1 -1
  38. package/src/components/CommandTopic/CommandTopic_Helpers.res.mjs +3 -3
  39. package/src/components/Counter/Counter.res.mjs +2 -2
  40. package/src/components/Counter/Counter_Callback.res.mjs +4 -4
  41. package/src/components/Counter/Counter_Operations.res.mjs +4 -4
  42. package/src/components/Dcb/Dcb_Builder.res +1 -1
  43. package/src/components/Dcb/Dcb_Builder.res.mjs +8 -6
  44. package/src/components/DcbEventLog/DcbEventLog_Builder.res.mjs +4 -3
  45. package/src/components/EventCollector/EventCollector_Builder.res +1 -1
  46. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res +1 -2
  47. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +11 -12
  48. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res +3 -4
  49. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +24 -25
  50. package/src/components/SideEffectHandler/SideEffectHandler_Callback.res +1 -1
  51. package/src/components/SideEffectHandler/SideEffectHandler_Callback.res.mjs +3 -3
  52. package/src/components/StateChangeSlice/StateChangeSlice_Callback.res +2 -2
  53. package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +4 -4
  54. package/src/components/StateViewSlice/StateViewSlice_Builder.res +1 -1
  55. package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +3 -3
  56. package/src/plugin/api/PluginBaseFragment.res +12 -29
  57. package/src/plugin/api/PluginBaseFragment.res.mjs +3 -22
  58. package/src/plugin/component/Capability_Inference.res +118 -1
  59. package/src/plugin/component/Capability_Inference.res.mjs +128 -1
  60. package/src/plugin/component/Plugin_Builder.res +9 -2
  61. package/src/plugin/component/Plugin_Builder.res.mjs +5 -2
  62. package/src/plugin/component/Plugin_Helpers.res +11 -11
  63. package/src/plugin/component/Plugin_Helpers.res.mjs +11 -10
  64. package/src/plugin/component/Plugin_Structure.res +458 -296
  65. package/src/plugin/component/Plugin_Structure.res.mjs +259 -182
  66. package/src/plugin/component/Plugin_SubscriptionSchema.res +1 -1
  67. package/src/plugin/component/Plugin_SubscriptionSchema.res.mjs +1 -1
  68. package/src/plugin/component/SchemaWalker.res +11 -11
  69. package/src/plugin/component/SchemaWalker.res.mjs +8 -9
  70. package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +15 -15
  71. package/src/plugin/lifecycle/PluginBehavior.res.mjs +55 -55
  72. package/src/plugin/lifecycle/PluginSpec.res +22 -7
  73. package/src/plugin/lifecycle/PluginSpec.res.mjs +91 -36
  74. package/src/plugin/lifecycle/PluginsReadModelSpec.res +36 -9
  75. package/src/plugin/lifecycle/PluginsReadModelSpec.res.mjs +33 -22
  76. package/src/util/Interstack.res +3 -3
  77. package/src/util/LogFormat.res +1 -2
  78. package/src/util/LogFormat.res.mjs +2 -2
  79. package/tests/IdentityTest.res +6 -7
  80. package/tests/IdentityTest.res.mjs +7 -9
  81. package/tests/adapter/MonitoringTest.res +30 -3
  82. package/tests/adapter/MonitoringTest.res.mjs +31 -12
  83. package/tests/adapter/RuntimeExtensionHookReachTest.res +0 -1
  84. package/tests/adapter/RuntimeExtensionHookReachTest.res.mjs +5 -7
  85. package/tests/admin/Platform_Admin_StructureTest.res +254 -0
  86. package/tests/admin/Platform_Admin_StructureTest.res.mjs +219 -0
  87. package/tests/admin/Platform_BakedManifestTest.res +1 -0
  88. package/tests/admin/Platform_BakedManifestTest.res.mjs +1 -0
  89. package/tests/admin/Platform_ComponentDefinitionsApiTest.res +3 -0
  90. package/tests/admin/Platform_ComponentDefinitionsApiTest.res.mjs +6 -0
  91. package/tests/admin/Platform_PluginStructuresApiTest.res +1 -0
  92. package/tests/admin/Platform_PluginStructuresApiTest.res.mjs +2 -0
  93. package/tests/aggregate/AggregateCacheTest.res +0 -1
  94. package/tests/aggregate/AggregateCacheTest.res.mjs +13 -15
  95. package/tests/aggregate/AggregateConflictTest.res +0 -1
  96. package/tests/aggregate/AggregateConflictTest.res.mjs +7 -9
  97. package/tests/aggregate/AggregateFixtures.res +0 -1
  98. package/tests/aggregate/AggregateFixtures.res.mjs +19 -21
  99. package/tests/aggregate/AggregateSnapshotTest.res +1 -2
  100. package/tests/aggregate/AggregateSnapshotTest.res.mjs +15 -16
  101. package/tests/api/ApiNoApiTest.res.mjs +17 -9
  102. package/tests/api/GraphQL_FragmentGeneratorTest.res +232 -0
  103. package/tests/api/GraphQL_FragmentGeneratorTest.res.mjs +207 -55
  104. package/tests/api/PsInternalFieldsReadModel.res +21 -0
  105. package/tests/api/PsInternalFieldsReadModel.res.mjs +74 -0
  106. package/tests/api/StorageRefFieldsTest.res.mjs +13 -13
  107. package/tests/api/SuryToJsonSchemaTest.res +73 -3
  108. package/tests/api/SuryToJsonSchemaTest.res.mjs +364 -816
  109. package/tests/commandgenerator/CommandGeneratorFixtures.res +0 -1
  110. package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +19 -21
  111. package/tests/commandgenerator/OwnerStampingTest.res +0 -1
  112. package/tests/commandgenerator/OwnerStampingTest.res.mjs +9 -11
  113. package/tests/commandtopic/CommandTopicCallbackFixtures.res +0 -1
  114. package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +7 -9
  115. package/tests/counter/CounterFixtures.res +0 -1
  116. package/tests/counter/CounterFixtures.res.mjs +1 -4
  117. package/tests/dcb/DcbDecodeTest.res.mjs +24 -24
  118. package/tests/dcb/DcbEventLogOperationsTest.res +2 -2
  119. package/tests/dcb/DcbEventLogOperationsTest.res.mjs +3 -3
  120. package/tests/dcb/DcbEventLogSchemaTest.res.mjs +7 -7
  121. package/tests/dcb/DcbFixtures.res +0 -1
  122. package/tests/dcb/DcbFixtures.res.mjs +87 -89
  123. package/tests/dcb/DcbTagTest.res.mjs +6 -6
  124. package/tests/dcb/DcbValidationTest.res.mjs +52 -52
  125. package/tests/eventlog/EventLogFixtures.res +0 -1
  126. package/tests/eventlog/EventLogFixtures.res.mjs +7 -9
  127. package/tests/eventmapper/EventMapperFixtures.res +0 -1
  128. package/tests/eventmapper/EventMapperFixtures.res.mjs +24 -26
  129. package/tests/eventtopic/EventTopicFixtures.res +0 -1
  130. package/tests/eventtopic/EventTopicFixtures.res.mjs +7 -9
  131. package/tests/extensionpoint/ExtensionPointFixtures.res +0 -1
  132. package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +10 -12
  133. package/tests/extensionpoint/ExtensionPointOperationsTest.res +1 -2
  134. package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +9 -10
  135. package/tests/logger/LogFormatTest.res +3 -2
  136. package/tests/logger/LogFormatTest.res.mjs +7 -9
  137. package/tests/message/MessageTest.res +2 -2
  138. package/tests/message/MessageTest.res.mjs +8 -7
  139. package/tests/message/MetaEnvelopeTest.res +5 -5
  140. package/tests/message/MetaEnvelopeTest.res.mjs +12 -11
  141. package/tests/plugin/ManifestVisibilityTest.res.mjs +7 -7
  142. package/tests/plugin/PluginDefinitionScalars.res +5 -3
  143. package/tests/plugin/PluginDefinitionScalars.res.mjs +2 -2
  144. package/tests/plugin/PluginLifecycleCorpusTest.res +4 -3
  145. package/tests/plugin/PluginLifecycleCorpusTest.res.mjs +3 -6
  146. package/tests/plugin/PluginSpecExperiment.res +0 -1
  147. package/tests/plugin/PluginSpecExperiment.res.mjs +12 -14
  148. package/tests/plugin/PluginStructureTest.res +292 -2
  149. package/tests/plugin/PluginStructureTest.res.mjs +391 -88
  150. package/tests/plugin/Plugin_EventQuerySchemaTest.res.mjs +3 -3
  151. package/tests/plugin/SchemaWalkerTest.res +0 -1
  152. package/tests/plugin/SchemaWalkerTest.res.mjs +17 -19
  153. package/tests/plugin/StateChangeSlice/PsAttachInvoice.res.mjs +5 -5
  154. package/tests/plugin/StateChangeSlice/PsChangePhoto.res.mjs +8 -8
  155. package/tests/plugin/StateChangeSlice/PsDispatchShipment.res.mjs +5 -5
  156. package/tests/plugin/StateChangeSlice/PsGatedCommands.res.mjs +9 -9
  157. package/tests/plugin/StateChangeSlice/PsPlaceOrder.res.mjs +5 -5
  158. package/tests/plugin/StateChangeSlice/PsReserveStock.res.mjs +8 -8
  159. package/tests/plugin/StateChangeSlice/PsShipOrder.res.mjs +15 -15
  160. package/tests/plugin/StateChangeSlice/PsTypoStore.res +31 -0
  161. package/tests/plugin/StateChangeSlice/PsTypoStore.res.mjs +62 -0
  162. package/tests/plugin/StateChangeSlice/PsUploadAvatar.res.mjs +8 -8
  163. package/tests/plugin/StateChangeSlice/PsUploadImages.res +40 -0
  164. package/tests/plugin/StateChangeSlice/PsUploadImages.res.mjs +66 -0
  165. package/tests/plugin/StateViewSlice/PsAnnotatedView.res.mjs +13 -12
  166. package/tests/plugin/StateViewSlice/PsAvailableProductsView.res.mjs +8 -8
  167. package/tests/plugin/StateViewSlice/PsCategoriesView.res.mjs +6 -6
  168. package/tests/plugin/StateViewSlice/PsCustomersView.res.mjs +10 -10
  169. package/tests/plugin/StateViewSlice/PsGatedView.res.mjs +6 -6
  170. package/tests/plugin/StateViewSlice/PsOrdersView.res.mjs +9 -9
  171. package/tests/plugin/StateViewSlice/PsShipmentsView.res.mjs +11 -10
  172. package/tests/plugin/pluginDefinitionRequiredScalars.txt +15 -0
  173. package/tests/querydb/QueryDbFixtures.res +0 -1
  174. package/tests/querydb/QueryDbFixtures.res.mjs +5 -7
  175. package/tests/sideeffecthandler/SideEffectHandlerFixtures.res +0 -1
  176. package/tests/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +4 -6
  177. package/tests/util/CommandPublisherTest.res +0 -1
  178. package/tests/util/CommandPublisherTest.res.mjs +4 -6
@@ -1,4 +1,3 @@
1
- S.enableJson()
2
1
 
3
2
  // ─────────────────────────────────────────────────────────────
4
3
  // Aggregate spec for CommandGenerator tests
@@ -1,32 +1,30 @@
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 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 = S.union([
13
- S.literal("Create"),
14
- S.schema(s => ({
10
+ let commandSchema = Sury.union([
11
+ Sury.literal("Create"),
12
+ Sury.$schema(s => ({
15
13
  TAG: "CreateWithName",
16
- name: s.m(S.string)
14
+ name: s.m(Sury.string)
17
15
  })),
18
- S.literal("Invalid")
16
+ Sury.literal("Invalid")
19
17
  ]);
20
18
 
21
- let eventSchema = S.union([
22
- S.literal("Created"),
23
- S.schema(s => ({
19
+ let eventSchema = Sury.union([
20
+ Sury.literal("Created"),
21
+ Sury.$schema(s => ({
24
22
  TAG: "CreatedWithName",
25
- name: s.m(S.string)
23
+ name: s.m(Sury.string)
26
24
  }))
27
25
  ]);
28
26
 
29
- let errorSchema = S.literal("InvalidCommand");
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 = S.schema(s => ({
112
+ let singleTagCommandSchema = Sury.$schema(s => ({
115
113
  TAG: "CreateItem",
116
114
  itemId: s.m(DcbTag$Reventless.string),
117
- name: s.m(S.string)
115
+ name: s.m(Sury.string)
118
116
  }));
119
117
 
120
- let compositeTagCommandSchema = S.schema(s => ({
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(S.string)
122
+ version: s.m(Sury.string)
125
123
  }));
126
124
 
127
- let optionalFieldCommandSchema = S.schema(s => ({
125
+ let optionalFieldCommandSchema = Sury.$schema(s => ({
128
126
  TAG: "StoreItem",
129
127
  itemId: s.m(DcbTag$Reventless.string),
130
- data: s.m(S.json),
131
- note: s.m(S.option(S.string))
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
- /* Not a pure module */
206
+ /* commandSchema Not a pure module */
@@ -1,6 +1,5 @@
1
1
  open JestGlobals
2
2
 
3
- S.enableJson()
4
3
 
5
4
  // Driven through `makeGenerateCommand` rather than by calling `stampOwnerFields`
6
5
  // directly. The unit under test is not really the stamp — it is the claim that
@@ -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_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
- S.enableJson();
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(S.string)
20
+ note: s.m(Sury.string)
23
21
  })),
24
- S.schema(s => ({
22
+ Sury.$schema(s => ({
25
23
  TAG: "ImportProducts",
26
24
  batchId: s.m(DcbTag$Reventless.string),
27
- source: s.m(S.string)
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", S.json, "StateChangeSlice", false);
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(S.json, "PlaceOrder")).toEqual([]);
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
- /* Not a pure module */
224
+ /* commandSchema Not a pure module */
@@ -1,4 +1,3 @@
1
- S.enableJson()
2
1
 
3
2
  // ─────────────────────────────────────────────────────────────
4
3
  // Command spec for CommandTopic_Callback tests
@@ -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 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 = S.union([
16
- S.schema(s => ({
13
+ let commandSchema = Sury.union([
14
+ Sury.$schema(s => ({
17
15
  TAG: "CreateItem",
18
- itemId: s.m(S.string)
16
+ itemId: s.m(Sury.string)
19
17
  })),
20
- S.schema(s => ({
18
+ Sury.$schema(s => ({
21
19
  TAG: "DeleteItem",
22
- itemId: s.m(S.string)
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
- /* Not a pure module */
150
+ /* commandSchema Not a pure module */
@@ -1,4 +1,3 @@
1
- S.enableJson()
2
1
 
3
2
  // ─────────────────────────────────────────────────────────────
4
3
  // Shared captures — reset in beforeEach
@@ -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
- /* Not a pure module */
64
+ /* TestCounterHandler Not a pure module */
@@ -1,57 +1,57 @@
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 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 = S.union([
9
- S.schema(s => ({
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(S.string)
12
+ name: s.m(Sury.string)
13
13
  })),
14
- S.schema(s => ({
14
+ Sury.$schema(s => ({
15
15
  TAG: "ItemRenamed",
16
16
  itemId: s.m(DcbTag$Reventless.string),
17
- newName: s.m(S.string)
17
+ newName: s.m(Sury.string)
18
18
  })),
19
- S.schema(s => ({
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 = S.union([
26
- S.literal("ItemCreated"),
27
- S.literal("ItemArchived")
25
+ let consumedPayloadLessSchema = Sury.union([
26
+ Sury.literal("ItemCreated"),
27
+ Sury.literal("ItemArchived")
28
28
  ]);
29
29
 
30
- let consumedPartialSchema = S.union([
31
- S.schema(s => ({
30
+ let consumedPartialSchema = Sury.union([
31
+ Sury.$schema(s => ({
32
32
  TAG: "ItemCreated",
33
- itemId: s.m(S.string)
33
+ itemId: s.m(Sury.string)
34
34
  })),
35
- S.schema(s => ({
35
+ Sury.$schema(s => ({
36
36
  TAG: "ItemRenamed",
37
- itemId: s.m(S.string)
37
+ itemId: s.m(Sury.string)
38
38
  }))
39
39
  ]);
40
40
 
41
- let consumedFullSchema = S.union([
42
- S.schema(s => ({
41
+ let consumedFullSchema = Sury.union([
42
+ Sury.$schema(s => ({
43
43
  TAG: "ItemCreated",
44
- itemId: s.m(S.string),
45
- name: s.m(S.string)
44
+ itemId: s.m(Sury.string),
45
+ name: s.m(Sury.string)
46
46
  })),
47
- S.schema(s => ({
47
+ Sury.$schema(s => ({
48
48
  TAG: "ItemRenamed",
49
- itemId: s.m(S.string),
50
- newName: s.m(S.string)
49
+ itemId: s.m(Sury.string),
50
+ newName: s.m(Sury.string)
51
51
  })),
52
- S.schema(s => ({
52
+ Sury.$schema(s => ({
53
53
  TAG: "ItemArchived",
54
- itemId: s.m(S.string)
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->S.reverseConvertToJsonOrThrow(DcbFixtures.TestEventLogSpec.eventSchema)
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->S.parseJsonOrThrow(DcbFixtures.TestEventLogSpec.eventSchema)
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 = S.reverseConvertToJsonOrThrow(event, DcbFixtures$ReventlessCore.TestEventLogSpec.eventSchema);
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 S.parseJsonOrThrow(json, DcbFixtures$ReventlessCore.TestEventLogSpec.eventSchema);
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 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
  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 S.object(s => {
11
- s.f("TAG", S.literal(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 = S.union([variant("CategoryAdded", [[
22
+ let addCategory = Sury.union([variant("CategoryAdded", [[
23
23
  "imageUrl",
24
24
  StorageRef$Reventless.forStore(undefined, "categoryImages")
25
25
  ]])]);
26
26
 
27
- let addProduct = S.union([variant("ProductAdded", [[
27
+ let addProduct = Sury.union([variant("ProductAdded", [[
28
28
  "imageUrl",
29
29
  StorageRef$Reventless.forStore(undefined, "productImages")
30
30
  ]])]);
31
31
 
32
- let renameCategory = S.union([variant("CategoryRenamed", [[
32
+ let renameCategory = Sury.union([variant("CategoryRenamed", [[
33
33
  "name",
34
- S.string
34
+ Sury.string
35
35
  ]])]);
36
36
 
37
37
  globalThis.describe("Dcb_Builder.mergedEventSchema", () => {
@@ -1,4 +1,3 @@
1
- S.enableJson()
2
1
 
3
2
  // --- Test Event Log Spec (events with DCB tags) ---
4
3