@reventlessdev/reventless-core 3.0.0-alpha.331 → 3.0.0-alpha.332

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 (84) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +7 -7
  3. package/src/CommandSent.res.mjs +2 -2
  4. package/src/Projection.res.mjs +7 -7
  5. package/src/RequestContext.res.mjs +1 -1
  6. package/src/adapter/Runtime/AggregateRuntime_Builder_Common.res.mjs +2 -2
  7. package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res.mjs +2 -2
  8. package/src/adapter/Runtime/Runtime.res.mjs +8 -7
  9. package/src/admin/Platform_Admin_Callback.res.mjs +4 -3
  10. package/src/components/Aggregate/Aggregate_Callback.res.mjs +23 -22
  11. package/src/components/AutomationSlice/AutomationSlice_Builder.res.mjs +5 -4
  12. package/src/components/AutomationSlice/AutomationSlice_Callback.res.mjs +1 -1
  13. package/src/components/CommandGenerator/CommandGenerator_Callback.res.mjs +9 -8
  14. package/src/components/CommandTopic/CommandTopic_Builder.res.mjs +5 -4
  15. package/src/components/CommandTopic/CommandTopic_Callback.res.mjs +9 -7
  16. package/src/components/CommandTopic/CommandTopic_Helpers.res.mjs +2 -2
  17. package/src/components/CommandTopic/CommandTopic_Operations.res.mjs +2 -2
  18. package/src/components/Counter/Counter_Callback.res.mjs +4 -3
  19. package/src/components/Counter/Counter_Operations.res.mjs +1 -1
  20. package/src/components/DcbEventLog/DcbEventLog_Operations.res.mjs +5 -4
  21. package/src/components/EventCollector/EventCollector_Builder.res.mjs +1 -1
  22. package/src/components/EventLog/EventLog_Operations.res +1 -1
  23. package/src/components/EventLog/EventLog_Operations.res.mjs +9 -8
  24. package/src/components/EventMapper/EventMapper_Callback.res.mjs +11 -10
  25. package/src/components/EventTopic/EventTopic_Operations.res.mjs +2 -2
  26. package/src/components/Extension/Extension_Operations.res.mjs +2 -2
  27. package/src/components/ExtensionPoint/ExtensionPoint_Callback.res.mjs +3 -3
  28. package/src/components/ExtensionPoint/ExtensionPoint_Operations.res.mjs +2 -2
  29. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +1 -1
  30. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Webhook.res.mjs +2 -2
  31. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res.mjs +5 -4
  32. package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +1 -1
  33. package/src/components/QueryDb/QueryDb_Operations.res.mjs +1 -1
  34. package/src/components/ReadModel/ReadModel_Callback.res.mjs +7 -6
  35. package/src/components/SideEffectHandler/SideEffectHandler_Callback.res.mjs +7 -6
  36. package/src/components/StateChangeSlice/StateChangeSlice_Builder.res.mjs +5 -4
  37. package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +19 -18
  38. package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +9 -8
  39. package/src/components/StateViewSlice/StateViewSlice_Callback.res.mjs +2 -2
  40. package/src/plugin/component/Plugin_Callback.res.mjs +5 -4
  41. package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +1 -1
  42. package/src/plugin/lifecycle/PluginSpec.res +8 -3
  43. package/src/plugin/lifecycle/PluginSpec.res.mjs +8 -4
  44. package/src/util/CommandPublisher.res.mjs +2 -2
  45. package/src/util/CsvStream.res +8 -4
  46. package/src/util/CsvStream.res.mjs +7 -6
  47. package/src/util/EffectLogger.res +26 -46
  48. package/src/util/EffectLogger.res.mjs +24 -21
  49. package/src/util/FTPHandler.res.mjs +1 -1
  50. package/src/util/ScheduleOps.res.mjs +2 -2
  51. package/src/util/ScheduleTime.res.mjs +5 -5
  52. package/src/util/Util_AdapterRuntime.res.mjs +2 -2
  53. package/src/util/Util_Promise.res.mjs +2 -2
  54. package/src/util/Util_QueryDbRuntime.res.mjs +2 -2
  55. package/src/util/Validation.res.mjs +2 -2
  56. package/tests/adapter/RuntimeExtensionHookReachTest.res.mjs +1 -1
  57. package/tests/aggregate/AggregateCacheTest.res.mjs +1 -1
  58. package/tests/aggregate/AggregateCallbackTest.res.mjs +1 -1
  59. package/tests/aggregate/AggregateCausationTest.res.mjs +1 -1
  60. package/tests/aggregate/AggregateConflictTest.res.mjs +1 -1
  61. package/tests/aggregate/AggregateRejectionTest.res.mjs +1 -1
  62. package/tests/aggregate/AggregateRepeatTest.res.mjs +1 -1
  63. package/tests/aggregate/AggregateSnapshotTest.res.mjs +10 -11
  64. package/tests/commandgenerator/CommandGeneratorCallbackTest.res.mjs +1 -1
  65. package/tests/commandgenerator/OwnerActingTest.res.mjs +1 -1
  66. package/tests/commandgenerator/OwnerStampingTest.res.mjs +1 -1
  67. package/tests/commandtopic/CommandOutcomeHookTest.res.mjs +1 -1
  68. package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +1 -1
  69. package/tests/commandtopic/CommandTopicCallbackTest.res.mjs +1 -1
  70. package/tests/commandtopic/CommandTopicHelpersRejectionTest.res.mjs +1 -1
  71. package/tests/counter/CounterFixtures.res.mjs +1 -1
  72. package/tests/dcb/DcbPiiSliceTest.res.mjs +1 -1
  73. package/tests/dcb/DcbStateChangeSliceTest.res.mjs +1 -1
  74. package/tests/eventmapper/EventMapperCallbackTest.res.mjs +1 -1
  75. package/tests/extensionpoint/ExtensionPointCallbackTest.res.mjs +1 -1
  76. package/tests/logger/ComponentLineIdsTest.res.mjs +1 -1
  77. package/tests/logger/LogFormatTest.res.mjs +4 -3
  78. package/tests/logger/LoggerSinkTest.res.mjs +1 -1
  79. package/tests/querydb/QueryDbOperationsTest.res.mjs +2 -2
  80. package/tests/querydb/RowChangeTest.res.mjs +2 -2
  81. package/tests/querydb/TaggedUnionStampTest.res.mjs +2 -2
  82. package/tests/sideeffecthandler/SideEffectHandlerCallbackTest.res.mjs +1 -1
  83. package/tests/util/CsvStreamTest.res.mjs +4 -4
  84. package/tests/util/ScheduleTimeTest.res.mjs +1 -1
