@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.
- package/CHANGELOG.md +19 -0
- package/package.json +9 -9
- package/src/admin/Platform_Admin_Structure.res +1 -2
- package/src/admin/Platform_Admin_Structure.res.mjs +1 -1
- package/src/admin/UiFragmentRegistry/StateChange/UiFragmentRegistry.res.mjs +2 -2
- package/src/components/Dcb/Dcb_Builder.res +11 -20
- package/src/components/Dcb/Dcb_Builder.res.mjs +7 -12
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res +27 -24
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +4 -4
- package/src/plugin/component/Plugin_Builder.res +8 -18
- package/src/plugin/component/Plugin_Builder.res.mjs +2 -8
- package/src/plugin/component/Plugin_Helpers.res +5 -6
- package/src/plugin/component/Plugin_Helpers.res.mjs +1 -1
- package/src/plugin/component/Plugin_Structure.res +22 -28
- package/src/plugin/component/Plugin_Structure.res.mjs +12 -12
- package/src/plugin/connect/PluginConnectExtension_Mapping.res.mjs +1 -1
- package/src/plugin/connect/PluginExtensionPoint_Plugin.res.mjs +1 -1
- package/src/plugin/connect/PluginExtensionPoint_UiFragment.res +1 -1
- package/src/plugin/connect/PluginExtensionPoint_UiFragment.res.mjs +1 -1
- package/src/plugin/lifecycle/PluginSpec.res.mjs +2 -2
- package/tests/aggregate/AggregateCacheTest.res.mjs +4 -4
- package/tests/aggregate/AggregateConflictTest.res.mjs +4 -4
- package/tests/aggregate/AggregateFixtures.res.mjs +4 -4
- package/tests/aggregate/AggregateSnapshotTest.res.mjs +6 -6
- package/tests/api/GraphQL_FragmentGeneratorTest.res.mjs +6 -6
- package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +3 -3
- package/tests/commandgenerator/OwnerActingTest.res.mjs +7 -7
- package/tests/commandtopic/CommandOutcomeHookTest.res.mjs +1 -1
- package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +3 -3
- package/tests/dcb/DcbFixtures.res.mjs +2 -2
- package/tests/dcb/DcbStateChangeSliceTest.res.mjs +7 -7
- package/tests/eventmapper/EventMapperFixtures.res.mjs +4 -4
- package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +2 -2
- package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +2 -2
- package/tests/plugin/PluginStructureAccessTest.res +6 -5
- package/tests/plugin/PluginStructureAccessTest.res.mjs +17 -14
- package/tests/plugin/PluginStructureTest.res.mjs +10 -10
- package/tests/plugin/StateChange/PsAttachInvoice.res.mjs +2 -2
- package/tests/plugin/StateChange/PsChangePhoto.res.mjs +2 -2
- package/tests/plugin/StateChange/PsDispatchShipment.res.mjs +2 -2
- package/tests/plugin/StateChange/PsGatedCommands.res.mjs +3 -3
- package/tests/plugin/StateChange/PsPlaceOrder.res.mjs +2 -2
- package/tests/plugin/StateChange/PsReserveStock.res.mjs +2 -2
- package/tests/plugin/StateChange/PsShipOrder.res.mjs +2 -2
- package/tests/plugin/StateChange/PsTransitionSwitch.res.mjs +2 -2
- package/tests/plugin/StateChange/PsTypoStore.res.mjs +2 -2
- package/tests/plugin/StateChange/PsUploadAvatar.res.mjs +2 -2
- package/tests/plugin/StateChange/PsUploadImages.res.mjs +2 -2
- package/tests/util/CommandPublisherTest.res.mjs +2 -2
|
@@ -644,12 +644,12 @@ function syntheticCommand(schema, variantName) {
|
|
|
644
644
|
}
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
-
function constructorPermissions(commandSchema,
|
|
648
|
-
return DcbTag$Reventless.extractAllVariantNames(commandSchema).map(
|
|
647
|
+
function constructorPermissions(commandSchema, authorizationOf) {
|
|
648
|
+
return DcbTag$Reventless.extractAllVariantNames(commandSchema).map(authorizationOf);
|
|
649
649
|
}
|
|
650
650
|
|
|
651
|
-
function inboundDoorPermission(commandSchema,
|
|
652
|
-
return Authorization$Reventless.anyOf(
|
|
651
|
+
function inboundDoorPermission(commandSchema, authorizationOf) {
|
|
652
|
+
return Authorization$Reventless.anyOf(DcbTag$Reventless.extractAllVariantNames(commandSchema).map(authorizationOf));
|
|
653
653
|
}
|
|
654
654
|
|
|
655
655
|
function annotateArgTypes(schema, argTypes) {
|
|
@@ -666,7 +666,7 @@ function annotateArgTypes(schema, argTypes) {
|
|
|
666
666
|
return schema;
|
|
667
667
|
}
|
|
668
668
|
|
|
669
|
-
function toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor, parentSchema,
|
|
669
|
+
function toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor, parentSchema, authorizationOf, commandTransition, derivedEdgeFor, v) {
|
|
670
670
|
let mkDef = (variantName, properties) => {
|
|
671
671
|
let match = commandLevelAndId(isAggregate, partitionKey, variantName, properties);
|
|
672
672
|
let aggregateIdField = match[1];
|
|
@@ -708,7 +708,7 @@ function toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor
|
|
|
708
708
|
let excluded = ApiNoApiHelpers$ReventlessCore.getExcludedVariants(parentSchema);
|
|
709
709
|
apiExposed = excluded !== undefined ? !excluded.has(variantName) : true;
|
|
710
710
|
}
|
|
711
|
-
let rule =
|
|
711
|
+
let rule = authorizationOf(variantName);
|
|
712
712
|
let requiredAccess = accessKeysFor(rule);
|
|
713
713
|
let mutationField = apiExposed ? mutationFieldFor(variantName) : "";
|
|
714
714
|
let jsonSchema = SuryToJsonSchema$ReventlessCore.deriveObjectSchema(apiExposed, mutationField, v);
|
|
@@ -753,12 +753,12 @@ function toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor
|
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
-
function extractCommandDefs(identityViews, isAggregate, partitionKey, mutationFieldFor,
|
|
756
|
+
function extractCommandDefs(identityViews, isAggregate, partitionKey, mutationFieldFor, authorizationOf, commandTransition, derivedEdgeForOpt, commandSchema) {
|
|
757
757
|
let derivedEdgeFor = derivedEdgeForOpt !== undefined ? derivedEdgeForOpt : param => {};
|
|
758
758
|
if (commandSchema.type === "anyOf") {
|
|
759
|
-
return Stdlib_Array.filterMap(commandSchema.anyOf, v => toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor, commandSchema,
|
|
759
|
+
return Stdlib_Array.filterMap(commandSchema.anyOf, v => toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor, commandSchema, authorizationOf, commandTransition, derivedEdgeFor, v));
|
|
760
760
|
} else {
|
|
761
|
-
return Stdlib_Option.mapOr(toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor, commandSchema,
|
|
761
|
+
return Stdlib_Option.mapOr(toCommandDef(identityViews, isAggregate, partitionKey, mutationFieldFor, commandSchema, authorizationOf, commandTransition, derivedEdgeFor, commandSchema), [], def => [def]);
|
|
762
762
|
}
|
|
763
763
|
}
|
|
764
764
|
|
|
@@ -1226,7 +1226,7 @@ function make(name, aggregatesOpt, readModelsOpt, stateViewSlicesOpt, stateChang
|
|
|
1226
1226
|
let consumed = match$1[1];
|
|
1227
1227
|
return {
|
|
1228
1228
|
name: SCS.Spec.name,
|
|
1229
|
-
commands: extractCommandDefs(identityViews, false, partitionBySlice[SCS.Spec.name], variantName => Api_Naming$ReventlessCore.sliceMutationFieldFor(name, SCS.Spec.name, SCS.Spec.commandSchema, variantName),
|
|
1229
|
+
commands: extractCommandDefs(identityViews, false, partitionBySlice[SCS.Spec.name], variantName => Api_Naming$ReventlessCore.sliceMutationFieldFor(name, SCS.Spec.name, SCS.Spec.commandSchema, variantName), name => Authorization$Reventless.named(SCS.Spec.authorizationOf(name)), SCS.Spec.commandTransition, extra => derivedEdgeFor(SCS.Spec.name, extra), SCS.Spec.commandSchema),
|
|
1230
1230
|
producedEventTypes: produced,
|
|
1231
1231
|
consumedEventTypes: consumed,
|
|
1232
1232
|
linkedViews: linkedSvsFor(produced),
|
|
@@ -1241,7 +1241,7 @@ function make(name, aggregatesOpt, readModelsOpt, stateViewSlicesOpt, stateChang
|
|
|
1241
1241
|
let produced = match[1];
|
|
1242
1242
|
return {
|
|
1243
1243
|
name: A.Spec.name,
|
|
1244
|
-
commands: extractCommandDefs(identityViews, true, undefined, variantName => Api_Naming$ReventlessCore.aggregateMutationField(name, A.Spec.name, variantName),
|
|
1244
|
+
commands: extractCommandDefs(identityViews, true, undefined, variantName => Api_Naming$ReventlessCore.aggregateMutationField(name, A.Spec.name, variantName), name => Authorization$Reventless.named(A.Spec.authorizationOf(name)), A.Spec.commandTransition, extra => derivedEdgeFor(A.Spec.name, extra), A.Spec.commandSchema),
|
|
1245
1245
|
producedEventTypes: produced,
|
|
1246
1246
|
consumedEventTypes: [],
|
|
1247
1247
|
linkedViews: linkedSvsFor(produced).concat(linkedReadModelsFor(A.Spec.name)),
|
|
@@ -1276,7 +1276,7 @@ function make(name, aggregatesOpt, readModelsOpt, stateViewSlicesOpt, stateChang
|
|
|
1276
1276
|
targetName: ITS.Spec.targetName,
|
|
1277
1277
|
externalSystem: ITS.Spec.externalSystem,
|
|
1278
1278
|
chapter: componentChapters[ITS.Spec.name],
|
|
1279
|
-
requiredRoles: nonEmpty(Array.from(new Set(
|
|
1279
|
+
requiredRoles: nonEmpty(Array.from(new Set(DcbTag$Reventless.extractAllVariantNames(ITS.Spec.commandSchema).map(name => Authorization$Reventless.named(ITS.Spec.authorizationOf(name))).flatMap(Authorization$Reventless.rolesOf).map(role => role)).values()))
|
|
1280
1280
|
}));
|
|
1281
1281
|
let tableFailures = [];
|
|
1282
1282
|
let tableWarnings = [];
|
|
@@ -75,7 +75,7 @@ function Make(Spec) {
|
|
|
75
75
|
errorSchema: ExtensionMapping$ReventlessInfra.NoDelegate.errorSchema,
|
|
76
76
|
commandSchema: ExtensionMapping$ReventlessInfra.NoDelegate.commandSchema,
|
|
77
77
|
moduleUrl: ExtensionMapping$ReventlessInfra.NoDelegate.moduleUrl,
|
|
78
|
-
|
|
78
|
+
authorizationOf: ExtensionMapping$ReventlessInfra.NoDelegate.authorizationOf,
|
|
79
79
|
commandTransition: ExtensionMapping$ReventlessInfra.NoDelegate.commandTransition,
|
|
80
80
|
traits: ExtensionMapping$ReventlessInfra.NoDelegate.traits
|
|
81
81
|
},
|
|
@@ -405,7 +405,7 @@ function Make(Spec) {
|
|
|
405
405
|
errorSchema: PluginSpec$ReventlessCore.errorSchema,
|
|
406
406
|
commandSchema: PluginSpec$ReventlessCore.commandSchema,
|
|
407
407
|
moduleUrl: PluginSpec$ReventlessCore.moduleUrl,
|
|
408
|
-
|
|
408
|
+
authorizationOf: PluginSpec$ReventlessCore.authorizationOf,
|
|
409
409
|
commandTransition: PluginSpec$ReventlessCore.commandTransition,
|
|
410
410
|
traits: PluginSpec$ReventlessCore.traits
|
|
411
411
|
},
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// aggregate; the two run side by side on the same EP.
|
|
10
10
|
//
|
|
11
11
|
// A StateChangeSlice Spec structurally satisfies Reventless.Aggregate.Spec (name, Id,
|
|
12
|
-
// command/event/error + schemas, commandSchema,
|
|
12
|
+
// command/event/error + schemas, commandSchema, authorizationOf, moduleUrl), which is all
|
|
13
13
|
// ExtensionPointMapping.Make consumes from a Delegate.
|
|
14
14
|
|
|
15
15
|
open ReventlessInfra.ExtensionPointMapping
|
|
@@ -72,7 +72,7 @@ let Mapping = ExtensionPointMapping$ReventlessInfra.Make({
|
|
|
72
72
|
errorSchema: UiFragmentRegistry$ReventlessCore.errorSchema,
|
|
73
73
|
commandSchema: UiFragmentRegistry$ReventlessCore.commandSchema,
|
|
74
74
|
moduleUrl: UiFragmentRegistry$ReventlessCore.moduleUrl,
|
|
75
|
-
|
|
75
|
+
authorizationOf: UiFragmentRegistry$ReventlessCore.authorizationOf,
|
|
76
76
|
commandTransition: UiFragmentRegistry$ReventlessCore.commandTransition,
|
|
77
77
|
traits: UiFragmentRegistry$ReventlessCore.traits
|
|
78
78
|
},
|
|
@@ -146,7 +146,7 @@ let commandSchema$1 = Api$ReventlessInfra.markNoApiVariants(commandSchema, [
|
|
|
146
146
|
"Disconnect"
|
|
147
147
|
]);
|
|
148
148
|
|
|
149
|
-
function
|
|
149
|
+
function authorizationOf(param) {
|
|
150
150
|
return "AllowAuthenticated";
|
|
151
151
|
}
|
|
152
152
|
|
|
@@ -170,7 +170,7 @@ export {
|
|
|
170
170
|
commandTransition,
|
|
171
171
|
commandSchema$1 as commandSchema,
|
|
172
172
|
moduleUrl,
|
|
173
|
-
|
|
173
|
+
authorizationOf,
|
|
174
174
|
traits,
|
|
175
175
|
}
|
|
176
176
|
/* commandSchema Not a pure module */
|
|
@@ -33,7 +33,7 @@ let errorSchema = Sury.literal("Never");
|
|
|
33
33
|
|
|
34
34
|
let moduleUrl = import.meta.url;
|
|
35
35
|
|
|
36
|
-
function
|
|
36
|
+
function authorizationOf(param) {
|
|
37
37
|
return "AllowAuthenticated";
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -50,7 +50,7 @@ let AggSpec = {
|
|
|
50
50
|
eventSchema: eventSchema,
|
|
51
51
|
errorSchema: errorSchema,
|
|
52
52
|
moduleUrl: moduleUrl,
|
|
53
|
-
|
|
53
|
+
authorizationOf: authorizationOf,
|
|
54
54
|
commandTransition: commandTransition,
|
|
55
55
|
traits: traits
|
|
56
56
|
};
|
|
@@ -245,7 +245,7 @@ let TestHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
245
245
|
errorSchema: errorSchema,
|
|
246
246
|
commandSchema: commandSchema,
|
|
247
247
|
moduleUrl: moduleUrl,
|
|
248
|
-
|
|
248
|
+
authorizationOf: authorizationOf,
|
|
249
249
|
commandTransition: commandTransition,
|
|
250
250
|
traits: traits
|
|
251
251
|
})({
|
|
@@ -268,7 +268,7 @@ let TestHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
268
268
|
errorSchema: errorSchema,
|
|
269
269
|
commandSchema: commandSchema,
|
|
270
270
|
moduleUrl: moduleUrl,
|
|
271
|
-
|
|
271
|
+
authorizationOf: authorizationOf,
|
|
272
272
|
commandTransition: commandTransition,
|
|
273
273
|
traits: traits
|
|
274
274
|
},
|
|
@@ -22,7 +22,7 @@ let errorSchema = Sury.literal("AlreadyExists");
|
|
|
22
22
|
|
|
23
23
|
let moduleUrl = import.meta.url;
|
|
24
24
|
|
|
25
|
-
function
|
|
25
|
+
function authorizationOf(param) {
|
|
26
26
|
return "AllowAuthenticated";
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -39,7 +39,7 @@ let AggSpec = {
|
|
|
39
39
|
eventSchema: eventSchema,
|
|
40
40
|
errorSchema: errorSchema,
|
|
41
41
|
moduleUrl: moduleUrl,
|
|
42
|
-
|
|
42
|
+
authorizationOf: authorizationOf,
|
|
43
43
|
commandTransition: commandTransition,
|
|
44
44
|
traits: traits
|
|
45
45
|
};
|
|
@@ -202,7 +202,7 @@ let TestHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
202
202
|
errorSchema: errorSchema,
|
|
203
203
|
commandSchema: commandSchema,
|
|
204
204
|
moduleUrl: moduleUrl,
|
|
205
|
-
|
|
205
|
+
authorizationOf: authorizationOf,
|
|
206
206
|
commandTransition: commandTransition,
|
|
207
207
|
traits: traits
|
|
208
208
|
})({
|
|
@@ -225,7 +225,7 @@ let TestHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
225
225
|
errorSchema: errorSchema,
|
|
226
226
|
commandSchema: commandSchema,
|
|
227
227
|
moduleUrl: moduleUrl,
|
|
228
|
-
|
|
228
|
+
authorizationOf: authorizationOf,
|
|
229
229
|
commandTransition: commandTransition,
|
|
230
230
|
traits: traits
|
|
231
231
|
},
|
|
@@ -36,7 +36,7 @@ let errorSchema = Sury.union([
|
|
|
36
36
|
|
|
37
37
|
let moduleUrl = import.meta.url;
|
|
38
38
|
|
|
39
|
-
function
|
|
39
|
+
function authorizationOf(param) {
|
|
40
40
|
return "AllowAuthenticated";
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -53,7 +53,7 @@ let AggSpec = {
|
|
|
53
53
|
eventSchema: eventSchema,
|
|
54
54
|
errorSchema: errorSchema,
|
|
55
55
|
moduleUrl: moduleUrl,
|
|
56
|
-
|
|
56
|
+
authorizationOf: authorizationOf,
|
|
57
57
|
commandTransition: commandTransition,
|
|
58
58
|
traits: traits
|
|
59
59
|
};
|
|
@@ -237,7 +237,7 @@ let TestHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
237
237
|
errorSchema: errorSchema,
|
|
238
238
|
commandSchema: commandSchema,
|
|
239
239
|
moduleUrl: moduleUrl,
|
|
240
|
-
|
|
240
|
+
authorizationOf: authorizationOf,
|
|
241
241
|
commandTransition: commandTransition,
|
|
242
242
|
traits: traits
|
|
243
243
|
})({
|
|
@@ -260,7 +260,7 @@ let TestHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
260
260
|
errorSchema: errorSchema,
|
|
261
261
|
commandSchema: commandSchema,
|
|
262
262
|
moduleUrl: moduleUrl,
|
|
263
|
-
|
|
263
|
+
authorizationOf: authorizationOf,
|
|
264
264
|
commandTransition: commandTransition,
|
|
265
265
|
traits: traits
|
|
266
266
|
},
|
|
@@ -28,7 +28,7 @@ let errorSchema = Sury.literal("Never");
|
|
|
28
28
|
|
|
29
29
|
let moduleUrl = import.meta.url;
|
|
30
30
|
|
|
31
|
-
function
|
|
31
|
+
function authorizationOf(param) {
|
|
32
32
|
return "AllowAuthenticated";
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -45,7 +45,7 @@ let AggSpec = {
|
|
|
45
45
|
eventSchema: eventSchema,
|
|
46
46
|
errorSchema: errorSchema,
|
|
47
47
|
moduleUrl: moduleUrl,
|
|
48
|
-
|
|
48
|
+
authorizationOf: authorizationOf,
|
|
49
49
|
commandTransition: commandTransition,
|
|
50
50
|
traits: traits
|
|
51
51
|
};
|
|
@@ -292,7 +292,7 @@ let TestHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
292
292
|
errorSchema: errorSchema,
|
|
293
293
|
commandSchema: commandSchema,
|
|
294
294
|
moduleUrl: moduleUrl,
|
|
295
|
-
|
|
295
|
+
authorizationOf: authorizationOf,
|
|
296
296
|
commandTransition: commandTransition,
|
|
297
297
|
traits: traits
|
|
298
298
|
})({
|
|
@@ -315,7 +315,7 @@ let TestHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
315
315
|
errorSchema: errorSchema,
|
|
316
316
|
commandSchema: commandSchema,
|
|
317
317
|
moduleUrl: moduleUrl,
|
|
318
|
-
|
|
318
|
+
authorizationOf: authorizationOf,
|
|
319
319
|
commandTransition: commandTransition,
|
|
320
320
|
traits: traits
|
|
321
321
|
},
|
|
@@ -438,7 +438,7 @@ let PlainHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
438
438
|
errorSchema: errorSchema,
|
|
439
439
|
commandSchema: commandSchema,
|
|
440
440
|
moduleUrl: moduleUrl,
|
|
441
|
-
|
|
441
|
+
authorizationOf: authorizationOf,
|
|
442
442
|
commandTransition: commandTransition,
|
|
443
443
|
traits: traits
|
|
444
444
|
})({
|
|
@@ -461,7 +461,7 @@ let PlainHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
461
461
|
errorSchema: errorSchema,
|
|
462
462
|
commandSchema: commandSchema,
|
|
463
463
|
moduleUrl: moduleUrl,
|
|
464
|
-
|
|
464
|
+
authorizationOf: authorizationOf,
|
|
465
465
|
commandTransition: commandTransition,
|
|
466
466
|
traits: traits
|
|
467
467
|
},
|
|
@@ -29,7 +29,7 @@ let commandSchema = Sury.union([
|
|
|
29
29
|
}))
|
|
30
30
|
]);
|
|
31
31
|
|
|
32
|
-
function
|
|
32
|
+
function authorizationOf(param) {
|
|
33
33
|
return "AllowAuthenticated";
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -41,7 +41,7 @@ let traits = [];
|
|
|
41
41
|
|
|
42
42
|
let OrderSliceCmd = {
|
|
43
43
|
commandSchema: commandSchema,
|
|
44
|
-
|
|
44
|
+
authorizationOf: authorizationOf,
|
|
45
45
|
commandTransition: commandTransition,
|
|
46
46
|
traits: traits
|
|
47
47
|
};
|
|
@@ -291,7 +291,7 @@ let commandSchema$1 = Sury.union([
|
|
|
291
291
|
}))
|
|
292
292
|
]);
|
|
293
293
|
|
|
294
|
-
function
|
|
294
|
+
function authorizationOf$1(param) {
|
|
295
295
|
return "AllowAuthenticated";
|
|
296
296
|
}
|
|
297
297
|
|
|
@@ -303,7 +303,7 @@ let traits$1 = [];
|
|
|
303
303
|
|
|
304
304
|
let AddProductCmd = {
|
|
305
305
|
commandSchema: commandSchema$1,
|
|
306
|
-
|
|
306
|
+
authorizationOf: authorizationOf$1,
|
|
307
307
|
commandTransition: commandTransition$1,
|
|
308
308
|
traits: traits$1
|
|
309
309
|
};
|
|
@@ -320,7 +320,7 @@ let commandSchema$2 = Sury.union([
|
|
|
320
320
|
}))
|
|
321
321
|
]);
|
|
322
322
|
|
|
323
|
-
function
|
|
323
|
+
function authorizationOf$2(param) {
|
|
324
324
|
return "AllowAuthenticated";
|
|
325
325
|
}
|
|
326
326
|
|
|
@@ -332,7 +332,7 @@ let traits$2 = [];
|
|
|
332
332
|
|
|
333
333
|
let ChangePriceCmd = {
|
|
334
334
|
commandSchema: commandSchema$2,
|
|
335
|
-
|
|
335
|
+
authorizationOf: authorizationOf$2,
|
|
336
336
|
commandTransition: commandTransition$2,
|
|
337
337
|
traits: traits$2
|
|
338
338
|
};
|
|
@@ -28,7 +28,7 @@ let errorSchema = Sury.literal("InvalidCommand");
|
|
|
28
28
|
|
|
29
29
|
let moduleUrl = import.meta.url;
|
|
30
30
|
|
|
31
|
-
function
|
|
31
|
+
function authorizationOf(param) {
|
|
32
32
|
return "AllowAuthenticated";
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -45,7 +45,7 @@ let CmdGenAggSpec = {
|
|
|
45
45
|
eventSchema: eventSchema,
|
|
46
46
|
errorSchema: errorSchema,
|
|
47
47
|
moduleUrl: moduleUrl,
|
|
48
|
-
|
|
48
|
+
authorizationOf: authorizationOf,
|
|
49
49
|
commandTransition: commandTransition,
|
|
50
50
|
traits: traits
|
|
51
51
|
};
|
|
@@ -114,7 +114,7 @@ let TestGenerator = CommandGenerator_Callback$ReventlessCore.Make(MockPublishSpe
|
|
|
114
114
|
errorSchema: errorSchema,
|
|
115
115
|
commandSchema: commandSchema,
|
|
116
116
|
moduleUrl: moduleUrl,
|
|
117
|
-
|
|
117
|
+
authorizationOf: authorizationOf,
|
|
118
118
|
commandTransition: commandTransition,
|
|
119
119
|
traits: traits
|
|
120
120
|
});
|
|
@@ -72,7 +72,7 @@ let errorSchema = Sury.union([
|
|
|
72
72
|
Sury.literal("OrderNotFound")
|
|
73
73
|
]);
|
|
74
74
|
|
|
75
|
-
function
|
|
75
|
+
function authorizationOf(param) {
|
|
76
76
|
return "AllowAuthenticated";
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -90,7 +90,7 @@ let OrderSlice = {
|
|
|
90
90
|
consumedEventSchema: consumedEventSchema,
|
|
91
91
|
commandSchema: commandSchema,
|
|
92
92
|
errorSchema: errorSchema,
|
|
93
|
-
|
|
93
|
+
authorizationOf: authorizationOf,
|
|
94
94
|
commandTransition: commandTransition,
|
|
95
95
|
traits: traits,
|
|
96
96
|
readConsistency: "EscalateOnRetry"
|
|
@@ -189,7 +189,7 @@ let OrderHandler = StateChangeSlice_Callback$ReventlessCore.Make({
|
|
|
189
189
|
errorSchema: errorSchema,
|
|
190
190
|
eventSchema: eventSchema,
|
|
191
191
|
commandSchema: commandSchema,
|
|
192
|
-
|
|
192
|
+
authorizationOf: authorizationOf,
|
|
193
193
|
commandTransition: commandTransition,
|
|
194
194
|
traits: traits,
|
|
195
195
|
readConsistency: "EscalateOnRetry"
|
|
@@ -270,7 +270,7 @@ let errorSchema$1 = Sury.union([
|
|
|
270
270
|
|
|
271
271
|
let moduleUrl$1 = import.meta.url;
|
|
272
272
|
|
|
273
|
-
function
|
|
273
|
+
function authorizationOf$1(param) {
|
|
274
274
|
return "AllowAuthenticated";
|
|
275
275
|
}
|
|
276
276
|
|
|
@@ -287,7 +287,7 @@ let AccountSpec = {
|
|
|
287
287
|
eventSchema: eventSchema$1,
|
|
288
288
|
errorSchema: errorSchema$1,
|
|
289
289
|
moduleUrl: moduleUrl$1,
|
|
290
|
-
|
|
290
|
+
authorizationOf: authorizationOf$1,
|
|
291
291
|
commandTransition: commandTransition$1,
|
|
292
292
|
traits: traits$1
|
|
293
293
|
};
|
|
@@ -453,7 +453,7 @@ let AccountHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
453
453
|
errorSchema: errorSchema$1,
|
|
454
454
|
commandSchema: commandSchema$1,
|
|
455
455
|
moduleUrl: moduleUrl$1,
|
|
456
|
-
|
|
456
|
+
authorizationOf: authorizationOf$1,
|
|
457
457
|
commandTransition: commandTransition$1,
|
|
458
458
|
traits: traits$1
|
|
459
459
|
})({
|
|
@@ -476,7 +476,7 @@ let AccountHandler = Aggregate_Callback$ReventlessCore.Make({
|
|
|
476
476
|
errorSchema: errorSchema$1,
|
|
477
477
|
commandSchema: commandSchema$1,
|
|
478
478
|
moduleUrl: moduleUrl$1,
|
|
479
|
-
|
|
479
|
+
authorizationOf: authorizationOf$1,
|
|
480
480
|
commandTransition: commandTransition$1,
|
|
481
481
|
traits: traits$1
|
|
482
482
|
},
|
|
@@ -63,7 +63,7 @@ let SliceHandler = StateChangeSlice_Callback$ReventlessCore.Make({
|
|
|
63
63
|
errorSchema: DcbFixtures$ReventlessCore.TestCommandSpec.errorSchema,
|
|
64
64
|
eventSchema: DcbFixtures$ReventlessCore.TestCommandSpec.eventSchema,
|
|
65
65
|
commandSchema: DcbFixtures$ReventlessCore.TestCommandSpec.commandSchema,
|
|
66
|
-
|
|
66
|
+
authorizationOf: DcbFixtures$ReventlessCore.TestCommandSpec.authorizationOf,
|
|
67
67
|
commandTransition: DcbFixtures$ReventlessCore.TestCommandSpec.commandTransition,
|
|
68
68
|
traits: DcbFixtures$ReventlessCore.TestCommandSpec.traits,
|
|
69
69
|
readConsistency: DcbFixtures$ReventlessCore.TestCommandSpec.readConsistency
|
|
@@ -21,7 +21,7 @@ let commandSchema = Sury.union([
|
|
|
21
21
|
}))
|
|
22
22
|
]);
|
|
23
23
|
|
|
24
|
-
function
|
|
24
|
+
function authorizationOf(param) {
|
|
25
25
|
return "AllowAuthenticated";
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -35,7 +35,7 @@ let TestSpec = {
|
|
|
35
35
|
Id: undefined,
|
|
36
36
|
name: name,
|
|
37
37
|
commandSchema: commandSchema,
|
|
38
|
-
|
|
38
|
+
authorizationOf: authorizationOf,
|
|
39
39
|
commandTransition: commandTransition,
|
|
40
40
|
traits: traits
|
|
41
41
|
};
|
|
@@ -72,7 +72,7 @@ let TestOps_Spec = {
|
|
|
72
72
|
Id: Id$Reventless.StringPure,
|
|
73
73
|
name: name,
|
|
74
74
|
commandSchema: commandSchema,
|
|
75
|
-
|
|
75
|
+
authorizationOf: authorizationOf,
|
|
76
76
|
commandTransition: commandTransition,
|
|
77
77
|
traits: traits
|
|
78
78
|
};
|
|
@@ -152,7 +152,7 @@ function decide(state, command) {
|
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
function
|
|
155
|
+
function authorizationOf(param) {
|
|
156
156
|
return "AllowAuthenticated";
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -178,7 +178,7 @@ let TestCommandSpec = {
|
|
|
178
178
|
initialState: TestCommandSpec_initialState,
|
|
179
179
|
evolve: evolve,
|
|
180
180
|
decide: decide,
|
|
181
|
-
|
|
181
|
+
authorizationOf: authorizationOf,
|
|
182
182
|
commandTransition: commandTransition,
|
|
183
183
|
traits: traits,
|
|
184
184
|
readConsistency: "EscalateOnRetry"
|
|
@@ -59,7 +59,7 @@ let TestHandler = StateChangeSlice_Callback$ReventlessCore.Make({
|
|
|
59
59
|
errorSchema: DcbFixtures$ReventlessCore.TestCommandSpec.errorSchema,
|
|
60
60
|
eventSchema: DcbFixtures$ReventlessCore.TestCommandSpec.eventSchema,
|
|
61
61
|
commandSchema: DcbFixtures$ReventlessCore.TestCommandSpec.commandSchema,
|
|
62
|
-
|
|
62
|
+
authorizationOf: DcbFixtures$ReventlessCore.TestCommandSpec.authorizationOf,
|
|
63
63
|
commandTransition: DcbFixtures$ReventlessCore.TestCommandSpec.commandTransition,
|
|
64
64
|
traits: DcbFixtures$ReventlessCore.TestCommandSpec.traits,
|
|
65
65
|
readConsistency: DcbFixtures$ReventlessCore.TestCommandSpec.readConsistency
|
|
@@ -77,7 +77,7 @@ let commandSchema = DcbFixtures$ReventlessCore.TestCommandSpec.commandSchema;
|
|
|
77
77
|
|
|
78
78
|
let errorSchema = DcbFixtures$ReventlessCore.TestCommandSpec.errorSchema;
|
|
79
79
|
|
|
80
|
-
let
|
|
80
|
+
let authorizationOf = DcbFixtures$ReventlessCore.TestCommandSpec.authorizationOf;
|
|
81
81
|
|
|
82
82
|
let commandTransition = DcbFixtures$ReventlessCore.TestCommandSpec.commandTransition;
|
|
83
83
|
|
|
@@ -102,7 +102,7 @@ let StrongSpec = {
|
|
|
102
102
|
initialState: StrongSpec_initialState,
|
|
103
103
|
evolve: StrongSpec_evolve,
|
|
104
104
|
decide: StrongSpec_decide,
|
|
105
|
-
|
|
105
|
+
authorizationOf: authorizationOf,
|
|
106
106
|
commandTransition: commandTransition,
|
|
107
107
|
traits: traits,
|
|
108
108
|
readConsistency: "AlwaysStrong"
|
|
@@ -120,7 +120,7 @@ let commandSchema$1 = DcbFixtures$ReventlessCore.TestCommandSpec.commandSchema;
|
|
|
120
120
|
|
|
121
121
|
let errorSchema$1 = DcbFixtures$ReventlessCore.TestCommandSpec.errorSchema;
|
|
122
122
|
|
|
123
|
-
let
|
|
123
|
+
let authorizationOf$1 = DcbFixtures$ReventlessCore.TestCommandSpec.authorizationOf;
|
|
124
124
|
|
|
125
125
|
let commandTransition$1 = DcbFixtures$ReventlessCore.TestCommandSpec.commandTransition;
|
|
126
126
|
|
|
@@ -145,7 +145,7 @@ let EventualSpec = {
|
|
|
145
145
|
initialState: EventualSpec_initialState,
|
|
146
146
|
evolve: EventualSpec_evolve,
|
|
147
147
|
decide: EventualSpec_decide,
|
|
148
|
-
|
|
148
|
+
authorizationOf: authorizationOf$1,
|
|
149
149
|
commandTransition: commandTransition$1,
|
|
150
150
|
traits: traits$1,
|
|
151
151
|
readConsistency: "AlwaysEventual"
|
|
@@ -158,7 +158,7 @@ let StrongHandler = StateChangeSlice_Callback$ReventlessCore.Make({
|
|
|
158
158
|
errorSchema: errorSchema,
|
|
159
159
|
eventSchema: eventSchema,
|
|
160
160
|
commandSchema: commandSchema,
|
|
161
|
-
|
|
161
|
+
authorizationOf: authorizationOf,
|
|
162
162
|
commandTransition: commandTransition,
|
|
163
163
|
traits: traits,
|
|
164
164
|
readConsistency: "AlwaysStrong"
|
|
@@ -171,7 +171,7 @@ let EventualHandler = StateChangeSlice_Callback$ReventlessCore.Make({
|
|
|
171
171
|
errorSchema: errorSchema$1,
|
|
172
172
|
eventSchema: eventSchema$1,
|
|
173
173
|
commandSchema: commandSchema$1,
|
|
174
|
-
|
|
174
|
+
authorizationOf: authorizationOf$1,
|
|
175
175
|
commandTransition: commandTransition$1,
|
|
176
176
|
traits: traits$1,
|
|
177
177
|
readConsistency: "AlwaysEventual"
|
|
@@ -161,7 +161,7 @@ let commandSchema = Sury.union([
|
|
|
161
161
|
|
|
162
162
|
let moduleUrl$2 = import.meta.url;
|
|
163
163
|
|
|
164
|
-
function
|
|
164
|
+
function authorizationOf(param) {
|
|
165
165
|
return "AllowAuthenticated";
|
|
166
166
|
}
|
|
167
167
|
|
|
@@ -176,7 +176,7 @@ let CmdTargetSpec = {
|
|
|
176
176
|
name: name$3,
|
|
177
177
|
commandSchema: commandSchema,
|
|
178
178
|
moduleUrl: moduleUrl$2,
|
|
179
|
-
|
|
179
|
+
authorizationOf: authorizationOf,
|
|
180
180
|
commandTransition: commandTransition,
|
|
181
181
|
traits: traits
|
|
182
182
|
};
|
|
@@ -253,7 +253,7 @@ let OrderMappings_Target = {
|
|
|
253
253
|
name: name$3,
|
|
254
254
|
commandSchema: commandSchema,
|
|
255
255
|
moduleUrl: moduleUrl$2,
|
|
256
|
-
|
|
256
|
+
authorizationOf: authorizationOf,
|
|
257
257
|
commandTransition: commandTransition,
|
|
258
258
|
traits: traits
|
|
259
259
|
};
|
|
@@ -284,7 +284,7 @@ let CountOrderMappings_Target = {
|
|
|
284
284
|
name: name$3,
|
|
285
285
|
commandSchema: commandSchema,
|
|
286
286
|
moduleUrl: moduleUrl$2,
|
|
287
|
-
|
|
287
|
+
authorizationOf: authorizationOf,
|
|
288
288
|
commandTransition: commandTransition,
|
|
289
289
|
traits: traits
|
|
290
290
|
};
|
|
@@ -26,7 +26,7 @@ let directiveSchema = Sury.literal("DirectiveA");
|
|
|
26
26
|
|
|
27
27
|
let moduleUrl = import.meta.url;
|
|
28
28
|
|
|
29
|
-
function
|
|
29
|
+
function authorizationOf(param) {
|
|
30
30
|
return "AllowAuthenticated";
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -42,7 +42,7 @@ let TestEPSpec = {
|
|
|
42
42
|
eventSchema: eventSchema,
|
|
43
43
|
directiveSchema: directiveSchema,
|
|
44
44
|
moduleUrl: moduleUrl,
|
|
45
|
-
|
|
45
|
+
authorizationOf: authorizationOf,
|
|
46
46
|
commandTransition: commandTransition,
|
|
47
47
|
traits: traits
|
|
48
48
|
};
|
|
@@ -21,7 +21,7 @@ let directiveSchema = Sury.literal("OpsEPNoDirective");
|
|
|
21
21
|
|
|
22
22
|
let moduleUrl = import.meta.url;
|
|
23
23
|
|
|
24
|
-
function
|
|
24
|
+
function authorizationOf(param) {
|
|
25
25
|
return "AllowAuthenticated";
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -37,7 +37,7 @@ let OpsEPSpec = {
|
|
|
37
37
|
eventSchema: eventSchema,
|
|
38
38
|
directiveSchema: directiveSchema,
|
|
39
39
|
moduleUrl: moduleUrl,
|
|
40
|
-
|
|
40
|
+
authorizationOf: authorizationOf,
|
|
41
41
|
commandTransition: commandTransition,
|
|
42
42
|
traits: traits
|
|
43
43
|
};
|
|
@@ -147,10 +147,11 @@ module PsTwoRuleFeed = {
|
|
|
147
147
|
let targetName = "AddProduct"
|
|
148
148
|
let externalSystem = None
|
|
149
149
|
type role = Reventless.Role.name
|
|
150
|
-
let
|
|
151
|
-
switch
|
|
152
|
-
| AddProduct
|
|
153
|
-
| AddCategory
|
|
150
|
+
let authorizationOf = (name: string): Reventless.Authorization.rule<role> =>
|
|
151
|
+
switch name {
|
|
152
|
+
| "AddProduct" => AllowRoles([Reventless.Role.make("Merchandiser")])
|
|
153
|
+
| "AddCategory" => AllowRoles([Reventless.Role.make("Admin")])
|
|
154
|
+
| _ => DenyAll
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
157
|
|
|
@@ -172,7 +173,7 @@ module PsTwoRuleFeedSlice: ReventlessInfra.InboundTranslationSlice.T = {
|
|
|
172
173
|
describe("an inbound slice's roles", () => {
|
|
173
174
|
let door = Dcb_Builder.inboundDoorPermission(
|
|
174
175
|
PsTwoRuleFeed.commandSchema,
|
|
175
|
-
PsTwoRuleFeed.
|
|
176
|
+
PsTwoRuleFeed.authorizationOf,
|
|
176
177
|
)
|
|
177
178
|
|
|
178
179
|
testSync("the door admits any constructor's roles", () =>
|