@reventlessdev/reventless-core 3.0.0-alpha.341 → 3.0.0-alpha.343
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 +23 -0
- package/package.json +7 -7
- package/src/Projection.res +32 -4
- package/src/Projection.res.mjs +51 -4
- package/src/ViewChange.res +1 -9
- package/src/ViewChange.res.mjs +2 -13
- package/src/admin/Platform_ComponentDefinitionsApi.res +29 -1
- package/src/admin/Platform_ComponentDefinitionsApi.res.mjs +47 -1
- package/src/admin/Platform_PluginStructuresApi.res +4 -3
- package/src/admin/Platform_PluginStructuresApi.res.mjs +5 -1
- package/src/components/Api/SuryToJsonSchema.res +7 -0
- package/src/components/Api/SuryToJsonSchema.res.mjs +18 -0
- package/src/components/Dcb/Dcb_Builder.res +59 -0
- package/src/components/Dcb/Dcb_Builder.res.mjs +48 -3
- package/src/components/DcbEventLog/DcbEventLog.res +2 -0
- package/src/components/DcbEventLog/DcbEventLog_Adapter.res +7 -0
- package/src/components/DcbEventLog/DcbEventLog_Builder.res +12 -3
- package/src/components/DcbEventLog/DcbEventLog_Builder.res.mjs +5 -3
- package/src/components/DcbEventLog/DcbEventLog_Operations.res +3 -0
- package/src/components/DcbEventLog/DcbEventLog_Operations.res.mjs +3 -1
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res.mjs +2 -2
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res +156 -107
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +174 -154
- package/src/components/StateChangeSlice/StateChangeSlice.res +3 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Builder.res +6 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Builder.res.mjs +5 -4
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res +369 -279
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +210 -166
- package/src/plugin/component/Plugin_Structure.res +45 -0
- package/src/plugin/component/Plugin_Structure.res.mjs +42 -1
- package/src/util/Logger.res +5 -5
- package/src/util/Logger.res.mjs +3 -3
- package/tests/admin/AdminApiSchemaDriftTest.res +23 -0
- package/tests/admin/AdminApiSchemaDriftTest.res.mjs +21 -1
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res +1 -0
- package/tests/admin/Platform_ComponentDefinitionsApiTest.res.mjs +1 -0
- package/tests/admin/Platform_PluginStructuresApiTest.res +1 -0
- package/tests/admin/Platform_PluginStructuresApiTest.res.mjs +1 -0
- package/tests/api/QuantitySemanticTest.res +68 -0
- package/tests/api/QuantitySemanticTest.res.mjs +68 -0
- package/tests/commandgenerator/OwnerActingTest.res.mjs +1 -1
- package/tests/commandtopic/CommandOutcomeHookTest.res.mjs +1 -1
- package/tests/dcb/DcbFenceCountReadTest.res +213 -0
- package/tests/dcb/DcbFenceCountReadTest.res.mjs +358 -0
- package/tests/dcb/DcbPiiSliceTest.res.mjs +1 -1
- package/tests/dcb/DcbReadsNothingTest.res.mjs +1 -1
- package/tests/dcb/DcbScopeInferenceTest.res +143 -2
- package/tests/dcb/DcbScopeInferenceTest.res.mjs +192 -2
- package/tests/dcb/DcbStateChangeSliceTest.res.mjs +22 -22
- package/tests/dcb/DcbTagTest.res +68 -0
- package/tests/dcb/DcbTagTest.res.mjs +86 -10
- package/tests/dcb/DcbValidationTest.res.mjs +1 -1
- package/tests/logger/LoggerLazyTest.res.mjs +3 -3
- package/tests/plugin/PluginStructureAccessTest.res +1 -0
- package/tests/plugin/PluginStructureAccessTest.res.mjs +1 -1
- package/tests/plugin/PluginStructureTest.res +61 -0
- package/tests/plugin/PluginStructureTest.res.mjs +78 -32
- package/tests/plugin/StateChange/PsRateSession.res +37 -0
- package/tests/plugin/StateChange/PsRateSession.res.mjs +80 -0
- package/tests/plugin/pluginDefinitionRequiredScalars.txt +10 -0
- package/tests/projection/ViewChangeTest.res +32 -0
- package/tests/projection/ViewChangeTest.res.mjs +57 -0
|
@@ -278,6 +278,63 @@ globalThis.describe("ViewChange", () => {
|
|
|
278
278
|
globalThis.expect(printed.includes("secret")).toBe(false);
|
|
279
279
|
globalThis.expect(Stdlib_Option.mapOr(Stdlib_Option.map(heard.contents[0].after, j => JSON.stringify(j)), false, s => s.includes("new-secret"))).toBe(true);
|
|
280
280
|
});
|
|
281
|
+
globalThis.test("the action line carries the ids of the event it came from", async () => {
|
|
282
|
+
let actionLines = async sources => {
|
|
283
|
+
let lines = [];
|
|
284
|
+
let removeSink = Logger$ReventlessCore.addSink(r => {
|
|
285
|
+
lines.push(r);
|
|
286
|
+
});
|
|
287
|
+
Logger$ReventlessCore.setDefaultMinLevel("DEBUG");
|
|
288
|
+
let match = makeOps();
|
|
289
|
+
await Projection$ReventlessCore.handleAction(undefined, sources, undefined, {
|
|
290
|
+
TAG: "Set",
|
|
291
|
+
_0: "a",
|
|
292
|
+
_1: {
|
|
293
|
+
name: "A",
|
|
294
|
+
total: 1,
|
|
295
|
+
token: "t"
|
|
296
|
+
}
|
|
297
|
+
}, match[1], undefined);
|
|
298
|
+
Logger$ReventlessCore.setDefaultMinLevel("INFO");
|
|
299
|
+
removeSink();
|
|
300
|
+
return lines.filter(r => r.message.startsWith("handling action"));
|
|
301
|
+
};
|
|
302
|
+
let one = await actionLines([{
|
|
303
|
+
msgId: "m-1",
|
|
304
|
+
correlationId: "flow-1",
|
|
305
|
+
entityId: "order-1",
|
|
306
|
+
entityType: "Order"
|
|
307
|
+
}]);
|
|
308
|
+
globalThis.expect(one.map(r => [
|
|
309
|
+
"msgId",
|
|
310
|
+
"correlationId",
|
|
311
|
+
"entityId",
|
|
312
|
+
"entityType"
|
|
313
|
+
].map(k => r.annotations[k]))).toEqual([[
|
|
314
|
+
"m-1",
|
|
315
|
+
"flow-1",
|
|
316
|
+
"order-1",
|
|
317
|
+
"Order"
|
|
318
|
+
]]);
|
|
319
|
+
let merged = await actionLines([
|
|
320
|
+
{
|
|
321
|
+
msgId: "m-1",
|
|
322
|
+
correlationId: "flow-1",
|
|
323
|
+
entityId: "order-1",
|
|
324
|
+
entityType: "Order"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
msgId: "m-2",
|
|
328
|
+
correlationId: "flow-1",
|
|
329
|
+
entityId: "order-1",
|
|
330
|
+
entityType: "Order"
|
|
331
|
+
}
|
|
332
|
+
]);
|
|
333
|
+
globalThis.expect(merged.map(r => r.annotations)).toEqual([Object.fromEntries([[
|
|
334
|
+
"correlationId",
|
|
335
|
+
"flow-1"
|
|
336
|
+
]])]);
|
|
337
|
+
});
|
|
281
338
|
});
|
|
282
339
|
|
|
283
340
|
export {
|