@reventlessdev/reventless-core 3.0.0-alpha.306 → 3.0.0-alpha.308
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 +39 -0
- package/package.json +5 -5
- package/src/Projection.res +4 -4
- package/src/Projection.res.mjs +11 -9
- package/src/ResourceAttribution.res +3 -3
- package/src/ResourceAttribution.res.mjs +1 -4
- package/src/adapter/Auth/Auth_ActiveRole.res +13 -18
- package/src/adapter/Auth/Auth_ActiveRole.res.mjs +4 -9
- package/src/adapter/Auth/Auth_UserId.res +24 -0
- package/src/adapter/Auth/Auth_UserId.res.mjs +23 -0
- package/src/adapter/EventLogProvisioning/EventLogProvisioning.res +1 -1
- package/src/adapter/Monitoring/Monitoring.res +5 -5
- package/src/adapter/Stash/Stash_Memory_Backend.res +35 -0
- package/src/adapter/Stash/Stash_Memory_Backend.res.mjs +44 -0
- package/src/adapter/Throttle/AnonymousLimiter.res +37 -0
- package/src/adapter/Throttle/AnonymousLimiter.res.mjs +43 -0
- package/src/admin/Platform_Admin.res +2 -2
- package/src/admin/Platform_Admin_Structure.res +0 -9
- package/src/admin/Platform_Admin_Structure.res.mjs +3 -12
- package/src/admin/Platform_BakedManifest.res +6 -6
- package/src/admin/Platform_BakedManifest.res.mjs +11 -26
- package/src/admin/Platform_PluginStructuresApi.res +36 -2
- package/src/admin/Platform_PluginStructuresApi.res.mjs +43 -1
- package/src/admin/Platform_SelfRegistration.res +54 -0
- package/src/admin/Platform_SelfRegistration.res.mjs +77 -0
- package/src/components/Api/GraphQL_SchemaInspector.res +3 -3
- package/src/components/Api/SuryToJsonSchema.res +3 -3
- package/src/components/Dcb/Dcb_Builder.res +6 -9
- package/src/components/Dcb/Dcb_Builder.res.mjs +0 -3
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res +14 -1
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res.mjs +3 -3
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res +73 -8
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +60 -12
- package/src/plugin/component/Plugin.res +2 -0
- package/src/plugin/component/Plugin_Builder.res +9 -8
- package/src/plugin/component/Plugin_Builder.res.mjs +6 -10
- package/src/plugin/component/Plugin_Helpers.res +4 -4
- package/src/plugin/component/Plugin_Structure.res +179 -115
- package/src/plugin/component/Plugin_Structure.res.mjs +83 -17
- package/src/plugin/lifecycle/PluginsProjection.res +10 -6
- package/src/plugin/lifecycle/PluginsReadModelSpec.res +8 -8
- package/src/util/FTPHandler.res +3 -3
- package/src/util/ScheduleTime.res +5 -8
- package/src/util/ScheduleTime.res.mjs +0 -3
- package/src/util/Util_Promise.res +1 -1
- package/tests/AnonymousLimiterTest.res +66 -0
- package/tests/AnonymousLimiterTest.res.mjs +89 -0
- package/tests/Auth_UserIdTest.res +24 -0
- package/tests/Auth_UserIdTest.res.mjs +23 -0
- package/tests/ResourceAttributionTest.res +1 -1
- package/tests/ResourceAttributionTest.res.mjs +1 -4
- package/tests/Stash_Memory_BackendTest.res +63 -0
- package/tests/Stash_Memory_BackendTest.res.mjs +98 -0
- package/tests/admin/AdminApiSchemaDriftTest.res +72 -44
- package/tests/admin/AdminApiSchemaDriftTest.res.mjs +41 -3
- package/tests/admin/Platform_Admin_StructureTest.res +1 -1
- package/tests/admin/Platform_Admin_StructureTest.res.mjs +4 -22
- package/tests/admin/Platform_BakedManifestTest.res +11 -29
- package/tests/admin/Platform_BakedManifestTest.res.mjs +8 -39
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res +24 -84
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res.mjs +36 -169
- package/tests/admin/Platform_PluginStructuresApiTest.res +46 -31
- package/tests/admin/Platform_PluginStructuresApiTest.res.mjs +37 -34
- package/tests/admin/Platform_SelfRegistrationTest.res +70 -0
- package/tests/admin/Platform_SelfRegistrationTest.res.mjs +98 -0
- package/tests/admin/Platform_UIFragmentsApiTest.res +1 -4
- package/tests/admin/Platform_UIFragmentsApiTest.res.mjs +1 -4
- package/tests/api/GeocodingTest.res +1 -1
- package/tests/logger/LogFormatTest.res +0 -2
- package/tests/logger/LogFormatTest.res.mjs +0 -2
- package/tests/message/MessageTest.res +0 -13
- package/tests/message/MessageTest.res.mjs +2 -15
- package/tests/plugin/ManifestVisibilityTest.res.mjs +1 -1
- package/tests/plugin/PluginStructureAccessTest.res +6 -1
- package/tests/plugin/PluginStructureAccessTest.res.mjs +9 -5
- package/tests/plugin/PluginStructureTest.res +99 -23
- package/tests/plugin/PluginStructureTest.res.mjs +123 -79
- package/tests/plugin/pluginDefinitionRequiredScalars.txt +10 -0
|
@@ -9,14 +9,9 @@ let cmd: commandDef = {
|
|
|
9
9
|
name: "Add",
|
|
10
10
|
schema: "{}",
|
|
11
11
|
level: Collection,
|
|
12
|
-
aggregateIdField: None,
|
|
13
12
|
mutationField: "AddProduct",
|
|
14
|
-
references: [{fieldName: "categoryId", entity: "Category", plugin:
|
|
15
|
-
|
|
16
|
-
targetState: None,
|
|
17
|
-
apiExposed: Some(true),
|
|
18
|
-
requiredAccess: None,
|
|
19
|
-
ownerField: None,
|
|
13
|
+
references: [{fieldName: "categoryId", entity: "Category", plugin: "Catalog"}],
|
|
14
|
+
apiExposed: true,
|
|
20
15
|
}
|
|
21
16
|
|
|
22
17
|
let qbl: readSideDef = {
|
|
@@ -27,30 +22,20 @@ let qbl: readSideDef = {
|
|
|
27
22
|
linkedWriteSide: ["Product"],
|
|
28
23
|
labelField: "displayName",
|
|
29
24
|
searchableFields: ["displayName"],
|
|
30
|
-
labelFieldSource:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
singleQueryField: Some("Catalog_Product"),
|
|
35
|
-
idField: Some("productId"),
|
|
36
|
-
idFieldSource: Some("convention"),
|
|
37
|
-
requiredAccess: None,
|
|
38
|
-
ownerField: None,
|
|
39
|
-
retiredField: None,
|
|
40
|
-
retiredValues: None,
|
|
41
|
-
namedWhenRetired: None,
|
|
25
|
+
labelFieldSource: "annotation",
|
|
26
|
+
singleQueryField: "Catalog_Product",
|
|
27
|
+
idField: "productId",
|
|
28
|
+
idFieldSource: "convention",
|
|
42
29
|
}
|
|
43
30
|
|
|
44
31
|
let wbl: writeSideDef = {
|
|
45
32
|
name: "Product",
|
|
46
33
|
commands: [cmd],
|
|
47
34
|
linkedViews: ["Products"],
|
|
48
|
-
consistencyRead: None,
|
|
49
35
|
producedEventTypes: ["ProductAdded"],
|
|
50
36
|
consumedEventTypes: [],
|
|
51
37
|
events: [{name: "ProductAdded", schema: "{}", references: []}],
|
|
52
38
|
errors: [{name: "ProductAlreadyExists", schema: "{}", references: []}],
|
|
53
|
-
chapter: None,
|
|
54
39
|
}
|
|
55
40
|
|
|
56
41
|
let structure: pluginStructure = {
|
|
@@ -64,7 +49,6 @@ let structure: pluginStructure = {
|
|
|
64
49
|
consumedEventTypes: ["StockLow"],
|
|
65
50
|
producedCommandTypes: ["Restock"],
|
|
66
51
|
targetName: "Product",
|
|
67
|
-
chapter: None,
|
|
68
52
|
},
|
|
69
53
|
],
|
|
70
54
|
outboundTranslationSlices: [
|
|
@@ -72,10 +56,6 @@ let structure: pluginStructure = {
|
|
|
72
56
|
name: "ToShipper",
|
|
73
57
|
consumedEventTypes: ["OrderPlaced"],
|
|
74
58
|
inboundCommandTypes: ["Ship"],
|
|
75
|
-
targetName: None,
|
|
76
|
-
externalSystem: None,
|
|
77
|
-
chapter: None,
|
|
78
|
-
consumedSources: None,
|
|
79
59
|
},
|
|
80
60
|
],
|
|
81
61
|
inboundTranslationSlices: [
|
|
@@ -83,8 +63,6 @@ let structure: pluginStructure = {
|
|
|
83
63
|
name: "FromBilling",
|
|
84
64
|
commandTypes: ["RecordPayment"],
|
|
85
65
|
targetName: "Order",
|
|
86
|
-
externalSystem: None,
|
|
87
|
-
chapter: None,
|
|
88
66
|
},
|
|
89
67
|
],
|
|
90
68
|
extensions: [
|
|
@@ -93,19 +71,10 @@ let structure: pluginStructure = {
|
|
|
93
71
|
delegateNames: ["onAdded"],
|
|
94
72
|
eventTypes: ["ProductAdded"],
|
|
95
73
|
commandTypes: [],
|
|
96
|
-
handledEvents:
|
|
97
|
-
|
|
98
|
-
]),
|
|
99
|
-
issuedCommands: Some([
|
|
100
|
-
{name: "Catalog.Products.Acknowledge", fromEventTypes: ["Catalog.Watched"]},
|
|
101
|
-
]),
|
|
74
|
+
handledEvents: [{name: "Catalog.Products.ProductAdded", toCommandTypes: ["Catalog.Watch"]}],
|
|
75
|
+
issuedCommands: [{name: "Catalog.Products.Acknowledge", fromEventTypes: ["Catalog.Watched"]}],
|
|
102
76
|
},
|
|
103
77
|
],
|
|
104
|
-
extensionPoints: None,
|
|
105
|
-
requiredStores: None,
|
|
106
|
-
requiredStoreDeclarations: None,
|
|
107
|
-
requiredCapabilities: None,
|
|
108
|
-
traitDeclarations: None,
|
|
109
78
|
}
|
|
110
79
|
|
|
111
80
|
let encoded = Platform_ComponentDefinitionsApi.encodePluginStructureEntry(
|
|
@@ -223,10 +192,7 @@ describe("translation-slice externalSystem round-trip", () => {
|
|
|
223
192
|
name: "ToShipper",
|
|
224
193
|
consumedEventTypes: ["OrderPlaced"],
|
|
225
194
|
inboundCommandTypes: ["Ship"],
|
|
226
|
-
|
|
227
|
-
externalSystem: Some("ShipperGateway"),
|
|
228
|
-
chapter: None,
|
|
229
|
-
consumedSources: None,
|
|
195
|
+
externalSystem: "ShipperGateway",
|
|
230
196
|
},
|
|
231
197
|
],
|
|
232
198
|
inboundTranslationSlices: [
|
|
@@ -234,8 +200,7 @@ describe("translation-slice externalSystem round-trip", () => {
|
|
|
234
200
|
name: "FromBilling",
|
|
235
201
|
commandTypes: ["RecordPayment"],
|
|
236
202
|
targetName: "Order",
|
|
237
|
-
externalSystem:
|
|
238
|
-
chapter: None,
|
|
203
|
+
externalSystem: "BillingProvider",
|
|
239
204
|
},
|
|
240
205
|
],
|
|
241
206
|
}
|
|
@@ -266,18 +231,11 @@ describe("visibility filtering (deployed AutoUI hides Internal)", () => {
|
|
|
266
231
|
linkedWriteSide: [],
|
|
267
232
|
labelField: "name",
|
|
268
233
|
searchableFields: ["name"],
|
|
269
|
-
labelFieldSource:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
idField: Some("productId"),
|
|
275
|
-
idFieldSource: Some("sole"),
|
|
276
|
-
requiredAccess: None,
|
|
277
|
-
ownerField: None,
|
|
278
|
-
retiredField: None,
|
|
279
|
-
retiredValues: None,
|
|
280
|
-
namedWhenRetired: None,
|
|
234
|
+
labelFieldSource: "convention",
|
|
235
|
+
visibility: "Internal",
|
|
236
|
+
singleQueryField: "Ordering_AvailableProduct",
|
|
237
|
+
idField: "productId",
|
|
238
|
+
idFieldSource: "sole",
|
|
281
239
|
}
|
|
282
240
|
// A distinct name per source array: the complement has to be fed by both, and
|
|
283
241
|
// reusing one def would hide a version that only walks `readModels`.
|
|
@@ -353,15 +311,13 @@ describe("allowedStates + lifecycleField populated", () => {
|
|
|
353
311
|
name: "Activate",
|
|
354
312
|
schema: "{}",
|
|
355
313
|
level: Instance,
|
|
356
|
-
aggregateIdField:
|
|
314
|
+
aggregateIdField: "id",
|
|
357
315
|
mutationField: "Platform_Plugin_Activate",
|
|
358
316
|
references: [],
|
|
359
|
-
allowedStates:
|
|
360
|
-
targetState:
|
|
317
|
+
allowedStates: ["Inactive"],
|
|
318
|
+
targetState: "Active",
|
|
361
319
|
allowedStatesSource: "declared",
|
|
362
|
-
apiExposed:
|
|
363
|
-
requiredAccess: None,
|
|
364
|
-
ownerField: None,
|
|
320
|
+
apiExposed: true,
|
|
365
321
|
}
|
|
366
322
|
|
|
367
323
|
let qblWithStatus: readSideDef = {
|
|
@@ -372,30 +328,19 @@ describe("allowedStates + lifecycleField populated", () => {
|
|
|
372
328
|
linkedWriteSide: ["Plugin"],
|
|
373
329
|
labelField: "name",
|
|
374
330
|
searchableFields: ["name"],
|
|
375
|
-
labelFieldSource:
|
|
376
|
-
lifecycleField:
|
|
377
|
-
|
|
378
|
-
chapter: None,
|
|
379
|
-
singleQueryField: Some("Platform_Plugin"),
|
|
380
|
-
idField: None,
|
|
381
|
-
idFieldSource: None,
|
|
382
|
-
requiredAccess: None,
|
|
383
|
-
ownerField: None,
|
|
384
|
-
retiredField: None,
|
|
385
|
-
retiredValues: None,
|
|
386
|
-
namedWhenRetired: None,
|
|
331
|
+
labelFieldSource: "convention",
|
|
332
|
+
lifecycleField: "status",
|
|
333
|
+
singleQueryField: "Platform_Plugin",
|
|
387
334
|
}
|
|
388
335
|
|
|
389
336
|
let wblWithStates: writeSideDef = {
|
|
390
337
|
name: "Plugin",
|
|
391
338
|
commands: [cmdWithStates],
|
|
392
339
|
linkedViews: ["Plugin"],
|
|
393
|
-
consistencyRead: None,
|
|
394
340
|
producedEventTypes: [],
|
|
395
341
|
consumedEventTypes: [],
|
|
396
342
|
events: [],
|
|
397
343
|
errors: [],
|
|
398
|
-
chapter: None,
|
|
399
344
|
}
|
|
400
345
|
|
|
401
346
|
let structureWithStates: pluginStructure = {
|
|
@@ -407,11 +352,6 @@ describe("allowedStates + lifecycleField populated", () => {
|
|
|
407
352
|
outboundTranslationSlices: [],
|
|
408
353
|
inboundTranslationSlices: [],
|
|
409
354
|
extensions: [],
|
|
410
|
-
extensionPoints: None,
|
|
411
|
-
requiredStores: None,
|
|
412
|
-
requiredStoreDeclarations: None,
|
|
413
|
-
requiredCapabilities: None,
|
|
414
|
-
traitDeclarations: None,
|
|
415
355
|
}
|
|
416
356
|
|
|
417
357
|
let json =
|
|
@@ -453,7 +393,7 @@ describe("singleQueryField reaches the caller", () => {
|
|
|
453
393
|
// hand-rolled def that declines to state it, must decode rather than fail.
|
|
454
394
|
testSync("encodes an unstated singular as null", () => {
|
|
455
395
|
let unstated =
|
|
456
|
-
{...structure, readModels: [{...qbl, singleQueryField: None}]}
|
|
396
|
+
{...structure, readModels: [{...qbl, singleQueryField: ?None}]}
|
|
457
397
|
->Platform_ComponentDefinitionsApi.encodePluginStructureEntry(~pluginId="Catalog", _)
|
|
458
398
|
->JSON.stringify
|
|
459
399
|
expect(unstated->String.includes("\"singleQueryField\":null"))->toEqual(true)
|
|
@@ -479,7 +419,7 @@ describe("idField / idFieldSource reach the caller", () => {
|
|
|
479
419
|
// or none at all) has nothing to report — null, not an invented field name.
|
|
480
420
|
testSync("encodes an unresolved key as null on both fields", () => {
|
|
481
421
|
let unresolved =
|
|
482
|
-
{...structure, readModels: [{...qbl, idField: None, idFieldSource: None}]}
|
|
422
|
+
{...structure, readModels: [{...qbl, idField: ?None, idFieldSource: ?None}]}
|
|
483
423
|
->Platform_ComponentDefinitionsApi.encodePluginStructureEntry(~pluginId="Catalog", _)
|
|
484
424
|
->JSON.stringify
|
|
485
425
|
expect(unresolved->String.includes("\"idField\":null"))->toEqual(true)
|
|
@@ -18,14 +18,9 @@ let cmd = {
|
|
|
18
18
|
name: "Add",
|
|
19
19
|
schema: "{}",
|
|
20
20
|
level: "Collection",
|
|
21
|
-
aggregateIdField: undefined,
|
|
22
21
|
mutationField: "AddProduct",
|
|
23
22
|
references: cmd_references,
|
|
24
|
-
|
|
25
|
-
targetState: undefined,
|
|
26
|
-
apiExposed: cmd_apiExposed,
|
|
27
|
-
requiredAccess: undefined,
|
|
28
|
-
ownerField: undefined
|
|
23
|
+
apiExposed: cmd_apiExposed
|
|
29
24
|
};
|
|
30
25
|
|
|
31
26
|
let qbl_consumedEventTypes = ["ProductAdded"];
|
|
@@ -51,17 +46,9 @@ let qbl = {
|
|
|
51
46
|
labelField: "displayName",
|
|
52
47
|
searchableFields: qbl_searchableFields,
|
|
53
48
|
labelFieldSource: qbl_labelFieldSource,
|
|
54
|
-
lifecycleField: undefined,
|
|
55
|
-
ownerField: undefined,
|
|
56
|
-
retiredField: undefined,
|
|
57
|
-
retiredValues: undefined,
|
|
58
|
-
namedWhenRetired: undefined,
|
|
59
|
-
visibility: undefined,
|
|
60
|
-
chapter: undefined,
|
|
61
49
|
singleQueryField: qbl_singleQueryField,
|
|
62
50
|
idField: qbl_idField,
|
|
63
|
-
idFieldSource: qbl_idFieldSource
|
|
64
|
-
requiredAccess: undefined
|
|
51
|
+
idFieldSource: qbl_idFieldSource
|
|
65
52
|
};
|
|
66
53
|
|
|
67
54
|
let wbl_commands = [cmd];
|
|
@@ -90,10 +77,8 @@ let wbl = {
|
|
|
90
77
|
producedEventTypes: wbl_producedEventTypes,
|
|
91
78
|
consumedEventTypes: wbl_consumedEventTypes,
|
|
92
79
|
linkedViews: wbl_linkedViews,
|
|
93
|
-
consistencyRead: undefined,
|
|
94
80
|
events: wbl_events,
|
|
95
|
-
errors: wbl_errors
|
|
96
|
-
chapter: undefined
|
|
81
|
+
errors: wbl_errors
|
|
97
82
|
};
|
|
98
83
|
|
|
99
84
|
let structure_readModels = [qbl];
|
|
@@ -108,26 +93,19 @@ let structure_automationSlices = [{
|
|
|
108
93
|
name: "Restocker",
|
|
109
94
|
consumedEventTypes: ["StockLow"],
|
|
110
95
|
producedCommandTypes: ["Restock"],
|
|
111
|
-
targetName: "Product"
|
|
112
|
-
chapter: undefined
|
|
96
|
+
targetName: "Product"
|
|
113
97
|
}];
|
|
114
98
|
|
|
115
99
|
let structure_outboundTranslationSlices = [{
|
|
116
100
|
name: "ToShipper",
|
|
117
101
|
consumedEventTypes: ["OrderPlaced"],
|
|
118
|
-
inboundCommandTypes: ["Ship"]
|
|
119
|
-
targetName: undefined,
|
|
120
|
-
externalSystem: undefined,
|
|
121
|
-
chapter: undefined,
|
|
122
|
-
consumedSources: undefined
|
|
102
|
+
inboundCommandTypes: ["Ship"]
|
|
123
103
|
}];
|
|
124
104
|
|
|
125
105
|
let structure_inboundTranslationSlices = [{
|
|
126
106
|
name: "FromBilling",
|
|
127
107
|
commandTypes: ["RecordPayment"],
|
|
128
|
-
targetName: "Order"
|
|
129
|
-
externalSystem: undefined,
|
|
130
|
-
chapter: undefined
|
|
108
|
+
targetName: "Order"
|
|
131
109
|
}];
|
|
132
110
|
|
|
133
111
|
let structure_extensions = [{
|
|
@@ -153,12 +131,7 @@ let structure = {
|
|
|
153
131
|
automationSlices: structure_automationSlices,
|
|
154
132
|
outboundTranslationSlices: structure_outboundTranslationSlices,
|
|
155
133
|
inboundTranslationSlices: structure_inboundTranslationSlices,
|
|
156
|
-
extensions: structure_extensions
|
|
157
|
-
extensionPoints: undefined,
|
|
158
|
-
requiredStores: undefined,
|
|
159
|
-
requiredStoreDeclarations: undefined,
|
|
160
|
-
requiredCapabilities: undefined,
|
|
161
|
-
traitDeclarations: undefined
|
|
134
|
+
extensions: structure_extensions
|
|
162
135
|
};
|
|
163
136
|
|
|
164
137
|
let encoded = Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Catalog", undefined, structure);
|
|
@@ -235,44 +208,20 @@ globalThis.describe("encodePluginStructureEntry", () => {
|
|
|
235
208
|
});
|
|
236
209
|
|
|
237
210
|
globalThis.describe("translation-slice externalSystem round-trip", () => {
|
|
238
|
-
let
|
|
239
|
-
|
|
240
|
-
let externalStructure_stateChangeSlices = structure_stateChangeSlices;
|
|
241
|
-
let externalStructure_aggregates = structure_aggregates;
|
|
242
|
-
let externalStructure_automationSlices = structure_automationSlices;
|
|
243
|
-
let externalStructure_outboundTranslationSlices = [{
|
|
244
|
-
name: "ToShipper",
|
|
245
|
-
consumedEventTypes: ["OrderPlaced"],
|
|
246
|
-
inboundCommandTypes: ["Ship"],
|
|
247
|
-
targetName: undefined,
|
|
248
|
-
externalSystem: "ShipperGateway",
|
|
249
|
-
chapter: undefined,
|
|
250
|
-
consumedSources: undefined
|
|
251
|
-
}];
|
|
252
|
-
let externalStructure_inboundTranslationSlices = [{
|
|
211
|
+
let newrecord = {...structure};
|
|
212
|
+
newrecord.inboundTranslationSlices = [{
|
|
253
213
|
name: "FromBilling",
|
|
254
214
|
commandTypes: ["RecordPayment"],
|
|
255
215
|
targetName: "Order",
|
|
256
|
-
externalSystem: "BillingProvider"
|
|
257
|
-
chapter: undefined
|
|
216
|
+
externalSystem: "BillingProvider"
|
|
258
217
|
}];
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
outboundTranslationSlices: externalStructure_outboundTranslationSlices,
|
|
267
|
-
inboundTranslationSlices: externalStructure_inboundTranslationSlices,
|
|
268
|
-
extensions: externalStructure_extensions,
|
|
269
|
-
extensionPoints: undefined,
|
|
270
|
-
requiredStores: undefined,
|
|
271
|
-
requiredStoreDeclarations: undefined,
|
|
272
|
-
requiredCapabilities: undefined,
|
|
273
|
-
traitDeclarations: undefined
|
|
274
|
-
};
|
|
275
|
-
let externalJson = JSON.stringify(Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Catalog", undefined, externalStructure));
|
|
218
|
+
newrecord.outboundTranslationSlices = [{
|
|
219
|
+
name: "ToShipper",
|
|
220
|
+
consumedEventTypes: ["OrderPlaced"],
|
|
221
|
+
inboundCommandTypes: ["Ship"],
|
|
222
|
+
externalSystem: "ShipperGateway"
|
|
223
|
+
}];
|
|
224
|
+
let externalJson = JSON.stringify(Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Catalog", undefined, newrecord));
|
|
276
225
|
globalThis.test("surfaces Some outbound externalSystem as its inner string", () => {
|
|
277
226
|
globalThis.expect(externalJson.includes("\"externalSystem\":\"ShipperGateway\"")).toEqual(true);
|
|
278
227
|
});
|
|
@@ -299,48 +248,21 @@ globalThis.describe("visibility filtering (deployed AutoUI hides Internal)", ()
|
|
|
299
248
|
labelField: "name",
|
|
300
249
|
searchableFields: internalQbl_searchableFields,
|
|
301
250
|
labelFieldSource: internalQbl_labelFieldSource,
|
|
302
|
-
lifecycleField: undefined,
|
|
303
|
-
ownerField: undefined,
|
|
304
|
-
retiredField: undefined,
|
|
305
|
-
retiredValues: undefined,
|
|
306
|
-
namedWhenRetired: undefined,
|
|
307
251
|
visibility: internalQbl_visibility,
|
|
308
|
-
chapter: undefined,
|
|
309
252
|
singleQueryField: internalQbl_singleQueryField,
|
|
310
253
|
idField: internalQbl_idField,
|
|
311
|
-
idFieldSource: internalQbl_idFieldSource
|
|
312
|
-
requiredAccess: undefined
|
|
254
|
+
idFieldSource: internalQbl_idFieldSource
|
|
313
255
|
};
|
|
314
256
|
let newrecord = {...internalQbl};
|
|
315
257
|
newrecord.queryField = "Ordering_PendingShipments";
|
|
316
258
|
newrecord.name = "PendingShipments";
|
|
317
|
-
let
|
|
259
|
+
let newrecord$1 = {...structure};
|
|
260
|
+
newrecord$1.stateViewSlices = [newrecord];
|
|
261
|
+
newrecord$1.readModels = [
|
|
318
262
|
qbl,
|
|
319
263
|
internalQbl
|
|
320
264
|
];
|
|
321
|
-
let
|
|
322
|
-
let mixed_stateChangeSlices = structure_stateChangeSlices;
|
|
323
|
-
let mixed_aggregates = structure_aggregates;
|
|
324
|
-
let mixed_automationSlices = structure_automationSlices;
|
|
325
|
-
let mixed_outboundTranslationSlices = structure_outboundTranslationSlices;
|
|
326
|
-
let mixed_inboundTranslationSlices = structure_inboundTranslationSlices;
|
|
327
|
-
let mixed_extensions = structure_extensions;
|
|
328
|
-
let mixed = {
|
|
329
|
-
readModels: mixed_readModels,
|
|
330
|
-
stateViewSlices: mixed_stateViewSlices,
|
|
331
|
-
stateChangeSlices: mixed_stateChangeSlices,
|
|
332
|
-
aggregates: mixed_aggregates,
|
|
333
|
-
automationSlices: mixed_automationSlices,
|
|
334
|
-
outboundTranslationSlices: mixed_outboundTranslationSlices,
|
|
335
|
-
inboundTranslationSlices: mixed_inboundTranslationSlices,
|
|
336
|
-
extensions: mixed_extensions,
|
|
337
|
-
extensionPoints: undefined,
|
|
338
|
-
requiredStores: undefined,
|
|
339
|
-
requiredStoreDeclarations: undefined,
|
|
340
|
-
requiredCapabilities: undefined,
|
|
341
|
-
traitDeclarations: undefined
|
|
342
|
-
};
|
|
343
|
-
let mixedEntry = Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Ordering", undefined, mixed);
|
|
265
|
+
let mixedEntry = Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Ordering", undefined, newrecord$1);
|
|
344
266
|
let namesAt = (entry, key) => Stdlib_Array.filterMap(Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(entry), o => o[key]), Stdlib_JSON.Decode.array), []), c => Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(c), o => o["name"]), Stdlib_JSON.Decode.string));
|
|
345
267
|
globalThis.test("excludes an Internal readSideDef from the encoded read-side", () => {
|
|
346
268
|
globalThis.expect(namesAt(mixedEntry, "readModels")).toEqual(["Products"]);
|
|
@@ -356,21 +278,8 @@ globalThis.describe("visibility filtering (deployed AutoUI hides Internal)", ()
|
|
|
356
278
|
]);
|
|
357
279
|
});
|
|
358
280
|
globalThis.test("encodes internalQueryables as [] for an all-Public entry, not a missing key", () => {
|
|
359
|
-
let
|
|
360
|
-
|
|
361
|
-
stateViewSlices: [],
|
|
362
|
-
stateChangeSlices: structure_stateChangeSlices,
|
|
363
|
-
aggregates: structure_aggregates,
|
|
364
|
-
automationSlices: structure_automationSlices,
|
|
365
|
-
outboundTranslationSlices: structure_outboundTranslationSlices,
|
|
366
|
-
inboundTranslationSlices: structure_inboundTranslationSlices,
|
|
367
|
-
extensions: structure_extensions,
|
|
368
|
-
extensionPoints: undefined,
|
|
369
|
-
requiredStores: undefined,
|
|
370
|
-
requiredStoreDeclarations: undefined,
|
|
371
|
-
requiredCapabilities: undefined,
|
|
372
|
-
traitDeclarations: undefined
|
|
373
|
-
});
|
|
281
|
+
let newrecord = {...structure};
|
|
282
|
+
let entry = Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Ordering", undefined, (newrecord.stateViewSlices = [], newrecord.readModels = [qbl], newrecord));
|
|
374
283
|
globalThis.expect(Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(entry), o => o["internalQueryables"])).toEqual([]);
|
|
375
284
|
});
|
|
376
285
|
globalThis.test("declares internalQueryables on the entry type in the SDL", () => {
|
|
@@ -396,9 +305,7 @@ globalThis.describe("allowedStates + lifecycleField populated", () => {
|
|
|
396
305
|
allowedStates: cmdWithStates_allowedStates,
|
|
397
306
|
targetState: cmdWithStates_targetState,
|
|
398
307
|
allowedStatesSource: cmdWithStates_allowedStatesSource,
|
|
399
|
-
apiExposed: cmdWithStates_apiExposed
|
|
400
|
-
requiredAccess: undefined,
|
|
401
|
-
ownerField: undefined
|
|
308
|
+
apiExposed: cmdWithStates_apiExposed
|
|
402
309
|
};
|
|
403
310
|
let qblWithStatus_consumedEventTypes = [];
|
|
404
311
|
let qblWithStatus_linkedWriteSide = ["Plugin"];
|
|
@@ -416,16 +323,7 @@ globalThis.describe("allowedStates + lifecycleField populated", () => {
|
|
|
416
323
|
searchableFields: qblWithStatus_searchableFields,
|
|
417
324
|
labelFieldSource: qblWithStatus_labelFieldSource,
|
|
418
325
|
lifecycleField: qblWithStatus_lifecycleField,
|
|
419
|
-
|
|
420
|
-
retiredField: undefined,
|
|
421
|
-
retiredValues: undefined,
|
|
422
|
-
namedWhenRetired: undefined,
|
|
423
|
-
visibility: undefined,
|
|
424
|
-
chapter: undefined,
|
|
425
|
-
singleQueryField: qblWithStatus_singleQueryField,
|
|
426
|
-
idField: undefined,
|
|
427
|
-
idFieldSource: undefined,
|
|
428
|
-
requiredAccess: undefined
|
|
326
|
+
singleQueryField: qblWithStatus_singleQueryField
|
|
429
327
|
};
|
|
430
328
|
let wblWithStates_commands = [cmdWithStates];
|
|
431
329
|
let wblWithStates_producedEventTypes = [];
|
|
@@ -439,10 +337,8 @@ globalThis.describe("allowedStates + lifecycleField populated", () => {
|
|
|
439
337
|
producedEventTypes: wblWithStates_producedEventTypes,
|
|
440
338
|
consumedEventTypes: wblWithStates_consumedEventTypes,
|
|
441
339
|
linkedViews: wblWithStates_linkedViews,
|
|
442
|
-
consistencyRead: undefined,
|
|
443
340
|
events: wblWithStates_events,
|
|
444
|
-
errors: wblWithStates_errors
|
|
445
|
-
chapter: undefined
|
|
341
|
+
errors: wblWithStates_errors
|
|
446
342
|
};
|
|
447
343
|
let structureWithStates_readModels = [qblWithStatus];
|
|
448
344
|
let structureWithStates_stateViewSlices = [];
|
|
@@ -460,12 +356,7 @@ globalThis.describe("allowedStates + lifecycleField populated", () => {
|
|
|
460
356
|
automationSlices: structureWithStates_automationSlices,
|
|
461
357
|
outboundTranslationSlices: structureWithStates_outboundTranslationSlices,
|
|
462
358
|
inboundTranslationSlices: structureWithStates_inboundTranslationSlices,
|
|
463
|
-
extensions: structureWithStates_extensions
|
|
464
|
-
extensionPoints: undefined,
|
|
465
|
-
requiredStores: undefined,
|
|
466
|
-
requiredStoreDeclarations: undefined,
|
|
467
|
-
requiredCapabilities: undefined,
|
|
468
|
-
traitDeclarations: undefined
|
|
359
|
+
extensions: structureWithStates_extensions
|
|
469
360
|
};
|
|
470
361
|
let json = JSON.stringify(Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Platform", undefined, structureWithStates));
|
|
471
362
|
globalThis.test("encodes populated allowedStates as a JSON array", () => {
|
|
@@ -489,22 +380,10 @@ globalThis.describe("singleQueryField reaches the caller", () => {
|
|
|
489
380
|
globalThis.expect(json.includes("\"singleQueryField\":\"Catalog_Product\"")).toEqual(true);
|
|
490
381
|
});
|
|
491
382
|
globalThis.test("encodes an unstated singular as null", () => {
|
|
492
|
-
let newrecord = {...
|
|
493
|
-
let
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
stateChangeSlices: structure_stateChangeSlices,
|
|
497
|
-
aggregates: structure_aggregates,
|
|
498
|
-
automationSlices: structure_automationSlices,
|
|
499
|
-
outboundTranslationSlices: structure_outboundTranslationSlices,
|
|
500
|
-
inboundTranslationSlices: structure_inboundTranslationSlices,
|
|
501
|
-
extensions: structure_extensions,
|
|
502
|
-
extensionPoints: undefined,
|
|
503
|
-
requiredStores: undefined,
|
|
504
|
-
requiredStoreDeclarations: undefined,
|
|
505
|
-
requiredCapabilities: undefined,
|
|
506
|
-
traitDeclarations: undefined
|
|
507
|
-
}));
|
|
383
|
+
let newrecord = {...structure};
|
|
384
|
+
let newrecord$1 = {...qbl};
|
|
385
|
+
newrecord.readModels = [(newrecord$1.singleQueryField = undefined, newrecord$1)];
|
|
386
|
+
let unstated = JSON.stringify(Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Catalog", undefined, newrecord));
|
|
508
387
|
globalThis.expect(unstated.includes("\"singleQueryField\":null")).toEqual(true);
|
|
509
388
|
});
|
|
510
389
|
globalThis.test("types it as a nullable String on the read-side SDL", () => {
|
|
@@ -520,22 +399,10 @@ globalThis.describe("idField / idFieldSource reach the caller", () => {
|
|
|
520
399
|
globalThis.expect(json.includes("\"idFieldSource\":\"convention\"")).toEqual(true);
|
|
521
400
|
});
|
|
522
401
|
globalThis.test("encodes an unresolved key as null on both fields", () => {
|
|
523
|
-
let newrecord = {...
|
|
524
|
-
let
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
stateChangeSlices: structure_stateChangeSlices,
|
|
528
|
-
aggregates: structure_aggregates,
|
|
529
|
-
automationSlices: structure_automationSlices,
|
|
530
|
-
outboundTranslationSlices: structure_outboundTranslationSlices,
|
|
531
|
-
inboundTranslationSlices: structure_inboundTranslationSlices,
|
|
532
|
-
extensions: structure_extensions,
|
|
533
|
-
extensionPoints: undefined,
|
|
534
|
-
requiredStores: undefined,
|
|
535
|
-
requiredStoreDeclarations: undefined,
|
|
536
|
-
requiredCapabilities: undefined,
|
|
537
|
-
traitDeclarations: undefined
|
|
538
|
-
}));
|
|
402
|
+
let newrecord = {...structure};
|
|
403
|
+
let newrecord$1 = {...qbl};
|
|
404
|
+
newrecord.readModels = [(newrecord$1.idFieldSource = undefined, newrecord$1.idField = undefined, newrecord$1)];
|
|
405
|
+
let unresolved = JSON.stringify(Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry("Catalog", undefined, newrecord));
|
|
539
406
|
globalThis.expect(unresolved.includes("\"idField\":null")).toEqual(true);
|
|
540
407
|
globalThis.expect(unresolved.includes("\"idFieldSource\":null")).toEqual(true);
|
|
541
408
|
});
|