@reventlessdev/reventless-gwt 1.0.0-alpha.248 → 1.0.0-alpha.250

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 (56) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +1 -1
  3. package/package.json +8 -8
  4. package/src/.gwtignore +1 -1
  5. package/src/{Behavior_GWT.res → Decision_GWT.res} +25 -25
  6. package/src/{Behavior_GWT.res.mjs → Decision_GWT.res.mjs} +10 -10
  7. package/src/Delegate_GWT.res +1 -1
  8. package/src/EventMapping_GWT.res +7 -7
  9. package/src/EventMapping_GWT.res.mjs +3 -3
  10. package/src/Flow_GWT.res +14 -14
  11. package/src/Flow_GWT.res.mjs +6 -6
  12. package/src/Hint.res +1 -1
  13. package/src/Mapping_GWT.res +8 -8
  14. package/src/Mapping_GWT.res.mjs +6 -6
  15. package/src/Outcome.res +1 -1
  16. package/src/Projection_GWT.res +3 -3
  17. package/src/Projection_GWT.res.mjs +1 -1
  18. package/src/Query_GWT.res +1 -1
  19. package/src/RunnerHook.res +1 -1
  20. package/src/ScenarioRecorder.res +2 -2
  21. package/src/ScenarioRecorder.res.mjs +1 -1
  22. package/src/StateChange/ExternalAddCategorySlice.res +1 -1
  23. package/src/StateChange/WithFixtures.res +1 -1
  24. package/src/StateChange/WithManualOpen.res +1 -1
  25. package/tests/CallerTest.res +7 -7
  26. package/tests/CallerTest.res.mjs +8 -8
  27. package/tests/FlowAggregateGwtTest.res +6 -6
  28. package/tests/FlowAggregateGwtTest.res.mjs +6 -6
  29. package/tests/FlowCrossPluginGwtTest.res +8 -8
  30. package/tests/FlowCrossPluginGwtTest.res.mjs +8 -8
  31. package/tests/FlowGwtTest.res +5 -5
  32. package/tests/FlowGwtTest.res.mjs +6 -6
  33. package/tests/HintTest.res +3 -3
  34. package/tests/HintTest.res.mjs +3 -3
  35. package/tests/LocalHostIntegration.res +3 -3
  36. package/tests/MappingGwtTest.res +5 -5
  37. package/tests/MappingGwtTest.res.mjs +6 -6
  38. package/tests/QueryGwtTest.res +1 -1
  39. package/tests/QueryGwtTest.res.mjs +2 -2
  40. package/tests/ScenarioRecorderTest.res +1 -1
  41. package/tests/StateChange/ExternalAddCategorySlice_GWT.res +3 -3
  42. package/tests/StateChange/ExternalAddCategorySlice_GWT.res.mjs +5 -5
  43. package/tests/StateChange/WithFixtures_GWT.res.mjs +5 -5
  44. package/tests/StateChange/WithManualOpen_GWT.res.mjs +5 -5
  45. package/tests/StateChangeSliceAuthorizeGwtTest.res +10 -10
  46. package/tests/StateChangeSliceAuthorizeGwtTest.res.mjs +14 -14
  47. package/tests/StateChangeSliceGwtTest.res +9 -9
  48. package/tests/StateChangeSliceGwtTest.res.mjs +12 -12
  49. package/tests/StateViewSliceGwtTest.res +1 -1
  50. package/tests/StateViewSliceGwtTest.res.mjs +2 -2
  51. /package/src/StateChange/{ExternalAddCategorySlice_Behavior.res → ExternalAddCategorySlice_Decision.res} +0 -0
  52. /package/src/StateChange/{ExternalAddCategorySlice_Behavior.res.mjs → ExternalAddCategorySlice_Decision.res.mjs} +0 -0
  53. /package/src/StateChange/{WithFixtures_Behavior.res → WithFixtures_Decision.res} +0 -0
  54. /package/src/StateChange/{WithFixtures_Behavior.res.mjs → WithFixtures_Decision.res.mjs} +0 -0
  55. /package/src/StateChange/{WithManualOpen_Behavior.res → WithManualOpen_Decision.res} +0 -0
  56. /package/src/StateChange/{WithManualOpen_Behavior.res.mjs → WithManualOpen_Decision.res.mjs} +0 -0