@@ -1,11 +1,12 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
3
4
  import * as Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
4
5
  import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
5
6
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
6
7
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
7
8
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
8
- import * as Effect from "effect/Effect";
9
+ import * as Effect$1 from "effect/Effect";
9
10
  import * as Stream$1 from "effect/Stream";
10
11
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
11
12
  import * as Message$ReventlessCore from "../../Message.res.mjs";
@@ -108,8 +109,8 @@ function Make(Ops) {
108
109
  headPosition: rawResult.headPosition
109
110
  };
110
111
  };
111
- let readStream = (query, after, strongConsistency) => Stream$1.map(Ops.storage.readStream(query, after, strongConsistency), raw => raw);
112
- let appendStream = (stream, condition) => Effect.flatMap(Stream.runCollect(Stream$1.map(stream, rawEvent => rawEvent)), rawEvents => Effect.promise(() => Ops.storage.append(rawEvents, condition)));
112
+ let readStream = (query, after, strongConsistency) => Stream.map(Ops.storage.readStream(query, after, strongConsistency), raw => raw);
113
+ let appendStream = (stream, condition) => Effect$1.flatMap(Stream$1.runCollect(Stream.map(stream, rawEvent => rawEvent)), rawEvents => Effect$1.promise(() => Ops.storage.append(rawEvents, condition)));
113
114
  return {
114
115
  read: read,
115
116
  append: append,
@@ -121,4 +122,4 @@ function Make(Ops) {
121
122
  export {
122
123
  Make,
123
124
  }
124
- /* Stream Not a pure module */
125
+ /* Effect Not a pure module */
@@ -2,8 +2,8 @@
2
2
 
3
3
  import * as Sury from "sury";
4
4
  import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
5
+ import * as Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
5
6
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
- import * as Stream from "effect/Stream";
7
7
  import * as Component$ReventlessCore from "../Component.res.mjs";
8
8
  import * as ComponentType$ReventlessCore from "../../ComponentType.res.mjs";
9
9
  import * as EventCollector$ReventlessCore from "./EventCollector.res.mjs";
@@ -33,7 +33,7 @@ let isTransient = (e: EventLog.appendError) =>
33
33
  msg->String.includes("InternalServerError")
34
34
  }
35
35
 
36
- let storageRetrySchedule: Schedule.t<(Duration.t, int), EventLog.appendError, unit> =
36
+ let storageRetrySchedule: Schedule.t<Duration.t, EventLog.appendError, unit> =
37
37
  Schedule.exponential(Duration.millis(100))
38
38
  ->Schedule.jittered
39
39
  ->Schedule.intersect(Schedule.recurs(5))
@@ -1,16 +1,17 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
4
+ import * as Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
5
+ import * as Schedule from "@reventlessdev/rescript-effect/src/Schedule.res.mjs";
4
6
  import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
5
7
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
6
8
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
7
9
  import * as Stdlib_Result from "@rescript/runtime/lib/es6/Stdlib_Result.js";
8
10
  import * as Effect$1 from "effect/Effect";
9
- import * as Stream from "effect/Stream";
10
11
  import * as Pii$Reventless from "@reventlessdev/reventless-spec/src/components/Pii.res.mjs";
11
12
  import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
12
13
  import * as Duration from "effect/Duration";
13
- import * as Schedule from "effect/Schedule";
14
+ import * as Schedule$1 from "effect/Schedule";
14
15
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
15
16
  import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
16
17
  import * as Message$ReventlessCore from "../../Message.res.mjs";
@@ -31,7 +32,7 @@ function isTransient(e) {
31
32
  }
32
33
  }
