@reventlessdev/reventless-gwt 1.0.0-alpha.249 → 1.0.0-alpha.251

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,37 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 1.0.0-alpha.251 (2026-10-21)
7
+
8
+ * feat!: a rejected command says whether the model, the access check or the platform said no ([6a8a6b0](https://github.com/ReventlessDev/reventless-core/commit/6a8a6b0f2f31e766ae26a944c23b0904e51a5865))
9
+
10
+ ### BREAKING CHANGES
11
+
12
+ * a type error variant with one of those names fails to
13
+ compile; rename it for what the model means, such as AlreadyBooked. On
14
+ AWS, rebuild every plugin against this release before a client selects
15
+ cause: a plugin built earlier answers it with a non-null error.
16
+
17
+
18
+
19
+ # 1.0.0-alpha.250 (2026-10-21)
20
+
21
+ * feat!: a state view's row key is module Id ([08c9726](https://github.com/ReventlessDev/reventless-core/commit/08c972659a3d689a39fd5e2f2026597155e92210))
22
+ * feat!: a plugin structure's component definitions are read-side and write-side defs ([ea2ab69](https://github.com/ReventlessDev/reventless-core/commit/ea2ab69e928ba16d7e640e4c66ab0e9ba034fe5c))
23
+
24
+ ### BREAKING CHANGES
25
+
26
+ * a state view spec declares its row key as module Id. A
27
+ hand-written module Key in a spec under StateView/ or StateViewStream/
28
+ fails the build with "A state view's row key is `module Id`, not
29
+ `module Key`".
30
+ * Plugin.queryableDef, Plugin.writableDef, their schemas,
31
+ isPublicQueryable and encodeQueryableDef no longer exist; a reader names
32
+ readSideDef, writeSideDef, isPublicReadSide and encodeReadSideDef. There
33
+ are no aliases, so the compiler lists every reader.
34
+
35
+
36
+
6
37
  # 1.0.0-alpha.249 (2026-10-21)
7
38
 
8
39
  * feat!: the write-side logic module is called the decision, and a codemod moves an app over ([cb573ff](https://github.com/ReventlessDev/reventless-core/commit/cb573ff5b928c7d7f3e75988dfaa65066f8c95eb))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-gwt",
3
- "version": "1.0.0-alpha.249",
3
+ "version": "1.0.0-alpha.251",
4
4
  "description": "Given-When-Then DSLs and test harness for Reventless slice testing",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -14,17 +14,17 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "sury": "11.0.0",
17
- "@reventlessdev/rescript-effect": "1.0.0-alpha.1",
18
17
  "@reventlessdev/rescript-jest": "1.0.0-alpha.13",
19
- "@reventlessdev/reventless-infra": "3.0.0-alpha.198",
18
+ "@reventlessdev/rescript-effect": "1.0.0-alpha.1",
20
19
  "@reventlessdev/rescript-node": "2.0.0-alpha.23",
21
- "@reventlessdev/reventless-core": "3.0.0-alpha.301",
22
- "@reventlessdev/reventless-spec": "3.0.0-alpha.170"
20
+ "@reventlessdev/reventless-core": "3.0.0-alpha.303",
21
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.200",
22
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.172"
23
23
  },
24
24
  "devDependencies": {
25
25
  "rescript": "12.3.1",
26
26
  "sury-ppx": "11.0.0",
27
- "@reventlessdev/reventless-ppx": "1.0.0-alpha.103"
27
+ "@reventlessdev/reventless-ppx": "1.0.0-alpha.104"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "rescript": "^12.3.1"
@@ -152,7 +152,7 @@ module Acting = (Spec: ActingSpec) => {
152
152
  } else {
153
153
  refusal :=
154
154
  Some({
155
- errorCode: "Forbidden",
155
+ errorCode: Reventless.CommandOutcome.code(Forbidden),
156
156
  errorDetail: `${Spec.name}.${commandName(
157
157
  command,
158
158
  )}: the caller holds no role this command's rule admits`,
@@ -211,7 +211,9 @@ module Acting = (Spec: ActingSpec) => {
211
211
  Outcome.fail(
212
212
  ErrorMismatch({
213
213
  expected: JSON.Encode.object(
214
- Dict.fromArray([("errorCode", JSON.Encode.string("Forbidden"))]),
214
+ Dict.fromArray([
215
+ ("errorCode", JSON.Encode.string(Reventless.CommandOutcome.code(Forbidden))),
216
+ ]),
215
217
  ),
216
218
  actual: decided,
217
219
  actualEvents: encEvents(events),
@@ -14,6 +14,7 @@ import * as OwnerScope$Reventless from "@reventlessdev/reventless-spec/src/types
14
14
  import * as JestBind$ReventlessGwt from "./JestBind.res.mjs";
15
15
  import * as Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
16
16
  import * as Authorization$Reventless from "@reventlessdev/reventless-spec/src/types/Authorization.res.mjs";
17
+ import * as CommandOutcome$Reventless from "@reventlessdev/reventless-spec/src/components/CommandOutcome.res.mjs";
17
18
  import * as DcbScopeInference$Reventless from "@reventlessdev/reventless-spec/src/components/DcbScopeInference.res.mjs";
18
19
  import * as ScenarioRecorder$ReventlessGwt from "./ScenarioRecorder.res.mjs";
19
20
  import * as CommandTopic_Helpers$ReventlessCore from "@reventlessdev/reventless-core/src/components/CommandTopic/CommandTopic_Helpers.res.mjs";
@@ -111,7 +112,7 @@ function Acting(Spec) {
111
112
  return false;
112
113
  } else {
113
114
  refusal.contents = {
114
- errorCode: "Forbidden",
115
+ errorCode: CommandOutcome$Reventless.code("Forbidden"),
115
116
  errorDetail: Spec.name + `.` + Message$ReventlessCore.variantNameOfJson(Message$ReventlessCore.encode(command, Spec.commandSchema)) + `: the caller holds no role this command's rule admits`
116
117
  };
117
118
  return true;
@@ -165,7 +166,7 @@ function Acting(Spec) {
165
166
  TAG: "ErrorMismatch",
166
167
  expected: Object.fromEntries([[
167
168
  "errorCode",
168
- "Forbidden"
169
+ CommandOutcome$Reventless.code("Forbidden")
169
170
  ]]),
170
171
  actual: decided,
171
172
  actualEvents: encEvents(events)
@@ -399,7 +400,7 @@ function Make(Spec) {
399
400
  return false;
400
401
  } else {
401
402
  refusal.contents = {
402
- errorCode: "Forbidden",
403
+ errorCode: CommandOutcome$Reventless.code("Forbidden"),
403
404
  errorDetail: name + `.` + Message$ReventlessCore.variantNameOfJson(Message$ReventlessCore.encode(command, commandSchema)) + `: the caller holds no role this command's rule admits`
404
405
  };
405
406
  return true;
@@ -559,7 +560,7 @@ function Make(Spec) {
559
560
  TAG: "ErrorMismatch",
560
561
  expected: Object.fromEntries([[
561
562
  "errorCode",
562
- "Forbidden"
563
+ CommandOutcome$Reventless.code("Forbidden")
563
564
  ]]),
564
565
  actual: decided,
565
566
  actualEvents: encEvents(events)
@@ -788,7 +789,7 @@ function MakeFromAggregate(Spec) {
788
789
  return false;
789
790
  } else {
790
791
  refusal.contents = {
791
- errorCode: "Forbidden",
792
+ errorCode: CommandOutcome$Reventless.code("Forbidden"),
792
793
  errorDetail: name + `.` + Message$ReventlessCore.variantNameOfJson(Message$ReventlessCore.encode(command, commandSchema)) + `: the caller holds no role this command's rule admits`
793
794
  };
794
795
  return true;
@@ -921,7 +922,7 @@ function MakeFromAggregate(Spec) {
921
922
  TAG: "ErrorMismatch",
922
923
  expected: Object.fromEntries([[
923
924
  "errorCode",
924
- "Forbidden"
925
+ CommandOutcome$Reventless.code("Forbidden")
925
926
  ]]),
926
927
  actual: decided,
927
928
  actualEvents: encEvents(events)
@@ -20,7 +20,7 @@ module type Spec = {
20
20
 
21
21
  let stateSchema: S.t<state>
22
22
 
23
- module Key: Reventless.Id.T
23
+ module Id: Reventless.Id.T
24
24
 
25
25
  @schema
26
26
  type consumedEvent
@@ -33,7 +33,7 @@ module type Projection = {
33
33
  module Spec: Spec
34
34
 
35
35
  let project: Reventless.StateViewSlice.consumed<Spec.consumedEvent> => array<
36
- Reventless.Projection.action<Spec.Key.t, Spec.state>,
36
+ Reventless.Projection.action<Spec.Id.t, Spec.state>,
37
37
  >
38
38
  }
39
39
 
@@ -180,7 +180,7 @@ module Make = (Spec: Spec, Projection: Projection with module Spec := Spec): (
180
180
  ->Projection.project
181
181
  ->Array.map(action =>
182
182
  action
183
- ->Reventless.Projection.mapActionId(~to_=Spec.Key.toString, ~from=Spec.Key.makeFromString)
183
+ ->Reventless.Projection.mapActionId(~to_=Spec.Id.toString, ~from=Spec.Id.makeFromString)
184
184
  ->ReventlessCore.Projection.rewriteTrail(~at=TestFixtures.meta.time, Spec.stateSchema)
185
185
  )
186
186
  )
@@ -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",
@@ -120,7 +120,7 @@ module ShipOrderDecision = {
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
@@ -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,
@@ -4,7 +4,7 @@
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
@@ -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,
@@ -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
  })
@@ -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}
@@ -242,7 +242,7 @@ let subIdConfig = {
242
242
  let OrdersView = {
243
243
  name: name$1,
244
244
  moduleUrl: moduleUrl$1,
245
- Key: undefined,
245
+ Id: undefined,
246
246
  stateSchema: stateSchema$1,
247
247
  consumedEventSchema: consumedEventSchema,
248
248
  project: project,
@@ -256,7 +256,7 @@ let OrdersQuery = Query_GWT$ReventlessGwt.Make(Query_GWT$ReventlessGwt.FromState
256
256
  name: name$1,
257
257
  moduleUrl: moduleUrl$1,
258
258
  stateSchema: stateSchema$1,
259
- Key: {
259
+ Id: {
260
260
  schema: Id$Reventless.StringPure.schema,
261
261
  make: prim => prim,
262
262
  makeFromString: prim => prim,
@@ -11,7 +11,7 @@
11
11
  open Reventless.Projection
12
12
 
13
13
  module CategoriesView = {
14
- module Key = Reventless.Id.StringPure
14
+ module Id = Reventless.Id.StringPure
15
15
  let name = "CategoriesView"
16
16
 
17
17
  @schema
@@ -30,7 +30,7 @@ let consumedEventSchema = Sury.union([
30
30
  ]);
31
31
 
32
32
  let CategoriesView = {
33
- Key: undefined,
33
+ Id: undefined,
34
34
  name: name,
35
35
  stateSchema: stateSchema,
36
36
  consumedEventSchema: consumedEventSchema,
@@ -85,7 +85,7 @@ let CategoriesViewProjection = {
85
85
  let include = Projection_GWT$ReventlessGwt.Make({
86
86
  name: name,
87
87
  stateSchema: stateSchema,
88
- Key: {
88
+ Id: {
89
89
  schema: Id$Reventless.StringPure.schema,
90
90
  make: prim => prim,
91
91
  makeFromString: prim => prim,