@reventlessdev/reventless-local 3.0.0-alpha.281 → 3.0.0-alpha.283
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 +18 -0
- package/package.json +9 -9
- package/src/Platform.res +5 -4
- package/src/Platform.res.mjs +12 -12
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res +6 -25
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res.mjs +4 -20
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_GraphQL.res +34 -38
- package/src/adapter/CommandGenerator/InboundTranslationResolvers_GraphQL.res.mjs +14 -6
- package/src/adapter/PlatformGraphQL_Server.res +1 -1
- package/tests/adapter/CommandAuthorizationTest.res +7 -8
- package/tests/adapter/CommandAuthorizationTest.res.mjs +5 -5
- package/tests/adapter/InboundTranslationMutationTest.res +95 -7
- package/tests/adapter/InboundTranslationMutationTest.res.mjs +97 -9
- package/tests/components/aggregate/AggregateFixtures.res.mjs +3 -3
- package/tests/components/aggregate/AggregateSelfMappingFixtures.res.mjs +3 -3
- package/tests/components/automationslice/AutomationSliceFixtures.res.mjs +4 -4
- package/tests/components/automationslice/AutomationSliceSelfDeadlockFixtures.res.mjs +8 -8
- package/tests/components/automationslice/MixedSourceAutomationSliceFixtures.res.mjs +2 -2
- package/tests/components/commandgenerator/CommandGeneratorFixtures.res.mjs +3 -3
- package/tests/components/commandtopic/CommandTopicFixtures.res.mjs +2 -2
- package/tests/components/commandtopic/CommandTopicStreamFixtures.res.mjs +2 -2
- package/tests/components/dcb/DcbCrossPartitionFixtures.res.mjs +3 -3
- package/tests/components/dcb/DcbFixtures.res.mjs +3 -3
- package/tests/components/extensionpoint/ExtensionPointFixtures.res.mjs +5 -5
- package/tests/components/inboundtranslationslice/InboundTranslationSliceCallbackTest.res +116 -8
- package/tests/components/inboundtranslationslice/InboundTranslationSliceCallbackTest.res.mjs +160 -19
- package/tests/components/inboundtranslationslice/InboundTranslationSliceFixtures.res +58 -0
- package/tests/components/inboundtranslationslice/InboundTranslationSliceFixtures.res.mjs +145 -7
- package/tests/components/outboundtranslationslice/OutboundTranslationSlicePlatformFixtures.res.mjs +3 -3
- package/tests/components/readmodel/DcbReadModelE2EFixtures.res.mjs +3 -3
- package/tests/plugin/PluginBehavior_GWT.res.mjs +2 -2
- package/tests/plugin/UiFragmentRegistry_GWT.res.mjs +1 -1
|
@@ -44,16 +44,36 @@ let selection = `__typename
|
|
|
44
44
|
... on CommandAccepted { msgId entityId eventCount }
|
|
45
45
|
... on CommandRejected { msgId errorCode errorDetail }`
|
|
46
46
|
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
let signedIn = (groups): Reventless.Identity.t => {
|
|
48
|
+
userId: "u-1",
|
|
49
|
+
username: "alice",
|
|
50
|
+
groups,
|
|
51
|
+
provider: InMemory,
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let contextOf = (identity: option<Reventless.Identity.t>): JSON.t =>
|
|
55
|
+
switch identity {
|
|
56
|
+
| Some(identity) =>
|
|
57
|
+
Dict.fromArray([
|
|
58
|
+
("identity", identity->Reventless.Util_Sury.toJson(Reventless.Identity.schema)),
|
|
59
|
+
])->JSON.Encode.object
|
|
60
|
+
| None => JSON.Encode.null
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let execute = async (~caller, source) =>
|
|
51
64
|
await GraphqlYoga.graphql({
|
|
52
65
|
"schema": DomainGraphQL_Server.composeSchema(),
|
|
53
66
|
"source": source,
|
|
54
|
-
"contextValue":
|
|
67
|
+
"contextValue": contextOf(caller),
|
|
55
68
|
})
|
|
56
|
-
|
|
69
|
+
|
|
70
|
+
let runMutation = async (~status: string) =>
|
|
71
|
+
await execute(
|
|
72
|
+
~caller=Some(signedIn([])),
|
|
73
|
+
`mutation {
|
|
74
|
+
r: ${fieldName}(paymentId: "pay-1", orderId: "ord-1", status: "${status}") { ${selection} }
|
|
75
|
+
}`,
|
|
76
|
+
)
|
|
57
77
|
|
|
58
78
|
let errorMessages = (result: GraphqlYoga.executionResult): array<string> =>
|
|
59
79
|
result.errors
|
|
@@ -86,13 +106,14 @@ describe("InboundTranslationSlice mutation — response envelope", () => {
|
|
|
86
106
|
InboundTranslationResolvers_GraphQL.register(
|
|
87
107
|
~fieldName,
|
|
88
108
|
~externalInputSchema=PaymentWebhookSpec.externalInputSchema->S.castToUnknown,
|
|
109
|
+
~permission=AllowAuthenticated,
|
|
89
110
|
~server=DomainGraphQL_Server.asInterface,
|
|
90
111
|
)
|
|
91
112
|
DomainGraphQL_Server.resetScope()
|
|
92
113
|
|
|
93
114
|
InboundTranslationResolvers_GraphQL.bindReceive(
|
|
94
115
|
~fieldName,
|
|
95
|
-
~receive=inputJson => Callback.receive(publishJsons, inputJson),
|
|
116
|
+
~receive=(inputJson, ~caller=?) => Callback.receive(publishJsons, inputJson, ~caller?),
|
|
96
117
|
)
|
|
97
118
|
})
|
|
98
119
|
|
|
@@ -140,3 +161,70 @@ describe("InboundTranslationSlice mutation — response envelope", () => {
|
|
|
140
161
|
expect(fieldLine->Option.map(l => l->String.endsWith(": CommandResult!")))->toEqual(Some(true))
|
|
141
162
|
})
|
|
142
163
|
})
|
|
164
|
+
|
|
165
|
+
module CatalogFeedTranslation = {
|
|
166
|
+
let translate = CatalogFeedSpec.translate
|
|
167
|
+
let moduleUrl = CatalogFeedSpec.moduleUrl
|
|
168
|
+
}
|
|
169
|
+
module CatalogFeedCallback = ReventlessCore.InboundTranslationSlice_Callback.Make(
|
|
170
|
+
CatalogFeedSpec,
|
|
171
|
+
CatalogFeedTranslation,
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
let feedField = "Catalog_CatalogFeed"
|
|
175
|
+
|
|
176
|
+
let runFeed = async (~caller, ~kind) =>
|
|
177
|
+
await execute(
|
|
178
|
+
~caller,
|
|
179
|
+
`mutation { r: ${feedField}(kind: "${kind}", id: "x-1") { ${selection} } }`,
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
describe("InboundTranslationSlice mutation — the door", () => {
|
|
183
|
+
beforeEach(() => {
|
|
184
|
+
DomainGraphQL_Server.asInterface.reset()
|
|
185
|
+
published.contents = []
|
|
186
|
+
|
|
187
|
+
DomainGraphQL_Server.setScope("Catalog")
|
|
188
|
+
InboundTranslationResolvers_GraphQL.register(
|
|
189
|
+
~fieldName=feedField,
|
|
190
|
+
~externalInputSchema=CatalogFeedSpec.externalInputSchema->S.castToUnknown,
|
|
191
|
+
~permission=?ReventlessCore.Dcb_Builder.inboundDoorPermission(
|
|
192
|
+
CatalogFeedSpec.commandSchema,
|
|
193
|
+
CatalogFeedSpec.authorizationOf,
|
|
194
|
+
),
|
|
195
|
+
~server=DomainGraphQL_Server.asInterface,
|
|
196
|
+
)
|
|
197
|
+
DomainGraphQL_Server.resetScope()
|
|
198
|
+
|
|
199
|
+
InboundTranslationResolvers_GraphQL.bindReceive(
|
|
200
|
+
~fieldName=feedField,
|
|
201
|
+
~receive=(inputJson, ~caller=?) =>
|
|
202
|
+
CatalogFeedCallback.receive(publishJsons, inputJson, ~caller?),
|
|
203
|
+
)
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
testPromise("a caller holding none of the commands' roles is refused", async () => {
|
|
207
|
+
let node = payload(await runFeed(~caller=Some(signedIn(["Ops"])), ~kind="product"))
|
|
208
|
+
expect(node->str("errorCode"))->toEqual(Some("Forbidden"))
|
|
209
|
+
expect(published.contents->Array.length)->toBe(0)
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
testPromise("an unauthenticated caller is refused", async () => {
|
|
213
|
+
let node = payload(await runFeed(~caller=None, ~kind="product"))
|
|
214
|
+
expect(node->str("errorCode"))->toEqual(Some("Forbidden"))
|
|
215
|
+
expect(published.contents->Array.length)->toBe(0)
|
|
216
|
+
})
|
|
217
|
+
|
|
218
|
+
testPromise("a caller holding a command's role is let through", async () => {
|
|
219
|
+
let node = payload(await runFeed(~caller=Some(signedIn(["Merchandiser"])), ~kind="product"))
|
|
220
|
+
expect(node->str("__typename"))->toEqual(Some("CommandAccepted"))
|
|
221
|
+
expect(published.contents->Array.length)->toBe(1)
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
// The caller reaches `receive`, which refuses the command the door could not see.
|
|
225
|
+
testPromise("the caller reaches the per-command check", async () => {
|
|
226
|
+
let node = payload(await runFeed(~caller=Some(signedIn(["Merchandiser"])), ~kind="both"))
|
|
227
|
+
expect(node->str("errorCode"))->toEqual(Some("Forbidden"))
|
|
228
|
+
expect(published.contents->Array.length)->toBe(0)
|
|
229
|
+
})
|
|
230
|
+
})
|
|
@@ -5,6 +5,9 @@ import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
|
|
|
5
5
|
import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
|
|
6
6
|
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
7
7
|
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
8
|
+
import * as Identity$Reventless from "@reventlessdev/reventless-spec/src/types/Identity.res.mjs";
|
|
9
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
10
|
+
import * as Dcb_Builder$ReventlessCore from "@reventlessdev/reventless-core/src/components/Dcb/Dcb_Builder.res.mjs";
|
|
8
11
|
import * as DomainGraphQL_Server$ReventlessLocal from "../../src/adapter/DomainGraphQL_Server.res.mjs";
|
|
9
12
|
import * as InboundTranslationSliceFixtures$ReventlessLocal from "../components/inboundtranslationslice/InboundTranslationSliceFixtures.res.mjs";
|
|
10
13
|
import * as InboundTranslationSlice_Callback$ReventlessCore from "@reventlessdev/reventless-core/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs";
|
|
@@ -26,8 +29,7 @@ let Callback = InboundTranslationSlice_Callback$ReventlessCore.Make({
|
|
|
26
29
|
commandSchema: InboundTranslationSliceFixtures$ReventlessLocal.PaymentWebhookSpec.commandSchema,
|
|
27
30
|
targetName: InboundTranslationSliceFixtures$ReventlessLocal.PaymentWebhookSpec.targetName,
|
|
28
31
|
externalSystem: InboundTranslationSliceFixtures$ReventlessLocal.PaymentWebhookSpec.externalSystem,
|
|
29
|
-
|
|
30
|
-
commandTransition: InboundTranslationSliceFixtures$ReventlessLocal.PaymentWebhookSpec.commandTransition
|
|
32
|
+
authorizationOf: InboundTranslationSliceFixtures$ReventlessLocal.PaymentWebhookSpec.authorizationOf
|
|
31
33
|
})(PaymentWebhookTranslation);
|
|
32
34
|
|
|
33
35
|
let scope = "Payments";
|
|
@@ -46,17 +48,40 @@ let selection = `__typename
|
|
|
46
48
|
... on CommandAccepted { msgId entityId eventCount }
|
|
47
49
|
... on CommandRejected { msgId errorCode errorDetail }`;
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
function signedIn(groups) {
|
|
52
|
+
return {
|
|
53
|
+
userId: "u-1",
|
|
54
|
+
username: "alice",
|
|
55
|
+
groups: groups,
|
|
56
|
+
provider: "InMemory"
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function contextOf(identity) {
|
|
61
|
+
if (identity !== undefined) {
|
|
62
|
+
return Object.fromEntries([[
|
|
63
|
+
"identity",
|
|
64
|
+
Util_Sury$Reventless.toJson(identity, Identity$Reventless.schema)
|
|
65
|
+
]]);
|
|
66
|
+
} else {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function execute(caller, source) {
|
|
53
72
|
return await Graphql.graphql({
|
|
54
73
|
schema: DomainGraphQL_Server$ReventlessLocal.composeSchema(),
|
|
55
74
|
source: source,
|
|
56
|
-
contextValue:
|
|
75
|
+
contextValue: contextOf(caller)
|
|
57
76
|
});
|
|
58
77
|
}
|
|
59
78
|
|
|
79
|
+
async function runMutation(status) {
|
|
80
|
+
return await execute(signedIn([]), `mutation {
|
|
81
|
+
r: ` + fieldName + `(paymentId: "pay-1", orderId: "ord-1", status: "` + status + `") { ` + selection + ` }
|
|
82
|
+
}`);
|
|
83
|
+
}
|
|
84
|
+
|
|
60
85
|
function errorMessages(result) {
|
|
61
86
|
return Stdlib_Option.getOr(result.errors, []).map(e => Stdlib_Option.getOr(Stdlib_JsExn.message(e), "unknown error"));
|
|
62
87
|
}
|
|
@@ -79,9 +104,9 @@ globalThis.describe("InboundTranslationSlice mutation — response envelope", ()
|
|
|
79
104
|
published.contents = [];
|
|
80
105
|
Object.keys(Callback.auditLog).forEach(k => Stdlib_Dict.$$delete(Callback.auditLog, k));
|
|
81
106
|
DomainGraphQL_Server$ReventlessLocal.setScope(scope);
|
|
82
|
-
InboundTranslationResolvers_GraphQL$ReventlessLocal.register(fieldName, InboundTranslationSliceFixtures$ReventlessLocal.PaymentWebhookSpec.externalInputSchema, DomainGraphQL_Server$ReventlessLocal.asInterface);
|
|
107
|
+
InboundTranslationResolvers_GraphQL$ReventlessLocal.register(fieldName, InboundTranslationSliceFixtures$ReventlessLocal.PaymentWebhookSpec.externalInputSchema, "AllowAuthenticated", DomainGraphQL_Server$ReventlessLocal.asInterface);
|
|
83
108
|
DomainGraphQL_Server$ReventlessLocal.resetScope();
|
|
84
|
-
InboundTranslationResolvers_GraphQL$ReventlessLocal.bindReceive(fieldName, inputJson => Callback.receive(publishJsons, inputJson));
|
|
109
|
+
InboundTranslationResolvers_GraphQL$ReventlessLocal.bindReceive(fieldName, (inputJson, caller) => Callback.receive(publishJsons, inputJson, caller));
|
|
85
110
|
});
|
|
86
111
|
globalThis.test("a successful translation resolves as CommandAccepted, with no errors", async () => {
|
|
87
112
|
let result = await runMutation("completed");
|
|
@@ -116,6 +141,62 @@ globalThis.describe("InboundTranslationSlice mutation — response envelope", ()
|
|
|
116
141
|
});
|
|
117
142
|
});
|
|
118
143
|
|
|
144
|
+
let translate$1 = InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.translate;
|
|
145
|
+
|
|
146
|
+
let moduleUrl$1 = InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.moduleUrl;
|
|
147
|
+
|
|
148
|
+
let CatalogFeedTranslation = {
|
|
149
|
+
translate: translate$1,
|
|
150
|
+
moduleUrl: moduleUrl$1
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
let CatalogFeedCallback = InboundTranslationSlice_Callback$ReventlessCore.Make({
|
|
154
|
+
name: InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.name,
|
|
155
|
+
moduleUrl: InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.moduleUrl,
|
|
156
|
+
externalInputSchema: InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.externalInputSchema,
|
|
157
|
+
commandSchema: InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.commandSchema,
|
|
158
|
+
targetName: InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.targetName,
|
|
159
|
+
externalSystem: InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.externalSystem,
|
|
160
|
+
authorizationOf: InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.authorizationOf
|
|
161
|
+
})(CatalogFeedTranslation);
|
|
162
|
+
|
|
163
|
+
let feedField = "Catalog_CatalogFeed";
|
|
164
|
+
|
|
165
|
+
async function runFeed(caller, kind) {
|
|
166
|
+
return await execute(caller, `mutation { r: ` + feedField + `(kind: "` + kind + `", id: "x-1") { ` + selection + ` } }`);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
globalThis.describe("InboundTranslationSlice mutation — the door", () => {
|
|
170
|
+
globalThis.beforeEach(() => {
|
|
171
|
+
DomainGraphQL_Server$ReventlessLocal.asInterface.reset();
|
|
172
|
+
published.contents = [];
|
|
173
|
+
DomainGraphQL_Server$ReventlessLocal.setScope("Catalog");
|
|
174
|
+
InboundTranslationResolvers_GraphQL$ReventlessLocal.register(feedField, InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.externalInputSchema, Dcb_Builder$ReventlessCore.inboundDoorPermission(InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.commandSchema, InboundTranslationSliceFixtures$ReventlessLocal.CatalogFeedSpec.authorizationOf), DomainGraphQL_Server$ReventlessLocal.asInterface);
|
|
175
|
+
DomainGraphQL_Server$ReventlessLocal.resetScope();
|
|
176
|
+
InboundTranslationResolvers_GraphQL$ReventlessLocal.bindReceive(feedField, (inputJson, caller) => CatalogFeedCallback.receive(publishJsons, inputJson, caller));
|
|
177
|
+
});
|
|
178
|
+
globalThis.test("a caller holding none of the commands' roles is refused", async () => {
|
|
179
|
+
let node = payload(await runFeed(signedIn(["Ops"]), "product"));
|
|
180
|
+
globalThis.expect(str(node, "errorCode")).toEqual("Forbidden");
|
|
181
|
+
globalThis.expect(published.contents.length).toBe(0);
|
|
182
|
+
});
|
|
183
|
+
globalThis.test("an unauthenticated caller is refused", async () => {
|
|
184
|
+
let node = payload(await runFeed(undefined, "product"));
|
|
185
|
+
globalThis.expect(str(node, "errorCode")).toEqual("Forbidden");
|
|
186
|
+
globalThis.expect(published.contents.length).toBe(0);
|
|
187
|
+
});
|
|
188
|
+
globalThis.test("a caller holding a command's role is let through", async () => {
|
|
189
|
+
let node = payload(await runFeed(signedIn(["Merchandiser"]), "product"));
|
|
190
|
+
globalThis.expect(str(node, "__typename")).toEqual("CommandAccepted");
|
|
191
|
+
globalThis.expect(published.contents.length).toBe(1);
|
|
192
|
+
});
|
|
193
|
+
globalThis.test("the caller reaches the per-command check", async () => {
|
|
194
|
+
let node = payload(await runFeed(signedIn(["Merchandiser"]), "both"));
|
|
195
|
+
globalThis.expect(str(node, "errorCode")).toEqual("Forbidden");
|
|
196
|
+
globalThis.expect(published.contents.length).toBe(0);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
119
200
|
export {
|
|
120
201
|
PaymentWebhookTranslation,
|
|
121
202
|
Callback,
|
|
@@ -124,10 +205,17 @@ export {
|
|
|
124
205
|
published,
|
|
125
206
|
publishJsons,
|
|
126
207
|
selection,
|
|
208
|
+
signedIn,
|
|
209
|
+
contextOf,
|
|
210
|
+
execute,
|
|
127
211
|
runMutation,
|
|
128
212
|
errorMessages,
|
|
129
213
|
payload,
|
|
130
214
|
str,
|
|
131
215
|
num,
|
|
216
|
+
CatalogFeedTranslation,
|
|
217
|
+
CatalogFeedCallback,
|
|
218
|
+
feedField,
|
|
219
|
+
runFeed,
|
|
132
220
|
}
|
|
133
221
|
/* Callback Not a pure module */
|
|
@@ -23,7 +23,7 @@ let errorSchema = Sury.literal("AlreadyExists");
|
|
|
23
23
|
|
|
24
24
|
let moduleUrl = import.meta.url;
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
function authorizationOf(param) {
|
|
27
27
|
return "AllowAuthenticated";
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -40,7 +40,7 @@ let ItemSpec = {
|
|
|
40
40
|
eventSchema: eventSchema,
|
|
41
41
|
errorSchema: errorSchema,
|
|
42
42
|
moduleUrl: moduleUrl,
|
|
43
|
-
|
|
43
|
+
authorizationOf: authorizationOf,
|
|
44
44
|
commandTransition: commandTransition,
|
|
45
45
|
traits: traits
|
|
46
46
|
};
|
|
@@ -97,7 +97,7 @@ let ItemAgg = ItemAggregateMaker.Make({
|
|
|
97
97
|
errorSchema: errorSchema,
|
|
98
98
|
commandSchema: commandSchema,
|
|
99
99
|
moduleUrl: moduleUrl,
|
|
100
|
-
|
|
100
|
+
authorizationOf: authorizationOf,
|
|
101
101
|
commandTransition: commandTransition,
|
|
102
102
|
traits: traits
|
|
103
103
|
})(ItemBehavior)(NoEventMappings$ReventlessInfra.Make({
|
|
@@ -25,7 +25,7 @@ let errorSchema = Sury.$unit;
|
|
|
25
25
|
|
|
26
26
|
let moduleUrl = import.meta.url;
|
|
27
27
|
|
|
28
|
-
function
|
|
28
|
+
function authorizationOf(param) {
|
|
29
29
|
return "AllowAuthenticated";
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -42,7 +42,7 @@ let ShipmentSpec = {
|
|
|
42
42
|
eventSchema: eventSchema,
|
|
43
43
|
errorSchema: errorSchema,
|
|
44
44
|
moduleUrl: moduleUrl,
|
|
45
|
-
|
|
45
|
+
authorizationOf: authorizationOf,
|
|
46
46
|
commandTransition: commandTransition,
|
|
47
47
|
traits: traits
|
|
48
48
|
};
|
|
@@ -155,7 +155,7 @@ let ShipmentAgg = ShipmentAggregateMaker.Make({
|
|
|
155
155
|
errorSchema: errorSchema,
|
|
156
156
|
commandSchema: commandSchema,
|
|
157
157
|
moduleUrl: moduleUrl,
|
|
158
|
-
|
|
158
|
+
authorizationOf: authorizationOf,
|
|
159
159
|
commandTransition: commandTransition,
|
|
160
160
|
traits: traits
|
|
161
161
|
})(ShipmentBehavior)({
|
|
@@ -59,7 +59,7 @@ let commandSchema = Sury.$schema(s => ({
|
|
|
59
59
|
orderId: s.m(DcbTag$Reventless.string)
|
|
60
60
|
}));
|
|
61
61
|
|
|
62
|
-
function
|
|
62
|
+
function authorizationOf(param) {
|
|
63
63
|
return "AllowAuthenticated";
|
|
64
64
|
}
|
|
65
65
|
|
|
@@ -77,7 +77,7 @@ let ShipOrderSpec = {
|
|
|
77
77
|
maxRetries: 3,
|
|
78
78
|
heartbeatInterval: 60,
|
|
79
79
|
targetName: "CreateShipment",
|
|
80
|
-
|
|
80
|
+
authorizationOf: authorizationOf,
|
|
81
81
|
commandTransition: commandTransition,
|
|
82
82
|
traits: traits
|
|
83
83
|
};
|
|
@@ -90,7 +90,7 @@ let todoItemSchema$1 = Sury.$schema(s => ({
|
|
|
90
90
|
|
|
91
91
|
let commandSchema$1 = Sury.literal("Noop");
|
|
92
92
|
|
|
93
|
-
function
|
|
93
|
+
function authorizationOf$1(param) {
|
|
94
94
|
return "AllowAuthenticated";
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -108,7 +108,7 @@ let SkipProcessSpec = {
|
|
|
108
108
|
maxRetries: 0,
|
|
109
109
|
heartbeatInterval: 60,
|
|
110
110
|
targetName: "Noop",
|
|
111
|
-
|
|
111
|
+
authorizationOf: authorizationOf$1,
|
|
112
112
|
commandTransition: commandTransition$1,
|
|
113
113
|
traits: traits$1
|
|
114
114
|
};
|
|
@@ -37,7 +37,7 @@ let commandSchema = Sury.$schema(s => ({
|
|
|
37
37
|
|
|
38
38
|
let errorSchema = Sury.literal("AlreadyPlaced");
|
|
39
39
|
|
|
40
|
-
function
|
|
40
|
+
function authorizationOf(param) {
|
|
41
41
|
return "AllowAuthenticated";
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -55,7 +55,7 @@ let PlaceSpec = {
|
|
|
55
55
|
consumedEventSchema: consumedEventSchema,
|
|
56
56
|
errorSchema: errorSchema,
|
|
57
57
|
commandSchema: commandSchema,
|
|
58
|
-
|
|
58
|
+
authorizationOf: authorizationOf,
|
|
59
59
|
commandTransition: commandTransition,
|
|
60
60
|
traits: traits,
|
|
61
61
|
readConsistency: "EscalateOnRetry"
|
|
@@ -116,7 +116,7 @@ let commandSchema$1 = Sury.$schema(s => ({
|
|
|
116
116
|
|
|
117
117
|
let errorSchema$1 = Sury.literal("NotPlaced");
|
|
118
118
|
|
|
119
|
-
function
|
|
119
|
+
function authorizationOf$1(param) {
|
|
120
120
|
return "AllowAuthenticated";
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -134,7 +134,7 @@ let ShipSpec = {
|
|
|
134
134
|
consumedEventSchema: consumedEventSchema$1,
|
|
135
135
|
errorSchema: errorSchema$1,
|
|
136
136
|
commandSchema: commandSchema$1,
|
|
137
|
-
|
|
137
|
+
authorizationOf: authorizationOf$1,
|
|
138
138
|
commandTransition: commandTransition$1,
|
|
139
139
|
traits: traits$1,
|
|
140
140
|
readConsistency: "EscalateOnRetry"
|
|
@@ -225,7 +225,7 @@ let commandSchema$2 = Sury.$schema(s => ({
|
|
|
225
225
|
orderId: s.m(DcbTag$Reventless.string)
|
|
226
226
|
}));
|
|
227
227
|
|
|
228
|
-
function
|
|
228
|
+
function authorizationOf$2(param) {
|
|
229
229
|
return "AllowAuthenticated";
|
|
230
230
|
}
|
|
231
231
|
|
|
@@ -243,7 +243,7 @@ let AutoShipSpec = {
|
|
|
243
243
|
maxRetries: 3,
|
|
244
244
|
heartbeatInterval: 60,
|
|
245
245
|
targetName: "Ship",
|
|
246
|
-
|
|
246
|
+
authorizationOf: authorizationOf$2,
|
|
247
247
|
commandTransition: commandTransition$2,
|
|
248
248
|
traits: traits$2
|
|
249
249
|
};
|
|
@@ -362,7 +362,7 @@ let PlaceMaker = StateChangeSlice_Builder$ReventlessLocal.Make({
|
|
|
362
362
|
errorSchema: errorSchema,
|
|
363
363
|
eventSchema: eventSchema,
|
|
364
364
|
commandSchema: commandSchema,
|
|
365
|
-
|
|
365
|
+
authorizationOf: authorizationOf,
|
|
366
366
|
commandTransition: commandTransition,
|
|
367
367
|
traits: traits,
|
|
368
368
|
readConsistency: "EscalateOnRetry"
|
|
@@ -382,7 +382,7 @@ let ShipMaker = StateChangeSlice_Builder$ReventlessLocal.Make({
|
|
|
382
382
|
errorSchema: errorSchema$1,
|
|
383
383
|
eventSchema: eventSchema$1,
|
|
384
384
|
commandSchema: commandSchema$1,
|
|
385
|
-
|
|
385
|
+
authorizationOf: authorizationOf$1,
|
|
386
386
|
commandTransition: commandTransition$1,
|
|
387
387
|
traits: traits$1,
|
|
388
388
|
readConsistency: "EscalateOnRetry"
|
|
@@ -64,7 +64,7 @@ let commandSchema = Sury.$schema(s => ({
|
|
|
64
64
|
productId: s.m(DcbTag$Reventless.string)
|
|
65
65
|
}));
|
|
66
66
|
|
|
67
|
-
function
|
|
67
|
+
function authorizationOf(param) {
|
|
68
68
|
return "AllowAuthenticated";
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -82,7 +82,7 @@ let AutoFulfillSpec = {
|
|
|
82
82
|
maxRetries: 3,
|
|
83
83
|
heartbeatInterval: 60,
|
|
84
84
|
targetName: "MarkFulfilled",
|
|
85
|
-
|
|
85
|
+
authorizationOf: authorizationOf,
|
|
86
86
|
commandTransition: commandTransition,
|
|
87
87
|
traits: traits
|
|
88
88
|
};
|
|
@@ -24,7 +24,7 @@ let errorSchema = Sury.literal("CGAlreadyExists");
|
|
|
24
24
|
|
|
25
25
|
let moduleUrl = import.meta.url;
|
|
26
26
|
|
|
27
|
-
function
|
|
27
|
+
function authorizationOf(param) {
|
|
28
28
|
return "AllowAuthenticated";
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -41,7 +41,7 @@ let CGSpec = {
|
|
|
41
41
|
eventSchema: eventSchema,
|
|
42
42
|
errorSchema: errorSchema,
|
|
43
43
|
moduleUrl: moduleUrl,
|
|
44
|
-
|
|
44
|
+
authorizationOf: authorizationOf,
|
|
45
45
|
commandTransition: commandTransition,
|
|
46
46
|
traits: traits
|
|
47
47
|
};
|
|
@@ -89,7 +89,7 @@ let CGMaker = CommandGenerator_Builder$ReventlessCore.Make({
|
|
|
89
89
|
errorSchema: errorSchema,
|
|
90
90
|
commandSchema: commandSchema,
|
|
91
91
|
moduleUrl: moduleUrl,
|
|
92
|
-
|
|
92
|
+
authorizationOf: authorizationOf,
|
|
93
93
|
commandTransition: commandTransition,
|
|
94
94
|
traits: traits
|
|
95
95
|
})(LocalCommandGeneratorResolvers$ReventlessLocal);
|
|
@@ -29,7 +29,7 @@ let errorSchema = Sury.literal("AlreadyExists");
|
|
|
29
29
|
|
|
30
30
|
let moduleUrl = import.meta.url;
|
|
31
31
|
|
|
32
|
-
function
|
|
32
|
+
function authorizationOf(param) {
|
|
33
33
|
return "AllowAuthenticated";
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -46,7 +46,7 @@ let ItemSpec = {
|
|
|
46
46
|
eventSchema: eventSchema,
|
|
47
47
|
errorSchema: errorSchema,
|
|
48
48
|
moduleUrl: moduleUrl,
|
|
49
|
-
|
|
49
|
+
authorizationOf: authorizationOf,
|
|
50
50
|
commandTransition: commandTransition,
|
|
51
51
|
traits: traits
|
|
52
52
|
};
|
|
@@ -31,7 +31,7 @@ let errorSchema = Sury.literal("AlreadyExists");
|
|
|
31
31
|
|
|
32
32
|
let moduleUrl = import.meta.url;
|
|
33
33
|
|
|
34
|
-
function
|
|
34
|
+
function authorizationOf(param) {
|
|
35
35
|
return "AllowAuthenticated";
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -48,7 +48,7 @@ let ItemSpec = {
|
|
|
48
48
|
eventSchema: eventSchema,
|
|
49
49
|
errorSchema: errorSchema,
|
|
50
50
|
moduleUrl: moduleUrl,
|
|
51
|
-
|
|
51
|
+
authorizationOf: authorizationOf,
|
|
52
52
|
commandTransition: commandTransition,
|
|
53
53
|
traits: traits
|
|
54
54
|
};
|
|
@@ -68,7 +68,7 @@ let errorSchema = Sury.union([
|
|
|
68
68
|
Sury.literal("CategoryNotFound")
|
|
69
69
|
]);
|
|
70
70
|
|
|
71
|
-
function
|
|
71
|
+
function authorizationOf(param) {
|
|
72
72
|
return "AllowAuthenticated";
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -86,7 +86,7 @@ let AddProductSpec = {
|
|
|
86
86
|
consumedEventSchema: consumedEventSchema,
|
|
87
87
|
errorSchema: errorSchema,
|
|
88
88
|
commandSchema: commandSchema,
|
|
89
|
-
|
|
89
|
+
authorizationOf: authorizationOf,
|
|
90
90
|
commandTransition: commandTransition,
|
|
91
91
|
traits: traits,
|
|
92
92
|
readConsistency: "EscalateOnRetry"
|
|
@@ -177,7 +177,7 @@ let AddProductMaker = StateChangeSlice_Builder$ReventlessLocal.Make({
|
|
|
177
177
|
errorSchema: errorSchema,
|
|
178
178
|
eventSchema: eventSchema$1,
|
|
179
179
|
commandSchema: commandSchema,
|
|
180
|
-
|
|
180
|
+
authorizationOf: authorizationOf,
|
|
181
181
|
commandTransition: commandTransition,
|
|
182
182
|
traits: traits,
|
|
183
183
|
readConsistency: "EscalateOnRetry"
|
|
@@ -45,7 +45,7 @@ let commandSchema = Sury.$schema(s => ({
|
|
|
45
45
|
|
|
46
46
|
let errorSchema = Sury.literal("ItemAlreadyExists");
|
|
47
47
|
|
|
48
|
-
function
|
|
48
|
+
function authorizationOf(param) {
|
|
49
49
|
return "AllowAuthenticated";
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -63,7 +63,7 @@ let AddItemSpec = {
|
|
|
63
63
|
consumedEventSchema: consumedEventSchema,
|
|
64
64
|
errorSchema: errorSchema,
|
|
65
65
|
commandSchema: commandSchema,
|
|
66
|
-
|
|
66
|
+
authorizationOf: authorizationOf,
|
|
67
67
|
commandTransition: commandTransition,
|
|
68
68
|
traits: traits,
|
|
69
69
|
readConsistency: "EscalateOnRetry"
|
|
@@ -129,7 +129,7 @@ let AddItemMaker = StateChangeSlice_Builder$ReventlessLocal.Make({
|
|
|
129
129
|
errorSchema: errorSchema,
|
|
130
130
|
eventSchema: eventSchema$1,
|
|
131
131
|
commandSchema: commandSchema,
|
|
132
|
-
|
|
132
|
+
authorizationOf: authorizationOf,
|
|
133
133
|
commandTransition: commandTransition,
|
|
134
134
|
traits: traits,
|
|
135
135
|
readConsistency: "EscalateOnRetry"
|
|
@@ -25,7 +25,7 @@ let directiveSchema = Sury.literal("TEPNoDirective");
|
|
|
25
25
|
|
|
26
26
|
let moduleUrl = import.meta.url;
|
|
27
27
|
|
|
28
|
-
function
|
|
28
|
+
function authorizationOf(param) {
|
|
29
29
|
return "AllowAuthenticated";
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -41,7 +41,7 @@ let TestEPSpec = {
|
|
|
41
41
|
eventSchema: eventSchema,
|
|
42
42
|
directiveSchema: directiveSchema,
|
|
43
43
|
moduleUrl: moduleUrl,
|
|
44
|
-
|
|
44
|
+
authorizationOf: authorizationOf,
|
|
45
45
|
commandTransition: commandTransition,
|
|
46
46
|
traits: traits
|
|
47
47
|
};
|
|
@@ -62,7 +62,7 @@ let errorSchema = Sury.literal("TEAggNoError");
|
|
|
62
62
|
|
|
63
63
|
let moduleUrl$1 = import.meta.url;
|
|
64
64
|
|
|
65
|
-
function
|
|
65
|
+
function authorizationOf$1(param) {
|
|
66
66
|
return "AllowAuthenticated";
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -79,7 +79,7 @@ let DelegateAggSpec = {
|
|
|
79
79
|
eventSchema: eventSchema$1,
|
|
80
80
|
errorSchema: errorSchema,
|
|
81
81
|
moduleUrl: moduleUrl$1,
|
|
82
|
-
|
|
82
|
+
authorizationOf: authorizationOf$1,
|
|
83
83
|
commandTransition: commandTransition$1,
|
|
84
84
|
traits: traits$1
|
|
85
85
|
};
|
|
@@ -137,7 +137,7 @@ let TestEPMapping1 = ExtensionPointMapping$ReventlessInfra.Make({
|
|
|
137
137
|
errorSchema: errorSchema,
|
|
138
138
|
commandSchema: commandSchema$1,
|
|
139
139
|
moduleUrl: moduleUrl$1,
|
|
140
|
-
|
|
140
|
+
authorizationOf: authorizationOf$1,
|
|
141
141
|
commandTransition: commandTransition$1,
|
|
142
142
|
traits: traits$1
|
|
143
143
|
},
|