33
34
 
34
- let storageRetrySchedule = Schedule.whileInput(Schedule.intersect(Schedule.jittered(Schedule.exponential(Duration.millis(100))), Schedule.recurs(5)), isTransient);
35
+ let storageRetrySchedule = Schedule.whileInput(Schedule.intersect(Schedule$1.jittered(Schedule$1.exponential(Duration.millis(100))), Schedule$1.recurs(5)), isTransient);
35
36
 
36
37
  function Make(Spec) {
37
38
  return Ops => {
@@ -106,7 +107,7 @@ function Make(Spec) {
106
107
  } catch (raw_err) {
107
108
  let err = Primitive_exceptions.internalToException(raw_err);
108
109
  let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message), "unknown");
109
- return Effect$1.runSync(EffectLogger$ReventlessCore.logError(`EventLog(` + Spec.name + `)`, undefined, undefined, `beforePublishHook error: ` + errMsg));
110
+ return Effect.runSync(EffectLogger$ReventlessCore.logError(`EventLog(` + Spec.name + `)`, undefined, undefined, `beforePublishHook error: ` + errMsg));
110
111
  }
111
112
  };
112
113
  let runAfterPublishHook = async (idStr, eventsJson, meta) => {
@@ -120,7 +121,7 @@ function Make(Spec) {
120
121
  } catch (raw_err) {
121
122
  let err = Primitive_exceptions.internalToException(raw_err);
122
123
  let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message), "unknown");
123
- return Effect$1.runSync(EffectLogger$ReventlessCore.logError(`EventLog(` + Spec.name + `)`, undefined, undefined, `afterPublishHook error: ` + errMsg));
124
+ return Effect.runSync(EffectLogger$ReventlessCore.logError(`EventLog(` + Spec.name + `)`, undefined, undefined, `afterPublishHook error: ` + errMsg));
124
125
  }
125
126
  };
