@sanoma-ai/workflows 0.2.0 → 0.4.0
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/README.md +121 -62
- package/dist/approvals.d.ts +11 -6
- package/dist/approvals.js +38 -10
- package/dist/approvals.js.map +1 -1
- package/dist/call-workflow.d.ts +16 -0
- package/dist/call-workflow.js +35 -0
- package/dist/call-workflow.js.map +1 -0
- package/dist/call.d.ts +33 -4
- package/dist/call.js +107 -42
- package/dist/call.js.map +1 -1
- package/dist/cedar.d.ts +87 -0
- package/dist/cedar.js +365 -0
- package/dist/cedar.js.map +1 -0
- package/dist/client.d.ts +85 -7
- package/dist/client.js +289 -25
- package/dist/client.js.map +1 -1
- package/dist/collection.d.ts +107 -0
- package/dist/collection.js +306 -0
- package/dist/collection.js.map +1 -0
- package/dist/config.d.ts +42 -14
- package/dist/config.js +82 -18
- package/dist/config.js.map +1 -1
- package/dist/constructors.d.ts +2 -0
- package/dist/constructors.js +5 -0
- package/dist/constructors.js.map +1 -0
- package/dist/data.d.ts +2 -0
- package/dist/data.js +3 -0
- package/dist/data.js.map +1 -0
- package/dist/datafile.d.ts +28 -2
- package/dist/datafile.js +118 -19
- package/dist/datafile.js.map +1 -1
- package/dist/db.d.ts +5 -3
- package/dist/db.js +88 -21
- package/dist/db.js.map +1 -1
- package/dist/define.d.ts +10 -4
- package/dist/define.js +1 -5
- package/dist/define.js.map +1 -1
- package/dist/describe.d.ts +45 -5
- package/dist/describe.js +72 -7
- package/dist/describe.js.map +1 -1
- package/dist/direct.d.ts +9 -0
- package/dist/direct.js +11 -0
- package/dist/direct.js.map +1 -0
- package/dist/errors.d.ts +16 -1
- package/dist/errors.js +30 -1
- package/dist/errors.js.map +1 -1
- package/dist/expectations.d.ts +3 -3
- package/dist/expectations.js +16 -7
- package/dist/expectations.js.map +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/ledger.d.ts +12 -1
- package/dist/ledger.js +18 -11
- package/dist/ledger.js.map +1 -1
- package/dist/lint.d.ts +5 -4
- package/dist/lint.js +24 -7
- package/dist/lint.js.map +1 -1
- package/dist/op.d.ts +6 -0
- package/dist/op.js.map +1 -1
- package/dist/outline.d.ts +2 -0
- package/dist/outline.js +1 -1
- package/dist/outline.js.map +1 -1
- package/dist/paths.d.ts +4 -0
- package/dist/paths.js +17 -3
- package/dist/paths.js.map +1 -1
- package/dist/person.d.ts +61 -0
- package/dist/person.js +69 -0
- package/dist/person.js.map +1 -0
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/policy.d.ts +51 -55
- package/dist/policy.js +14 -36
- package/dist/policy.js.map +1 -1
- package/dist/resource.d.ts +21 -5
- package/dist/resource.js +12 -3
- package/dist/resource.js.map +1 -1
- package/dist/resources.d.ts +58 -6
- package/dist/resources.js +119 -26
- package/dist/resources.js.map +1 -1
- package/dist/run.d.ts +17 -1
- package/dist/run.js.map +1 -1
- package/dist/scenario.d.ts +16 -9
- package/dist/scenario.js +93 -20
- package/dist/scenario.js.map +1 -1
- package/dist/scenarios.d.ts +10 -6
- package/dist/scenarios.js +8 -4
- package/dist/scenarios.js.map +1 -1
- package/dist/schema.d.ts +32 -0
- package/dist/schema.js +225 -0
- package/dist/schema.js.map +1 -0
- package/dist/sdk.d.ts +34 -0
- package/dist/sdk.js +168 -0
- package/dist/sdk.js.map +1 -0
- package/dist/shared.d.ts +181 -5
- package/dist/shared.js +160 -7
- package/dist/shared.js.map +1 -1
- package/dist/sites.d.ts +52 -0
- package/dist/sites.js +174 -0
- package/dist/sites.js.map +1 -0
- package/dist/version.d.ts +3 -2
- package/dist/version.js +3 -2
- package/dist/version.js.map +1 -1
- package/dist/worker.d.ts +3 -2
- package/dist/worker.js +24 -4
- package/dist/worker.js.map +1 -1
- package/oxlint.json +5 -16
- package/package.json +8 -3
- package/src/approvals.ts +49 -13
- package/src/call-workflow.ts +44 -0
- package/src/call.ts +157 -45
- package/src/cedar.ts +493 -0
- package/src/client.ts +368 -37
- package/src/collection.ts +431 -0
- package/src/config.ts +131 -34
- package/src/constructors.ts +4 -0
- package/src/data.ts +10 -0
- package/src/datafile.ts +141 -21
- package/src/db.ts +90 -22
- package/src/define.ts +11 -9
- package/src/describe.ts +113 -10
- package/src/direct.ts +15 -0
- package/src/errors.ts +36 -1
- package/src/expectations.ts +17 -8
- package/src/index.ts +33 -2
- package/src/ledger.ts +35 -17
- package/src/lint.ts +29 -12
- package/src/op.ts +6 -0
- package/src/outline.ts +1 -1
- package/src/paths.ts +18 -3
- package/src/person.ts +75 -0
- package/src/plugin.ts +1 -1
- package/src/policy.ts +59 -63
- package/src/resource.ts +35 -8
- package/src/resources.ts +165 -24
- package/src/run.ts +18 -1
- package/src/scenario.ts +128 -33
- package/src/scenarios.ts +15 -8
- package/src/schema.ts +261 -0
- package/src/sdk.ts +211 -0
- package/src/shared.ts +271 -8
- package/src/sites.ts +220 -0
- package/src/version.ts +3 -2
- package/src/worker.ts +29 -6
package/dist/resources.js
CHANGED
|
@@ -1,24 +1,99 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readFileSync, statSync } from "node:fs";
|
|
2
2
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
3
3
|
import { parsed } from "./ast.js";
|
|
4
|
-
import {
|
|
5
|
-
import { readDataFile, Reference } from "./datafile.js";
|
|
4
|
+
import { readDataFile, Reference, SECRET_ENTRIES, } from "./datafile.js";
|
|
6
5
|
import { LOCKFILE, readLockfile } from "./lockfile.js";
|
|
7
6
|
import { VENDOR } from "./op.js";
|
|
7
|
+
import { filesUnder } from "./paths.js";
|
|
8
|
+
import { peopleConnector } from "./person.js";
|
|
8
9
|
import { resourceTypesOf } from "./resource.js";
|
|
9
|
-
import {
|
|
10
|
+
import { Principal } from "./define.js";
|
|
11
|
+
import { NotAdmittedError } from "./errors.js";
|
|
12
|
+
import { AGENTS, declaresPeople, personOf, principalOf, problemLine, RUNTIME_AGENTS, } from "./shared.js";
|
|
13
|
+
/** A file that imports the runtime's constructors, `sanoma` (by any local name): the files `readPeople` reads. */
|
|
14
|
+
const DECLARES_PEOPLE = /\{[^}]*\bsanoma\b[^}]*\}\s*from\s*["'](?:sanoma|@sanoma-ai\/workflows)\/resources["']/;
|
|
15
|
+
/** The last read of the people under each root, by what its data files were then (`filesStamp`). */
|
|
16
|
+
const peopleRead = new Map();
|
|
17
|
+
/** Each data file under `root` with its size and modification time: unchanged while the files are. */
|
|
18
|
+
const filesStamp = (root) => dataFilesUnder(join(root, "resources"))
|
|
19
|
+
.map((path) => {
|
|
20
|
+
// Gone since it was listed (an editor's save by rename): stamped as such, and read next time.
|
|
21
|
+
const stat = statSync(path, { bigint: true, throwIfNoEntry: false });
|
|
22
|
+
return `${path} ${stat?.size} ${stat?.mtimeNs}`;
|
|
23
|
+
})
|
|
24
|
+
.join("\n");
|
|
10
25
|
/**
|
|
11
|
-
* The
|
|
12
|
-
*
|
|
13
|
-
*
|
|
26
|
+
* The people, agents and groups the data files under `root` declare (`sanoma.person`, `.agent`,
|
|
27
|
+
* `.group`), read without running them, as `principalOf` takes them, with what is wrong in their
|
|
28
|
+
* files; none without a root. Read again only when a data file changed (by its size and time),
|
|
29
|
+
* so a new colleague is admitted once their file is saved, and a request costs a `stat` per file.
|
|
14
30
|
*/
|
|
15
|
-
export function
|
|
16
|
-
|
|
31
|
+
export function readPeople(root) {
|
|
32
|
+
if (root === undefined)
|
|
33
|
+
return { people: [], problems: [] };
|
|
34
|
+
const stamp = filesStamp(root);
|
|
35
|
+
const cached = peopleRead.get(root);
|
|
36
|
+
if (cached?.stamp === stamp)
|
|
37
|
+
return cached.read;
|
|
38
|
+
const read = readDataFiles(root, [peopleConnector], undefined, (source) => DECLARES_PEOPLE.test(source));
|
|
39
|
+
const people = read.resources;
|
|
40
|
+
// The people are never bound, so the lockfile's problems are not theirs.
|
|
41
|
+
const own = read.problems.filter((p) => p.file !== LOCKFILE);
|
|
42
|
+
const ids = new Map();
|
|
43
|
+
for (const r of people) {
|
|
44
|
+
if (r.type === "group") {
|
|
45
|
+
if (r.name === AGENTS) {
|
|
46
|
+
own.push({
|
|
47
|
+
file: r.file,
|
|
48
|
+
message: `${r.id} is named "${AGENTS}", the group every agent is in: give it another name`,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
const id = r.name;
|
|
54
|
+
const other = ids.get(id);
|
|
55
|
+
if (other || RUNTIME_AGENTS.includes(id)) {
|
|
56
|
+
own.push({
|
|
57
|
+
file: r.file,
|
|
58
|
+
message: other
|
|
59
|
+
? `${r.id} has the id "${id}", which ${other.id} has: give each person and agent their own`
|
|
60
|
+
: `${r.id} has the id "${id}", one of the runtime's own agents': give it another`,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
ids.set(id, r);
|
|
64
|
+
}
|
|
65
|
+
const declared = { people, problems: own };
|
|
66
|
+
peopleRead.set(root, { stamp, read: declared });
|
|
67
|
+
return declared;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Who `asking` is admitted as, by the people the data files declare (`readPeople`): the declared
|
|
71
|
+
* principal (`principalOf`) of the id it names, a person's or an agent's; for a sign-in
|
|
72
|
+
* (`signIn`), of the person it matches (`personOf`: email, GitHub login, then id), never an agent.
|
|
73
|
+
* While no person is declared, whoever names an id is taken as given. Throws `NotAdmittedError`
|
|
74
|
+
* for anyone else, and for everyone while the people's files have problems.
|
|
75
|
+
*/
|
|
76
|
+
export function admit(asking, { people, problems }, signIn = false) {
|
|
77
|
+
const who = asking.github ?? asking.id ?? asking.email ?? "This sign-in";
|
|
17
78
|
if (problems.length) {
|
|
18
|
-
|
|
19
|
-
|
|
79
|
+
// The runtime's own agents are declared by no file, so a broken one does not stop them (`check`'s scenarios).
|
|
80
|
+
if (!signIn && asking.id !== undefined && RUNTIME_AGENTS.includes(asking.id)) {
|
|
81
|
+
return principalOf(asking.id, people);
|
|
82
|
+
}
|
|
83
|
+
throw new NotAdmittedError(who, problems.map(problemLine));
|
|
20
84
|
}
|
|
21
|
-
|
|
85
|
+
if (!declaresPeople(people)) {
|
|
86
|
+
const given = Principal.safeParse(asking).data;
|
|
87
|
+
if (given)
|
|
88
|
+
return given;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
const id = signIn ? personOf(asking, people) : asking.id;
|
|
92
|
+
const admitted = id === undefined ? undefined : principalOf(id, people);
|
|
93
|
+
if (admitted)
|
|
94
|
+
return admitted;
|
|
95
|
+
}
|
|
96
|
+
throw new NotAdmittedError(who);
|
|
22
97
|
}
|
|
23
98
|
/**
|
|
24
99
|
* Reads `resources/` under `root`, the config's directory: each `.ts` file in it but
|
|
@@ -31,24 +106,35 @@ export function readResources(config) {
|
|
|
31
106
|
* type the connector does not declare, a value the type refuses (a reference where its type
|
|
32
107
|
* takes none among them), a reference cycle, and two resources of one type with one identity.
|
|
33
108
|
*
|
|
109
|
+
* The collections `resources/data.ts` declares are listed as they are read (`collections`),
|
|
110
|
+
* never matched to a connector, a resource type or the lockfile: the runtime imports that file.
|
|
111
|
+
*
|
|
34
112
|
* Each declaration is joined to its binding in the lockfile (`readLockfile`) by its key,
|
|
35
113
|
* `<file>#<export>`; a binding no export declares is an orphan. Problems: the lockfile's, a
|
|
36
114
|
* binding of another type than its declaration's, and two declarations bound to one object.
|
|
115
|
+
*
|
|
116
|
+
* `partial` reads part of the files: only those whose source it passes, and in them, an import of
|
|
117
|
+
* a connector not in `connectors`, or of a file left out, is left unread rather than reported.
|
|
37
118
|
*/
|
|
38
|
-
export function readDataFiles(root, connectors, types = resourceTypesOf(connectors)) {
|
|
119
|
+
export function readDataFiles(root, connectors, types = resourceTypesOf(connectors), partial) {
|
|
39
120
|
const problems = [];
|
|
40
121
|
if (root === undefined) {
|
|
41
122
|
problems.push({
|
|
42
123
|
message: "The config has no root, so its data files cannot be found: make it with defineConfig, which records its file, or set its `root`",
|
|
43
124
|
});
|
|
44
|
-
return { resources: [], bindings: {}, orphans: [], problems };
|
|
125
|
+
return { resources: [], bindings: {}, orphans: [], collections: [], problems };
|
|
45
126
|
}
|
|
46
127
|
const lock = readLockfile(root);
|
|
47
128
|
problems.push(...lock.problems);
|
|
48
129
|
const files = new Map();
|
|
130
|
+
const left = new Set();
|
|
49
131
|
for (const path of dataFilesUnder(join(root, "resources"))) {
|
|
50
132
|
const rel = relative(root, path).split(sep).join("/");
|
|
51
133
|
const source = readFileSync(path, "utf8");
|
|
134
|
+
if (partial && !partial(source)) {
|
|
135
|
+
left.add(path);
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
52
138
|
const { program, problems: syntax, at } = parsed(source, path);
|
|
53
139
|
const data = readDataFile(program, path, join(root, "resources"));
|
|
54
140
|
const problem = (offset, message) => problems.push({ file: rel, ...at(offset), message });
|
|
@@ -65,6 +151,10 @@ export function readDataFiles(root, connectors, types = resourceTypesOf(connecto
|
|
|
65
151
|
if (info?.package)
|
|
66
152
|
entries.set(`${info.package}/resources`, id);
|
|
67
153
|
}
|
|
154
|
+
// The runtime's own (`peopleConnector`, package `sanoma`) is imported from either name of its entry.
|
|
155
|
+
if (entries.get("sanoma/resources") === "sanoma")
|
|
156
|
+
for (const entry of SECRET_ENTRIES)
|
|
157
|
+
entries.set(entry, "sanoma");
|
|
68
158
|
// What each file's names stand for, and every resource read by its id.
|
|
69
159
|
const vendors = new Map();
|
|
70
160
|
const named = new Map();
|
|
@@ -75,6 +165,8 @@ export function readDataFiles(root, connectors, types = resourceTypesOf(connecto
|
|
|
75
165
|
for (const imp of file.data.imports) {
|
|
76
166
|
if (imp.kind === "constructors") {
|
|
77
167
|
const vendor = entries.get(imp.source);
|
|
168
|
+
if (vendor === undefined && partial)
|
|
169
|
+
continue;
|
|
78
170
|
if (vendor === undefined) {
|
|
79
171
|
file.problem(imp.start, `"${imp.source}" is not the resources entry of a connector in the config's \`connectors\`: add the connector, and import from its package's \`/resources\``);
|
|
80
172
|
}
|
|
@@ -86,7 +178,10 @@ export function readDataFiles(root, connectors, types = resourceTypesOf(connecto
|
|
|
86
178
|
}
|
|
87
179
|
continue;
|
|
88
180
|
}
|
|
89
|
-
const
|
|
181
|
+
const target = resolve(dirname(path), imp.source);
|
|
182
|
+
const other = files.get(target);
|
|
183
|
+
if (!other && left.has(target))
|
|
184
|
+
continue;
|
|
90
185
|
if (!other) {
|
|
91
186
|
file.problem(imp.start, `"${imp.source}" is not a data file under resources/`);
|
|
92
187
|
}
|
|
@@ -228,17 +323,15 @@ export function readDataFiles(root, connectors, types = resourceTypesOf(connecto
|
|
|
228
323
|
refs: result.refs,
|
|
229
324
|
});
|
|
230
325
|
}
|
|
326
|
+
const collections = [...files.values()].flatMap(({ rel, data }) => data.collections.map((c) => ({
|
|
327
|
+
id: `${rel}#${c.export}`,
|
|
328
|
+
file: rel,
|
|
329
|
+
name: c.name,
|
|
330
|
+
span: [c.start, c.end],
|
|
331
|
+
})));
|
|
231
332
|
problems.sort((a, b) => (a.file ?? "").localeCompare(b.file ?? "") || (a.line ?? 0) - (b.line ?? 0) || (a.column ?? 0) - (b.column ?? 0));
|
|
232
|
-
return { resources, bindings: lock.bindings, orphans, problems };
|
|
233
|
-
}
|
|
234
|
-
/** The data files under `dir`, sorted: regular `.ts` files, less tests, declarations and `node_modules`; none when `dir` is not a directory. */
|
|
235
|
-
function dataFilesUnder(dir) {
|
|
236
|
-
if (!statSync(dir, { throwIfNoEntry: false })?.isDirectory())
|
|
237
|
-
return [];
|
|
238
|
-
return readdirSync(dir, { recursive: true, withFileTypes: true })
|
|
239
|
-
.filter((d) => d.isFile() && d.name.endsWith(".ts") && !d.name.endsWith(".test.ts") && !d.name.endsWith(".d.ts"))
|
|
240
|
-
.map((d) => join(d.parentPath, d.name))
|
|
241
|
-
.filter((path) => !relative(dir, path).split(sep).includes("node_modules"))
|
|
242
|
-
.toSorted();
|
|
333
|
+
return { resources, bindings: lock.bindings, orphans, collections, problems };
|
|
243
334
|
}
|
|
335
|
+
/** The data files under `dir`, sorted: regular `.ts` files, less tests, declarations and `node_modules`. */
|
|
336
|
+
const dataFilesUnder = (dir) => filesUnder(dir, (name) => name.endsWith(".ts") && !name.endsWith(".test.ts") && !name.endsWith(".d.ts"));
|
|
244
337
|
//# sourceMappingURL=resources.js.map
|
package/dist/resources.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resources.js","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAC;AACxD,OAAO,EAAsD,YAAY,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EAA+B,QAAQ,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAkB,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAgC,eAAe,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAqD1C;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAAoB;IAChD,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IACjF,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;QACpB,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACzD,MAAM,IAAI,KAAK,CAAC,6CAA6C,KAAK,CAAC,IAAI,CAA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ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Collection } from "./collection.ts";
|
|
3
|
+
import type { ApprovalState, Approver, Principal, WorkflowDefinition } from "./define.ts";
|
|
3
4
|
import type { Fake } from "./fake.ts";
|
|
4
5
|
import type { LedgerStore } from "./ledger.ts";
|
|
5
6
|
import type { DriverFn, Op } from "./op.ts";
|
|
@@ -15,6 +16,17 @@ export interface RunArgs {
|
|
|
15
16
|
startedBy: Principal;
|
|
16
17
|
/** The scenario a sandbox run is seeded from; the run calls the fakes instead of the drivers. */
|
|
17
18
|
sandbox?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The policy's hold on the start (`workflow:<name>`), as `SanomaClient.start` was answered: the
|
|
21
|
+
* run waits for this approval before its body runs.
|
|
22
|
+
*/
|
|
23
|
+
hold?: StartHold;
|
|
24
|
+
}
|
|
25
|
+
/** A start the policy held: whom it asks, the approval's title, and the rules that held it. */
|
|
26
|
+
export interface StartHold {
|
|
27
|
+
approver: Approver;
|
|
28
|
+
title: string;
|
|
29
|
+
reasons?: string[];
|
|
18
30
|
}
|
|
19
31
|
/**
|
|
20
32
|
* What one `startWorker` call runs with. DBOS registrations are process-wide and outlive a
|
|
@@ -35,9 +47,13 @@ export interface WorkerState {
|
|
|
35
47
|
/** The worker's `source`, when it was given one. */
|
|
36
48
|
source?: Source;
|
|
37
49
|
types: ReadonlyMap<string, Resource>;
|
|
50
|
+
/** The collections, by name, which scenarios' steps may name (`data.<name>`). */
|
|
51
|
+
collections: ReadonlyMap<string, Collection>;
|
|
38
52
|
steps: readonly Steps[];
|
|
39
53
|
/** Its `version`, when it has one, is recorded with each of its decisions. */
|
|
40
54
|
policy: Policy;
|
|
55
|
+
/** The config's directory, whose data files declare the people an approval's decider is checked against (`readPeople`). */
|
|
56
|
+
root?: string;
|
|
41
57
|
ledger: LedgerStore;
|
|
42
58
|
/** The stored secrets, for a live run's drivers (`CallContext.secrets`). */
|
|
43
59
|
secrets: Secrets;
|
package/dist/run.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAsHrD;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,iBAAiB,EAAO,CAAC"}
|
package/dist/scenario.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RunSummary, SanomaClient } from "./client.ts";
|
|
2
|
+
import type { Approver } from "./define.ts";
|
|
2
3
|
import type { ResolvedConfig } from "./config.ts";
|
|
3
4
|
import type { Fake } from "./fake.ts";
|
|
4
5
|
import type { LedgerRecord } from "./ledger.ts";
|
|
@@ -63,9 +64,11 @@ export interface Decision {
|
|
|
63
64
|
/**
|
|
64
65
|
* What the run should do: call an operation (with at least this input) or not, run the step
|
|
65
66
|
* `name`d in the workflow's outline or not, or a number of `times`, have the policy deny an
|
|
66
|
-
* operation (`denied
|
|
67
|
-
*
|
|
68
|
-
*
|
|
67
|
+
* operation (`denied`, for a `reason` when the step names one) or hold one for an approver
|
|
68
|
+
* (`held`: a person's id or a group's name, or `{ group }` a group's alone), end a certain way,
|
|
69
|
+
* for a drift run, report the resource `declared` (`<file>#<export>`) clean, gone, absent, or
|
|
70
|
+
* drifted in a field, or for an apply run, create it, or leave it bound to an object (`bound`,
|
|
71
|
+
* its vendor's id).
|
|
69
72
|
* A step whose own code checks the run (a connector's or the company's, or an operation's own
|
|
70
73
|
* test's) is `custom`, with what it is about.
|
|
71
74
|
*/
|
|
@@ -87,11 +90,12 @@ export type Expectation = {
|
|
|
87
90
|
step: string;
|
|
88
91
|
op: string;
|
|
89
92
|
decision: "denied";
|
|
93
|
+
reason?: string;
|
|
90
94
|
} | {
|
|
91
95
|
step: string;
|
|
92
96
|
op: string;
|
|
93
97
|
decision: "held";
|
|
94
|
-
approver:
|
|
98
|
+
approver: Approver;
|
|
95
99
|
} | {
|
|
96
100
|
step: string;
|
|
97
101
|
outcome: "finished" | "failed";
|
|
@@ -134,6 +138,8 @@ export interface Scenario {
|
|
|
134
138
|
text: string;
|
|
135
139
|
/** Every step in order, for a list and for marking graph nodes. */
|
|
136
140
|
steps: ScenarioStep[];
|
|
141
|
+
/** Who starts the run, by id, when a `Given <who> is acting` says: a declared person or agent. */
|
|
142
|
+
startedBy?: string;
|
|
137
143
|
given: Given[];
|
|
138
144
|
input: unknown;
|
|
139
145
|
decisions: Decision[];
|
|
@@ -152,10 +158,11 @@ export interface Check {
|
|
|
152
158
|
detail?: string;
|
|
153
159
|
}
|
|
154
160
|
/**
|
|
155
|
-
* What steps can name: the config's operations, workflows
|
|
156
|
-
* its connectors (and the company) ship,
|
|
161
|
+
* What steps can name: the config's operations, workflows, resource types and collections by id,
|
|
162
|
+
* the steps its connectors (and the company) ship, where the feature files are, and the root
|
|
163
|
+
* whose data files declare its people.
|
|
157
164
|
*/
|
|
158
|
-
export type Scope = Pick<ResolvedConfig, "ops" | "workflows" | "scenarios" | "types" | "steps">;
|
|
165
|
+
export type Scope = Pick<ResolvedConfig, "ops" | "workflows" | "scenarios" | "types" | "collections" | "steps" | "root">;
|
|
159
166
|
type Fault = Extract<Seed, {
|
|
160
167
|
fault: unknown;
|
|
161
168
|
}>["fault"];
|
|
@@ -178,8 +185,8 @@ export interface LoadedScenarios {
|
|
|
178
185
|
* compiled by Cucumber, with an error for each file that does not compile and each name used
|
|
179
186
|
* twice. No directory, or none given, is no scenarios. Rejects when an operation's phrase names
|
|
180
187
|
* a field it lacks. The files are compiled again only once one is added, removed or written
|
|
181
|
-
* (its name, `mtimeMs` or size changes)
|
|
182
|
-
* callers must not change.
|
|
188
|
+
* (its name, `mtimeMs` or size changes), or the people's data files change: until then each
|
|
189
|
+
* call returns the same object, which callers must not change.
|
|
183
190
|
*/
|
|
184
191
|
export declare function loadScenarios(scope: Scope): Promise<LoadedScenarios>;
|
|
185
192
|
/**
|
package/dist/scenario.js
CHANGED
|
@@ -5,12 +5,13 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
import { ParameterTypeRegistry } from "@cucumber/cucumber-expressions";
|
|
6
6
|
import { PickleStepType, } from "@cucumber/messages";
|
|
7
7
|
import { buildLibrary, lineOf, runFeatures, stepResults, StepStatus, } from "./cucumber.js";
|
|
8
|
-
import { errorInfo, SanomaError } from "./errors.js";
|
|
8
|
+
import { errorCode, errorInfo, SanomaError } from "./errors.js";
|
|
9
9
|
import { contains, detailOf, isCall } from "./expectations.js";
|
|
10
10
|
import { fill, isBug, seedFrom, shapeOf } from "./fill.js";
|
|
11
11
|
import { outlineWorkflow } from "./outline.js";
|
|
12
|
+
import { admit, readPeople } from "./resources.js";
|
|
12
13
|
import { memorySecrets } from "./secret.js";
|
|
13
|
-
import { APPLY_WORKFLOW, BUILT_IN_WORKFLOWS, DRIFT_WORKFLOW, errorMessage, fitsOp, flatten, isEnded, } from "./shared.js";
|
|
14
|
+
import { APPLY_WORKFLOW, BUILT_IN_WORKFLOWS, DATA_VENDOR, declaresPeople, DRIFT_WORKFLOW, errorMessage, fitsOp, flatten, groupNamesOf, isEnded, principalIdsOf, problemLine, RUNTIME_AGENTS, } from "./shared.js";
|
|
14
15
|
const KINDS = {
|
|
15
16
|
[PickleStepType.CONTEXT]: "given",
|
|
16
17
|
[PickleStepType.ACTION]: "when",
|
|
@@ -110,7 +111,9 @@ function builtFor(scope) {
|
|
|
110
111
|
if (cached &&
|
|
111
112
|
cached.scope.workflows === scope.workflows &&
|
|
112
113
|
cached.scope.types === scope.types &&
|
|
113
|
-
cached.scope.
|
|
114
|
+
cached.scope.collections === scope.collections &&
|
|
115
|
+
cached.scope.steps === scope.steps &&
|
|
116
|
+
cached.scope.root === scope.root) {
|
|
114
117
|
return cached;
|
|
115
118
|
}
|
|
116
119
|
const { rules, parameterTypes } = rulesOf(scope);
|
|
@@ -125,24 +128,59 @@ function builtFor(scope) {
|
|
|
125
128
|
const expecting = (expect) => ({ expect, verify: (run) => detailOf(expect, run.records) });
|
|
126
129
|
/** The rules a scope has, and the parameter types their expressions use. */
|
|
127
130
|
function rulesOf(scope) {
|
|
128
|
-
const { types } = scope;
|
|
131
|
+
const { types, collections } = scope;
|
|
132
|
+
// A collection's records are seeded as a resource's objects are, by `data.<name>`, through its operations.
|
|
133
|
+
const collectionOf = (id) => id.startsWith(`${DATA_VENDOR}.`)
|
|
134
|
+
? collections.get(id.slice(DATA_VENDOR.length + 1))
|
|
135
|
+
: undefined;
|
|
136
|
+
const seedable = new Map([
|
|
137
|
+
...types,
|
|
138
|
+
...[...collections.keys()].map((n) => [`${DATA_VENDOR}.${n}`, n]),
|
|
139
|
+
]);
|
|
129
140
|
const parameterTypes = [
|
|
130
141
|
{ name: "op", regexp: /\S+/, transformer: known("operation", scope.ops) },
|
|
131
142
|
{ name: "workflow", regexp: /\S+/, transformer: known("workflow", scope.workflows) },
|
|
132
143
|
{ name: "who", regexp: /\S+/, transformer: (s) => s },
|
|
133
|
-
{ name: "resource", regexp: /\S+/, transformer: known("resource type",
|
|
144
|
+
{ name: "resource", regexp: /\S+/, transformer: known("resource type", seedable) },
|
|
134
145
|
// A declared resource, as a drift report names it: `<file>#<export>`.
|
|
135
146
|
{ name: "declared", regexp: /[^\s#]+#\S+/, transformer: (s) => s },
|
|
136
147
|
{ name: "field", regexp: /\S+/, transformer: (s) => s },
|
|
137
148
|
];
|
|
138
149
|
const opOf = (id) => scope.ops.get(id);
|
|
139
150
|
const workflowOf = (name) => scope.workflows.get(name);
|
|
151
|
+
// The people as the root's data files declare them when a step names one (`readPeople`, read
|
|
152
|
+
// again only once a file changed): while they declare no one, any id and any group go.
|
|
153
|
+
/** `who`, as a run's start admits them (`admit`): a declared person or agent. */
|
|
154
|
+
const actorNamed = (who) => {
|
|
155
|
+
const declared = readPeople(scope.root);
|
|
156
|
+
try {
|
|
157
|
+
return admit({ id: who }, declared).id;
|
|
158
|
+
}
|
|
159
|
+
catch (err) {
|
|
160
|
+
if (errorCode(err) !== "not_admitted" || declared.problems.length)
|
|
161
|
+
throw err;
|
|
162
|
+
const ids = [...principalIdsOf(declared.people), ...RUNTIME_AGENTS].join(", ");
|
|
163
|
+
throw new Error(`${who} is not a declared person or agent; resources/ declares ${ids}`, { cause: err });
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
/** `group`, a declared group or `agents`, while the people's files have no problems. */
|
|
167
|
+
const groupNamed = (group) => {
|
|
168
|
+
const { people, problems } = readPeople(scope.root);
|
|
169
|
+
if (problems.length) {
|
|
170
|
+
throw new Error(`no group can be told while the people's files have problems: ${problems.map(problemLine).join("; ")}`);
|
|
171
|
+
}
|
|
172
|
+
const groups = groupNamesOf(people);
|
|
173
|
+
if (!declaresPeople(people) || groups.includes(group))
|
|
174
|
+
return group;
|
|
175
|
+
throw new Error(`no group "${group}"; resources/ declares ${groups.join(", ")}`);
|
|
176
|
+
};
|
|
140
177
|
/** A resource step's object: its type's id, vendor and type, and its import id. */
|
|
141
178
|
const object = (id, name) => {
|
|
142
179
|
const { vendor, type } = types.get(id);
|
|
143
180
|
return { resource: id, vendor, type, name: name };
|
|
144
181
|
};
|
|
145
182
|
const rules = [
|
|
183
|
+
{ kind: "actor", source: "{who} is acting", read: ([who]) => actorNamed(who) },
|
|
146
184
|
{
|
|
147
185
|
kind: "given",
|
|
148
186
|
source: "{op} was called with",
|
|
@@ -160,17 +198,30 @@ function rulesOf(scope) {
|
|
|
160
198
|
kind: "given",
|
|
161
199
|
source: "{resource} {string} has",
|
|
162
200
|
takes: TAKES_OBJECT,
|
|
163
|
-
read: ([resource, name], pickle) =>
|
|
164
|
-
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
201
|
+
read: ([resource, name], pickle) => {
|
|
202
|
+
const owner = `${resource} "${name}"`;
|
|
203
|
+
const c = collectionOf(resource);
|
|
204
|
+
if (c) {
|
|
205
|
+
// The record with its key, the fields the step gives, and the rest made up.
|
|
206
|
+
const record = shapeOf(opOf(c.save.id).input).record;
|
|
207
|
+
const fields = fieldsFrom(pickle, record, owner);
|
|
208
|
+
if (Object.hasOwn(fields, c.key) && fields[c.key] !== name) {
|
|
209
|
+
throw new Error(`${c.key} in ${owner} is ${JSON.stringify(fields[c.key])}: it is the key, "${name}"`);
|
|
210
|
+
}
|
|
211
|
+
return [{ op: c.save.id, input: { record: fill(record, { ...fields, [c.key]: name }) } }];
|
|
212
|
+
}
|
|
213
|
+
return [
|
|
214
|
+
{ ...object(resource, name), fields: fieldsFrom(pickle, types.get(resource).schema, owner) },
|
|
215
|
+
];
|
|
216
|
+
},
|
|
169
217
|
},
|
|
170
218
|
{
|
|
171
219
|
kind: "given",
|
|
172
220
|
source: "{resource} {string} is gone",
|
|
173
|
-
read: ([resource, name]) =>
|
|
221
|
+
read: ([resource, name]) => {
|
|
222
|
+
const c = collectionOf(resource);
|
|
223
|
+
return [c ? { op: c.delete.id, input: { key: name } } : { ...object(resource, name), gone: true }];
|
|
224
|
+
},
|
|
174
225
|
},
|
|
175
226
|
{
|
|
176
227
|
kind: "when",
|
|
@@ -233,11 +284,21 @@ function rulesOf(scope) {
|
|
|
233
284
|
source: "{op} was denied",
|
|
234
285
|
read: ([op]) => expecting({ op: op, decision: "denied" }),
|
|
235
286
|
},
|
|
287
|
+
{
|
|
288
|
+
kind: "then",
|
|
289
|
+
source: "{op} was denied with {string}",
|
|
290
|
+
read: ([op, reason]) => expecting({ op: op, decision: "denied", reason: reason }),
|
|
291
|
+
},
|
|
236
292
|
{
|
|
237
293
|
kind: "then",
|
|
238
294
|
source: "{op} was held for {who}",
|
|
239
295
|
read: ([op, who]) => expecting({ op: op, decision: "held", approver: who }),
|
|
240
296
|
},
|
|
297
|
+
{
|
|
298
|
+
kind: "then",
|
|
299
|
+
source: "{op} was held for group {string}",
|
|
300
|
+
read: ([op, group]) => expecting({ op: op, decision: "held", approver: { group: groupNamed(group) } }),
|
|
301
|
+
},
|
|
241
302
|
{
|
|
242
303
|
kind: "then",
|
|
243
304
|
source: "step {string} was called with",
|
|
@@ -435,7 +496,7 @@ function lastCall(records) {
|
|
|
435
496
|
}
|
|
436
497
|
/** Every step the scope knows, for an error: the generic ones by keyword, then each operation's phrases and each step library's steps under its name. */
|
|
437
498
|
function knownSteps(rules) {
|
|
438
|
-
const keyword = (kind) =>
|
|
499
|
+
const keyword = (kind) => kind === "any" ? "Given/When/Then" : kind === "actor" ? "Given" : kind[0].toUpperCase() + kind.slice(1);
|
|
439
500
|
const line = (r) => `${keyword(r.kind)} ${r.source}${r.takes ? ` (and ${r.takes})` : ""}`;
|
|
440
501
|
const { generic = [], ...groups } = Object.groupBy(rules, (r) => r.group ?? "generic");
|
|
441
502
|
return [
|
|
@@ -556,7 +617,9 @@ function ruleFor(built, expression, pickle) {
|
|
|
556
617
|
const kind = pickle.type && KINDS[pickle.type];
|
|
557
618
|
if (!kind)
|
|
558
619
|
throw new Error(`"${pickle.text}" needs a Given, When or Then before it`);
|
|
559
|
-
const rules = built.byExpression
|
|
620
|
+
const rules = built.byExpression
|
|
621
|
+
.get(expression)
|
|
622
|
+
.filter((r) => r.kind === kind || r.kind === "any" || (r.kind === "actor" && kind === "given"));
|
|
560
623
|
if (rules.length === 0)
|
|
561
624
|
throw new Error(noMatch(built, pickle.text));
|
|
562
625
|
if (rules.length > 1)
|
|
@@ -583,6 +646,11 @@ function compileWorld(built, specs) {
|
|
|
583
646
|
const { text } = pickle;
|
|
584
647
|
const step = { text, kind: KINDS[pickle.type] };
|
|
585
648
|
switch (rule.kind) {
|
|
649
|
+
case "actor":
|
|
650
|
+
if (spec.startedBy !== undefined)
|
|
651
|
+
throw new Error(`${spec.startedBy} is acting already: a run has one actor`);
|
|
652
|
+
spec.startedBy = rule.read(args, pickle);
|
|
653
|
+
break;
|
|
586
654
|
case "given": {
|
|
587
655
|
const items = rule.read(args, pickle);
|
|
588
656
|
spec.given.push(...items.map((item) => ({ step: text, ...item })));
|
|
@@ -740,6 +808,8 @@ function testWorld(built, { driver, fake }) {
|
|
|
740
808
|
}
|
|
741
809
|
case "any":
|
|
742
810
|
throw new Error(`"${text}" decides an approval: a step for a scenario in scenarios/, not an operation's own test`);
|
|
811
|
+
case "actor":
|
|
812
|
+
throw new Error(`"${text}" says who starts a run: a step for a scenario in scenarios/`);
|
|
743
813
|
case "then": {
|
|
744
814
|
const detail = rule.read(args, pickle).verify(viewOf(records));
|
|
745
815
|
if (detail !== undefined)
|
|
@@ -921,8 +991,9 @@ async function compile(scope, dir, files) {
|
|
|
921
991
|
return loaded;
|
|
922
992
|
}
|
|
923
993
|
/**
|
|
924
|
-
* Each scope's scenarios as last read, with the stamp of the files they were read from
|
|
925
|
-
*
|
|
994
|
+
* Each scope's scenarios as last read, with the stamp of the files they were read from and the
|
|
995
|
+
* people they were checked against (`readPeople`'s answer, the same object until a data file
|
|
996
|
+
* changes). By scope, since what a file means depends on its operations and workflows.
|
|
926
997
|
*/
|
|
927
998
|
const loadedByScope = new WeakMap();
|
|
928
999
|
/**
|
|
@@ -930,8 +1001,8 @@ const loadedByScope = new WeakMap();
|
|
|
930
1001
|
* compiled by Cucumber, with an error for each file that does not compile and each name used
|
|
931
1002
|
* twice. No directory, or none given, is no scenarios. Rejects when an operation's phrase names
|
|
932
1003
|
* a field it lacks. The files are compiled again only once one is added, removed or written
|
|
933
|
-
* (its name, `mtimeMs` or size changes)
|
|
934
|
-
* callers must not change.
|
|
1004
|
+
* (its name, `mtimeMs` or size changes), or the people's data files change: until then each
|
|
1005
|
+
* call returns the same object, which callers must not change.
|
|
935
1006
|
*/
|
|
936
1007
|
export async function loadScenarios(scope) {
|
|
937
1008
|
if (!scope.scenarios)
|
|
@@ -949,11 +1020,13 @@ export async function loadScenarios(scope) {
|
|
|
949
1020
|
return [file, mtimeMs, size];
|
|
950
1021
|
}),
|
|
951
1022
|
]);
|
|
1023
|
+
// None without a root, which declares no one.
|
|
1024
|
+
const people = scope.root === undefined ? undefined : readPeople(scope.root);
|
|
952
1025
|
const cached = loadedByScope.get(scope);
|
|
953
|
-
if (cached?.stamp === stamp)
|
|
1026
|
+
if (cached?.stamp === stamp && cached.people === people)
|
|
954
1027
|
return cached.loaded;
|
|
955
1028
|
const loaded = files.length ? compile(scope, dir, files) : Promise.resolve({ scenarios: [], errors: [] });
|
|
956
|
-
loadedByScope.set(scope, { stamp, loaded });
|
|
1029
|
+
loadedByScope.set(scope, { stamp, people, loaded });
|
|
957
1030
|
// A compile that throws (a bug) is not kept: the next call tries again.
|
|
958
1031
|
loaded.catch(() => {
|
|
959
1032
|
if (loadedByScope.get(scope)?.loaded === loaded)
|