@reventlessdev/reventless-core 3.0.0-alpha.292 → 3.0.0-alpha.294

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 (49) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/package.json +9 -9
  3. package/src/admin/Platform_Admin_Structure.res +1 -2
  4. package/src/admin/Platform_Admin_Structure.res.mjs +1 -1
  5. package/src/admin/UiFragmentRegistry/StateChange/UiFragmentRegistry.res.mjs +2 -2
  6. package/src/components/Dcb/Dcb_Builder.res +11 -20
  7. package/src/components/Dcb/Dcb_Builder.res.mjs +7 -12
  8. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res +27 -24
  9. package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +4 -4
  10. package/src/plugin/component/Plugin_Builder.res +8 -18
  11. package/src/plugin/component/Plugin_Builder.res.mjs +2 -8
  12. package/src/plugin/component/Plugin_Helpers.res +5 -6
  13. package/src/plugin/component/Plugin_Helpers.res.mjs +1 -1
  14. package/src/plugin/component/Plugin_Structure.res +22 -28
  15. package/src/plugin/component/Plugin_Structure.res.mjs +12 -12
  16. package/src/plugin/connect/PluginConnectExtension_Mapping.res.mjs +1 -1
  17. package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +1 -1
  18. package/src/plugin/connect/PluginExtensionPoint_UiFragment.res +1 -1
  19. package/src/plugin/connect/PluginExtensionPoint_UiFragment.res.mjs +1 -1
  20. package/src/plugin/lifecycle/PluginSpec.res.mjs +2 -2
  21. package/tests/aggregate/AggregateCacheTest.res.mjs +4 -4
  22. package/tests/aggregate/AggregateConflictTest.res.mjs +4 -4
  23. package/tests/aggregate/AggregateFixtures.res.mjs +4 -4
  24. package/tests/aggregate/AggregateSnapshotTest.res.mjs +6 -6
  25. package/tests/api/GraphQL_FragmentGeneratorTest.res.mjs +6 -6
  26. package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +3 -3
  27. package/tests/commandgenerator/OwnerActingTest.res.mjs +7 -7
  28. package/tests/commandtopic/CommandOutcomeHookTest.res.mjs +1 -1
  29. package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +3 -3
  30. package/tests/dcb/DcbFixtures.res.mjs +2 -2
  31. package/tests/dcb/DcbStateChangeSliceTest.res.mjs +7 -7
  32. package/tests/eventmapper/EventMapperFixtures.res.mjs +4 -4
  33. package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +2 -2
  34. package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +2 -2
  35. package/tests/plugin/PluginStructureAccessTest.res +6 -5
  36. package/tests/plugin/PluginStructureAccessTest.res.mjs +17 -14
  37. package/tests/plugin/PluginStructureTest.res.mjs +10 -10
  38. package/tests/plugin/StateChange/PsAttachInvoice.res.mjs +2 -2
  39. package/tests/plugin/StateChange/PsChangePhoto.res.mjs +2 -2
  40. package/tests/plugin/StateChange/PsDispatchShipment.res.mjs +2 -2
  41. package/tests/plugin/StateChange/PsGatedCommands.res.mjs +3 -3
  42. package/tests/plugin/StateChange/PsPlaceOrder.res.mjs +2 -2
  43. package/tests/plugin/StateChange/PsReserveStock.res.mjs +2 -2
  44. package/tests/plugin/StateChange/PsShipOrder.res.mjs +2 -2
  45. package/tests/plugin/StateChange/PsTransitionSwitch.res.mjs +2 -2
  46. package/tests/plugin/StateChange/PsTypoStore.res.mjs +2 -2
  47. package/tests/plugin/StateChange/PsUploadAvatar.res.mjs +2 -2
  48. package/tests/plugin/StateChange/PsUploadImages.res.mjs +2 -2
  49. package/tests/util/CommandPublisherTest.res.mjs +2 -2