@@ -64,7 +64,7 @@ function Make(Spec) {
64
64
  event: ev,
65
65
  meta: TestFixtures$ReventlessGwt.meta,
66
66
  recordedAt: TestFixtures$ReventlessGwt.recordedAt
67
- }).map(action => Projection$ReventlessCore.rewriteTrail(Projection$Reventless.mapActionId(action, Spec.Key.toString, Spec.Key.makeFromString), TestFixtures$ReventlessGwt.meta.time, Spec.stateSchema))).flat();
67
+ }).map(action => Projection$ReventlessCore.rewriteTrail(Projection$Reventless.mapActionId(action, Spec.Id.toString, Spec.Id.makeFromString), TestFixtures$ReventlessGwt.meta.time, Spec.stateSchema))).flat();
68
68
  await runActions(actions, {
69
69
  load: extra => Promise.resolve({
70
70
  TAG: "Ok",
package/src/Query_GWT.res CHANGED
@@ -12,7 +12,7 @@
12
12
  // `subIdConfig`), so both kinds of consumers use the same combinator set.
13
13
  // Adapter functors `FromReadModel` and `FromStateViewSlice` lift their
14
14
  // respective specs into the shared shape — mirroring how `Mapping_GWT` lifts
15
- // `Aggregate.Spec`/`StateChangeSlice.Spec` via `FromBehavior`/`FromStateChangeSlice`.
15
+ // `Aggregate.Spec`/`StateChangeSlice.Spec` via `FromDecision`/`FromStateChangeSlice`.
16
16
 
17
17
  // -- Unified spec shape ------------------------------------------------------
18
18
 
@@ -30,7 +30,7 @@ type sink = {
30
30
  ) => unit,
31
31
  }
32
32
 
33
- // The currently-registered sink, if any. `None` → plain Jest behaviour.
33
+ // The currently-registered sink, if any. `None` → plain Jest behavior.
34
34
  let current: ref<option<sink>> = ref(None)
35
35
 
36
36
  let register = (s: sink) => current := Some(s)
@@ -1,4 +1,4 @@
1
- // Behaviour scenarios as they run, written as sidecars `check-lifecycle` reads.
1
+ // Decision scenarios as they run, written as sidecars `check-lifecycle` reads.
2
2
  //
3
3
  // The PPX writes a `.gwt.json` sidecar from a `_GWT.res` file's source, so it can only name what
4
4
  // the source spells out: a literal constructor in a step. A suite written against a binding (a
@@ -103,7 +103,7 @@ let write = (~path: string, ~file: string, ~spec: string, scenarios: array<scena
103
103
  // What `check-lifecycle` takes the file's component from.
104
104
  ("stem", JSON.String(spec)),
105
105
  ("file", JSON.String(file)),
106
- ("componentKind", JSON.String("Behavior")),
106
+ ("componentKind", JSON.String("Decision")),
107
107
  ("recorded", JSON.Boolean(true)),
108
108
  (
109
109
  "scenarios",
@@ -133,7 +133,7 @@ function write(path, file, spec, scenarios) {
133
133
  ],
134
134
  [
135
135
  "componentKind",
136
- "Behavior"
136
+ "Decision"
137
137
  ],
138
138
  [
139
139
  "recorded",
@@ -4,7 +4,7 @@
4
4
  // on command + event, payload-less consumed events.
5
5
  //
6
6
  // Spec half (Plan 02 Phase 6) — types, schemas, name. The matching impl
7
- // half lives in [ExternalAddCategorySlice_Behavior.res].
7
+ // half lives in [ExternalAddCategorySlice_Decision.res].
8
8
 
9
9
  let name = "ExternalAddCategory"
10
10
 
@@ -2,7 +2,7 @@
2
2
  // tests at [tests/StateChange/WithFixtures_GWT.res] and
3
3
  // [tests/StateChange/WithManualOpen_GWT.res].
4
4
  //
5
- // Spec half — pairs with [WithFixtures_Behavior.res].
5
+ // Spec half — pairs with [WithFixtures_Decision.res].
6
6
 
7
7
  let name = "WithFixtures"
8
8
 
@@ -3,7 +3,7 @@
3
3
  // [WithFixtures]; named differently so it gets its own companion
4
4
  // [<Stem>_Fixtures] sibling that the PPX considers for auto-open.
5
5
  //
6
- // Spec half — pairs with [WithManualOpen_Behavior.res].
6
+ // Spec half — pairs with [WithManualOpen_Decision.res].
7
7
 
8
8
  let name = "WithManualOpen"
9
9
 
@@ -13,23 +13,23 @@ module Roles = {
13
13
 
14
14
  describe("Caller.owner", () => {
15
15
  testSync("takes a typed id as the user id it stands for", () =>
16
- expect(Behavior_GWT.Caller.owner(CustomerId.makeFromString("c1")).claim)->toEqual(
16
+ expect(Decision_GWT.Caller.owner(CustomerId.makeFromString("c1")).claim)->toEqual(
17
17
  Reventless.Message.CallerClaim.Owned({userId: "c1"}),
18
18
  )
19
19
  )
20
20
 
21
21
  testSync("takes a plain string too", () =>
22
- expect(Behavior_GWT.Caller.owner("c1").claim)->toEqual(
22
+ expect(Decision_GWT.Caller.owner("c1").claim)->toEqual(
23
23
  Reventless.Message.CallerClaim.Owned({userId: "c1"}),
24
24
  )
25
25
  )
26
26
 
27
27
  testSync("holds no role unless given some", () =>
28
- expect(Behavior_GWT.Caller.owner("c1").roles)->toEqual([])
28
+ expect(Decision_GWT.Caller.owner("c1").roles)->toEqual([])
29
29
  )
30
30
 
31
31
  testSync("holds the roles it is given, by name", () =>
32
- expect(Behavior_GWT.Caller.owner("c1", ~roles=[Roles.Merchandiser]).roles)->toEqual([
32
+ expect(Decision_GWT.Caller.owner("c1", ~roles=[Roles.Merchandiser]).roles)->toEqual([
33
33
  "Merchandiser",
34
34
  ])
35
35
  )
@@ -38,7 +38,7 @@ describe("Caller.owner", () => {
38
38
  // with a recorded owner would only ever refuse — a silent wrong answer.
39
39
  testSync("refuses a value that is not an id", () =>
40
40
  expect(
41
- switch Behavior_GWT.Caller.owner(42) {
41
+ switch Decision_GWT.Caller.owner(42) {
42
42
  | _ => false
43
43
  | exception _ => true
44
44
  },
@@ -48,13 +48,13 @@ describe("Caller.owner", () => {
48
48
 
49
49
  describe("Caller.inRoles", () => {
50
50
  testSync("is signed in, holds the roles, and owns nothing in particular", () => {
51
- let caller = Behavior_GWT.Caller.inRoles([Roles.Merchandiser])
51
+ let caller = Decision_GWT.Caller.inRoles([Roles.Merchandiser])
52
52
  expect((caller.signedIn, caller.roles))->toEqual((true, ["Merchandiser"]))
53
53
  })
54
54
 
55
55
  testSync("refuses a role that is not a payload-less case", () =>
56
56
  expect(
57
- switch Behavior_GWT.Caller.inRoles([42]) {
57
+ switch Decision_GWT.Caller.inRoles([42]) {
58
58
  | _ => false
59
59
  | exception _ => true
60
60
  },
@@ -1,7 +1,7 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
3
  import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
4
- import * as Behavior_GWT$ReventlessGwt from "../src/Behavior_GWT.res.mjs";
4
+ import * as Decision_GWT$ReventlessGwt from "../src/Decision_GWT.res.mjs";
5
5
 
6
6
  let CustomerId = Id$Reventless.Make({
7
7
  key: "customerId"
@@ -11,27 +11,27 @@ let Roles = {};
11
11
 
12
12
  globalThis.describe("Caller.owner", () => {
13
13
  globalThis.test("takes a typed id as the user id it stands for", () => {
14
- globalThis.expect(Behavior_GWT$ReventlessGwt.Caller.owner(CustomerId.makeFromString("c1"), undefined).claim).toEqual({
14
+ globalThis.expect(Decision_GWT$ReventlessGwt.Caller.owner(CustomerId.makeFromString("c1"), undefined).claim).toEqual({
15
15
  TAG: "Owned",
16
16
  userId: "c1"
17
17
  });
18
18
  });
19
19
  globalThis.test("takes a plain string too", () => {
20
- globalThis.expect(Behavior_GWT$ReventlessGwt.Caller.owner("c1", undefined).claim).toEqual({
20
+ globalThis.expect(Decision_GWT$ReventlessGwt.Caller.owner("c1", undefined).claim).toEqual({
21
21
  TAG: "Owned",
22
22
  userId: "c1"
23
23
  });
24
24
  });
25
25
  globalThis.test("holds no role unless given some", () => {
26
- globalThis.expect(Behavior_GWT$ReventlessGwt.Caller.owner("c1", undefined).roles).toEqual([]);
26
+ globalThis.expect(Decision_GWT$ReventlessGwt.Caller.owner("c1", undefined).roles).toEqual([]);
27
27
  });
28
28
  globalThis.test("holds the roles it is given, by name", () => {
29
- globalThis.expect(Behavior_GWT$ReventlessGwt.Caller.owner("c1", ["Merchandiser"]).roles).toEqual(["Merchandiser"]);
29
+ globalThis.expect(Decision_GWT$ReventlessGwt.Caller.owner("c1", ["Merchandiser"]).roles).toEqual(["Merchandiser"]);
30
30
  });
31
31
  globalThis.test("refuses a value that is not an id", () => {
32
32
  let tmp;
33
33
  try {
34
- Behavior_GWT$ReventlessGwt.Caller.owner(42, undefined);
34
+ Decision_GWT$ReventlessGwt.Caller.owner(42, undefined);
35
35
  tmp = false;
36
36
  } catch (exn) {
37
37
  tmp = true;
@@ -42,7 +42,7 @@ globalThis.describe("Caller.owner", () => {
42
42
 
43
43
  globalThis.describe("Caller.inRoles", () => {
44
44
  globalThis.test("is signed in, holds the roles, and owns nothing in particular", () => {
45
- let caller = Behavior_GWT$ReventlessGwt.Caller.inRoles(["Merchandiser"]);
45
+ let caller = Decision_GWT$ReventlessGwt.Caller.inRoles(["Merchandiser"]);
46
46
  globalThis.expect([
47
47
  caller.signedIn,
48
48
  caller.roles
@@ -54,7 +54,7 @@ globalThis.describe("Caller.inRoles", () => {
54
54
  globalThis.test("refuses a role that is not a payload-less case", () => {
55
55
  let tmp;
56
56
  try {
57
- Behavior_GWT$ReventlessGwt.Caller.inRoles([42]);
57
+ Decision_GWT$ReventlessGwt.Caller.inRoles([42]);
58
58
  tmp = false;
59
59
  } catch (exn) {
60
60
  tmp = true;
@@ -24,7 +24,7 @@ module CatalogProductAggregate = {
24
24
  type error = AlreadySynced
25
25
  }
26
26
 
27
- module CatalogProductBehavior = {
27
+ module CatalogProductDecision = {
28
28
  module Spec = CatalogProductAggregate
29
29
 
30
30
  type state = NotSynced | Synced
@@ -44,7 +44,7 @@ module CatalogProductBehavior = {
44
44
  | (Synced, _) => Error(CatalogProductAggregate.AlreadySynced)
45
45
  }
46
46
 
47
- let moduleUrl = "test://CatalogProductBehavior"
47
+ let moduleUrl = "test://CatalogProductDecision"
48
48
  }
49
49
 
50
50
  // -- Aggregate: Order ---------------------------------------------------------
@@ -68,7 +68,7 @@ module OrderAggregate = {
68
68
  | NotPlaced
69
69
  }
70
70
 
71
- module OrderBehavior = {
71
+ module OrderDecision = {
72
72
  module Spec = OrderAggregate
73
73
 
74
74
  type state = {placed: bool, shipped: bool}
@@ -98,13 +98,13 @@ module OrderBehavior = {
98
98
  }
99
99
  }
100
100
 
101
- let moduleUrl = "test://OrderBehavior"
101
+ let moduleUrl = "test://OrderDecision"
102
102
  }
103
103
 
104
104
  // -- Step modules -------------------------------------------------------------
105
105
 
106
- module Sync = AggregateCommandStep(CatalogProductAggregate, CatalogProductBehavior)
107
- module Place = AggregateCommandStep(OrderAggregate, OrderBehavior)
106
+ module Sync = AggregateCommandStep(CatalogProductAggregate, CatalogProductDecision)
107
+ module Place = AggregateCommandStep(OrderAggregate, OrderDecision)
108
108
 
109
109
  // -- Flows --------------------------------------------------------------------
110
110
 
@@ -59,9 +59,9 @@ function decide(state, command) {
59
59
  }
60
60
  }
61
61
 
62
- let moduleUrl = "test://CatalogProductBehavior";
62
+ let moduleUrl = "test://CatalogProductDecision";
63
63
 
64
- let CatalogProductBehavior = {
64
+ let CatalogProductDecision = {
65
65
  Spec: undefined,
66
66
  initialState: "NotSynced",
67
67
  snapshot: undefined,
@@ -169,9 +169,9 @@ function decide$1(state, command) {
169
169
  }
170
170
  }
171
171
 
172
- let moduleUrl$1 = "test://OrderBehavior";
172
+ let moduleUrl$1 = "test://OrderDecision";
173
173
 
174
- let OrderBehavior = {
174
+ let OrderDecision = {
175
175
  Spec: undefined,
176
176
  initialState: initialState,
177
177
  snapshot: undefined,
@@ -278,9 +278,9 @@ Flow_GWT$ReventlessGwt.describe("Aggregate flow (single plugin)", () => {
278
278
 
279
279
  export {
280
280
  CatalogProductAggregate,
281
- CatalogProductBehavior,
281
+ CatalogProductDecision,
282
282
  OrderAggregate,
283
- OrderBehavior,
283
+ OrderDecision,
284
284
  Sync,
285
285
  Place,
286
286
  }
@@ -46,7 +46,7 @@ module AddProductSlice = {
46
46
  })
47
47
  }
48
48
 
49
- module AddProductBehavior = {
49
+ module AddProductDecision = {
50
50
  module Spec = AddProductSlice
51
51
  type state = {added: bool}
52
52
  let initialState = {added: false}
@@ -164,7 +164,7 @@ module RecordDemandSlice = {
164
164
  let commandTransition = (_: command): Reventless.Transition.t<lifecycleState> => Unrestricted
165
165
  }
166
166
 
167
- module RecordDemandBehavior = {
167
+ module RecordDemandDecision = {
168
168
  module Spec = RecordDemandSlice
169
169
  type state = {count: int}
170
170
  let initialState = {count: 0}
@@ -225,7 +225,7 @@ module SyncProductSlice = {
225
225
  let commandTransition = (_: command): Reventless.Transition.t<lifecycleState> => Unrestricted
226
226
  }
227
227
 
228
- module SyncProductBehavior = {
228
+ module SyncProductDecision = {
229
229
  module Spec = SyncProductSlice
230
230
  type state = {synced: bool}
231
231
  let initialState = {synced: false}
@@ -278,7 +278,7 @@ module PlaceOrderSlice = {
278
278
  })
279
279
  }
280
280
 
281
- module PlaceOrderBehavior = {
281
+ module PlaceOrderDecision = {
282
282
  module Spec = PlaceOrderSlice
283
283
  type state = {placed: array<string>, available: array<string>}
284
284
  let initialState = {placed: [], available: []}
@@ -308,14 +308,14 @@ module PlaceOrderBehavior = {
308
308
  // Step modules
309
309
  // ===========================================================================
310
310
 
311
- module AddProduct = CommandStep(AddProductSlice, AddProductBehavior)
311
+ module AddProduct = CommandStep(AddProductSlice, AddProductDecision)
312
312
  module ProductsEp = ExtensionPointStep(ProductsEpMapping)
313
313
  module ProductsExt = ExtensionStep(ProductsExtMapping)
314
- module Sync = CommandStep(SyncProductSlice, SyncProductBehavior)
315
- module Place = CommandStep(PlaceOrderSlice, PlaceOrderBehavior)
314
+ module Sync = CommandStep(SyncProductSlice, SyncProductDecision)
315
+ module Place = CommandStep(PlaceOrderSlice, PlaceOrderDecision)
316
316
  module OrdersEp = ExtensionPointStep(OrdersEpMapping)
317
317
  module OrdersExt = ExtensionStep(OrdersExtMapping)
318
- module Demand = CommandStep(RecordDemandSlice, RecordDemandBehavior)
318
+ module Demand = CommandStep(RecordDemandSlice, RecordDemandDecision)
319
319
 
320
320
  // ===========================================================================
321
321
  // Flows
@@ -77,7 +77,7 @@ function decide(state, command) {
77
77
  }
78
78
  }
79
79
 
80
- let AddProductBehavior = {
80
+ let AddProductDecision = {
81
81
  Spec: undefined,
82
82
  initialState: initialState,
83
83
  evolve: evolve,
@@ -362,7 +362,7 @@ function decide$1(_state, command) {
362
362
  };
363
363
  }
364
364
 
365
- let RecordDemandBehavior = {
365
+ let RecordDemandDecision = {
366
366
  Spec: undefined,
367
367
  initialState: initialState$1,
368
368
  evolve: evolve$1,
@@ -473,7 +473,7 @@ function decide$2(_state, command) {
473
473
  };
474
474
  }
475
475
 
476
- let SyncProductBehavior = {
476
+ let SyncProductDecision = {
477
477
  Spec: undefined,
478
478
  initialState: initialState$2,
479
479
  evolve: evolve$2,
@@ -620,7 +620,7 @@ function decide$3(state, command) {
620
620
  }
621
621
  }
622
622
 
623
- let PlaceOrderBehavior = {
623
+ let PlaceOrderDecision = {
624
624
  Spec: undefined,
625
625
  initialState: initialState$3,
626
626
  evolve: evolve$3,
@@ -887,7 +887,7 @@ export {
887
887
  EPM,
888
888
  EM,
889
889
  AddProductSlice,
890
- AddProductBehavior,
890
+ AddProductDecision,
891
891
  ProductsEpSpec,
892
892
  ProductDelegate,
893
893
  ProductsEpMapping,
@@ -895,13 +895,13 @@ export {
895
895
  OrderDelegate,
896
896
  OrdersEpMapping,
897
897
  RecordDemandSlice,
898
- RecordDemandBehavior,
898
+ RecordDemandDecision,
899
899
  OrdersExtMapping,
900
900
  SyncProductSlice,
901
- SyncProductBehavior,
901
+ SyncProductDecision,
902
902
  ProductsExtMapping,
903
903
  PlaceOrderSlice,
904
- PlaceOrderBehavior,
904
+ PlaceOrderDecision,
905
905
  AddProduct,
906
906
  ProductsEp,
907
907
  ProductsExt,
@@ -28,7 +28,7 @@ module PlaceOrderSlice = {
28
28
  type event = OrderPlaced({orderId: @s.matches(Reventless.DcbTag.string) string, item: string})
29
29
  }
30
30
 
31
- module PlaceOrderBehavior = {
31
+ module PlaceOrderDecision = {
32
32
  module Spec = PlaceOrderSlice
33
33
  type state = {placed: bool}
34
34
  let initialState = {placed: false}
@@ -95,7 +95,7 @@ module ShipOrderSlice = {
95
95
  type event = OrderShipped({orderId: @s.matches(Reventless.DcbTag.string) string})
96
96
  }
97
97
 
98
- module ShipOrderBehavior = {
98
+ module ShipOrderDecision = {
99
99
  module Spec = ShipOrderSlice
100
100
  type state = {placed: bool, shipped: bool}
101
101
  let initialState = {placed: false, shipped: false}
@@ -120,7 +120,7 @@ module ShipOrderBehavior = {
120
120
  }
121
121
 
122
122
  module OrdersViewSlice = {
123
- module Key = Reventless.Id.StringPure
123
+ module Id = Reventless.Id.StringPure
124
124
  let name = "OrdersView"
125
125
 
126
126
  @schema
@@ -167,9 +167,9 @@ module ConfirmSlice = {
167
167
 
168
168
  // -- Step modules ------------------------------------------------------------
169
169
 
170
- module Place = CommandStep(PlaceOrderSlice, PlaceOrderBehavior)
170
+ module Place = CommandStep(PlaceOrderSlice, PlaceOrderDecision)
171
171
  module Auto = AutomationStep(AutoShipSlice)
172
- module Ship = CommandStep(ShipOrderSlice, ShipOrderBehavior)
172
+ module Ship = CommandStep(ShipOrderSlice, ShipOrderDecision)
173
173
  module View = ViewStep(OrdersViewSlice, OrdersViewProjection)
174
174
  module Confirm = OutboundStep(ConfirmSlice)
175
175
 
@@ -74,7 +74,7 @@ function decide(state, command) {
74
74
  }
75
75
  }
76
76
 
77
- let PlaceOrderBehavior = {
77
+ let PlaceOrderDecision = {
78
78
  Spec: undefined,
79
79
  initialState: initialState,
80
80
  evolve: evolve,
@@ -248,7 +248,7 @@ function decide$1(state, command) {
248
248
  }
249
249
  }
250
250
 
251
- let ShipOrderBehavior = {
251
+ let ShipOrderDecision = {
252
252
  Spec: undefined,
253
253
  initialState: initialState$1,
254
254
  evolve: evolve$1,
@@ -276,7 +276,7 @@ let consumedEventSchema$3 = Sury.union([
276
276
  ]);
277
277
 
278
278
  let OrdersViewSlice = {
279
- Key: undefined,
279
+ Id: undefined,
280
280
  name: name,
281
281
  stateSchema: stateSchema,
282
282
  consumedEventSchema: consumedEventSchema$3,
@@ -362,7 +362,7 @@ let Ship = Flow_GWT$ReventlessGwt.CommandStep(ShipOrderSlice)({
362
362
  let View = Flow_GWT$ReventlessGwt.ViewStep({
363
363
  name: name,
364
364
  stateSchema: stateSchema,
365
- Key: {
365
+ Id: {
366
366
  schema: Id$Reventless.StringPure.schema,
367
367
  make: prim => prim,
368
368
  makeFromString: prim => prim,
@@ -463,10 +463,10 @@ Flow_GWT$ReventlessGwt.describe("Order flow (single plugin)", () => {
463
463
 
464
464
  export {
465
465
  PlaceOrderSlice,
466
- PlaceOrderBehavior,
466
+ PlaceOrderDecision,
467
467
  AutoShipSlice,
468
468
  ShipOrderSlice,
469
- ShipOrderBehavior,
469
+ ShipOrderDecision,
470
470
  OrdersViewSlice,
471
471
  OrdersViewProjection,
472
472
  ConfirmSlice,
@@ -1,10 +1,10 @@
1
1
  // A state mismatch's hint names the fold that produced the state: `project` for
2
- // a view's scenario, `evolve` for a behavior's.
2
+ // a view's scenario, `evolve` for a decision's.
3
3
 
4
4
  open JestGlobals
5
5
 
6
6
  module CategoriesView = {
7
- module Key = Reventless.Id.StringPure
7
+ module Id = Reventless.Id.StringPure
8
8
  let name = "CategoriesView"
9
9
 
10
10
  @schema
@@ -46,7 +46,7 @@ describe("Hint for a StateMismatch", () => {
46
46
  }
47
47
  })
48
48
 
49
- testSync("a behavior's differing state still points at evolve", () => {
49
+ testSync("a decision's differing state still points at evolve", () => {
50
50
  let hint = Hint.forMismatch(
51
51
  ~slice="AddCategory",
52
52
  Outcome.StateMismatch({key: "c1", expected: None, actual: None}),
@@ -20,7 +20,7 @@ let consumedEventSchema = Sury.$schema(s => ({
20
20
  }));
21
21
 
22
22
  let CategoriesView = {
23
- Key: undefined,
23
+ Id: undefined,
24
24
  name: name,
25
25
  stateSchema: stateSchema,
26
26
  consumedEventSchema: consumedEventSchema,
@@ -50,7 +50,7 @@ let CategoriesViewProjection = {
50
50
  let View = Projection_GWT$ReventlessGwt.Make({
51
51
  name: name,
52
52
  stateSchema: stateSchema,
53
- Key: {
53
+ Id: {
54
54
  schema: Id$Reventless.StringPure.schema,
55
55
  make: prim => prim,
56
56
  makeFromString: prim => prim,
@@ -80,7 +80,7 @@ globalThis.describe("Hint for a StateMismatch", () => {
80
80
  globalThis.expect(hint.locus).toBe("CategoriesView.project");
81
81
  globalThis.expect(hint.message).toBe("project() filed a different row than expected. Check the arm for the event and the key it sets.");
82
82
  });
83
- globalThis.test("a behavior's differing state still points at evolve", () => {
83
+ globalThis.test("a decision's differing state still points at evolve", () => {
84
84
  let hint = Hint$ReventlessGwt.forMismatch("AddCategory", {
85
85
  TAG: "StateMismatch",
86
86
  key: "c1",
@@ -36,7 +36,7 @@ test("loadGraph cold-loads structures from the real plugins", async () => {
36
36
  let catalog = structureFor(g, "Catalog")->Option.getOrThrow
37
37
  let category =
38
38
  catalog.aggregates
39
- ->Array.find((a: Reventless.Plugin.writableDef) => a.name == "Category")
39
+ ->Array.find((a: Reventless.Plugin.writeSideDef) => a.name == "Category")
40
40
  ->Option.getOrThrow
41
41
  ok(category.producedEventTypes->Array.includes("Catalog.Added"))
42
42
 
@@ -50,7 +50,7 @@ test("loadGraph cold-loads structures from the real plugins", async () => {
50
50
  let ordering = structureFor(g, "Ordering")->Option.getOrThrow
51
51
  let order =
52
52
  ordering.aggregates
53
- ->Array.find((a: Reventless.Plugin.writableDef) => a.name == "Order")
53
+ ->Array.find((a: Reventless.Plugin.writeSideDef) => a.name == "Order")
54
54
  ->Option.getOrThrow
55
55
  ok(order.producedEventTypes->Array.includes("Ordering.Placed"))
56
56
 
@@ -72,7 +72,7 @@ test("loadGraph cold-loads structures from the real plugins", async () => {
72
72
  )
73
73
  let product =
74
74
  catalog.aggregates
75
- ->Array.find((a: Reventless.Plugin.writableDef) => a.name == "Product")
75
+ ->Array.find((a: Reventless.Plugin.writeSideDef) => a.name == "Product")
76
76
  ->Option.getOrThrow
77
77
  ok(productsEp.sourceEventTypes->Array.every(e => product.producedEventTypes->Array.includes(e)))
78
78
  })
@@ -7,7 +7,7 @@
7
7
  // module types.
8
8
 
9
9
  // ---------------------------------------------------------------------------
10
- // Shared Aggregate specs + behaviours used by the Aggr→* cases below.
10
+ // Shared Aggregate specs + decisions used by the Aggr→* cases below.
11
11
  // ---------------------------------------------------------------------------
12
12
 
13
13
  module CategorySpec = {
@@ -26,7 +26,7 @@ module CategorySpec = {
26
26
  let moduleUrl = ""
27
27
  }
28
28
 
29
- module CategoryBehavior = {
29
+ module CategoryDecision = {
30
30
  module Spec = CategorySpec
31
31
  type state = NotCreated | Created
32
32
  let initialState = NotCreated
@@ -64,7 +64,7 @@ module ProductSpec = {
64
64
  let moduleUrl = ""
65
65
  }
66
66
 
67
- module ProductBehavior = {
67
+ module ProductDecision = {
68
68
  module Spec = ProductSpec
69
69
  type state = Pristine | Mirrored
70
70
  let initialState = Pristine
@@ -164,8 +164,8 @@ module InventorySlice = {
164
164
  // Adapter aliases — built once, shared across mappings.
165
165
  // ---------------------------------------------------------------------------
166
166
 
167
- module CategorySource = Mapping_GWT.FromBehavior(CategorySpec, CategoryBehavior)
168
- module ProductTarget = Mapping_GWT.FromBehavior(ProductSpec, ProductBehavior)
167
+ module CategorySource = Mapping_GWT.FromDecision(CategorySpec, CategoryDecision)
168
+ module ProductTarget = Mapping_GWT.FromDecision(ProductSpec, ProductDecision)
169
169
  module NotificationSource = Mapping_GWT.FromStateChangeSlice(NotificationSlice)
170
170
  module NotificationTarget = Mapping_GWT.FromStateChangeSlice(NotificationSlice)
171
171
  module InventoryTarget = Mapping_GWT.FromStateChangeSlice(InventorySlice)
@@ -69,7 +69,7 @@ function decide(state, cmd) {
69
69
 
70
70
  let moduleUrl$1 = "";
71
71
 
72
- let CategoryBehavior = {
72
+ let CategoryDecision = {
73
73
  Spec: undefined,
74
74
  initialState: "NotCreated",
75
75
  snapshot: undefined,
@@ -145,7 +145,7 @@ function decide$1(state, cmd) {
145
145
 
146
146
  let moduleUrl$3 = "";
147
147
 
148
- let ProductBehavior = {
148
+ let ProductDecision = {
149
149
  Spec: undefined,
150
150
  initialState: "Pristine",
151
151
  snapshot: undefined,
@@ -298,7 +298,7 @@ let InventorySlice = {
298
298
  readConsistency: "EscalateOnRetry"
299
299
  };
300
300
 
301
- let CategorySource = Mapping_GWT$ReventlessGwt.FromBehavior({
301
+ let CategorySource = Mapping_GWT$ReventlessGwt.FromDecision({
302
302
  Id: {
303
303
  schema: Id$Reventless.StringPure.schema,
304
304
  make: prim => prim,
@@ -339,7 +339,7 @@ let CategorySource = Mapping_GWT$ReventlessGwt.FromBehavior({
339
339
  moduleUrl: moduleUrl$1
340
340
  });
341
341
 
342
- let ProductTarget = Mapping_GWT$ReventlessGwt.FromBehavior({
342
+ let ProductTarget = Mapping_GWT$ReventlessGwt.FromDecision({
343
343
  Id: {
344
344
  schema: Id$Reventless.StringPure.schema,
345
345
  make: prim => prim,
@@ -611,9 +611,9 @@ DcbToDcbGwt.describe("Inventory → Notification (DCB → DCB)", () => {
611
611
 
612
612
  export {
613
613
  CategorySpec,
614
- CategoryBehavior,
614
+ CategoryDecision,
615
615
  ProductSpec,
616
- ProductBehavior,
616
+ ProductDecision,
617
617
  NotificationSlice,
618
618
  InventorySlice,
619
619
  CategorySource,
@@ -115,7 +115,7 @@ CategoriesQuery.describe("Categories ReadModel queries", () => {
115
115
  module OrdersView = {
116
116
  let name = "OrdersView"
117
117
  let moduleUrl = ""
118
- module Key = Reventless.Id.StringPure
118
+ module Id = Reventless.Id.StringPure
119
119
 
120
120
  @schema
121
121
  type state = {orderId: string, customerId: string, total: int}