@reventlessdev/reventless-core 3.0.0-alpha.239 → 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 (170) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/package.json +9 -9
  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 -113
  11. package/src/admin/Platform_Admin_Structure.res.mjs +8 -139
  12. package/src/admin/UiFragmentRegistry/StateChangeSlice/UiFragmentRegistry.res.mjs +12 -12
  13. package/src/admin/UiFragmentRegistry/StateViewSlice/UiFragments.res.mjs +14 -14
  14. package/src/components/Aggregate/Aggregate_Callback.res +2 -2
  15. package/src/components/Aggregate/Aggregate_Callback.res.mjs +4 -4
  16. package/src/components/Api/ApiAllowedStatesHelpers.res.mjs +3 -3
  17. package/src/components/Api/ApiNoApiHelpers.res.mjs +5 -5
  18. package/src/components/Api/ApiTargetStateHelpers.res.mjs +3 -3
  19. package/src/components/Api/GraphQL_FragmentGenerator.res +18 -12
  20. package/src/components/Api/GraphQL_FragmentGenerator.res.mjs +7 -13
  21. package/src/components/Api/GraphQL_SchemaInspector.res +1 -1
  22. package/src/components/Api/GraphQL_SchemaInspector.res.mjs +1 -1
  23. package/src/components/Api/MCP_SchemaGenerator.res +1 -1
  24. package/src/components/Api/MCP_SchemaGenerator.res.mjs +1 -1
  25. package/src/components/Api/SchemaType.res +6 -10
  26. package/src/components/Api/SchemaType.res.mjs +4 -4
  27. package/src/components/Api/StorageRefFields.res +1 -1
  28. package/src/components/Api/StorageRefFields.res.mjs +1 -1
  29. package/src/components/Api/SuryToJsonSchema.res +11 -0
  30. package/src/components/Api/SuryToJsonSchema.res.mjs +2 -1
  31. package/src/components/AutomationSlice/AutomationSlice_Callback.res +3 -4
  32. package/src/components/AutomationSlice/AutomationSlice_Callback.res.mjs +22 -23
  33. package/src/components/CommandTopic/CommandTopic_Callback.res +1 -2
  34. package/src/components/CommandTopic/CommandTopic_Callback.res.mjs +3 -4
  35. package/src/components/CommandTopic/CommandTopic_Helpers.res +1 -1
  36. package/src/components/CommandTopic/CommandTopic_Helpers.res.mjs +3 -3
  37. package/src/components/Counter/Counter.res.mjs +2 -2
  38. package/src/components/Counter/Counter_Callback.res.mjs +4 -4
  39. package/src/components/Counter/Counter_Operations.res.mjs +4 -4
  40. package/src/components/Dcb/Dcb_Builder.res +1 -1
  41. package/src/components/Dcb/Dcb_Builder.res.mjs +8 -6
  42. package/src/components/DcbEventLog/DcbEventLog_Builder.res.mjs +4 -3
  43. package/src/components/EventCollector/EventCollector_Builder.res +1 -1
  44. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res +1 -2
  45. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +11 -12
  46. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res +3 -4
  47. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +24 -25
  48. package/src/components/SideEffectHandler/SideEffectHandler_Callback.res +1 -1
  49. package/src/components/SideEffectHandler/SideEffectHandler_Callback.res.mjs +3 -3
  50. package/src/components/StateChangeSlice/StateChangeSlice_Callback.res +2 -2
  51. package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +4 -4
  52. package/src/components/StateViewSlice/StateViewSlice_Builder.res +1 -1
  53. package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +3 -3
  54. package/src/plugin/api/PluginBaseFragment.res +12 -29
  55. package/src/plugin/api/PluginBaseFragment.res.mjs +3 -22
  56. package/src/plugin/component/Capability_Inference.res +118 -1
  57. package/src/plugin/component/Capability_Inference.res.mjs +128 -1
  58. package/src/plugin/component/Plugin_Builder.res +2 -2
  59. package/src/plugin/component/Plugin_Builder.res.mjs +2 -1
  60. package/src/plugin/component/Plugin_Helpers.res +11 -11
  61. package/src/plugin/component/Plugin_Helpers.res.mjs +11 -10
  62. package/src/plugin/component/Plugin_Structure.res +349 -274
  63. package/src/plugin/component/Plugin_Structure.res.mjs +212 -175
  64. package/src/plugin/component/Plugin_SubscriptionSchema.res +1 -1
  65. package/src/plugin/component/Plugin_SubscriptionSchema.res.mjs +1 -1
  66. package/src/plugin/component/SchemaWalker.res +11 -11
  67. package/src/plugin/component/SchemaWalker.res.mjs +8 -9
  68. package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +15 -15
  69. package/src/plugin/lifecycle/PluginBehavior.res.mjs +55 -55
  70. package/src/plugin/lifecycle/PluginSpec.res +22 -7
  71. package/src/plugin/lifecycle/PluginSpec.res.mjs +91 -36
  72. package/src/plugin/lifecycle/PluginsReadModelSpec.res +36 -9
  73. package/src/plugin/lifecycle/PluginsReadModelSpec.res.mjs +33 -22
  74. package/src/util/Interstack.res +3 -3
  75. package/src/util/LogFormat.res +1 -2
  76. package/src/util/LogFormat.res.mjs +2 -2
  77. package/tests/IdentityTest.res +6 -7
  78. package/tests/IdentityTest.res.mjs +7 -9
  79. package/tests/adapter/MonitoringTest.res +30 -3
  80. package/tests/adapter/MonitoringTest.res.mjs +31 -12
  81. package/tests/adapter/RuntimeExtensionHookReachTest.res +0 -1
  82. package/tests/adapter/RuntimeExtensionHookReachTest.res.mjs +5 -7
  83. package/tests/admin/Platform_Admin_StructureTest.res +254 -0
  84. package/tests/admin/Platform_Admin_StructureTest.res.mjs +219 -0
  85. package/tests/aggregate/AggregateCacheTest.res +0 -1
  86. package/tests/aggregate/AggregateCacheTest.res.mjs +13 -15
  87. package/tests/aggregate/AggregateConflictTest.res +0 -1
  88. package/tests/aggregate/AggregateConflictTest.res.mjs +7 -9
  89. package/tests/aggregate/AggregateFixtures.res +0 -1
  90. package/tests/aggregate/AggregateFixtures.res.mjs +19 -21
  91. package/tests/aggregate/AggregateSnapshotTest.res +1 -2
  92. package/tests/aggregate/AggregateSnapshotTest.res.mjs +15 -16
  93. package/tests/api/ApiNoApiTest.res.mjs +17 -9
  94. package/tests/api/GraphQL_FragmentGeneratorTest.res +62 -1
  95. package/tests/api/GraphQL_FragmentGeneratorTest.res.mjs +102 -58
  96. package/tests/api/PsInternalFieldsReadModel.res +21 -0
  97. package/tests/api/PsInternalFieldsReadModel.res.mjs +74 -0
  98. package/tests/api/StorageRefFieldsTest.res.mjs +13 -13
  99. package/tests/api/SuryToJsonSchemaTest.res +43 -0
  100. package/tests/api/SuryToJsonSchemaTest.res.mjs +352 -849
  101. package/tests/commandgenerator/CommandGeneratorFixtures.res +0 -1
  102. package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +19 -21
  103. package/tests/commandgenerator/OwnerStampingTest.res +0 -1
  104. package/tests/commandgenerator/OwnerStampingTest.res.mjs +9 -11
  105. package/tests/commandtopic/CommandTopicCallbackFixtures.res +0 -1
  106. package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +7 -9
  107. package/tests/counter/CounterFixtures.res +0 -1
  108. package/tests/counter/CounterFixtures.res.mjs +1 -4
  109. package/tests/dcb/DcbDecodeTest.res.mjs +24 -24
  110. package/tests/dcb/DcbEventLogOperationsTest.res +2 -2
  111. package/tests/dcb/DcbEventLogOperationsTest.res.mjs +3 -3
  112. package/tests/dcb/DcbEventLogSchemaTest.res.mjs +7 -7
  113. package/tests/dcb/DcbFixtures.res +0 -1
  114. package/tests/dcb/DcbFixtures.res.mjs +87 -89
  115. package/tests/dcb/DcbTagTest.res.mjs +6 -6
  116. package/tests/dcb/DcbValidationTest.res.mjs +52 -52
  117. package/tests/eventlog/EventLogFixtures.res +0 -1
  118. package/tests/eventlog/EventLogFixtures.res.mjs +7 -9
  119. package/tests/eventmapper/EventMapperFixtures.res +0 -1
  120. package/tests/eventmapper/EventMapperFixtures.res.mjs +24 -26
  121. package/tests/eventtopic/EventTopicFixtures.res +0 -1
  122. package/tests/eventtopic/EventTopicFixtures.res.mjs +7 -9
  123. package/tests/extensionpoint/ExtensionPointFixtures.res +0 -1
  124. package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +10 -12
  125. package/tests/extensionpoint/ExtensionPointOperationsTest.res +1 -2
  126. package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +9 -10
  127. package/tests/logger/LogFormatTest.res +3 -2
  128. package/tests/logger/LogFormatTest.res.mjs +7 -9
  129. package/tests/message/MessageTest.res +2 -2
  130. package/tests/message/MessageTest.res.mjs +8 -7
  131. package/tests/message/MetaEnvelopeTest.res +5 -5
  132. package/tests/message/MetaEnvelopeTest.res.mjs +12 -11
  133. package/tests/plugin/ManifestVisibilityTest.res.mjs +7 -7
  134. package/tests/plugin/PluginDefinitionScalars.res +5 -3
  135. package/tests/plugin/PluginDefinitionScalars.res.mjs +2 -2
  136. package/tests/plugin/PluginLifecycleCorpusTest.res +4 -3
  137. package/tests/plugin/PluginLifecycleCorpusTest.res.mjs +3 -6
  138. package/tests/plugin/PluginSpecExperiment.res +0 -1
  139. package/tests/plugin/PluginSpecExperiment.res.mjs +12 -14
  140. package/tests/plugin/PluginStructureTest.res +188 -1
  141. package/tests/plugin/PluginStructureTest.res.mjs +293 -102
  142. package/tests/plugin/Plugin_EventQuerySchemaTest.res.mjs +3 -3
  143. package/tests/plugin/SchemaWalkerTest.res +0 -1
  144. package/tests/plugin/SchemaWalkerTest.res.mjs +17 -19
  145. package/tests/plugin/StateChangeSlice/PsAttachInvoice.res.mjs +5 -5
  146. package/tests/plugin/StateChangeSlice/PsChangePhoto.res.mjs +8 -8
  147. package/tests/plugin/StateChangeSlice/PsDispatchShipment.res.mjs +5 -5
  148. package/tests/plugin/StateChangeSlice/PsGatedCommands.res.mjs +9 -9
  149. package/tests/plugin/StateChangeSlice/PsPlaceOrder.res.mjs +5 -5
  150. package/tests/plugin/StateChangeSlice/PsReserveStock.res.mjs +8 -8
  151. package/tests/plugin/StateChangeSlice/PsShipOrder.res.mjs +15 -15
  152. package/tests/plugin/StateChangeSlice/PsTypoStore.res +31 -0
  153. package/tests/plugin/StateChangeSlice/PsTypoStore.res.mjs +62 -0
  154. package/tests/plugin/StateChangeSlice/PsUploadAvatar.res.mjs +8 -8
  155. package/tests/plugin/StateChangeSlice/PsUploadImages.res +40 -0
  156. package/tests/plugin/StateChangeSlice/PsUploadImages.res.mjs +66 -0
  157. package/tests/plugin/StateViewSlice/PsAnnotatedView.res.mjs +13 -12
  158. package/tests/plugin/StateViewSlice/PsAvailableProductsView.res.mjs +8 -8
  159. package/tests/plugin/StateViewSlice/PsCategoriesView.res.mjs +6 -6
  160. package/tests/plugin/StateViewSlice/PsCustomersView.res.mjs +10 -10
  161. package/tests/plugin/StateViewSlice/PsGatedView.res.mjs +6 -6
  162. package/tests/plugin/StateViewSlice/PsOrdersView.res.mjs +9 -9
  163. package/tests/plugin/StateViewSlice/PsShipmentsView.res.mjs +11 -10
  164. package/tests/plugin/pluginDefinitionRequiredScalars.txt +15 -0
  165. package/tests/querydb/QueryDbFixtures.res +0 -1
  166. package/tests/querydb/QueryDbFixtures.res.mjs +5 -7
  167. package/tests/sideeffecthandler/SideEffectHandlerFixtures.res +0 -1
  168. package/tests/sideeffecthandler/SideEffectHandlerFixtures.res.mjs +4 -6
  169. package/tests/util/CommandPublisherTest.res +0 -1
  170. package/tests/util/CommandPublisherTest.res.mjs +4 -6