@@ -30,7 +30,7 @@ let PsGatedCommandsSlice_Spec = {
30
30
  errorSchema: PsGatedCommands$ReventlessCore.errorSchema,
31
31
  eventSchema: PsGatedCommands$ReventlessCore.eventSchema,
32
32
  commandSchema: PsGatedCommands$ReventlessCore.commandSchema,
33
- commandAuthorization: PsGatedCommands$ReventlessCore.commandAuthorization,
33
+ authorizationOf: PsGatedCommands$ReventlessCore.authorizationOf,
34
34
  commandTransition: PsGatedCommands$ReventlessCore.commandTransition,
35
35
  traits: PsGatedCommands$ReventlessCore.traits,
36
36
  readConsistency: PsGatedCommands$ReventlessCore.readConsistency
@@ -195,17 +195,20 @@ let commandSchema = Sury.union([
195
195
  }))
196
196
  ]);
197
197
 
198
- function commandAuthorization(command) {
199
- if (command.TAG === "AddProduct") {
200
- return {
201
- TAG: "AllowRoles",
202
- _0: ["Merchandiser"]
203
- };
204
- } else {
205
- return {
206
- TAG: "AllowRoles",
207
- _0: ["Admin"]
208
- };
198
+ function authorizationOf(name) {
199
+ switch (name) {
200
+ case "AddCategory" :
201
+ return {
202
+ TAG: "AllowRoles",
203
+ _0: ["Admin"]
204
+ };
205
+ case "AddProduct" :
206
+ return {
207
+ TAG: "AllowRoles",
208
+ _0: ["Merchandiser"]
209
+ };
210
+ default:
211
+ return "DenyAll";
209
212
  }
210
213
  }
211
214
 
@@ -218,7 +221,7 @@ let PsTwoRuleFeed = {
218
221
  commandSchema: commandSchema,
219
222
  targetName: "AddProduct",
220
223
  externalSystem: undefined,
221
- commandAuthorization: commandAuthorization,
224
+ authorizationOf: authorizationOf,
222
225
  traits: traits
223
226
  };
224
227
 
@@ -246,7 +249,7 @@ let PsTwoRuleFeedSlice = {
246
249
  };
247
250
 
248
251
  globalThis.describe("an inbound slice's roles", () => {
249
- let door = Dcb_Builder$ReventlessCore.inboundDoorPermission(commandSchema, commandAuthorization);
252
+ let door = Dcb_Builder$ReventlessCore.inboundDoorPermission(commandSchema, authorizationOf);
250
253
  globalThis.test("the door admits any constructor's roles", () => {
251
254
  globalThis.expect(Stdlib_Option.map(door, Authorization$Reventless.rolesOf)).toEqual([
252
255
  "Merchandiser",
@@ -53,7 +53,7 @@ let PsPlaceOrderSlice_Spec = {
53
53
  errorSchema: PsPlaceOrder$ReventlessCore.errorSchema,
54
54
  eventSchema: PsPlaceOrder$ReventlessCore.eventSchema,
55
55
  commandSchema: PsPlaceOrder$ReventlessCore.commandSchema,
56
- commandAuthorization: PsPlaceOrder$ReventlessCore.commandAuthorization,
56
+ authorizationOf: PsPlaceOrder$ReventlessCore.authorizationOf,
57
57
  commandTransition: PsPlaceOrder$ReventlessCore.commandTransition,
58
58
  traits: PsPlaceOrder$ReventlessCore.traits,
59
59
  readConsistency: PsPlaceOrder$ReventlessCore.readConsistency
@@ -84,7 +84,7 @@ let PsShipOrderSlice_Spec = {
84
84
  errorSchema: PsShipOrder$ReventlessCore.errorSchema,
85
85
  eventSchema: PsShipOrder$ReventlessCore.eventSchema,
86
86
  commandSchema: PsShipOrder$ReventlessCore.commandSchema,
87
- commandAuthorization: PsShipOrder$ReventlessCore.commandAuthorization,
87
+ authorizationOf: PsShipOrder$ReventlessCore.authorizationOf,
88
88
  commandTransition: PsShipOrder$ReventlessCore.commandTransition,
89
89
  traits: PsShipOrder$ReventlessCore.traits,
90
90
  readConsistency: PsShipOrder$ReventlessCore.readConsistency
@@ -280,7 +280,7 @@ let PsAttachInvoiceSlice_Spec = {
280
280
  errorSchema: PsAttachInvoice$ReventlessCore.errorSchema,
281
281
  eventSchema: PsAttachInvoice$ReventlessCore.eventSchema,
282
282
  commandSchema: PsAttachInvoice$ReventlessCore.commandSchema,
283
- commandAuthorization: PsAttachInvoice$ReventlessCore.commandAuthorization,
283
+ authorizationOf: PsAttachInvoice$ReventlessCore.authorizationOf,
284
284
  commandTransition: PsAttachInvoice$ReventlessCore.commandTransition,
285
285
  traits: PsAttachInvoice$ReventlessCore.traits,
286
286
  readConsistency: PsAttachInvoice$ReventlessCore.readConsistency
@@ -311,7 +311,7 @@ let PsUploadAvatarSlice_Spec = {
311
311
  errorSchema: PsUploadAvatar$ReventlessCore.errorSchema,
312
312
  eventSchema: PsUploadAvatar$ReventlessCore.eventSchema,
313
313
  commandSchema: PsUploadAvatar$ReventlessCore.commandSchema,
314
- commandAuthorization: PsUploadAvatar$ReventlessCore.commandAuthorization,
314
+ authorizationOf: PsUploadAvatar$ReventlessCore.authorizationOf,
315
315
  commandTransition: PsUploadAvatar$ReventlessCore.commandTransition,
316
316
  traits: PsUploadAvatar$ReventlessCore.traits,
317
317
  readConsistency: PsUploadAvatar$ReventlessCore.readConsistency
@@ -342,7 +342,7 @@ let PsUploadImagesSlice_Spec = {
342
342
  errorSchema: PsUploadImages$ReventlessCore.errorSchema,
343
343
  eventSchema: PsUploadImages$ReventlessCore.eventSchema,
344
344
  commandSchema: PsUploadImages$ReventlessCore.commandSchema,
345
- commandAuthorization: PsUploadImages$ReventlessCore.commandAuthorization,
345
+ authorizationOf: PsUploadImages$ReventlessCore.authorizationOf,
346
346
  commandTransition: PsUploadImages$ReventlessCore.commandTransition,
347
347
  traits: PsUploadImages$ReventlessCore.traits,
348
348
  readConsistency: PsUploadImages$ReventlessCore.readConsistency
@@ -373,7 +373,7 @@ let PsTypoStoreSlice_Spec = {
373
373
  errorSchema: PsTypoStore$ReventlessCore.errorSchema,
374
374
  eventSchema: PsTypoStore$ReventlessCore.eventSchema,
375
375
  commandSchema: PsTypoStore$ReventlessCore.commandSchema,
376
- commandAuthorization: PsTypoStore$ReventlessCore.commandAuthorization,
376
+ authorizationOf: PsTypoStore$ReventlessCore.authorizationOf,
377
377
  commandTransition: PsTypoStore$ReventlessCore.commandTransition,
378
378
  traits: PsTypoStore$ReventlessCore.traits,
379
379
  readConsistency: PsTypoStore$ReventlessCore.readConsistency
@@ -404,7 +404,7 @@ let PsChangePhotoSlice_Spec = {
404
404
  errorSchema: PsChangePhoto$ReventlessCore.errorSchema,
405
405
  eventSchema: PsChangePhoto$ReventlessCore.eventSchema,
406
406
  commandSchema: PsChangePhoto$ReventlessCore.commandSchema,
407
- commandAuthorization: PsChangePhoto$ReventlessCore.commandAuthorization,
407
+ authorizationOf: PsChangePhoto$ReventlessCore.authorizationOf,
408
408
  commandTransition: PsChangePhoto$ReventlessCore.commandTransition,
409
409
  traits: PsChangePhoto$ReventlessCore.traits,
410
410
  readConsistency: PsChangePhoto$ReventlessCore.readConsistency
@@ -435,7 +435,7 @@ let PsReserveStockSlice_Spec = {
435
435
  errorSchema: PsReserveStock$ReventlessCore.errorSchema,
436
436
  eventSchema: PsReserveStock$ReventlessCore.eventSchema,
437
437
  commandSchema: PsReserveStock$ReventlessCore.commandSchema,
438
- commandAuthorization: PsReserveStock$ReventlessCore.commandAuthorization,
438
+ authorizationOf: PsReserveStock$ReventlessCore.authorizationOf,
439
439
  commandTransition: PsReserveStock$ReventlessCore.commandTransition,
440
440
  traits: PsReserveStock$ReventlessCore.traits,
441
441
  readConsistency: PsReserveStock$ReventlessCore.readConsistency
@@ -466,7 +466,7 @@ let PsDispatchShipmentSlice_Spec = {
466
466
  errorSchema: PsDispatchShipment$ReventlessCore.errorSchema,
467
467
  eventSchema: PsDispatchShipment$ReventlessCore.eventSchema,
468
468
  commandSchema: PsDispatchShipment$ReventlessCore.commandSchema,
469
- commandAuthorization: PsDispatchShipment$ReventlessCore.commandAuthorization,
469
+ authorizationOf: PsDispatchShipment$ReventlessCore.authorizationOf,
470
470
  commandTransition: PsDispatchShipment$ReventlessCore.commandTransition,
471
471
  traits: PsDispatchShipment$ReventlessCore.traits,
472
472
  readConsistency: PsDispatchShipment$ReventlessCore.readConsistency
@@ -497,7 +497,7 @@ let PsTransitionSwitchSlice_Spec = {
497
497
  errorSchema: PsTransitionSwitch$ReventlessCore.errorSchema,
498
498
  eventSchema: PsTransitionSwitch$ReventlessCore.eventSchema,
499
499
  commandSchema: PsTransitionSwitch$ReventlessCore.commandSchema,
500
- commandAuthorization: PsTransitionSwitch$ReventlessCore.commandAuthorization,
500
+ authorizationOf: PsTransitionSwitch$ReventlessCore.authorizationOf,
501
501
  commandTransition: PsTransitionSwitch$ReventlessCore.commandTransition,
502
502
  traits: PsTransitionSwitch$ReventlessCore.traits,
503
503
  readConsistency: PsTransitionSwitch$ReventlessCore.readConsistency
@@ -32,7 +32,7 @@ function decide(_state, _command) {
32
32
  };
33
33
  }
34
34
 
35
- function commandAuthorization(param) {
35
+ function authorizationOf(param) {
36
36
  return "AllowAuthenticated";
37
37
  }
38
38
 
@@ -63,7 +63,7 @@ export {
63
63
  eventSchema,
64
64
  decide,
65
65
  moduleUrl,
66
- commandAuthorization,
66
+ authorizationOf,
67
67
  readConsistency,
68
68
  commandTransition,
69
69
  traits,
@@ -33,7 +33,7 @@ function decide(_state, _command) {
33
33
  };
34
34
  }
35
35
 
36
- function commandAuthorization(param) {
36
+ function authorizationOf(param) {
37
37
  return "AllowAuthenticated";
38
38
  }
39
39
 
@@ -64,7 +64,7 @@ export {
64
64
  eventSchema,
65
65
  decide,
66
66
  moduleUrl,
67
- commandAuthorization,
67
+ authorizationOf,
68
68
  readConsistency,
69
69
  commandTransition,
70
70
  traits,
@@ -39,7 +39,7 @@ function commandTransition(command) {
39
39
  };
40
40
  }
41
41
 
42
- function commandAuthorization(param) {
42
+ function authorizationOf(param) {
43
43
  return "AllowAuthenticated";
44
44
  }
45
45
 
@@ -67,7 +67,7 @@ export {
67
67
  decide,
68
68
  commandTransition,
69
69
  moduleUrl,
70
- commandAuthorization,
70
+ authorizationOf,
71
71
  readConsistency,
72
72
  traits,
73
73
  }
@@ -45,8 +45,8 @@ function decide(_state, _command) {
45
45
  };
46
46
  }
47
47
 
48
- function commandAuthorization(command) {
49
- if (command.TAG === "Restock") {
48
+ function authorizationOf(name) {
49
+ if (name === "Restock") {
50
50
  return {
51
51
  TAG: "AllowRoles",
52
52
  _0: [
@@ -87,7 +87,7 @@ export {
87
87
  eventSchema,
88
88
  decide,
89
89
  moduleUrl,
90
- commandAuthorization,
90
+ authorizationOf,
91
91
  readConsistency,
92
92
  commandTransition,
93
93
  traits,
@@ -31,7 +31,7 @@ function decide(_state, _command) {
31
31
  };
32
32
  }
33
33
 
34
- function commandAuthorization(param) {
34
+ function authorizationOf(param) {
35
35
  return "AllowAuthenticated";
36
36
  }
37
37
 
@@ -62,7 +62,7 @@ export {
62
62
  eventSchema,
63
63
  decide,
64
64
  moduleUrl,
65
- commandAuthorization,
65
+ authorizationOf,
66
66
  readConsistency,
67
67
  commandTransition,
68
68
  traits,
@@ -42,7 +42,7 @@ function decide(_state, _command) {
42
42
  };
43
43
  }
44
44
 
45
- function commandAuthorization(param) {
45
+ function authorizationOf(param) {
46
46
  return "AllowAuthenticated";
47
47
  }
48
48
 
@@ -74,7 +74,7 @@ export {
74
74
  eventSchema,
75
75
  decide,
76
76
  moduleUrl,
77
- commandAuthorization,
77
+ authorizationOf,
78
78
  readConsistency,
79
79
  commandTransition,
80
80
  traits,
@@ -59,7 +59,7 @@ function commandTransition(command) {
59
59
 
60
60
  let commandSchema$1 = Api$ReventlessInfra.markNoApiVariants(commandSchema, ["CancelShipment"]);
61
61
 
62
- function commandAuthorization(param) {
62
+ function authorizationOf(param) {
63
63
  return "AllowAuthenticated";
64
64
  }
65
65
 
@@ -87,7 +87,7 @@ export {
87
87
  commandTransition,
88
88
  commandSchema$1 as commandSchema,
89
89
  moduleUrl,
90
- commandAuthorization,
90
+ authorizationOf,
91
91
  readConsistency,
92
92
  traits,
93
93
  }
@@ -71,7 +71,7 @@ let traits = [{
71
71
  posture: "SelfContained"
72
72
  }];
73
73
 
74
- function commandAuthorization(param) {
74
+ function authorizationOf(param) {
75
75
  return "AllowAuthenticated";
76
76
  }
77
77
 
@@ -98,7 +98,7 @@ export {
98
98
  commandTransition,
99
99
  traits,
100
100
  moduleUrl,
101
- commandAuthorization,
101
+ authorizationOf,
102
102
  readConsistency,
103
103
  }
104
104
  /* consumedEventSchema Not a pure module */
@@ -31,7 +31,7 @@ function decide(_state, _command) {
31
31
  };
32
32
  }
33
33
 
34
- function commandAuthorization(param) {
34
+ function authorizationOf(param) {
35
35
  return "AllowAuthenticated";
36
36
  }
37
37
 
@@ -62,7 +62,7 @@ export {
62
62
  eventSchema,
63
63
  decide,
64
64
  moduleUrl,
65
- commandAuthorization,
65
+ authorizationOf,
66
66
  readConsistency,
67
67
  commandTransition,
68
68
  traits,
@@ -33,7 +33,7 @@ function decide(_state, _command) {
33
33
  };
34
34
  }
35
35
 
36
- function commandAuthorization(param) {
36
+ function authorizationOf(param) {
37
37
  return "AllowAuthenticated";
38
38
  }
39
39
 
@@ -64,7 +64,7 @@ export {
64
64
  eventSchema,
65
65
  decide,
66
66
  moduleUrl,
67
- commandAuthorization,
67
+ authorizationOf,
68
68
  readConsistency,
69
69
  commandTransition,
70
70
  traits,
@@ -35,7 +35,7 @@ function decide(_state, _command) {
35
35
  };
36
36
  }
37
37
 
38
- function commandAuthorization(param) {
38
+ function authorizationOf(param) {
39
39
  return "AllowAuthenticated";
40
40
  }
41
41
 
@@ -66,7 +66,7 @@ export {
66
66
  eventSchema,
67
67
  decide,
68
68
  moduleUrl,
69
- commandAuthorization,
69
+ authorizationOf,
70
70
  readConsistency,
71
71
  commandTransition,
72
72
  traits,
@@ -11,7 +11,7 @@ let commandSchema = Sury.$schema(s => ({
11
11
  value: s.m(Sury.int32)
12
12
  }));
13
13
 
14
- function commandAuthorization(param) {
14
+ function authorizationOf(param) {
15
15
  return "AllowAuthenticated";
16
16
  }
17
17
 
@@ -24,7 +24,7 @@ let traits = [];
24
24
  let TestSpec = {
25
25
  name: "TestCmd",
26
26
  commandSchema: commandSchema,
27
- commandAuthorization: commandAuthorization,
27
+ authorizationOf: authorizationOf,
28
28
  commandTransition: commandTransition,
29
29
  traits: traits
30
30
  };