126
127
  let publishToEventTopic = async (id, events$p, sealed, eventsJson) => {
@@ -133,7 +134,7 @@ function Make(Spec) {
133
134
  await Promise.all(events$p.map(async (event$p, i) => {
134
135
  let json = publishedJsonOf(event$p.id, event$p.meta, sealed[i]);
135
136
  await Ops.eventTopic.publishJson(idStr, event$p.meta, json);
136
- return Effect$1.runSync(EffectLogger$ReventlessCore.logInfo(`EventTopic(` + Spec.name + `)`, json, EffectLogger$ReventlessCore.idsOfJson(json), `published event ` + (i + 1 | 0).toString() + `/` + count + `: ` + LogFormat$ReventlessCore.eventDetail(json)));
137
+ return Effect.runSync(EffectLogger$ReventlessCore.logInfo(`EventTopic(` + Spec.name + `)`, json, EffectLogger$ReventlessCore.idsOfJson(json), `published event ` + (i + 1 | 0).toString() + `/` + count + `: ` + LogFormat$ReventlessCore.eventDetail(json)));
137
138
  }));
138
139
  await runAfterPublishHook(idStr, eventsJson, meta);
139
140
  return {
@@ -182,7 +183,7 @@ function Make(Spec) {
182
183
  return Message$ReventlessCore.storedEventToFlatJson(stored, Spec.Id.schema);
183
184
  });
184
185
  let idStr = Spec.Id.toString(id);
185
- let storageEffect = Effect$1.catchAll(Effect$1.map(Effect$1.retry(Effect$1.flatMap(Effect.tryPromise(err => ({
186
+ let storageEffect = Effect$1.catch(Effect$1.map(Effect$1.retry(Effect$1.flatMap(Effect.tryPromise(err => ({
186
187
  TAG: "StorageFailure",
187
188
  _0: Util_Error$ReventlessCore.messageFromUnknown(err, "storage error")
188
189
  }), () => Ops.storage.append(sequenceNr, idStr, eventsJson)), result => {
@@ -198,7 +199,7 @@ function Make(Spec) {
198
199
  TAG: "Error",
199
200
  _0: e
200
201
  }));
201
- let match = await Effect$1.runPromise(storageEffect);
202
+ let match = await Effect.runPromise(storageEffect);
202
203
  if (match.TAG === "Ok") {
203
204
  return Stdlib_Result.mapError(await publishToEventTopic(id, events$p, sealed, eventsJson), msg => ({
204
205
  TAG: "StorageFailure",
@@ -1,6 +1,7 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
4
+ import * as Schedule from "@reventlessdev/rescript-effect/src/Schedule.res.mjs";
4
5
  import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
5
6
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
6
7
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
@@ -9,7 +10,7 @@ import * as Effect$1 from "effect/Effect";
9
10
  import * as Stream from "effect/Stream";
10
11
  import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
11
12
  import * as Duration from "effect/Duration";
12
- import * as Schedule from "effect/Schedule";
13
+ import * as Schedule$1 from "effect/Schedule";
13
14
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
14
15
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
15
16
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
@@ -33,7 +34,7 @@ function MakeCounterHandler(Target) {
33
34
  } catch (raw_err) {
34
35
  let err = Primitive_exceptions.internalToException(raw_err);
35
36
  let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message), "unknown");
36
- Effect$1.runSync(EffectLogger$ReventlessCore.logError("EventMapper", undefined, undefined, `findMapping: Couldn't decode meta: ` + errMsg));
37
+ Effect.runSync(EffectLogger$ReventlessCore.logError("EventMapper", undefined, undefined, `findMapping: Couldn't decode meta: ` + errMsg));
37
38
  return;
38
39
  }
39
40
  if (eventMeta !== undefined) {
@@ -42,7 +43,7 @@ function MakeCounterHandler(Target) {
42
43
  if (entry !== undefined) {
43
44
  let mapping = entry[0];
44
45
  let source$1 = mapping.Source.name;
45
- Effect$1.runSync(EffectLogger$ReventlessCore.logInfo("EventMapper", undefined, EffectLogger$ReventlessCore.idsOf(undefined, undefined, eventMeta), `map: found mapping ` + source$1 + ` -> ` + target));
46
+ Effect.runSync(EffectLogger$ReventlessCore.logInfo("EventMapper", undefined, EffectLogger$ReventlessCore.idsOf(undefined, undefined, eventMeta), `map: found mapping ` + source$1 + ` -> ` + target));
46
47
  return [
47
48
  eventObj$p,
48
49
  eventMeta,
@@ -50,10 +51,10 @@ function MakeCounterHandler(Target) {
50
51
  entry[1]
51
52
  ];
52
53
  }
53
- Effect$1.runSync(EffectLogger$ReventlessCore.logInfo("EventMapper", undefined, EffectLogger$ReventlessCore.idsOf(undefined, undefined, eventMeta), `map: No mapping ` + source + ` -> ` + target + ` found`));
54
+ Effect.runSync(EffectLogger$ReventlessCore.logInfo("EventMapper", undefined, EffectLogger$ReventlessCore.idsOf(undefined, undefined, eventMeta), `map: No mapping ` + source + ` -> ` + target + ` found`));
54
55
  return;
55
56
  }
56
- Effect$1.runSync(EffectLogger$ReventlessCore.logError("EventMapper", undefined, undefined, `findMapping: Invalid JSON object: ` + JSON.stringify(eventJson$p)));
57
+ Effect.runSync(EffectLogger$ReventlessCore.logError("EventMapper", undefined, undefined, `findMapping: Invalid JSON object: ` + JSON.stringify(eventJson$p)));
57
58
  });
58
59
  let createCommandJson = (delay, id, meta, command) => ({
59
60
  id: Target.Id.toString(id),
@@ -122,7 +123,7 @@ function MakeCounterHandler(Target) {
122
123
  let eventsCount = eventsJson$p.length;
123
124
  let match = Stdlib_Array.partition(Stdlib_Array.filterMap(eventsJson$p.map((eventJson$p, idx) => {
124
125
  let idx$1 = idx + 1 | 0;
125
- Effect$1.runSync(EffectLogger$ReventlessCore.logInfo("EventMapper", undefined, undefined, `eventsHandler: incoming event ` + idx$1.toString() + `/` + eventsCount.toString() + `: ` + LogFormat$ReventlessCore.event$pJsonToLogMessage(eventJson$p)));
126
+ Effect.runSync(EffectLogger$ReventlessCore.logInfo("EventMapper", undefined, undefined, `eventsHandler: incoming event ` + idx$1.toString() + `/` + eventsCount.toString() + `: ` + LogFormat$ReventlessCore.event$pJsonToLogMessage(eventJson$p)));
126
127
  let match = findMapping(mappingsWithTags, eventJson$p);
127
128
  if (match === undefined) {
128
129
  return;
@@ -147,13 +148,13 @@ function MakeCounterHandler(Target) {
147
148
  exit = 1;
148
149
  }
149
150
  if (exit === 1) {
150
- Effect$1.runSync(EffectLogger$ReventlessCore.logError("EventMapper", undefined, EffectLogger$ReventlessCore.idsOf(undefined, undefined, eventMeta), `map: Invalid event: ` + JSON.stringify(eventJson$p)));
151
+ Effect.runSync(EffectLogger$ReventlessCore.logError("EventMapper", undefined, EffectLogger$ReventlessCore.idsOf(undefined, undefined, eventMeta), `map: Invalid event: ` + JSON.stringify(eventJson$p)));
151
152
  return;
152
153
  }
153
154
  } catch (raw_err) {
154
155
  let err = Primitive_exceptions.internalToException(raw_err);
155
156
  let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message), "unknown");
156
- Effect$1.runSync(EffectLogger$ReventlessCore.logError("EventMapper", undefined, EffectLogger$ReventlessCore.idsOf(undefined, undefined, eventMeta), `map: Couldn't decode event: ` + JSON.stringify(eventJson$p) + ` ` + errMsg));
157
+ Effect.runSync(EffectLogger$ReventlessCore.logError("EventMapper", undefined, EffectLogger$ReventlessCore.idsOf(undefined, undefined, eventMeta), `map: Couldn't decode event: ` + JSON.stringify(eventJson$p) + ` ` + errMsg));
157
158
  return;
158
159
  }
159
160
  }), entry => entry).flat(), resultType => resultType.TAG !== "Counter");
@@ -194,7 +195,7 @@ function MakeCounterHandler(Target) {
194
195
  }
195
196
 
196
197
  function MakeEventCollectorHandler(Ops) {
197
- let countRetrySchedule = Schedule.intersect(Schedule.jittered(Schedule.exponential(Duration.millis(1000))), Schedule.recurs(10));
198
+ let countRetrySchedule = Schedule.intersect(Schedule$1.jittered(Schedule$1.exponential(Duration.millis(1000))), Schedule$1.recurs(10));
198
199
  let handleJsonEvents = stream => Stream.runForEach(stream, eventJson$p => Effect$1.flatMap(Effect$1.promise(() => Ops.commonEventsHandler([eventJson$p])), param => {
199
200
  let publisherEntries = param[0];
200
201
  let match = Stdlib_Array.partition(param[1], x => x.TAG === "Count");
@@ -207,7 +208,7 @@ function MakeEventCollectorHandler(Ops) {
207
208
  return Effect$1.flatMap(Effect$1.flatMap(Effect$1.flatMap(Effect$1.flatMap(EffectLogger$ReventlessCore.logInfo("EventMapper", undefined, undefined, `eventCollectorEventsHandler: countItems: ` + countItems.length.toString()), () => {
208
209
  let match = countItems.length;
209
210
  if (match !== 0) {
210
- return Effect$1.catchAll(Effect$1.retry(Effect.tryPromise(e => Util_Error$ReventlessCore.messageFromUnknown(e, "unknown"), () => Ops.count(countItems)), countRetrySchedule), errMsg => EffectLogger$ReventlessCore.logError("EventMapper_Callback-ReventlessCore", undefined, undefined, `doCount: count error after retries: ` + errMsg));
211
+ return Effect$1.catch(Effect$1.retry(Effect.tryPromise(e => Util_Error$ReventlessCore.messageFromUnknown(e, "unknown"), () => Ops.count(countItems)), countRetrySchedule), errMsg => EffectLogger$ReventlessCore.logError("EventMapper_Callback-ReventlessCore", undefined, undefined, `doCount: count error after retries: ` + errMsg));
211
212
  } else {
212
213
  return Effect$1.succeed();
213
214
  }
@@ -1,6 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as Effect from "effect/Effect";
3
+ import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
4
4
  import * as Message$ReventlessCore from "../../Message.res.mjs";
5
5
  import * as LogFormat$ReventlessCore from "../../util/LogFormat.res.mjs";
6
6
  import * as EffectLogger$ReventlessCore from "../../util/EffectLogger.res.mjs";
@@ -36,4 +36,4 @@ function Make(Spec) {
36
36
  export {
37
37
  Make,
38
38
  }
39
- /* effect/Effect Not a pure module */
39
+ /* Effect Not a pure module */
@@ -1,9 +1,9 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
3
4
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
4
5
  import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
5
6
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
- import * as Effect from "effect/Effect";
7
7
  import * as Pii$Reventless from "@reventlessdev/reventless-spec/src/components/Pii.res.mjs";
8
8
  import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
9
9
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
@@ -152,4 +152,4 @@ export {
152
152
  ExtensionMapping,
153
153
  Make,
154
154
  }
155
- /* Stdlib_JsExn Not a pure module */
155
+ /* Effect Not a pure module */
@@ -1,9 +1,9 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
4
- import * as Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
5
4
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
5
  import * as Effect$1 from "effect/Effect";
6
+ import * as Stream from "effect/Stream";
7
7
  import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
8
8
  import * as Util_Error$ReventlessCore from "../../util/Util_Error.res.mjs";
9
9
  import * as CommandSent$ReventlessCore from "../../CommandSent.res.mjs";
@@ -18,7 +18,7 @@ function Make(Spec) {
18
18
  let cmdJson = action._2;
19
19
  let reference = action._1;
20
20
  let aggregateName = action._0;
21
- return Effect$1.catchAll(Effect.trySync(err => {
21
+ return Effect$1.catch(Effect.trySync(err => {
22
22
  let errMsg = Util_Error$ReventlessCore.messageFromUnknown(err, "unknown");
23
23
  return [
24
24
  {
@@ -41,7 +41,7 @@ function Make(Spec) {
41
41
  }
42
42
  let handler = action._1;
43
43
  let reference$1 = action._0;
44
- return Effect$1.catchAll(Effect$1.map(Effect.tryPromise(err => {
44
+ return Effect$1.catch(Effect$1.map(Effect.tryPromise(err => {
45
45
  let errMsg = Util_Error$ReventlessCore.messageFromUnknown(err, "unknown");
46
46
  return [
47
47
  {
@@ -1,8 +1,8 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
3
4
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
4
5
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
5
- import * as Effect from "effect/Effect";
6
6
  import * as Pii$Reventless from "@reventlessdev/reventless-spec/src/components/Pii.res.mjs";
7
7
  import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
8
8
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
@@ -124,4 +124,4 @@ function Make(MappingSpec) {
124
124
  export {
125
125
  Make,
126
126
  }
127
- /* Stdlib_JsExn Not a pure module */
127
+ /* Effect Not a pure module */
@@ -2,11 +2,11 @@
2
2
 
3
3
  import * as Sury from "sury";
4
4
  import * as Uuid from "uuid";
5
+ import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
5
6
  import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
6
7
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
7
8
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
8
9
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
9
- import * as Effect from "effect/Effect";
10
10
  import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
11
11
  import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js";
12
12
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
@@ -1,11 +1,11 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
3
4
  import * as Nodecrypto from "node:crypto";
4
5
  import * as Stdlib_Float from "@rescript/runtime/lib/es6/Stdlib_Float.js";
5
6
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
7
  import * as Stdlib_Result from "@rescript/runtime/lib/es6/Stdlib_Result.js";
7
8
  import * as Stdlib_String from "@rescript/runtime/lib/es6/Stdlib_String.js";
8
- import * as Effect from "effect/Effect";
9
9
  import * as Role$Reventless from "@reventlessdev/reventless-spec/src/types/Role.res.mjs";
10
10
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
11
11
  import * as Identity$Reventless from "@reventlessdev/reventless-spec/src/types/Identity.res.mjs";
@@ -291,4 +291,4 @@ export {
291
291
  serve,
292
292
  dispatch,
293
293
  }
294
- /* node:crypto Not a pure module */
294
+ /* Effect Not a pure module */
@@ -1,5 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
3
4
  import * as Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
4
5
  import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
5
6
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
@@ -7,7 +8,7 @@ import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
7
8
  import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
8
9
  import * as Output$Pulumi from "@reventlessdev/rescript-pulumi-pulumi/src/Output.res.mjs";
9
10
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
10
- import * as Effect from "effect/Effect";
11
+ import * as Effect$1 from "effect/Effect";
11
12
  import * as Stream$1 from "effect/Stream";
12
13
  import * as Pulumi from "@pulumi/pulumi";
13
14
  import * as Belt_SetString from "@rescript/runtime/lib/es6/Belt_SetString.js";
@@ -93,7 +94,7 @@ function Make(RuntimeEnvironment) {
93
94
  kind: "OutboundTranslationSlice",
94
95
  name: Spec.name
95
96
  }, opts);
96
- let jsonEventsHandler = stream => Effect.flatMap(Stream.runCollect(Stream$1.flatMap(Stream$1.mapEffect(stream, json => Effect.sync(() => {
97
+ let jsonEventsHandler = stream => Effect$1.flatMap(Stream$1.runCollect(Stream$1.flatMap(Stream.mapEffect(stream, json => Effect$1.sync(() => {
97
98
  let envelope = Stdlib_JSON.Decode.object(json);
98
99
  let rawEvent = Stdlib_Option.getOr(Stdlib_Option.flatMap(envelope, d => d["event"]), json);
99
100
  let sourceId = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_Option.flatMap(envelope, d => d["id"]), Stdlib_JSON.Decode.string), "");
@@ -108,7 +109,7 @@ function Make(RuntimeEnvironment) {
108
109
  } else {
109
110
  return [];
110
111
  }
111
- })), events => Stream$1.fromIterable(events))), eventsArr => Effect.promise(async () => {
112
+ })), events => Stream$1.fromIterable(events))), eventsArr => Effect$1.promise(async () => {
112
113
  await Callback.phase1(eventsArr.map(param => [
113
114
  param[0],
114
115
  param[1]
@@ -161,4 +162,4 @@ function Make(RuntimeEnvironment) {
161
162
  export {
162
163
  Make,
163
164
  }
164
- /* Stream Not a pure module */
165
+ /* Effect Not a pure module */
@@ -1,11 +1,11 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as Sury from "sury";
4
+ import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
4
5
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
5
6
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
6
7
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
7
8
  import * as Stdlib_Result from "@rescript/runtime/lib/es6/Stdlib_Result.js";
8
- import * as Effect from "effect/Effect";
9
9
  import * as Pii$Reventless from "@reventlessdev/reventless-spec/src/components/Pii.res.mjs";
10
10
  import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.js";
11
11
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
@@ -1,11 +1,11 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
3
4
  import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
4
5
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
5
6
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
6
7
  import * as Stdlib_Result from "@rescript/runtime/lib/es6/Stdlib_Result.js";
7
8
  import * as Effect from "effect/Effect";
8
- import * as Stream from "effect/Stream";
9
9
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
10
10
  import * as Logger$ReventlessCore from "../../util/Logger.res.mjs";
11
11
  import * as Message$ReventlessCore from "../../Message.res.mjs";
@@ -1,8 +1,9 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
- import * as Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
3
+ import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
4
4
  import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
5
- import * as Effect from "effect/Effect";
5
+ import * as Effect$1 from "effect/Effect";
6
+ import * as Stream from "effect/Stream";
6
7
  import * as Message$Reventless from "@reventlessdev/reventless-spec/src/types/Message.res.mjs";
7
8
  import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
8
9
  import * as Message$ReventlessCore from "../../Message.res.mjs";
@@ -22,7 +23,7 @@ function Make(ReadModelSpec) {
22
23
  })(Mappings);
23
24
  let comp = `ReadModel(` + ReadModelSpec.name + `)`;
24
25
  let onChange = ViewChange$ReventlessCore.reporter(comp, ReadModelSpec.name, state => Util_Sury$Reventless.toJson(state, ReadModelSpec.stateSchema));
25
- let handleJsonEvents = stream => Effect.flatMap(Stream.runCollect(stream), events => {
26
+ let handleJsonEvents = stream => Effect$1.flatMap(Stream.runCollect(stream), events => {
26
27
  let total = events.length.toString();
27
28
  return Stdlib_Array.reduce(events.map((json, idx) => {
28
29
  let context = Message$ReventlessCore.decode(json, Message$Reventless.contextSchema);
@@ -36,10 +37,10 @@ function Make(ReadModelSpec) {
36
37
  Projection$ReventlessCore.rewriteAction(action, context.meta.time, ReadModelSpec.stateSchema),
37
38
  sources
38
39
  ]);
39
- }).flat(), Effect.succeed(), (acc, param) => {
40
+ }).flat(), Effect$1.succeed(), (acc, param) => {
40
41
  let sources = param[1];
41
42
  let action = param[0];
42
- return Effect.flatMap(acc, () => Effect.map(Effect.promise(() => Projection$ReventlessCore.handleAction(comp, sources, onChange, action, Spec.operations, ReadModelSpec.subIdConfig)), param => {}));
43
+ return Effect$1.flatMap(acc, () => Effect$1.map(Effect$1.promise(() => Projection$ReventlessCore.handleAction(comp, sources, onChange, action, Spec.operations, ReadModelSpec.subIdConfig)), param => {}));
43
44
  });
44
45
  });
45
46
  return {
@@ -54,4 +55,4 @@ function Make(ReadModelSpec) {
54
55
  export {
55
56
  Make,
56
57
  }
57
- /* Stream Not a pure module */
58
+ /* Effect Not a pure module */
@@ -1,11 +1,12 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as Effect from "@reventlessdev/rescript-effect/src/Effect.res.mjs";
4
+ import * as Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
4
5
  import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
5
6
  import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
6
7
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
7
8
  import * as Effect$1 from "effect/Effect";
8
- import * as Stream from "effect/Stream";
9
+ import * as Stream$1 from "effect/Stream";
9
10
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
10
11
  import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
11
12
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
@@ -28,7 +29,7 @@ function Make(Spec) {
28
29
  } catch (raw_err) {
29
30
  let err = Primitive_exceptions.internalToException(raw_err);
30
31
  let errMsg = Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_JsExn.fromException(err), Stdlib_JsExn.message), "unknown");
31
- Effect$1.runSync(EffectLogger$ReventlessCore.logError("SideEffects", undefined, undefined, `map: Couldn't decode meta: ` + errMsg));
32
+ Effect.runSync(EffectLogger$ReventlessCore.logError("SideEffects", undefined, undefined, `map: Couldn't decode meta: ` + errMsg));
32
33
  return;
33
34
  }
34
35
  if (eventMeta !== undefined) {
@@ -47,9 +48,9 @@ function Make(Spec) {
47
48
  return;
48
49
  }
49
50
  }
50
- Effect$1.runSync(EffectLogger$ReventlessCore.logError("SideEffects", undefined, undefined, "map: Invalid JSON object"));
51
+ Effect.runSync(EffectLogger$ReventlessCore.logError("SideEffects", undefined, undefined, "map: Invalid JSON object"));
51
52
  });
52
- let handleJsonEvents = stream => Stream.runDrain(Stream.mapEffect(stream, eventJson$p => {
53
+ let handleJsonEvents = stream => Stream$1.runDrain(Stream.mapEffect(stream, eventJson$p => {
53
54
  let match = findSideEffect(sideEffectsWithTags, eventJson$p);
54
55
  if (match === undefined) {
55
56
  return Effect$1.succeed();
@@ -58,7 +59,7 @@ function Make(Spec) {
58
59
  let eventMeta = match[1];
59
60
  let eventObj = match[0];
60
61
  let sourceName = sideEffect.Source.name;
61
- return Effect$1.zipRight(EffectLogger$ReventlessCore.logInfo("SideEffectHandler", undefined, EffectLogger$ReventlessCore.idsOf(undefined, undefined, eventMeta), `eventsHandler: handling event from source ` + sourceName + `: ` + LogFormat$ReventlessCore.event$pJsonToLogMessage(eventJson$p)), Effect$1.catchAll(Effect$1.flatMap(Effect.trySync(err => {
62
+ return Effect$1.andThen(EffectLogger$ReventlessCore.logInfo("SideEffectHandler", undefined, EffectLogger$ReventlessCore.idsOf(undefined, undefined, eventMeta), `eventsHandler: handling event from source ` + sourceName + `: ` + LogFormat$ReventlessCore.event$pJsonToLogMessage(eventJson$p)), Effect$1.catch(Effect$1.flatMap(Effect.trySync(err => {
62
63
  let errMsg = Util_Error$ReventlessCore.messageFromUnknown(err, "unknown");
63
64
  return `SideEffectHandler.eventHandler: Couldn't decode event: ` + JSON.stringify(eventJson$p) + ` ` + errMsg;
64
65
  }, () => {
@@ -75,7 +76,7 @@ function Make(Spec) {
75
76
  if (event !== undefined) {
76
77
  let event$1 = Primitive_option.valFromOption(event);
77
78
  let eventId$1 = Primitive_option.valFromOption(eventId);
78
- return Effect$1.catchAll(Effect.tryPromise(err => {
79
+ return Effect$1.catch(Effect.tryPromise(err => {
79
80
  let errMsg = Util_Error$ReventlessCore.messageFromUnknown(err, "unknown");
80
81
  return `SideEffect: Error while processing: ` + errMsg;
81
82
  }, () => sideEffect.execute(eventId$1, eventMeta, event$1, Spec.queryEngine)), errMsg => EffectLogger$ReventlessCore.logError("SideEffectHandler", undefined, undefined, errMsg));
@@ -1,9 +1,10 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Stream from "@reventlessdev/rescript-effect/src/Stream.res.mjs";
3
4
  import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
4
5
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
5
6
  import * as Effect from "effect/Effect";
6
- import * as Stream from "effect/Stream";
7
+ import * as Stream$1 from "effect/Stream";
7
8
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
8
9
  import * as Logger$ReventlessCore from "../../util/Logger.res.mjs";
9
10
  import * as Message$ReventlessCore from "../../Message.res.mjs";
@@ -19,7 +20,7 @@ function Make(Spec) {
19
20
  return Decision => {
20
21
  let Callback = StateChangeSlice_Callback$ReventlessCore.Make(Spec)(Decision);
21
22
  let makeJsonHandler = (tagKeysByEventType, crossPartitionTagKeys, partitionTag, dcbEventLogOps) => (stream => {
22
- let decodedStream = Stream.flatMap(Stream.mapEffect(stream, param => {
23
+ let decodedStream = Stream$1.flatMap(Stream.mapEffect(stream, param => {
23
24
  let reference = param.reference;
24
25
  let json = param.command;
25
26
  return Effect.sync(() => {
@@ -39,9 +40,9 @@ function Make(Spec) {
39
40
  });
40
41
  }), opt => {
41
42
  if (opt !== undefined) {
42
- return Stream.fromIterable([opt]);
43
+ return Stream$1.fromIterable([opt]);
43
44
  } else {
44
- return Stream.empty;
45
+ return Stream$1.empty;
45
46
  }
46
47
  });
47
48
  return Callback.handleCommands(tagKeysByEventType, crossPartitionTagKeys, partitionTag, dcbEventLogOps, decodedStream);