@@ -263,8 +263,19 @@ and objectRefToJsonSchema = (
263
263
  ): JSON.t => {
264
264
  let props = Dict.make()
265
265
  let required: array<string> = []
266
+ // `@internal` fields are dropped rather than annotated. A marker would be the
267
+ // right answer for a field that is on the surface and merely unwanted (that is
268
+ // `@hidden`); this one is not on the surface at all, so there is nothing for a
269
+ // consumer to describe and an entry here would advertise a field the SDL does
270
+ // not declare — which is precisely the mismatch that made read-model queries
271
+ // reference fields the server rejects.
272
+ //
273
+ // This is the single point for every JSON-Schema consumer: `queryableDef.schema`,
274
+ // the MCP generator and the manifest all derive through this walk.
275
+ let internal = annotations->Option.flatMap(spec => spec.internal)->Option.getOr([])
266
276
  fields
267
277
  ->Dict.toArray
278
+ ->Array.filter(((fieldName, _)) => !(internal->Array.includes(fieldName)))
268
279
  ->Array.forEach(((fieldName, fieldType)) => {
269
280
  let baseSchema = fromSchemaType(fieldType)
270
281
  let withAnnotations = switch annotations {
@@ -281,7 +281,8 @@ function objectRefToJsonSchema(annotations, optionalOpt, ownersOpt, fields) {
281
281
  let owners = ownersOpt !== undefined ? ownersOpt : [];
282
282
  let props = {};
283
283
  let required = [];
284
- Object.entries(fields).forEach(param => {
284
+ let internal = Stdlib_Option.getOr(Stdlib_Option.flatMap(annotations, spec => spec.internal), []);
285
+ Object.entries(fields).filter(param => !internal.includes(param[0])).forEach(param => {
285
286
  let fieldType = param[1];
286
287
  let fieldName = param[0];
287
288
  let baseSchema = fromSchemaType(fieldType);
@@ -1,4 +1,3 @@
1
- S.enableJson()
2
1
  // AutomationSlice callback — implements the TODO list pattern with mixed-source
3
2
  // dispatch (Plan 04).
4
3
  //
@@ -143,7 +142,7 @@ module Make = (
143
142
  | Some(_) => () // Already exists — skip
144
143
  | None =>
145
144
  let row: todoRow = {
146
- item: item->S.reverseConvertToJsonOrThrow(Spec.todoItemSchema),
145
+ item: item->Reventless.Util_Sury.toJson(Spec.todoItemSchema),
147
146
  status: Pending,
148
147
  createdAt: now(),
149
148
  retryCount: 0,
@@ -198,7 +197,7 @@ module Make = (
198
197
  let commands = []
199
198
 
200
199
  pending->Array.forEach(((id, row)) => {
201
- let item = try row.item->S.parseJsonOrThrow(Spec.todoItemSchema)->Some catch {
200
+ let item = try row.item->Reventless.Util_Sury.fromJson(Spec.todoItemSchema)->Some catch {
202
201
  | exn =>
203
202
  let errMsg =
204
203
  exn->JsExn.fromException->Option.flatMap(JsExn.message)->Option.getOr("unknown")
@@ -214,7 +213,7 @@ module Make = (
214
213
  | Some((targetId, command)) =>
215
214
  todoItems->Dict.set(id, {...row, status: Processing, processedAt: now()})
216
215
  let commandJson = try command
217
- ->S.reverseConvertToJsonOrThrow(Spec.commandSchema)
216
+ ->Reventless.Util_Sury.toJson(Spec.commandSchema)
218
217
  ->Some catch {
219
218
  | exn =>
220
219
  let errMsg =
@@ -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_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
6
6
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
@@ -9,35 +9,34 @@ import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js
9
9
  import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
10
10
  import * as DcbDecode$Reventless from "@reventlessdev/reventless-spec/src/components/DcbDecode.res.mjs";
11
11
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
12
+ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
12
13
  import * as Message$ReventlessCore from "../../Message.res.mjs";
13
14
  import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
14
15
 
15
- S.enableJson();
16
-
17
- let todoStatusSchema = S.union([
18
- S.literal("Pending"),
19
- S.literal("Processing"),
20
- S.literal("Completed"),
21
- S.literal("Failed")
16
+ let todoStatusSchema = Sury.union([
17
+ Sury.literal("Pending"),
18
+ Sury.literal("Processing"),
19
+ Sury.literal("Completed"),
20
+ Sury.literal("Failed")
22
21
  ]);
23
22
 
24
- let todoRowSchema = S.schema(s => ({
25
- item: s.m(S.json),
23
+ let todoRowSchema = Sury.$schema(s => ({
24
+ item: s.m(Sury.json),
26
25
  status: s.m(todoStatusSchema),
27
- createdAt: s.m(S.string),
28
- processedAt: s.m(S.option(S.string)),
29
- completedAt: s.m(S.option(S.string)),
30
- retryCount: s.m(S.int)
26
+ createdAt: s.m(Sury.string),
27
+ processedAt: s.m(Sury.$option(Sury.string)),
28
+ completedAt: s.m(Sury.$option(Sury.string)),
29
+ retryCount: s.m(Sury.int)
31
30
  }));
32
31
 
33
32
  function todoRowSchemaFor(itemSchema) {
34
- return S.schema(s => ({
33
+ return Sury.$schema(s => ({
35
34
  item: s.m(itemSchema),
36
35
  status: s.m(todoStatusSchema),
37
- createdAt: s.m(S.string),
38
- processedAt: s.m(S.option(S.string)),
39
- completedAt: s.m(S.option(S.string)),
40
- retryCount: s.m(S.int)
36
+ createdAt: s.m(Sury.string),
37
+ processedAt: s.m(Sury.$option(Sury.string)),
38
+ completedAt: s.m(Sury.$option(Sury.string)),
39
+ retryCount: s.m(Sury.int)
41
40
  }));
42
41
  }
43
42
 
@@ -60,7 +59,7 @@ function Make(Spec) {
60
59
  if (match !== undefined) {
61
60
  return;
62
61
  }
63
- let row_item = S.reverseConvertToJsonOrThrow(param[1], Spec.todoItemSchema);
62
+ let row_item = Util_Sury$Reventless.toJson(param[1], Spec.todoItemSchema);
64
63
  let row_createdAt = new Date().toISOString();
65
64
  let row = {
66
65
  item: row_item,
@@ -115,7 +114,7 @@ function Make(Spec) {
115
114
  let id = param[0];
116
115
  let item;
117
116
  try {
118
- item = Primitive_option.some(S.parseJsonOrThrow(row.item, Spec.todoItemSchema));
117
+ item = Primitive_option.some(Util_Sury$Reventless.fromJson(row.item, Spec.todoItemSchema));
119
118
  } catch (raw_exn) {
120
119
  let exn = Primitive_exceptions.internalToException(raw_exn);
121
120
  let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(exn), Stdlib_JsExn.message), "unknown");
@@ -134,7 +133,7 @@ function Make(Spec) {
134
133
  todoItems[id] = newrecord;
135
134
  let commandJson;
136
135
  try {
137
- commandJson = S.reverseConvertToJsonOrThrow(match[1], Spec.commandSchema);
136
+ commandJson = Util_Sury$Reventless.toJson(match[1], Spec.commandSchema);
138
137
  } catch (raw_exn) {
139
138
  let exn = Primitive_exceptions.internalToException(raw_exn);
140
139
  let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(exn), Stdlib_JsExn.message), "unknown");
@@ -198,4 +197,4 @@ export {
198
197
  todoRowSchemaFor,
199
198
  Make,
200
199
  }
201
- /* Not a pure module */
200
+ /* todoStatusSchema Not a pure module */
@@ -18,8 +18,7 @@ module Make = (Spec: ReventlessInfra.CommandTopic.T, Ops: Ops with module Spec =
18
18
  | command' => Some({ReventlessInfra.CommandTopic.reference, command: command'})
19
19
  | exception err =>
20
20
  let commandStr = json->JSON.stringify
21
- let errMsg =
22
- err->JsExn.fromException->Option.flatMap(JsExn.message)->Option.getOr("unknown")
21
+ let errMsg = err->Reventless.Util_Sury.exnMessage
23
22
  EffectLogger.logError(
24
23
  ~comp,
25
24
  `decode failed: ${commandStr} err=${errMsg}`,
@@ -1,10 +1,9 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
4
- import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
5
3
  import * as Effect from "effect/Effect";
6
4
  import * as Stream from "effect/Stream";
7
5
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
6
+ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
8
7
  import * as Message$ReventlessCore from "../../Message.res.mjs";
9
8
  import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
10
9
 
@@ -21,7 +20,7 @@ function Make(Spec) {
21
20
  } catch (raw_err) {
22
21
  let err = Primitive_exceptions.internalToException(raw_err);
23
22
  let commandStr = JSON.stringify(json);
24
- let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message), "unknown");
23
+ let errMsg = Util_Sury$Reventless.exnMessage(err, undefined);
25
24
  Effect.runSync(EffectLogger$ReventlessCore.logError(comp, undefined, `decode failed: ` + commandStr + ` err=` + errMsg));
26
25
  return;
27
26
  }
@@ -46,4 +45,4 @@ function Make(Spec) {
46
45
  export {
47
46
  Make,
48
47
  }
49
- /* Stdlib_JsExn Not a pure module */
48
+ /* effect/Effect Not a pure module */
@@ -169,7 +169,7 @@ let encodeCommandJson = (cmdJson: Reventless.Message.commandJson): JSON.t =>
169
169
  JSON.Encode.object(
170
170
  Dict.fromArray([
171
171
  ("id", JSON.Encode.string(cmdJson.id)),
172
- ("meta", cmdJson.meta->S.reverseConvertToJsonOrThrow(Reventless.Message.metaSchema)),
172
+ ("meta", cmdJson.meta->Reventless.Util_Sury.toJson(Reventless.Message.metaSchema)),
173
173
  ("command", cmdJson.commandJson),
174
174
  ]),
175
175
  )
@@ -1,6 +1,5 @@
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_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
5
4
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
5
  import * as Effect from "effect/Effect";
@@ -8,6 +7,7 @@ import * as Stream from "effect/Stream";
8
7
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
9
8
  import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
10
9
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
10
+ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
11
11
  import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
12
12
 
13
13
  let commandOutcomeHook = {
@@ -127,7 +127,7 @@ function encodeCommandJson(cmdJson) {
127
127
  ],
128
128
  [
129
129
  "meta",
130
- S.reverseConvertToJsonOrThrow(cmdJson.meta, Message$Reventless.metaSchema)
130
+ Util_Sury$Reventless.toJson(cmdJson.meta, Message$Reventless.metaSchema)
131
131
  ],
132
132
  [
133
133
  "command",
@@ -238,4 +238,4 @@ export {
238
238
  registerHandler,
239
239
  getHandlers,
240
240
  }
241
- /* S Not a pure module */
241
+ /* Stdlib_JsExn Not a pure module */
@@ -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 ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
5
5
 
6
- let counterEventSchema = S.literal("CountFinished");
6
+ let counterEventSchema = Sury.literal("CountFinished");
7
7
 
8
8
  let name = ComponentType$ReventlessCore.toName("Counter");
9
9
 
@@ -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_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
5
5
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
6
  import * as Effect from "effect/Effect";
@@ -10,9 +10,9 @@ import * as Message$ReventlessCore from "../../Message.res.mjs";
10
10
  import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
11
11
  import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
12
12
 
13
- let countsStateSchema = S.schema(s => ({
14
- id: s.m(S.string),
15
- count: s.m(S.int)
13
+ let countsStateSchema = Sury.$schema(s => ({
14
+ id: s.m(Sury.string),
15
+ count: s.m(Sury.int)
16
16
  }));
17
17
 
18
18
  function groupByCounterId(references) {
@@ -1,15 +1,15 @@
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 Effect from "effect/Effect";
6
6
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
7
7
  import * as Counter$ReventlessCore from "./Counter.res.mjs";
8
8
  import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
9
9
 
10
- let referencesStateSchema = S.schema(s => ({
11
- id: s.m(S.string),
12
- inc: s.m(S.int)
10
+ let referencesStateSchema = Sury.$schema(s => ({
11
+ id: s.m(Sury.string),
12
+ inc: s.m(Sury.int)
13
13
  }));
14
14
 
15
15
  function groupCountItemsByCounterId(countItems) {
@@ -51,7 +51,7 @@ let mergedEventSchema = (schemas: array<S.t<unknown>>) =>
51
51
  many
52
52
  ->Array.flatMap(schema =>
53
53
  switch schema {
54
- | S.Union({anyOf}) => anyOf
54
+ | S.AnyOf({anyOf}) => anyOf
55
55
  | other => [other]
56
56
  }
57
57
  )
@@ -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_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
6
6
  import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
@@ -81,8 +81,8 @@ function mergedEventSchema(schemas) {
81
81
  return schemas[0];
82
82
  }
83
83
  let seen = new Set();
84
- return S.union(schemas.flatMap(schema => {
85
- if (schema.type === "union") {
84
+ return Sury.union(schemas.flatMap(schema => {
85
+ if (schema.type === "anyOf") {
86
86
  return schema.anyOf;
87
87
  } else {
88
88
  return [schema];
@@ -242,10 +242,11 @@ function Make(DcbEventLogStorage) {
242
242
  let DcbEventLog = DcbEventLog_Builder$ReventlessCore.Make(DcbEventLogStorage)(DcbEventTopicPublisher);
243
243
  let dcbEventLog = DcbEventLog.make(name, indexes$1, partitionTag, effectiveCrossPartitionTagKeys, opts);
244
244
  Stdlib_Option.forEach(HooksConfig.hooks.onDcbEventLogCreated, hook => hook(dcbEventLog));
245
+ let commandSchema = Sury.json;
245
246
  let DcbCommandTopic = CommandTopic_Builder$ReventlessCore.Make({
246
247
  Id: Id$Reventless.$$String,
247
248
  name: childName,
248
- commandSchema: S.json
249
+ commandSchema: commandSchema
249
250
  })(DcbCommandTopicChannel);
250
251
  let dcbCommandTopic = DcbCommandTopic.make(name + `Dcb`, {
251
252
  kind: "Plugin",
@@ -254,10 +255,11 @@ function Make(DcbEventLogStorage) {
254
255
  Stdlib_Option.forEach(HooksConfig.hooks.onDcbCommandTopicCreated, hook => hook(dcbCommandTopic));
255
256
  let publishJsons = Component$ReventlessCore.operations(dcbCommandTopic).apply(ops => ops.publishJsons);
256
257
  let name$1 = childName + "Async";
258
+ let commandSchema$1 = Sury.json;
257
259
  let DcbAsyncCommandTopic = CommandTopic_Builder$ReventlessCore.Make({
258
260
  Id: Id$Reventless.$$String,
259
261
  name: name$1,
260
- commandSchema: S.json
262
+ commandSchema: commandSchema$1
261
263
  })(DcbCommandTopicChannelAsync);
262
264
  let asyncDcbCommandTopicOpt;
263
265
  if (asyncSlices.length !== 0) {
@@ -447,7 +449,7 @@ function Make(DcbEventLogStorage) {
447
449
  });
448
450
  return [
449
451
  byTag$1,
450
- make(S.json)
452
+ make(Sury.json)
451
453
  ];
452
454
  });
453
455
  let dcbHandler = Pulumi.all([
@@ -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 Pulumi from "@pulumi/pulumi";
6
6
  import * as Component$ReventlessCore from "../Component.res.mjs";
@@ -13,6 +13,7 @@ import * as DcbEventLog_Operations$ReventlessCore from "./DcbEventLog_Operations
13
13
 
14
14
  function Make(Storage) {
15
15
  return EventTopicPublisher => {
16
+ let eventSchema = Sury.json;
16
17
  let make = (name, indexesOpt, partitionTag, crossPartitionTagKeysOpt, opts) => {
17
18
  let indexes = indexesOpt !== undefined ? indexesOpt : [];
18
19
  let crossPartitionTagKeys = crossPartitionTagKeysOpt !== undefined ? crossPartitionTagKeysOpt : [];
@@ -31,7 +32,7 @@ function Make(Storage) {
31
32
  let SpecificEventTopic = EventTopic_Builder$ReventlessCore.Make({
32
33
  Id: Id$Reventless.$$String,
33
34
  name: "DcbEventLog",
34
- eventSchema: S.json
35
+ eventSchema: eventSchema
35
36
  })(EventTopicPublisher);
36
37
  let eventTopic = SpecificEventTopic.make(extra$1, storage.resources, owner, Util_Pulumi$ReventlessCore.ComponentResourceOptions.ofCustomResourceOptions(opts));
37
38
  Component$ReventlessCore.setOperations(extra, Pulumi.all([
@@ -71,4 +72,4 @@ function Make(Storage) {
71
72
  export {
72
73
  Make,
73
74
  }
74
- /* S Not a pure module */
75
+ /* sury Not a pure module */
@@ -11,7 +11,7 @@ let makeStreamHandler = (
11
11
  let jsonHandler: EventCollector.jsonEventsHandler = stream =>
12
12
  stream
13
13
  ->Stream.mapEffect(json =>
14
- Effect.trySync(~catch=_exn => "decode error", () => json->S.parseOrThrow(schema))
14
+ Effect.trySync(~catch=_exn => "decode error", () => json->S.parseOrThrow(~to=schema))
15
15
  )
16
16
  ->jsonEventsHandler
17
17
 
@@ -1,4 +1,3 @@
1
- S.enableJson()
2
1
  // InboundTranslationSlice callback — receives external input and translates to commands.
3
2
  //
4
3
  // Maintains an audit log QueryDb and delegates translation to Translation.translate.
@@ -113,7 +112,7 @@ module Make = (
113
112
  let requestId = Uuid.v4()
114
113
 
115
114
  // Parse the external input
116
- let input = try inputJson->S.parseOrThrow(Spec.externalInputSchema)->Ok catch {
115
+ let input = try inputJson->S.parseOrThrow(~to=Spec.externalInputSchema)->Ok catch {
117
116
  | exn =>
118
117
  let msg =
119
118
  exn
@@ -1,6 +1,7 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as S from "sury/src/S.res.mjs";
4
+ import * as Sury from "sury";
4
5
  import * as Uuid from "uuid";
5
6
  import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
6
7
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
@@ -10,20 +11,18 @@ import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_excep
10
11
  import * as Message$ReventlessCore from "../../Message.res.mjs";
11
12
  import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
12
13
 
13
- S.enableJson();
14
-
15
- let auditStatusSchema = S.union([
16
- S.literal("Success"),
17
- S.literal("Failure")
14
+ let auditStatusSchema = Sury.union([
15
+ Sury.literal("Success"),
16
+ Sury.literal("Failure")
18
17
  ]);
19
18
 
20
- let auditRowSchema = S.schema(s => ({
21
- input: s.m(S.string),
19
+ let auditRowSchema = Sury.$schema(s => ({
20
+ input: s.m(Sury.string),
22
21
  status: s.m(auditStatusSchema),
23
- targetIds: s.m(S.option(S.array(S.string))),
24
- commandCount: s.m(S.option(S.int)),
25
- error: s.m(S.option(S.string)),
26
- receivedAt: s.m(S.string)
22
+ targetIds: s.m(Sury.$option(Sury.array(Sury.string))),
23
+ commandCount: s.m(Sury.$option(Sury.int)),
24
+ error: s.m(Sury.$option(Sury.string)),
25
+ receivedAt: s.m(Sury.string)
27
26
  }));
28
27
 
29
28
  function receiveResultToOutcome(result) {
@@ -236,4 +235,4 @@ export {
236
235
  takeAuditRow,
237
236
  Make,
238
237
  }
239
- /* Not a pure module */
238
+ /* auditStatusSchema Not a pure module */
@@ -1,4 +1,3 @@
1
- S.enableJson()
2
1
  // OutboundTranslationSlice callback — implements the tracked external call pattern.
3
2
  //
4
3
  // Phase 1 (collect): updates the in-memory TODO list from events (no resolve)
@@ -144,7 +143,7 @@ module Make = (
144
143
  | Some(_) => () // Already exists -- skip (idempotent)
145
144
  | None =>
146
145
  let row: todoRow = {
147
- item: item->S.reverseConvertToJsonOrThrow(Spec.outboundItemSchema),
146
+ item: item->Reventless.Util_Sury.toJson(Spec.outboundItemSchema),
148
147
  status: Pending,
149
148
  createdAt: now(),
150
149
  retryCount: 0,
@@ -170,7 +169,7 @@ module Make = (
170
169
  let _ = await pending->Array.reduce(Promise.resolve(), async (prev, (id, row)) => {
171
170
  let _ = await prev
172
171
 
173
- let item = try row.item->S.parseJsonOrThrow(Spec.outboundItemSchema)->Some catch {
172
+ let item = try row.item->Reventless.Util_Sury.fromJson(Spec.outboundItemSchema)->Some catch {
174
173
  | exn =>
175
174
  let errMsg =
176
175
  exn->JsExn.fromException->Option.flatMap(JsExn.message)->Option.getOr("unknown")
@@ -200,7 +199,7 @@ module Make = (
200
199
  | Ok(Some((targetId, cmd))) =>
201
200
  // Encode command and publish
202
201
  let commandJson = try cmd
203
- ->S.reverseConvertToJsonOrThrow(Spec.inboundCommandSchema)
202
+ ->Reventless.Util_Sury.toJson(Spec.inboundCommandSchema)
204
203
  ->Some catch {
205
204
  | exn =>
206
205
  let errMsg =
@@ -1,43 +1,42 @@
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_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
5
5
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
6
6
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
7
7
  import * as Effect from "effect/Effect";
8
8
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
9
9
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
10
+ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
10
11
  import * as Message$ReventlessCore from "../../Message.res.mjs";
11
12
  import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
12
13
 
13
- S.enableJson();
14
-
15
- let todoStatusSchema = S.union([
16
- S.literal("Pending"),
17
- S.literal("Processing"),
18
- S.literal("Completed"),
19
- S.literal("Failed")
14
+ let todoStatusSchema = Sury.union([
15
+ Sury.literal("Pending"),
16
+ Sury.literal("Processing"),
17
+ Sury.literal("Completed"),
18
+ Sury.literal("Failed")
20
19
  ]);
21
20
 
22
- let todoRowSchema = S.schema(s => ({
23
- item: s.m(S.json),
21
+ let todoRowSchema = Sury.$schema(s => ({
22
+ item: s.m(Sury.json),
24
23
  status: s.m(todoStatusSchema),
25
- createdAt: s.m(S.string),
26
- processedAt: s.m(S.option(S.string)),
27
- completedAt: s.m(S.option(S.string)),
28
- retryCount: s.m(S.int),
29
- lastError: s.m(S.option(S.string))
24
+ createdAt: s.m(Sury.string),
25
+ processedAt: s.m(Sury.$option(Sury.string)),
26
+ completedAt: s.m(Sury.$option(Sury.string)),
27
+ retryCount: s.m(Sury.int),
28
+ lastError: s.m(Sury.$option(Sury.string))
30
29
  }));
31
30
 
32
31
  function todoRowSchemaFor(itemSchema) {
33
- return S.schema(s => ({
32
+ return Sury.$schema(s => ({
34
33
  item: s.m(itemSchema),
35
34
  status: s.m(todoStatusSchema),
36
- createdAt: s.m(S.string),
37
- processedAt: s.m(S.option(S.string)),
38
- completedAt: s.m(S.option(S.string)),
39
- retryCount: s.m(S.int),
40
- lastError: s.m(S.option(S.string))
35
+ createdAt: s.m(Sury.string),
36
+ processedAt: s.m(Sury.$option(Sury.string)),
37
+ completedAt: s.m(Sury.$option(Sury.string)),
38
+ retryCount: s.m(Sury.int),
39
+ lastError: s.m(Sury.$option(Sury.string))
41
40
  }));
42
41
  }
43
42
 
@@ -53,7 +52,7 @@ function Make(Spec) {
53
52
  if (match !== undefined) {
54
53
  return;
55
54
  }
56
- let row_item = S.reverseConvertToJsonOrThrow(param[1], Spec.outboundItemSchema);
55
+ let row_item = Util_Sury$Reventless.toJson(param[1], Spec.outboundItemSchema);
57
56
  let row_createdAt = new Date().toISOString();
58
57
  let row = {
59
58
  item: row_item,
@@ -82,7 +81,7 @@ function Make(Spec) {
82
81
  await prev;
83
82
  let item;
84
83
  try {
85
- item = Primitive_option.some(S.parseJsonOrThrow(row.item, Spec.outboundItemSchema));
84
+ item = Primitive_option.some(Util_Sury$Reventless.fromJson(row.item, Spec.outboundItemSchema));
86
85
  } catch (raw_exn) {
87
86
  let exn = Primitive_exceptions.internalToException(raw_exn);
88
87
  let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(exn), Stdlib_JsExn.message), "unknown");
@@ -112,7 +111,7 @@ function Make(Spec) {
112
111
  if (match !== undefined) {
113
112
  let commandJson;
114
113
  try {
115
- commandJson = S.reverseConvertToJsonOrThrow(match[1], Spec.inboundCommandSchema);
114
+ commandJson = Util_Sury$Reventless.toJson(match[1], Spec.inboundCommandSchema);
116
115
  } catch (raw_exn$2) {
117
116
  let exn$2 = Primitive_exceptions.internalToException(raw_exn$2);
118
117
  let errMsg$1 = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(exn$2), Stdlib_JsExn.message), "unknown");
@@ -183,4 +182,4 @@ export {
183
182
  todoRowSchemaFor,
184
183
  Make,
185
184
  }
186
- /* Not a pure module */
185
+ /* todoStatusSchema Not a pure module */
@@ -25,7 +25,7 @@ module Make = (Spec: Spec): T => {
25
25
  ->JSON.Decode.object
26
26
  ->Option.flatMap(eventObj' => {
27
27
  let metaJson = eventObj'->Dict.get("meta")
28
- switch metaJson->Option.map(meta => meta->S.parseJsonOrThrow(Message.metaSchema)) {
28
+ switch metaJson->Option.map(meta => meta->Reventless.Util_Sury.fromJson(Message.metaSchema)) {
29
29
  | Some(eventMeta) =>
30
30
  let entry =
31
31
  sideEffectsWithTags->Array.find(((module(SideEffect: Reventless.SideEffect.T), _)) =>
@@ -1,6 +1,5 @@
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 "@reventlessdev/rescript-effect/src/Effect.res.mjs";
5
4
  import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
6
5
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
@@ -10,6 +9,7 @@ import * as Stream from "effect/Stream";
10
9
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
11
10
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
12
11
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
12
+ import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
13
13
  import * as Message$ReventlessCore from "../../Message.res.mjs";
14
14
  import * as LogFormat$ReventlessCore from "../../util/LogFormat.res.mjs";
15
15
  import * as Util_Error$ReventlessCore from "../../util/Util_Error.res.mjs";
@@ -24,7 +24,7 @@ function Make(Spec) {
24
24
  let metaJson = eventObj$p["meta"];
25
25
  let eventMeta;
26
26
  try {
27
- eventMeta = Stdlib_Option.map(metaJson, meta => S.parseJsonOrThrow(meta, Message$ReventlessCore.metaSchema));
27
+ eventMeta = Stdlib_Option.map(metaJson, meta => Util_Sury$Reventless.fromJson(meta, Message$ReventlessCore.metaSchema));
28
28
  } catch (raw_err) {
29
29
  let err = Primitive_exceptions.internalToException(raw_err);
30
30
  let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message), "unknown");
@@ -92,4 +92,4 @@ function Make(Spec) {
92
92
  export {
93
93
  Make,
94
94
  }
95
- /* S Not a pure module */
95
+ /* Effect Not a pure module */
@@ -39,7 +39,7 @@ module Make = (
39
39
  // fields entirely, while the consumer side (DcbDecode) parses with the sury
40
40
  // schema — a js_nullable option field would reject the missing key and the
41
41
  // event would be dropped as schema drift.
42
- let json = event->S.reverseConvertToJsonOrThrow(Spec.eventSchema)
42
+ let json = event->Reventless.Util_Sury.toJson(Spec.eventSchema)
43
43
  let (eventType, data) = json->Message.splitMessage
44
44
  // Use `extractTagsExpanded` (not `extractTags`) so per-element tags on
45
45
  // `array<string>` fields are emitted — e.g. OrderPlaced's
@@ -433,7 +433,7 @@ module Make = (
433
433
  | Error(error) =>
434
434
  // Business-rule rejection — no append, but the read snapshot is valid; cache it.
435
435
  cachePut((state, headPosition))
436
- let errorJson = error->S.reverseConvertToJsonOrThrow(Spec.errorSchema)
436
+ let errorJson = error->Reventless.Util_Sury.toJson(Spec.errorSchema)
437
437
  let errorCode = errorJson->Message.variantNameOfJson
438
438
  let (_, payloadDict) = errorJson->Message.splitMessage
439
439
  let errorDetail =