@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.
Files changed (172) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/package.json +11 -11
  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_Admin.res +1 -16
  10. package/src/admin/Platform_Admin.res.mjs +2 -30
  11. package/src/admin/Platform_AdminApi.res.mjs +3 -3
  12. package/src/admin/Platform_Admin_Structure.res +58 -113
  13. package/src/admin/Platform_Admin_Structure.res.mjs +24 -139
  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 +18 -12
  22. package/src/components/Api/GraphQL_FragmentGenerator.res.mjs +7 -13
  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 +11 -0
  32. package/src/components/Api/SuryToJsonSchema.res.mjs +2 -1
  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 +2 -2
  61. package/src/plugin/component/Plugin_Builder.res.mjs +2 -1
  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 +349 -274
  65. package/src/plugin/component/Plugin_Structure.res.mjs +212 -175
  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/aggregate/AggregateCacheTest.res +0 -1
  88. package/tests/aggregate/AggregateCacheTest.res.mjs +13 -15
  89. package/tests/aggregate/AggregateConflictTest.res +0 -1
  90. package/tests/aggregate/AggregateConflictTest.res.mjs +7 -9
  91. package/tests/aggregate/AggregateFixtures.res +0 -1
  92. package/tests/aggregate/AggregateFixtures.res.mjs +19 -21
  93. package/tests/aggregate/AggregateSnapshotTest.res +1 -2
  94. package/tests/aggregate/AggregateSnapshotTest.res.mjs +15 -16
  95. package/tests/api/ApiNoApiTest.res.mjs +17 -9
  96. package/tests/api/GraphQL_FragmentGeneratorTest.res +62 -1
  97. package/tests/api/GraphQL_FragmentGeneratorTest.res.mjs +102 -58
  98. package/tests/api/PsInternalFieldsReadModel.res +21 -0
  99. package/tests/api/PsInternalFieldsReadModel.res.mjs +74 -0
  100. package/tests/api/StorageRefFieldsTest.res.mjs +13 -13
  101. package/tests/api/SuryToJsonSchemaTest.res +43 -0
  102. package/tests/api/SuryToJsonSchemaTest.res.mjs +352 -849
  103. package/tests/commandgenerator/CommandGeneratorFixtures.res +0 -1
  104. package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +19 -21
  105. package/tests/commandgenerator/OwnerStampingTest.res +0 -1
  106. package/tests/commandgenerator/OwnerStampingTest.res.mjs +9 -11
  107. package/tests/commandtopic/CommandTopicCallbackFixtures.res +0 -1
  108. package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +7 -9
  109. package/tests/counter/CounterFixtures.res +0 -1
  110. package/tests/counter/CounterFixtures.res.mjs +1 -4
  111. package/tests/dcb/DcbDecodeTest.res.mjs +24 -24
  112. package/tests/dcb/DcbEventLogOperationsTest.res +2 -2
  113. package/tests/dcb/DcbEventLogOperationsTest.res.mjs +3 -3
  114. package/tests/dcb/DcbEventLogSchemaTest.res.mjs +7 -7
  115. package/tests/dcb/DcbFixtures.res +0 -1
  116. package/tests/dcb/DcbFixtures.res.mjs +87 -89
  117. package/tests/dcb/DcbTagTest.res.mjs +6 -6
  118. package/tests/dcb/DcbValidationTest.res.mjs +52 -52
  119. package/tests/eventlog/EventLogFixtures.res +0 -1
  120. package/tests/eventlog/EventLogFixtures.res.mjs +7 -9
  121. package/tests/eventmapper/EventMapperFixtures.res +0 -1
  122. package/tests/eventmapper/EventMapperFixtures.res.mjs +24 -26
  123. package/tests/eventtopic/EventTopicFixtures.res +0 -1
  124. package/tests/eventtopic/EventTopicFixtures.res.mjs +7 -9
  125. package/tests/extensionpoint/ExtensionPointFixtures.res +0 -1
  126. package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +10 -12
  127. package/tests/extensionpoint/ExtensionPointOperationsTest.res +1 -2
  128. package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +9 -10
  129. package/tests/logger/LogFormatTest.res +3 -2
  130. package/tests/logger/LogFormatTest.res.mjs +7 -9
  131. package/tests/message/MessageTest.res +2 -2
  132. package/tests/message/MessageTest.res.mjs +8 -7
  133. package/tests/message/MetaEnvelopeTest.res +5 -5
  134. package/tests/message/MetaEnvelopeTest.res.mjs +12 -11
  135. package/tests/plugin/ManifestVisibilityTest.res.mjs +7 -7
  136. package/tests/plugin/PluginDefinitionScalars.res +5 -3
  137. package/tests/plugin/PluginDefinitionScalars.res.mjs +2 -2
  138. package/tests/plugin/PluginLifecycleCorpusTest.res +4 -3
  139. package/tests/plugin/PluginLifecycleCorpusTest.res.mjs +3 -6
  140. package/tests/plugin/PluginSpecExperiment.res +0 -1
  141. package/tests/plugin/PluginSpecExperiment.res.mjs +12 -14
  142. package/tests/plugin/PluginStructureTest.res +188 -1
  143. package/tests/plugin/PluginStructureTest.res.mjs +293 -102
  144. package/tests/plugin/Plugin_EventQuerySchemaTest.res.mjs +3 -3
  145. package/tests/plugin/SchemaWalkerTest.res +0 -1
  146. package/tests/plugin/SchemaWalkerTest.res.mjs +17 -19
  147. package/tests/plugin/StateChangeSlice/PsAttachInvoice.res.mjs +5 -5
  148. package/tests/plugin/StateChangeSlice/PsChangePhoto.res.mjs +8 -8
  149. package/tests/plugin/StateChangeSlice/PsDispatchShipment.res.mjs +5 -5
  150. package/tests/plugin/StateChangeSlice/PsGatedCommands.res.mjs +9 -9
  151. package/tests/plugin/StateChangeSlice/PsPlaceOrder.res.mjs +5 -5
  152. package/tests/plugin/StateChangeSlice/PsReserveStock.res.mjs +8 -8
  153. package/tests/plugin/StateChangeSlice/PsShipOrder.res.mjs +15 -15
  154. package/tests/plugin/StateChangeSlice/PsTypoStore.res +31 -0
  155. package/tests/plugin/StateChangeSlice/PsTypoStore.res.mjs +62 -0
  156. package/tests/plugin/StateChangeSlice/PsUploadAvatar.res.mjs +8 -8
  157. package/tests/plugin/StateChangeSlice/PsUploadImages.res +40 -0
  158. package/tests/plugin/StateChangeSlice/PsUploadImages.res.mjs +66 -0
  159. package/tests/plugin/StateViewSlice/PsAnnotatedView.res.mjs +13 -12
  160. package/tests/plugin/StateViewSlice/PsAvailableProductsView.res.mjs +8 -8
  161. package/tests/plugin/StateViewSlice/PsCategoriesView.res.mjs +6 -6
  162. package/tests/plugin/StateViewSlice/PsCustomersView.res.mjs +10 -10
  163. package/tests/plugin/StateViewSlice/PsGatedView.res.mjs +6 -6
  164. package/tests/plugin/StateViewSlice/PsOrdersView.res.mjs +9 -9
  165. package/tests/plugin/StateViewSlice/PsShipmentsView.res.mjs +11 -10
  166. package/tests/plugin/pluginDefinitionRequiredScalars.txt +15 -0
  167. package/tests/querydb/QueryDbFixtures.res +0 -1
  168. package/tests/querydb/QueryDbFixtures.res.mjs +5 -7
  169. package/tests/sideeffecthandler/SideEffectHandlerFixtures.res +0 -1
  170. package/tests/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +4 -6
  171. package/tests/util/CommandPublisherTest.res +0 -1
  172. package/tests/util/CommandPublisherTest.res.mjs +4 -6
