@reventlessdev/reventless-core 3.0.0-alpha.334 → 3.0.0-alpha.336
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 +6 -6
- package/src/CommandSent.res +10 -0
- package/src/CommandSent.res.mjs +8 -0
- package/src/admin/Platform_I18n.res +112 -0
- package/src/admin/Platform_I18n.res.mjs +115 -0
- package/src/components/Aggregate/Aggregate_Callback.res +3 -0
- package/src/components/Aggregate/Aggregate_Callback.res.mjs +3 -3
- package/src/components/AutomationSlice/AutomationSlice.res +3 -0
- package/src/components/AutomationSlice/AutomationSlice_Builder.res +24 -8
- package/src/components/AutomationSlice/AutomationSlice_Builder.res.mjs +109 -102
- package/src/components/AutomationSlice/AutomationSlice_Callback.res +75 -8
- package/src/components/AutomationSlice/AutomationSlice_Callback.res.mjs +58 -7
- package/src/components/CommandGenerator/CommandGenerator_Callback.res.mjs +1 -1
- package/src/components/CommandTopic/CommandTopic.res.mjs +9 -0
- package/src/components/CommandTopic/CommandTopic_Helpers.res +118 -33
- package/src/components/CommandTopic/CommandTopic_Helpers.res.mjs +137 -22
- package/src/components/Dcb/Dcb_Builder.res +16 -0
- package/src/components/Dcb/Dcb_Builder.res.mjs +6 -3
- package/src/components/InboundTranslationSlice/InboundTranslationSlice.res +3 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res +17 -6
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Builder.res.mjs +46 -41
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res +37 -8
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Callback.res.mjs +33 -13
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Webhook.res +3 -0
- package/src/components/InboundTranslationSlice/InboundTranslationSlice_Webhook.res.mjs +14 -2
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice.res +3 -0
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res +30 -9
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Builder.res.mjs +10 -5
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res +40 -2
- package/src/components/OutboundTranslationSlice/OutboundTranslationSlice_Callback.res.mjs +57 -11
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res +4 -0
- package/src/components/StateChangeSlice/StateChangeSlice_Callback.res.mjs +4 -4
- package/tests/commandtopic/CommandOutcomeLineTest.res.mjs +3 -3
- package/tests/commandtopic/CommandTopicHelpersRejectionTest.res +102 -0
- package/tests/commandtopic/CommandTopicHelpersRejectionTest.res.mjs +101 -3
- package/tests/plugin/PluginStructureAccessTest.res +6 -1
- package/tests/plugin/PluginStructureAccessTest.res.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 3.0.0-alpha.336 (2026-11-09)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **core:** a deployment serves its catalogues beside config.json ([299f6eb](https://github.com/ReventlessDev/reventless-core/commit/299f6eb50fdcb8ae2fdd76a32cfc264004088075))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# 3.0.0-alpha.335 (2026-11-08)
|
|
14
|
+
|
|
15
|
+
* feat(core)!: an automation or outbound translation hears that its command was refused ([8c9b4b6](https://github.com/ReventlessDev/reventless-core/commit/8c9b4b6c643a5a9e95c85f823fbc333638224346))
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **aws:** an automation on AWS hears its command's outcome from the DCB command Lambda ([c9e7edf](https://github.com/ReventlessDev/reventless-core/commit/c9e7edf1c4906238d3a499403335b56f34f6cfd4))
|
|
19
|
+
* **core:** an inbound caller hears the target's refusal, and an unheard refusal is a warning ([3ed23f9](https://github.com/ReventlessDev/reventless-core/commit/3ed23f963fd3abf79d573aa6b0722cfd3e028a74))
|
|
20
|
+
|
|
21
|
+
### BREAKING CHANGES
|
|
22
|
+
|
|
23
|
+
* an AutomationSlice Automation module written outside an
|
|
24
|
+
@@reventless.automation file must declare onExhausted with ~lastError. External
|
|
25
|
+
consumers need the republished reventless-ppx for the injection.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
# 3.0.0-alpha.334 (2026-11-08)
|
|
7
30
|
|
|
8
31
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.336",
|
|
4
4
|
"description": "Core package for Reventless framework",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"sury": "11.1.0",
|
|
30
30
|
"uuid": "^13.0.0",
|
|
31
31
|
"@reventlessdev/rescript-effect": "1.0.0-alpha.3",
|
|
32
|
-
"@reventlessdev/rescript-fast-csv": "2.0.0-alpha.26",
|
|
33
32
|
"@reventlessdev/rescript-hash-object": "1.2.0-alpha.15",
|
|
34
|
-
"@reventlessdev/rescript-
|
|
33
|
+
"@reventlessdev/rescript-fast-csv": "2.0.0-alpha.26",
|
|
35
34
|
"@reventlessdev/rescript-node": "2.0.0-alpha.26",
|
|
35
|
+
"@reventlessdev/rescript-jest": "1.0.0-alpha.13",
|
|
36
36
|
"@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
|
|
37
|
-
"@reventlessdev/rescript-ssh2": "2.0.0-alpha.27",
|
|
38
37
|
"@reventlessdev/rescript-uuid": "2.0.0-alpha.1",
|
|
39
|
-
"@reventlessdev/reventless-infra": "3.0.0-alpha.227",
|
|
40
38
|
"@reventlessdev/reventless-interop": "3.0.0-alpha.43",
|
|
41
|
-
"@reventlessdev/
|
|
39
|
+
"@reventlessdev/rescript-ssh2": "2.0.0-alpha.27",
|
|
40
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.229",
|
|
41
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.198"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"rescript": "12.3.1",
|
package/src/CommandSent.res
CHANGED
|
@@ -20,3 +20,13 @@ let announcing = (
|
|
|
20
20
|
cmdJsons->Array.forEach(cmdJson => log(~comp, cmdJson))
|
|
21
21
|
publishJsons(cmdJsons)
|
|
22
22
|
}
|
|
23
|
+
|
|
24
|
+
/** `announcing` for the publish that waits for each command's outcome. */
|
|
25
|
+
let announcingAndWaiting = (
|
|
26
|
+
~comp: string,
|
|
27
|
+
publishJsonsAndWait: CommandTopic_Helpers.publishJsonsAndWait,
|
|
28
|
+
): CommandTopic_Helpers.publishJsonsAndWait =>
|
|
29
|
+
cmdJsons => {
|
|
30
|
+
cmdJsons->Array.forEach(cmdJson => log(~comp, cmdJson))
|
|
31
|
+
publishJsonsAndWait(cmdJsons)
|
|
32
|
+
}
|
package/src/CommandSent.res.mjs
CHANGED
|
@@ -15,8 +15,16 @@ function announcing(comp, publishJsons) {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
function announcingAndWaiting(comp, publishJsonsAndWait) {
|
|
19
|
+
return cmdJsons => {
|
|
20
|
+
cmdJsons.forEach(cmdJson => log(comp, cmdJson));
|
|
21
|
+
return publishJsonsAndWait(cmdJsons);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
18
25
|
export {
|
|
19
26
|
log,
|
|
20
27
|
announcing,
|
|
28
|
+
announcingAndWaiting,
|
|
21
29
|
}
|
|
22
30
|
/* Effect Not a pure module */
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Where a deployment's catalogues go, how they are merged, and what the shell is told about its
|
|
2
|
+
// languages.
|
|
3
|
+
//
|
|
4
|
+
// Stated once, in core, for the reason `Platform_UiSlots` gives: the AWS deploy and the local
|
|
5
|
+
// platform both write `i18n/<lang>.json` beside `config.json` and both write the `languages`
|
|
6
|
+
// key, and a platform that spelled either differently would serve catalogues nothing reads.
|
|
7
|
+
//
|
|
8
|
+
// The merge is per language and key: each source's `<lang>.json` in the order declared, a later
|
|
9
|
+
// source winning a key. A deployment lists each plugin's `i18n/` first and its own overrides
|
|
10
|
+
// last, so an app can reword a plugin's text without editing the plugin.
|
|
11
|
+
|
|
12
|
+
/** The `config.json` key naming the languages. */
|
|
13
|
+
let configKey = "languages"
|
|
14
|
+
|
|
15
|
+
/** Where a language's catalogue is served, relative to `config.json`. */
|
|
16
|
+
let fileName = (language: string): string => `i18n/${language}.json`
|
|
17
|
+
|
|
18
|
+
let isTag = (tag: string): bool => {
|
|
19
|
+
let parts = tag->String.split("-")
|
|
20
|
+
parts->Array.length > 0 &&
|
|
21
|
+
parts->Array.every(p => /^[A-Za-z0-9]{1,8}$/->RegExp.test(p)) &&
|
|
22
|
+
/^[A-Za-z]{2,3}$/->RegExp.test(parts->Array.getUnsafe(0))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** The declaration checked, with the default among the offered languages. A mistake is the
|
|
26
|
+
deployment's own and is stated, never repaired silently: a catalogue that is quietly not
|
|
27
|
+
served reads as a translation that does nothing. */
|
|
28
|
+
let validate = (i18n: ReventlessInfra.Platform.i18n): result<
|
|
29
|
+
ReventlessInfra.Platform.i18n,
|
|
30
|
+
string,
|
|
31
|
+
> =>
|
|
32
|
+
switch Array.concat([i18n.default], i18n.offered)->Array.filter(t => !isTag(t)) {
|
|
33
|
+
| [] =>
|
|
34
|
+
switch i18n.register {
|
|
35
|
+
| Some(r) if r != "Sie" && r != "du" =>
|
|
36
|
+
Error(`i18n: register must be "Sie" or "du", got "${r}"`)
|
|
37
|
+
| _ =>
|
|
38
|
+
Ok({
|
|
39
|
+
...i18n,
|
|
40
|
+
offered: i18n.offered->Array.includes(i18n.default)
|
|
41
|
+
? i18n.offered
|
|
42
|
+
: Array.concat([i18n.default], i18n.offered),
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
| bad => Error(`i18n: not a language tag: ${bad->Array.join(", ")}`)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** `config.json`'s `languages`, in the shape the shell reads. */
|
|
49
|
+
let configEntry = (i18n: ReventlessInfra.Platform.i18n): (string, JSON.t) => {
|
|
50
|
+
let fields = dict{
|
|
51
|
+
"default": JSON.Encode.string(i18n.default),
|
|
52
|
+
"offered": i18n.offered->Array.map(JSON.Encode.string)->JSON.Encode.array,
|
|
53
|
+
}
|
|
54
|
+
i18n.register->Option.forEach(r => fields->Dict.set("register", JSON.Encode.string(r)))
|
|
55
|
+
(configKey, JSON.Encode.object(fields))
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** A source's catalogue for a language, as text: `None` where the source has no file for it. */
|
|
59
|
+
type read = (~dir: string, ~language: string) => option<string>
|
|
60
|
+
|
|
61
|
+
/** One language's merged catalogue as written: keys sorted, two-space indent, a final newline. */
|
|
62
|
+
let merged = (i18n: ReventlessInfra.Platform.i18n, ~language: string, ~read: read): result<
|
|
63
|
+
string,
|
|
64
|
+
string,
|
|
65
|
+
> => {
|
|
66
|
+
let out = Dict.make()
|
|
67
|
+
let problem = i18n.sources->Array.findMap(dir =>
|
|
68
|
+
switch read(~dir, ~language) {
|
|
69
|
+
| None => None
|
|
70
|
+
| Some(text) =>
|
|
71
|
+
switch text->JSON.parseOrThrow->JSON.Decode.object {
|
|
72
|
+
| Some(entries) =>
|
|
73
|
+
entries->Dict.forEachWithKey((value, key) =>
|
|
74
|
+
value->JSON.Decode.string->Option.forEach(s => out->Dict.set(key, JSON.Encode.string(s)))
|
|
75
|
+
)
|
|
76
|
+
None
|
|
77
|
+
| None => Some(`i18n: ${dir}/${language}.json is not a JSON object`)
|
|
78
|
+
| exception _ => Some(`i18n: ${dir}/${language}.json is not JSON`)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
switch problem {
|
|
83
|
+
| Some(message) => Error(message)
|
|
84
|
+
| None =>
|
|
85
|
+
Ok(
|
|
86
|
+
JSON.stringify(
|
|
87
|
+
out
|
|
88
|
+
->Dict.toArray
|
|
89
|
+
->Array.toSorted(((a, _), (b, _)) => String.compare(a, b))
|
|
90
|
+
->Dict.fromArray
|
|
91
|
+
->JSON.Encode.object,
|
|
92
|
+
~space=2,
|
|
93
|
+
) ++ "\n",
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Every offered language's merged catalogue, as `(file name, text)`, or the first mistake. */
|
|
99
|
+
let files = (i18n: ReventlessInfra.Platform.i18n, ~read: read): result<
|
|
100
|
+
array<(string, string)>,
|
|
101
|
+
string,
|
|
102
|
+
> =>
|
|
103
|
+
validate(i18n)->Result.flatMap(i18n =>
|
|
104
|
+
i18n.offered->Array.reduce(Ok([]), (acc, language) =>
|
|
105
|
+
acc->Result.flatMap(
|
|
106
|
+
done =>
|
|
107
|
+
merged(i18n, ~language, ~read)->Result.map(
|
|
108
|
+
text => Array.concat(done, [(fileName(language), text)]),
|
|
109
|
+
),
|
|
110
|
+
)
|
|
111
|
+
)
|
|
112
|
+
)
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Dict from "@rescript/runtime/lib/es6/Stdlib_Dict.js";
|
|
4
|
+
import * as Stdlib_JSON from "@rescript/runtime/lib/es6/Stdlib_JSON.js";
|
|
5
|
+
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
6
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
7
|
+
import * as Stdlib_Result from "@rescript/runtime/lib/es6/Stdlib_Result.js";
|
|
8
|
+
import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
|
|
9
|
+
|
|
10
|
+
let configKey = "languages";
|
|
11
|
+
|
|
12
|
+
function fileName(language) {
|
|
13
|
+
return `i18n/` + language + `.json`;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function isTag(tag) {
|
|
17
|
+
let parts = tag.split("-");
|
|
18
|
+
if (parts.length !== 0 && parts.every(p => /^[A-Za-z0-9]{1,8}$/.test(p))) {
|
|
19
|
+
return /^[A-Za-z]{2,3}$/.test(parts[0]);
|
|
20
|
+
} else {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function validate(i18n) {
|
|
26
|
+
let bad = [i18n.default].concat(i18n.offered).filter(t => !isTag(t));
|
|
27
|
+
if (bad.length !== 0) {
|
|
28
|
+
return {
|
|
29
|
+
TAG: "Error",
|
|
30
|
+
_0: `i18n: not a language tag: ` + bad.join(", ")
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
let r = i18n.register;
|
|
34
|
+
if (r !== undefined && r !== "Sie" && r !== "du") {
|
|
35
|
+
return {
|
|
36
|
+
TAG: "Error",
|
|
37
|
+
_0: `i18n: register must be "Sie" or "du", got "` + r + `"`
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
let newrecord = {...i18n};
|
|
41
|
+
return {
|
|
42
|
+
TAG: "Ok",
|
|
43
|
+
_0: (newrecord.offered = i18n.offered.includes(i18n.default) ? i18n.offered : [i18n.default].concat(i18n.offered), newrecord)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function configEntry(i18n) {
|
|
48
|
+
let fields = {
|
|
49
|
+
default: i18n.default,
|
|
50
|
+
offered: i18n.offered.map(prim => prim)
|
|
51
|
+
};
|
|
52
|
+
Stdlib_Option.forEach(i18n.register, r => {
|
|
53
|
+
fields["register"] = r;
|
|
54
|
+
});
|
|
55
|
+
return [
|
|
56
|
+
configKey,
|
|
57
|
+
fields
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function merged(i18n, language, read) {
|
|
62
|
+
let out = {};
|
|
63
|
+
let problem = Stdlib_Array.findMap(i18n.sources, dir => {
|
|
64
|
+
let text = read(dir, language);
|
|
65
|
+
if (text === undefined) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
let entries;
|
|
69
|
+
try {
|
|
70
|
+
entries = Stdlib_JSON.Decode.object(JSON.parse(text));
|
|
71
|
+
} catch (exn) {
|
|
72
|
+
return `i18n: ` + dir + `/` + language + `.json is not JSON`;
|
|
73
|
+
}
|
|
74
|
+
if (entries !== undefined) {
|
|
75
|
+
Stdlib_Dict.forEachWithKey(entries, (value, key) => Stdlib_Option.forEach(Stdlib_JSON.Decode.string(value), s => {
|
|
76
|
+
out[key] = s;
|
|
77
|
+
}));
|
|
78
|
+
return;
|
|
79
|
+
} else {
|
|
80
|
+
return `i18n: ` + dir + `/` + language + `.json is not a JSON object`;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
if (problem !== undefined) {
|
|
84
|
+
return {
|
|
85
|
+
TAG: "Error",
|
|
86
|
+
_0: problem
|
|
87
|
+
};
|
|
88
|
+
} else {
|
|
89
|
+
return {
|
|
90
|
+
TAG: "Ok",
|
|
91
|
+
_0: JSON.stringify(Object.fromEntries(Object.entries(out).toSorted((param, param$1) => Primitive_string.compare(param[0], param$1[0]))), undefined, 2) + "\n"
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function files(i18n, read) {
|
|
97
|
+
return Stdlib_Result.flatMap(validate(i18n), i18n => Stdlib_Array.reduce(i18n.offered, {
|
|
98
|
+
TAG: "Ok",
|
|
99
|
+
_0: []
|
|
100
|
+
}, (acc, language) => Stdlib_Result.flatMap(acc, done => Stdlib_Result.map(merged(i18n, language, read), text => done.concat([[
|
|
101
|
+
fileName(language),
|
|
102
|
+
text
|
|
103
|
+
]])))));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export {
|
|
107
|
+
configKey,
|
|
108
|
+
fileName,
|
|
109
|
+
isTag,
|
|
110
|
+
validate,
|
|
111
|
+
configEntry,
|
|
112
|
+
merged,
|
|
113
|
+
files,
|
|
114
|
+
}
|
|
115
|
+
/* No side effect */
|
|
@@ -468,6 +468,7 @@ module Make = (
|
|
|
468
468
|
CommandTopic_Helpers.reportRejected(
|
|
469
469
|
~component=Spec.name,
|
|
470
470
|
~correlationId=meta.correlationId,
|
|
471
|
+
~claimed=meta.callerClaim->Option.isSome,
|
|
471
472
|
~causationId=?causedBy,
|
|
472
473
|
~cause=DomainRejection,
|
|
473
474
|
reference,
|
|
@@ -478,6 +479,7 @@ module Make = (
|
|
|
478
479
|
CommandTopic_Helpers.reportRejected(
|
|
479
480
|
~component=Spec.name,
|
|
480
481
|
~correlationId=meta.correlationId,
|
|
482
|
+
~claimed=meta.callerClaim->Option.isSome,
|
|
481
483
|
~causationId=?causedBy,
|
|
482
484
|
~cause=AccessRefusal,
|
|
483
485
|
reference,
|
|
@@ -507,6 +509,7 @@ module Make = (
|
|
|
507
509
|
CommandTopic_Helpers.reportRejected(
|
|
508
510
|
~component=Spec.name,
|
|
509
511
|
~correlationId=meta.correlationId,
|
|
512
|
+
~claimed=meta.callerClaim->Option.isSome,
|
|
510
513
|
~causationId=?causedBy,
|
|
511
514
|
~cause=InfrastructureFailure,
|
|
512
515
|
reference,
|
|
@@ -324,7 +324,7 @@ function Make(Spec) {
|
|
|
324
324
|
_0: reference
|
|
325
325
|
};
|
|
326
326
|
} else {
|
|
327
|
-
CommandTopic_Helpers$ReventlessCore.reportRejected(Spec.name, "InfrastructureFailure", meta.correlationId, causedBy, reference, {
|
|
327
|
+
CommandTopic_Helpers$ReventlessCore.reportRejected(Spec.name, "InfrastructureFailure", meta.correlationId, causedBy, Stdlib_Option.isSome(meta.callerClaim), reference, {
|
|
328
328
|
errorCode: CommandOutcome$Reventless.code("AppendFailed"),
|
|
329
329
|
errorDetail: appendErrorDetail
|
|
330
330
|
});
|
|
@@ -334,7 +334,7 @@ function Make(Spec) {
|
|
|
334
334
|
};
|
|
335
335
|
}
|
|
336
336
|
case "CmdRejected" :
|
|
337
|
-
CommandTopic_Helpers$ReventlessCore.reportRejected(Spec.name, "DomainRejection", meta.correlationId, causedBy, reference, {
|
|
337
|
+
CommandTopic_Helpers$ReventlessCore.reportRejected(Spec.name, "DomainRejection", meta.correlationId, causedBy, Stdlib_Option.isSome(meta.callerClaim), reference, {
|
|
338
338
|
errorCode: outcome.errorCode,
|
|
339
339
|
errorDetail: outcome.errorDetail
|
|
340
340
|
});
|
|
@@ -343,7 +343,7 @@ function Make(Spec) {
|
|
|
343
343
|
_0: reference
|
|
344
344
|
};
|
|
345
345
|
case "CmdRefused" :
|
|
346
|
-
CommandTopic_Helpers$ReventlessCore.reportRejected(Spec.name, "AccessRefusal", meta.correlationId, causedBy, reference, outcome._0.rejected);
|
|
346
|
+
CommandTopic_Helpers$ReventlessCore.reportRejected(Spec.name, "AccessRefusal", meta.correlationId, causedBy, Stdlib_Option.isSome(meta.callerClaim), reference, outcome._0.rejected);
|
|
347
347
|
return {
|
|
348
348
|
TAG: "Ok",
|
|
349
349
|
_0: reference
|
|
@@ -35,6 +35,9 @@ module type T = {
|
|
|
35
35
|
let make: (
|
|
36
36
|
~allEventTopics: EventTopic.allOutputs,
|
|
37
37
|
~publishJsons: Pulumi.Output.t<CommandTopic.publishJsons>,
|
|
38
|
+
/** The target's publish that waits for each command's outcome, where its topic
|
|
39
|
+
offers one; a refusal is then recorded on the row at once. */
|
|
40
|
+
~publishJsonsAndWait: Pulumi.Output.t<option<CommandTopic.publishJsonsAndWait>>=?,
|
|
38
41
|
~context: Reventless.AutomationSlice.context,
|
|
39
42
|
~runtime: ReventlessInfra.RuntimeHints.t=?,
|
|
40
43
|
~opts: Pulumi.ComponentResource.options=?,
|
|
@@ -144,6 +144,7 @@ module Make = (
|
|
|
144
144
|
let construct = (
|
|
145
145
|
~allEventTopics: EventTopic.allOutputs,
|
|
146
146
|
~publishJsons,
|
|
147
|
+
~publishJsonsAndWait: Pulumi.Output.t<option<CommandTopic.publishJsonsAndWait>>,
|
|
147
148
|
~context: Reventless.AutomationSlice.context,
|
|
148
149
|
~runtime,
|
|
149
150
|
self,
|
|
@@ -216,9 +217,9 @@ module Make = (
|
|
|
216
217
|
// first event arrival (which silently dropped Phase 2 in the previous
|
|
217
218
|
// shape).
|
|
218
219
|
let eventCollector =
|
|
219
|
-
(queryDb->Component.operations, publishJsons, schedulesOps)
|
|
220
|
-
->Pulumi.Output.
|
|
221
|
-
->Pulumi.Output.apply(((queryDbOps, publishJsonsFn, schedulesOps)) => {
|
|
220
|
+
(queryDb->Component.operations, publishJsons, schedulesOps, publishJsonsAndWait)
|
|
221
|
+
->Pulumi.Output.all4
|
|
222
|
+
->Pulumi.Output.apply(((queryDbOps, publishJsonsFn, schedulesOps, publishJsonsAndWait)) => {
|
|
222
223
|
let ec = SpecificEventCollector.make(
|
|
223
224
|
~name=Spec.name,
|
|
224
225
|
~eventTopics,
|
|
@@ -253,7 +254,7 @@ module Make = (
|
|
|
253
254
|
// fire-and-forget shape LocalBus already uses for
|
|
254
255
|
// cross-plugin EP→Extension routing.
|
|
255
256
|
let _ =
|
|
256
|
-
Callback.phase2(publishJsonsFn)
|
|
257
|
+
Callback.phase2(publishJsonsFn, ~publishJsonsAndWait?)
|
|
257
258
|
->Promise.then(() => syncToQueryDb(queryDbOps))
|
|
258
259
|
->Promise.catch(
|
|
259
260
|
exn => {
|
|
@@ -291,11 +292,18 @@ module Make = (
|
|
|
291
292
|
publishJsons,
|
|
292
293
|
queryDb->Component.operations,
|
|
293
294
|
schedulesOps,
|
|
295
|
+
publishJsonsAndWait,
|
|
294
296
|
)
|
|
295
|
-
->Pulumi.Output.
|
|
296
|
-
->Pulumi.Output.apply(((
|
|
297
|
+
->Pulumi.Output.all5
|
|
298
|
+
->Pulumi.Output.apply(((
|
|
299
|
+
ecOps,
|
|
300
|
+
publishJsonsFn,
|
|
301
|
+
queryDbOps,
|
|
302
|
+
schedulesOps,
|
|
303
|
+
publishJsonsAndWait,
|
|
304
|
+
)) => {
|
|
297
305
|
let processPending = async () => {
|
|
298
|
-
await Callback.phase2(publishJsonsFn)
|
|
306
|
+
await Callback.phase2(publishJsonsFn, ~publishJsonsAndWait?)
|
|
299
307
|
await syncToQueryDb(queryDbOps)
|
|
300
308
|
}
|
|
301
309
|
let reconcileSchedules = async () =>
|
|
@@ -351,6 +359,7 @@ module Make = (
|
|
|
351
359
|
let make = (
|
|
352
360
|
~allEventTopics,
|
|
353
361
|
~publishJsons,
|
|
362
|
+
~publishJsonsAndWait=Pulumi.Output.make(None),
|
|
354
363
|
~context,
|
|
355
364
|
~runtime=?,
|
|
356
365
|
~opts=?,
|
|
@@ -358,7 +367,14 @@ module Make = (
|
|
|
358
367
|
Component.make(
|
|
359
368
|
~componentType=AutomationSlice.componentType->ComponentType.toString,
|
|
360
369
|
~name=Spec.name,
|
|
361
|
-
~construct=construct(
|
|
370
|
+
~construct=construct(
|
|
371
|
+
~allEventTopics,
|
|
372
|
+
~publishJsons,
|
|
373
|
+
~publishJsonsAndWait,
|
|
374
|
+
~context,
|
|
375
|
+
~runtime,
|
|
376
|
+
...
|
|
377
|
+
),
|
|
362
378
|
~opts,
|
|
363
379
|
)
|
|
364
380
|
}
|