@reventlessdev/reventless-core 3.0.0-alpha.256 → 3.0.0-alpha.258
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 +28 -0
- package/package.json +8 -8
- package/src/adapter/Monitoring/Monitoring.res +79 -5
- package/src/adapter/Monitoring/Monitoring.res.mjs +42 -2
- package/src/admin/Platform_Admin_Structure.res.mjs +1 -1
- package/src/admin/Platform_ComponentDefinitionsApi.res +5 -1
- package/src/admin/Platform_ComponentDefinitionsApi.res.mjs +5 -1
- package/src/admin/Platform_UiSlots.res +21 -0
- package/src/admin/Platform_UiSlots.res.mjs +15 -0
- package/src/admin/UiFragmentRegistry/StateChangeSlice/UiFragmentRegistry.res.mjs +1 -1
- package/src/components/Aggregate/Aggregate_Callback.res +13 -4
- package/src/components/Aggregate/Aggregate_Callback.res.mjs +6 -5
- package/src/components/Api/GraphQL_FragmentGenerator.res +2 -0
- package/src/components/Api/GraphQL_FragmentGenerator.res.mjs +4 -0
- package/src/components/Api/MCP_SchemaGenerator.res.mjs +2 -2
- package/src/components/Api/SchemaType.res +8 -0
- package/src/components/Api/SchemaType.res.mjs +15 -5
- package/src/components/Api/SuryToJsonSchema.res +70 -12
- package/src/components/Api/SuryToJsonSchema.res.mjs +43 -16
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res +6 -1
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +1 -1
- package/src/components/StateViewSlice/StateViewSlice_Builder.res +7 -2
- package/src/components/StateViewSlice/StateViewSlice_Builder.res.mjs +4 -1
- package/src/components/StateViewSlice/StateViewSlice_Callback.res +3 -1
- package/src/components/StateViewSlice/StateViewSlice_Callback.res.mjs +1 -1
- package/src/plugin/component/Plugin.res +1 -0
- package/src/plugin/component/Plugin_Builder.res +2 -0
- package/src/plugin/component/Plugin_Builder.res.mjs +3 -2
- package/src/plugin/component/Plugin_Structure.res +105 -10
- package/src/plugin/component/Plugin_Structure.res.mjs +71 -27
- package/src/util/Validation.res +1 -1
- package/src/util/Validation.res.mjs +2 -2
- package/tests/adapter/MonitoringTest.res +46 -7
- package/tests/adapter/MonitoringTest.res.mjs +47 -5
- package/tests/admin/AdminApiSchemaDriftTest.res +1 -0
- package/tests/admin/AdminApiSchemaDriftTest.res.mjs +3 -0
- package/tests/admin/Platform_Admin_StructureTest.res.mjs +2 -14
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res +1 -0
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res.mjs +2 -0
- package/tests/aggregate/AggregateCacheTest.res.mjs +1 -1
- package/tests/aggregate/AggregateConflictTest.res.mjs +1 -1
- package/tests/aggregate/AggregateFixtures.res.mjs +1 -1
- package/tests/aggregate/AggregateSnapshotTest.res.mjs +1 -1
- package/tests/api/GraphQL_FragmentGeneratorTest.res +6 -4
- package/tests/api/GraphQL_FragmentGeneratorTest.res.mjs +5 -5
- package/tests/api/SuryToJsonSchemaTest.res.mjs +57 -57
- package/tests/api/TaggedUnionSchemaTest.res.mjs +1 -1
- package/tests/commandgenerator/CommandGeneratorFixtures.res.mjs +1 -1
- package/tests/commandtopic/CommandTopicCallbackFixtures.res.mjs +1 -1
- package/tests/dcb/DcbFixtures.res.mjs +1 -1
- package/tests/eventmapper/EventMapperFixtures.res.mjs +1 -1
- package/tests/extensionpoint/ExtensionPointFixtures.res.mjs +1 -1
- package/tests/extensionpoint/ExtensionPointOperationsTest.res.mjs +1 -1
- package/tests/plugin/ManifestVisibilityTest.res.mjs +1 -1
- package/tests/plugin/PluginStructureAccessTest.res.mjs +1 -1
- package/tests/plugin/PluginStructureTest.res +184 -0
- package/tests/plugin/PluginStructureTest.res.mjs +142 -17
- package/tests/plugin/StateChangeSlice/PsAttachInvoice.res.mjs +1 -1
- package/tests/plugin/StateChangeSlice/PsChangePhoto.res.mjs +1 -1
- package/tests/plugin/StateChangeSlice/PsGatedCommands.res.mjs +1 -1
- package/tests/plugin/StateChangeSlice/PsPlaceOrder.res.mjs +1 -1
- package/tests/plugin/StateChangeSlice/PsReserveStock.res +14 -1
- package/tests/plugin/StateChangeSlice/PsReserveStock.res.mjs +9 -2
- package/tests/plugin/StateChangeSlice/PsTypoStore.res.mjs +1 -1
- package/tests/plugin/StateChangeSlice/PsUploadAvatar.res.mjs +1 -1
- package/tests/plugin/StateChangeSlice/PsUploadImages.res.mjs +1 -1
- package/tests/util/CommandPublisherTest.res.mjs +1 -1
|
@@ -61,6 +61,8 @@ let cmd_allowedStates = ["Draft"];
|
|
|
61
61
|
|
|
62
62
|
let cmd_targetState = "Active";
|
|
63
63
|
|
|
64
|
+
let cmd_allowedStatesSource = "declared";
|
|
65
|
+
|
|
64
66
|
let cmd_apiExposed = true;
|
|
65
67
|
|
|
66
68
|
let cmd_requiredAccess = ["catalog.write"];
|
|
@@ -76,6 +78,7 @@ let cmd = {
|
|
|
76
78
|
references: cmd_references,
|
|
77
79
|
allowedStates: cmd_allowedStates,
|
|
78
80
|
targetState: cmd_targetState,
|
|
81
|
+
allowedStatesSource: cmd_allowedStatesSource,
|
|
79
82
|
apiExposed: cmd_apiExposed,
|
|
80
83
|
requiredAccess: cmd_requiredAccess,
|
|
81
84
|
ownerField: cmd_ownerField
|
|
@@ -63,21 +63,9 @@ globalThis.describe("the admin structure's declared transitions are checked", ()
|
|
|
63
63
|
globalThis.expect(raises([Platform_Admin_Structure$ReventlessCore.pluginAggregate])).toEqual(false);
|
|
64
64
|
});
|
|
65
65
|
globalThis.test("and a state the view does not declare is caught", () => {
|
|
66
|
-
let
|
|
66
|
+
let newrecord = {...commandNamed("Activate")};
|
|
67
67
|
let bogus_name = Platform_Admin_Structure$ReventlessCore.pluginAggregate.name;
|
|
68
|
-
let bogus_commands = [
|
|
69
|
-
name: init.name,
|
|
70
|
-
schema: init.schema,
|
|
71
|
-
level: init.level,
|
|
72
|
-
aggregateIdField: init.aggregateIdField,
|
|
73
|
-
mutationField: init.mutationField,
|
|
74
|
-
references: init.references,
|
|
75
|
-
allowedStates: init.allowedStates,
|
|
76
|
-
targetState: "Conected",
|
|
77
|
-
apiExposed: init.apiExposed,
|
|
78
|
-
requiredAccess: init.requiredAccess,
|
|
79
|
-
ownerField: init.ownerField
|
|
80
|
-
}];
|
|
68
|
+
let bogus_commands = [(newrecord.targetState = "Conected", newrecord)];
|
|
81
69
|
let bogus_producedEventTypes = Platform_Admin_Structure$ReventlessCore.pluginAggregate.producedEventTypes;
|
|
82
70
|
let bogus_consumedEventTypes = Platform_Admin_Structure$ReventlessCore.pluginAggregate.consumedEventTypes;
|
|
83
71
|
let bogus_linkedViews = Platform_Admin_Structure$ReventlessCore.pluginAggregate.linkedViews;
|
|
@@ -355,6 +355,7 @@ describe("allowedStates + lifecycleField populated", () => {
|
|
|
355
355
|
references: [],
|
|
356
356
|
allowedStates: Some(["Inactive"]),
|
|
357
357
|
targetState: Some("Active"),
|
|
358
|
+
allowedStatesSource: "declared",
|
|
358
359
|
apiExposed: Some(true),
|
|
359
360
|
requiredAccess: None,
|
|
360
361
|
ownerField: None,
|
|
@@ -410,6 +410,7 @@ globalThis.describe("allowedStates + lifecycleField populated", () => {
|
|
|
410
410
|
let cmdWithStates_references = [];
|
|
411
411
|
let cmdWithStates_allowedStates = ["Inactive"];
|
|
412
412
|
let cmdWithStates_targetState = "Active";
|
|
413
|
+
let cmdWithStates_allowedStatesSource = "declared";
|
|
413
414
|
let cmdWithStates_apiExposed = true;
|
|
414
415
|
let cmdWithStates = {
|
|
415
416
|
name: "Activate",
|
|
@@ -420,6 +421,7 @@ globalThis.describe("allowedStates + lifecycleField populated", () => {
|
|
|
420
421
|
references: cmdWithStates_references,
|
|
421
422
|
allowedStates: cmdWithStates_allowedStates,
|
|
422
423
|
targetState: cmdWithStates_targetState,
|
|
424
|
+
allowedStatesSource: cmdWithStates_allowedStatesSource,
|
|
423
425
|
apiExposed: cmdWithStates_apiExposed,
|
|
424
426
|
requiredAccess: undefined,
|
|
425
427
|
ownerField: undefined
|
|
@@ -357,11 +357,13 @@ describe("GraphQL_FragmentGenerator.mutationArgTypes", () => {
|
|
|
357
357
|
expect((typeOf("tip"), typeOf("total")))->toEqual((Some("MoneyInput"), Some("MoneyInput!")))
|
|
358
358
|
)
|
|
359
359
|
|
|
360
|
-
//
|
|
361
|
-
//
|
|
362
|
-
//
|
|
360
|
+
// `orderId` differs from what the JSON-Schema type alone suggests — a plain
|
|
361
|
+
// string there, an `ID!` here — which is the narrower reason a client cannot
|
|
362
|
+
// derive even the scalars itself. `itemCount` is an `Int!` on both sides: sury
|
|
363
|
+
// carries the whole-number format and the walk now keeps it, so a quantity is
|
|
364
|
+
// no longer a field a client could legally send `2.5` in.
|
|
363
365
|
testSync("reports the scalar the server chose, not the JSON-Schema one", () =>
|
|
364
|
-
expect((typeOf("orderId"), typeOf("itemCount")))->toEqual((Some("ID!"), Some("
|
|
366
|
+
expect((typeOf("orderId"), typeOf("itemCount")))->toEqual((Some("ID!"), Some("Int!")))
|
|
365
367
|
)
|
|
366
368
|
|
|
367
369
|
// The property that makes publishing worth more than re-deriving downstream:
|
|
@@ -25,7 +25,7 @@ function commandAuthorization(param) {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function commandTransition(param) {
|
|
28
|
-
return "
|
|
28
|
+
return "Undeclared";
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
let traits = [];
|
|
@@ -237,7 +237,7 @@ function commandAuthorization$1(param) {
|
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
function commandTransition$1(param) {
|
|
240
|
-
return "
|
|
240
|
+
return "Undeclared";
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
let traits$1 = [];
|
|
@@ -266,7 +266,7 @@ function commandAuthorization$2(param) {
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
function commandTransition$2(param) {
|
|
269
|
-
return "
|
|
269
|
+
return "Undeclared";
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
let traits$2 = [];
|
|
@@ -359,7 +359,7 @@ globalThis.describe("GraphQL_FragmentGenerator.mutationArgTypes", () => {
|
|
|
359
359
|
argTypes["itemCount"]
|
|
360
360
|
]).toEqual([
|
|
361
361
|
"ID!",
|
|
362
|
-
"
|
|
362
|
+
"Int!"
|
|
363
363
|
]);
|
|
364
364
|
});
|
|
365
365
|
globalThis.test("agrees with every argument the SDL declares", () => {
|
|
@@ -550,7 +550,7 @@ globalThis.describe("@internal keeps a field off the generated type", () => {
|
|
|
550
550
|
]);
|
|
551
551
|
});
|
|
552
552
|
globalThis.test("the published state schema drops them too", () => {
|
|
553
|
-
let json = JSON.stringify(SuryToJsonSchema$ReventlessCore.deriveObjectSchema(PsInternalFieldsReadModel$ReventlessCore.stateSchema));
|
|
553
|
+
let json = JSON.stringify(SuryToJsonSchema$ReventlessCore.deriveObjectSchema(undefined, undefined, PsInternalFieldsReadModel$ReventlessCore.stateSchema));
|
|
554
554
|
globalThis.expect([
|
|
555
555
|
json.includes("eventCollector"),
|
|
556
556
|
json.includes("name")
|