@@ -1,11 +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 Plugin_EventQuerySchema$ReventlessCore from "../../src/plugin/component/Plugin_EventQuerySchema.res.mjs";
5
5
 
6
- let eventSchema = S.schema(s => ({
6
+ let eventSchema = Sury.$schema(s => ({
7
7
  TAG: "Happened",
8
- thingId: s.m(S.string)
8
+ thingId: s.m(Sury.string)
9
9
  }));
10
10
 
11
11
  let SomeEvent = {
@@ -1,6 +1,5 @@
1
1
  open JestGlobals
2
2
 
3
- S.enableJson()
4
3
 
5
4
  @schema
6
5
  type simpleRecord = {
@@ -1,30 +1,28 @@
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_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
5
5
  import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
6
6
  import * as SchemaWalker$ReventlessCore from "../../src/plugin/component/SchemaWalker.res.mjs";
7
7
 
8
- S.enableJson();
9
-
10
- let simpleRecordSchema = S.schema(s => ({
11
- label: s.m(S.string),
12
- count: s.m(S.int),
13
- rating: s.m(S.option(S.float))
8
+ let simpleRecordSchema = Sury.$schema(s => ({
9
+ label: s.m(Sury.string),
10
+ count: s.m(Sury.int),
11
+ rating: s.m(Sury.$option(Sury.float))
14
12
  }));
15
13
 
16
- let simpleVariantSchema = S.union([
17
- S.schema(s => ({
14
+ let simpleVariantSchema = Sury.union([
15
+ Sury.$schema(s => ({
18
16
  TAG: "Added",
19
- id: s.m(S.string),
20
- name: s.m(S.string)
17
+ id: s.m(Sury.string),
18
+ name: s.m(Sury.string)
21
19
  })),
22
- S.schema(s => ({
20
+ Sury.$schema(s => ({
23
21
  TAG: "Renamed",
24
- id: s.m(S.string),
25
- newName: s.m(S.string)
22
+ id: s.m(Sury.string),
23
+ newName: s.m(Sury.string)
26
24
  })),
27
- S.literal("Removed")
25
+ Sury.literal("Removed")
28
26
  ]);
29
27
 
30
28
  globalThis.describe("SchemaWalker:", () => {
@@ -139,15 +137,15 @@ globalThis.describe("SchemaWalker:", () => {
139
137
  });
140
138
  globalThis.describe("scalar / unsupported schema", () => {
141
139
  globalThis.test("plain string schema → kind unknown", () => {
142
- let result = SchemaWalker$ReventlessCore.walk("Scalar", S.string);
140
+ let result = SchemaWalker$ReventlessCore.walk("Scalar", Sury.string);
143
141
  globalThis.expect(result.kind).toBe("unknown");
144
142
  });
145
143
  globalThis.test("plain string schema → empty fields", () => {
146
- let result = SchemaWalker$ReventlessCore.walk("Scalar", S.string);
144
+ let result = SchemaWalker$ReventlessCore.walk("Scalar", Sury.string);
147
145
  globalThis.expect(result.fields).toEqual([]);
148
146
  });
149
147
  globalThis.test("plain string schema → empty structuralHash", () => {
150
- let result = SchemaWalker$ReventlessCore.walk("Scalar", S.string);
148
+ let result = SchemaWalker$ReventlessCore.walk("Scalar", Sury.string);
151
149
  globalThis.expect(result.structuralHash).toBe("");
152
150
  });
153
151
  });
@@ -157,4 +155,4 @@ export {
157
155
  simpleRecordSchema,
158
156
  simpleVariantSchema,
159
157
  }
160
- /* Not a pure module */
158
+ /* simpleRecordSchema Not a pure module */
@@ -1,25 +1,25 @@
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
 
7
- let consumedEventSchema = S.literal("OrderPlaced");
7
+ let consumedEventSchema = Sury.literal("OrderPlaced");
8
8
 
9
9
  function evolve(_state, _event) {
10
10
  return true;
11
11
  }
12
12
 
13
- let commandSchema = S.schema(s => ({
13
+ let commandSchema = Sury.$schema(s => ({
14
14
  TAG: "AttachInvoice",
15
15
  orderId: s.m(DcbTag$Reventless.string),
16
16
  documentUrl: s.m(StorageRef$Reventless.forStore(undefined, "documents")),
17
17
  logoUrl: s.m(StorageRef$Reventless.forStore("branding", "logos"))
18
18
  }));
19
19
 
20
- let errorSchema = S.literal("OrderNotFound");
20
+ let errorSchema = Sury.literal("OrderNotFound");
21
21
 
22
- let eventSchema = S.schema(s => ({
22
+ let eventSchema = Sury.$schema(s => ({
23
23
  TAG: "InvoiceAttached",
24
24
  orderId: s.m(DcbTag$Reventless.string),
25
25
  documentUrl: s.m(StorageRef$Reventless.forStore(undefined, "documents"))
@@ -1,28 +1,28 @@
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
 
7
- let consumedEventSchema = S.literal("OrderPlaced");
7
+ let consumedEventSchema = Sury.literal("OrderPlaced");
8
8
 
9
9
  function evolve(_state, _event) {
10
10
  return true;
11
11
  }
12
12
 
13
- let commandSchema = S.schema(s => ({
13
+ let commandSchema = Sury.$schema(s => ({
14
14
  TAG: "ChangePhoto",
15
15
  productId: s.m(DcbTag$Reventless.string),
16
- photoUrl: s.m(S.string),
17
- caption: s.m(S.string)
16
+ photoUrl: s.m(Sury.string),
17
+ caption: s.m(Sury.string)
18
18
  }));
19
19
 
20
- let errorSchema = S.literal("ProductNotFound");
20
+ let errorSchema = Sury.literal("ProductNotFound");
21
21
 
22
- let eventSchema = S.schema(s => ({
22
+ let eventSchema = Sury.$schema(s => ({
23
23
  TAG: "PhotoChanged",
24
24
  productId: s.m(DcbTag$Reventless.string),
25
- photoUrl: s.m(S.string),
25
+ photoUrl: s.m(Sury.string),
26
26
  thumbnail: s.m(StorageRef$Reventless.forStore(undefined, "productPhotos"))
27
27
  }));
28
28
 
@@ -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";
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 Api$ReventlessInfra from "@reventlessdev/reventless-infra/src/components/Api.res.mjs";
6
6
 
7
- let consumedEventSchema = S.schema(s => ({
7
+ let consumedEventSchema = Sury.$schema(s => ({
8
8
  TAG: "ShipmentBooked",
9
9
  shipmentId: s.m(DcbTag$Reventless.string)
10
10
  }));
@@ -13,14 +13,14 @@ function evolve(_state, _event) {
13
13
  return true;
14
14
  }
15
15
 
16
- let commandSchema = S.schema(s => ({
16
+ let commandSchema = Sury.$schema(s => ({
17
17
  TAG: "DispatchShipment",
18
18
  shipmentId: s.m(DcbTag$Reventless.string)
19
19
  }));
20
20
 
21
- let errorSchema = S.literal("ShipmentNotFound");
21
+ let errorSchema = Sury.literal("ShipmentNotFound");
22
22
 
23
- let eventSchema = S.schema(s => ({
23
+ let eventSchema = Sury.$schema(s => ({
24
24
  TAG: "ShipmentDispatched",
25
25
  shipmentId: s.m(DcbTag$Reventless.string)
26
26
  }));
@@ -1,9 +1,9 @@
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
- let consumedEventSchema = S.schema(s => ({
6
+ let consumedEventSchema = Sury.$schema(s => ({
7
7
  TAG: "StockLow",
8
8
  productId: s.m(DcbTag$Reventless.string)
9
9
  }));
@@ -12,25 +12,25 @@ function evolve(_state, _event) {
12
12
  return true;
13
13
  }
14
14
 
15
- let commandSchema = S.union([
16
- S.schema(s => ({
15
+ let commandSchema = Sury.union([
16
+ Sury.$schema(s => ({
17
17
  TAG: "Restock",
18
18
  productId: s.m(DcbTag$Reventless.string)
19
19
  })),
20
- S.schema(s => ({
20
+ Sury.$schema(s => ({
21
21
  TAG: "RequestRestock",
22
22
  productId: s.m(DcbTag$Reventless.string)
23
23
  }))
24
24
  ]);
25
25
 
26
- let errorSchema = S.literal("UnknownProduct");
26
+ let errorSchema = Sury.literal("UnknownProduct");
27
27
 
28
- let eventSchema = S.union([
29
- S.schema(s => ({
28
+ let eventSchema = Sury.union([
29
+ Sury.$schema(s => ({
30
30
  TAG: "Restocked",
31
31
  productId: s.m(DcbTag$Reventless.string)
32
32
  })),
33
- S.schema(s => ({
33
+ Sury.$schema(s => ({
34
34
  TAG: "RestockRequested",
35
35
  productId: s.m(DcbTag$Reventless.string)
36
36
  }))
@@ -1,9 +1,9 @@
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
- let consumedEventSchema = S.schema(s => ({
6
+ let consumedEventSchema = Sury.$schema(s => ({
7
7
  TAG: "CatalogProductSynced",
8
8
  productId: s.m(DcbTag$Reventless.string)
9
9
  }));
@@ -12,14 +12,14 @@ function evolve(_state, _event) {
12
12
  return true;
13
13
  }
14
14
 
15
- let commandSchema = S.schema(s => ({
15
+ let commandSchema = Sury.$schema(s => ({
16
16
  TAG: "PlaceOrder",
17
17
  orderId: s.m(DcbTag$Reventless.string)
18
18
  }));
19
19
 
20
- let errorSchema = S.literal("AlreadyPlaced");
20
+ let errorSchema = Sury.literal("AlreadyPlaced");
21
21
 
22
- let eventSchema = S.schema(s => ({
22
+ let eventSchema = Sury.$schema(s => ({
23
23
  TAG: "OrderPlaced",
24
24
  orderId: s.m(DcbTag$Reventless.string)
25
25
  }));
@@ -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";
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 Reference$Reventless from "@reventlessdev/reventless-spec/src/components/Reference.res.mjs";
6
6
 
7
- let consumedEventSchema = S.schema(s => ({
7
+ let consumedEventSchema = Sury.$schema(s => ({
8
8
  TAG: "StockReserved",
9
9
  reservationId: s.m(DcbTag$Reventless.string)
10
10
  }));
@@ -13,20 +13,20 @@ function evolve(_state, _event) {
13
13
  return true;
14
14
  }
15
15
 
16
- let commandSchema = S.schema(s => ({
16
+ let commandSchema = Sury.$schema(s => ({
17
17
  TAG: "ReserveStock",
18
18
  reservationId: s.m(DcbTag$Reventless.partition),
19
19
  customerId: s.m(Reference$Reventless.to_(undefined, undefined, "Customers")),
20
- productIds: s.m(S.array(Reference$Reventless.to_(undefined, "productId", "AvailableProducts"))),
21
- warehouseIds: s.m(S.option(S.array(Reference$Reventless.to_(undefined, "warehouseId", "Warehouses"))))
20
+ productIds: s.m(Sury.array(Reference$Reventless.to_(undefined, "productId", "AvailableProducts"))),
21
+ warehouseIds: s.m(Sury.$option(Sury.array(Reference$Reventless.to_(undefined, "warehouseId", "Warehouses"))))
22
22
  }));
23
23
 
24
- let errorSchema = S.literal("OutOfStock");
24
+ let errorSchema = Sury.literal("OutOfStock");
25
25
 
26
- let eventSchema = S.schema(s => ({
26
+ let eventSchema = Sury.$schema(s => ({
27
27
  TAG: "StockReserved",
28
28
  reservationId: s.m(DcbTag$Reventless.partition),
29
- productIds: s.m(S.array(Reference$Reventless.to_(undefined, "productId", "AvailableProducts")))
29
+ productIds: s.m(Sury.array(Reference$Reventless.to_(undefined, "productId", "AvailableProducts")))
30
30
  }));
31
31
 
32
32
  function decide(_state, _command) {
@@ -1,41 +1,41 @@
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 Api$ReventlessInfra from "@reventlessdev/reventless-infra/src/components/Api.res.mjs";
6
6
 
7
- let consumedEventSchema = S.union([
8
- S.literal("OrderPlaced"),
9
- S.literal("OrderShipped"),
10
- S.literal("OrderCancelled")
7
+ let consumedEventSchema = Sury.union([
8
+ Sury.literal("OrderPlaced"),
9
+ Sury.literal("OrderShipped"),
10
+ Sury.literal("OrderCancelled")
11
11
  ]);
12
12
 
13
13
  function evolve(_state, _event) {
14
14
  return true;
15
15
  }
16
16
 
17
- let commandSchema = S.union([
18
- S.schema(s => ({
17
+ let commandSchema = Sury.union([
18
+ Sury.$schema(s => ({
19
19
  TAG: "ShipOrder",
20
20
  orderId: s.m(DcbTag$Reventless.string)
21
21
  })),
22
- S.literal("CancelShipment")
22
+ Sury.literal("CancelShipment")
23
23
  ]);
24
24
 
25
- let errorSchema = S.union([
26
- S.literal("OrderNotFound"),
27
- S.schema(s => ({
25
+ let errorSchema = Sury.union([
26
+ Sury.literal("OrderNotFound"),
27
+ Sury.$schema(s => ({
28
28
  TAG: "NotShippable",
29
- reason: s.m(S.string)
29
+ reason: s.m(Sury.string)
30
30
  }))
31
31
  ]);
32
32
 
33
- let eventSchema = S.union([
34
- S.schema(s => ({
33
+ let eventSchema = Sury.union([
34
+ Sury.$schema(s => ({
35
35
  TAG: "OrderShipped",
36
36
  orderId: s.m(DcbTag$Reventless.string)
37
37
  })),
38
- S.literal("ShipmentVoided")
38
+ Sury.literal("ShipmentVoided")
39
39
  ]);
40
40
 
41
41
  function decide(_state, _command) {
@@ -0,0 +1,31 @@
1
+ // Test fixture spec for the near-duplicate-store check.
2
+ //
3
+ // Two uploadable fields whose names differ by a transposition. Both compile,
4
+ // both derive a store, and both would be provisioned — which is the failure the
5
+ // check exists to make loud, because nothing downstream can see it.
6
+
7
+ @@reventless.spec("TypoStore")
8
+
9
+ type state = bool
10
+ let initialState = false
11
+
12
+ @schema
13
+ type consumedEvent = ProductAdded
14
+
15
+ let evolve = (_state, _event) => true
16
+
17
+ @schema
18
+ type command =
19
+ | TypoStore({
20
+ productId: string,
21
+ productImage: Reventless.UploadableImage.t,
22
+ productImgae: Reventless.UploadableImage.t,
23
+ })
24
+
25
+ @schema
26
+ type error = ProductNotFound
27
+
28
+ @schema
29
+ type event = TypoStored({productId: string})
30
+
31
+ let decide = (_state, _command): result<array<event>, error> => Ok([])
@@ -0,0 +1,62 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Sury from "sury";
4
+ import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
5
+ import * as UploadableImage$Reventless from "@reventlessdev/reventless-spec/src/semantic/UploadableImage.res.mjs";
6
+
7
+ let consumedEventSchema = Sury.literal("ProductAdded");
8
+
9
+ function evolve(_state, _event) {
10
+ return true;
11
+ }
12
+
13
+ let commandSchema = Sury.$schema(s => ({
14
+ TAG: "TypoStore",
15
+ productId: s.m(DcbTag$Reventless.string),
16
+ productImage: s.m(UploadableImage$Reventless.forField(undefined, "productImages")),
17
+ productImgae: s.m(UploadableImage$Reventless.forField(undefined, "productImgaes"))
18
+ }));
19
+
20
+ let errorSchema = Sury.literal("ProductNotFound");
21
+
22
+ let eventSchema = Sury.$schema(s => ({
23
+ TAG: "TypoStored",
24
+ productId: s.m(DcbTag$Reventless.string)
25
+ }));
26
+
27
+ function decide(_state, _command) {
28
+ return {
29
+ TAG: "Ok",
30
+ _0: []
31
+ };
32
+ }
33
+
34
+ function commandAuthorization(param) {
35
+ return "AllowAuthenticated";
36
+ }
37
+
38
+ let name = "TypoStore";
39
+
40
+ let Id;
41
+
42
+ let initialState = false;
43
+
44
+ let moduleUrl = "@reventlessdev/reventless-core/tests/plugin/StateChangeSlice/PsTypoStore.res.mjs";
45
+
46
+ let readConsistency = "EscalateOnRetry";
47
+
48
+ export {
49
+ name,
50
+ Id,
51
+ initialState,
52
+ consumedEventSchema,
53
+ evolve,
54
+ commandSchema,
55
+ errorSchema,
56
+ eventSchema,
57
+ decide,
58
+ moduleUrl,
59
+ commandAuthorization,
60
+ readConsistency,
61
+ }
62
+ /* consumedEventSchema Not a pure module */
@@ -1,29 +1,29 @@
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 Reference$Reventless from "@reventlessdev/reventless-spec/src/components/Reference.res.mjs";
6
6
  import * as StorageRef$Reventless from "@reventlessdev/reventless-spec/src/semantic/StorageRef.res.mjs";
7
7
 
8
- let consumedEventSchema = S.literal("OrderPlaced");
8
+ let consumedEventSchema = Sury.literal("OrderPlaced");
9
9
 
10
10
  function evolve(_state, _event) {
11
11
  return true;
12
12
  }
13
13
 
14
- let commandSchema = S.schema(s => ({
14
+ let commandSchema = Sury.$schema(s => ({
15
15
  TAG: "UploadAvatar",
16
16
  customerId: s.m(DcbTag$Reventless.string),
17
- avatarUrl: s.m(S.option(StorageRef$Reventless.forStore(undefined, "avatars"))),
18
- referredBy: s.m(S.option(Reference$Reventless.to_(undefined, undefined, "Customers")))
17
+ avatarUrl: s.m(Sury.$option(StorageRef$Reventless.forStore(undefined, "avatars"))),
18
+ referredBy: s.m(Sury.$option(Reference$Reventless.to_(undefined, undefined, "Customers")))
19
19
  }));
20
20
 
21
- let errorSchema = S.literal("CustomerNotFound");
21
+ let errorSchema = Sury.literal("CustomerNotFound");
22
22
 
23
- let eventSchema = S.schema(s => ({
23
+ let eventSchema = Sury.$schema(s => ({
24
24
  TAG: "AvatarUploaded",
25
25
  customerId: s.m(DcbTag$Reventless.string),
26
- avatarUrl: s.m(S.option(StorageRef$Reventless.forStore(undefined, "avatars")))
26
+ avatarUrl: s.m(Sury.$option(StorageRef$Reventless.forStore(undefined, "avatars")))
27
27
  }));
28
28
 
29
29
  function decide(_state, _command) {
@@ -0,0 +1,40 @@
1
+ // Test fixture spec for the uploadable semantic types.
2
+ //
3
+ // The store is not written anywhere: it is the field's name, pluralised. This
4
+ // fixture carries the four shapes the derivation has to get right — a required
5
+ // field, an optional one, an array (whose marker goes on the element), and an
6
+ // explicit `@storageRef` override that keeps the type's semantic while
7
+ // replacing the derived store.
8
+
9
+ @@reventless.spec("UploadImages")
10
+
11
+ type state = bool
12
+ let initialState = false
13
+
14
+ @schema
15
+ type consumedEvent = ProductAdded
16
+
17
+ let evolve = (_state, _event) => true
18
+
19
+ @schema
20
+ type command =
21
+ | UploadImages({
22
+ productId: string,
23
+ // → `productImages`
24
+ productImage: Reventless.UploadableImage.t,
25
+ // → `categoryImages`, through the optional wrapper
26
+ categoryImage?: Reventless.UploadableImage.t,
27
+ // → `datasheets`; already plural, so the derivation is idempotent
28
+ datasheets: array<Reventless.UploadableFile.t>,
29
+ // The documented override: another plugin's store, and the field keeps
30
+ // `uploadableImage` rather than being downgraded to a bare storage ref.
31
+ @storageRef("branding.logos") logo: Reventless.UploadableImage.t,
32
+ })
33
+
34
+ @schema
35
+ type error = ProductNotFound
36
+
37
+ @schema
38
+ type event = ImagesUploaded({productId: string, productImage: Reventless.UploadableImage.t})
39
+
40
+ let decide = (_state, _command): result<array<event>, error> => Ok([])
@@ -0,0 +1,66 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Sury from "sury";
4
+ import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
5
+ import * as UploadableFile$Reventless from "@reventlessdev/reventless-spec/src/semantic/UploadableFile.res.mjs";
6
+ import * as UploadableImage$Reventless from "@reventlessdev/reventless-spec/src/semantic/UploadableImage.res.mjs";
7
+
8
+ let consumedEventSchema = Sury.literal("ProductAdded");
9
+
10
+ function evolve(_state, _event) {
11
+ return true;
12
+ }
13
+
14
+ let commandSchema = Sury.$schema(s => ({
15
+ TAG: "UploadImages",
16
+ productId: s.m(DcbTag$Reventless.string),
17
+ productImage: s.m(UploadableImage$Reventless.forField(undefined, "productImages")),
18
+ categoryImage: s.m(Sury.$option(UploadableImage$Reventless.forField(undefined, "categoryImages"))),
19
+ datasheets: s.m(Sury.array(UploadableFile$Reventless.forField(undefined, "datasheets"))),
20
+ logo: s.m(UploadableImage$Reventless.forField("branding", "logos"))
21
+ }));
22
+
23
+ let errorSchema = Sury.literal("ProductNotFound");
24
+
25
+ let eventSchema = Sury.$schema(s => ({
26
+ TAG: "ImagesUploaded",
27
+ productId: s.m(DcbTag$Reventless.string),
28
+ productImage: s.m(UploadableImage$Reventless.forField(undefined, "productImages"))
29
+ }));
30
+
31
+ function decide(_state, _command) {
32
+ return {
33
+ TAG: "Ok",
34
+ _0: []
35
+ };
36
+ }
37
+
38
+ function commandAuthorization(param) {
39
+ return "AllowAuthenticated";
40
+ }
41
+
42
+ let name = "UploadImages";
43
+
44
+ let Id;
45
+
46
+ let initialState = false;
47
+
48
+ let moduleUrl = "@reventlessdev/reventless-core/tests/plugin/StateChangeSlice/PsUploadImages.res.mjs";
49
+
50
+ let readConsistency = "EscalateOnRetry";
51
+
52
+ export {
53
+ name,
54
+ Id,
55
+ initialState,
56
+ consumedEventSchema,
57
+ evolve,
58
+ commandSchema,
59
+ errorSchema,
60
+ eventSchema,
61
+ decide,
62
+ moduleUrl,
63
+ commandAuthorization,
64
+ readConsistency,
65
+ }
66
+ /* consumedEventSchema Not a pure module */
@@ -1,25 +1,25 @@
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 ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
6
6
  import * as StateAnnotations$Reventless from "@reventlessdev/reventless-spec/src/components/StateAnnotations.res.mjs";
7
7
 
8
- let consumedEventSchema = S.schema(s => ({
8
+ let consumedEventSchema = Sury.$schema(s => ({
9
9
  TAG: "ItemRecorded",
10
10
  itemId: s.m(DcbTag$Reventless.string),
11
11
  ownerId: s.m(DcbTag$Reventless.string),
12
- version: s.m(S.string),
13
- name: s.m(S.string),
14
- total: s.m(S.float)
12
+ version: s.m(Sury.string),
13
+ name: s.m(Sury.string),
14
+ total: s.m(Sury.float)
15
15
  }));
16
16
 
17
- let stateSchema = S.schema(s => ({
18
- itemId: s.m(S.string),
19
- version: s.m(S.string),
20
- ownerId: s.m(S.string),
21
- name: s.m(S.string),
22
- total: s.m(S.float)
17
+ let stateSchema = Sury.$schema(s => ({
18
+ itemId: s.m(Sury.string),
19
+ version: s.m(Sury.string),
20
+ ownerId: s.m(Sury.string),
21
+ name: s.m(Sury.string),
22
+ total: s.m(Sury.float)
23
23
  }));
24
24
 
25
25
  function project(param) {
@@ -52,7 +52,7 @@ let subIdConfig = {
52
52
 
53
53
  let makeId = (state => state.itemId);
54
54
 
55
- let stateSchema$1 = S.Metadata.set(stateSchema, StateAnnotations$Reventless.stateAnnotationsId, {
55
+ let stateSchema$1 = Sury.$Metadata_set(stateSchema, StateAnnotations$Reventless.stateAnnotationsId, {
56
56
  ids: ["itemId"],
57
57
  compositeIds: [],
58
58
  subIds: ["version"],
@@ -63,6 +63,7 @@ let stateSchema$1 = S.Metadata.set(stateSchema, StateAnnotations$Reventless.stat
63
63
  ]],
64
64
  hidden: [],
65
65
  summary: [],
66
+ internal: [],
66
67
  drillTargets: [],
67
68
  drillTargetKeys: [],
68
69
  collapsed: [],