@sanoma-ai/workflows 0.9.1 → 0.10.1
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 +193 -50
- package/SECRET-SUPPORT.md +33 -0
- package/dist/apply-steps.js +5 -2
- package/dist/apply-steps.js.map +1 -1
- package/dist/apply.d.ts +3 -0
- package/dist/apply.js +27 -13
- package/dist/apply.js.map +1 -1
- package/dist/approvals.d.ts +1 -0
- package/dist/approvals.js +6 -1
- package/dist/approvals.js.map +1 -1
- package/dist/apps.d.ts +13 -24
- package/dist/apps.js +69 -68
- package/dist/apps.js.map +1 -1
- package/dist/ast.d.ts +9 -7
- package/dist/ast.js +2 -0
- package/dist/ast.js.map +1 -1
- package/dist/authentication.d.ts +54 -0
- package/dist/authentication.js +138 -0
- package/dist/authentication.js.map +1 -0
- package/dist/call-workflow.d.ts +5 -0
- package/dist/call-workflow.js +4 -3
- package/dist/call-workflow.js.map +1 -1
- package/dist/call.d.ts +3 -2
- package/dist/call.js +36 -7
- package/dist/call.js.map +1 -1
- package/dist/cedar.js +14 -1
- package/dist/cedar.js.map +1 -1
- package/dist/change-steps.js +7 -5
- package/dist/change-steps.js.map +1 -1
- package/dist/change.d.ts +7 -0
- package/dist/change.js +7 -0
- package/dist/change.js.map +1 -1
- package/dist/client.d.ts +62 -10
- package/dist/client.js +272 -47
- package/dist/client.js.map +1 -1
- package/dist/collection.d.ts +7 -0
- package/dist/collection.js +5 -2
- package/dist/collection.js.map +1 -1
- package/dist/config.d.ts +16 -4
- package/dist/config.js +89 -21
- package/dist/config.js.map +1 -1
- package/dist/connection.d.ts +389 -0
- package/dist/connection.js +657 -0
- package/dist/connection.js.map +1 -0
- package/dist/credentials.d.ts +7 -53
- package/dist/credentials.js +84 -247
- package/dist/credentials.js.map +1 -1
- package/dist/db.js +34 -2
- package/dist/db.js.map +1 -1
- package/dist/define.d.ts +9 -2
- package/dist/define.js.map +1 -1
- package/dist/definitions.d.ts +20 -0
- package/dist/definitions.js +16 -0
- package/dist/definitions.js.map +1 -0
- package/dist/deployment-key.d.ts +2 -0
- package/dist/deployment-key.js +22 -0
- package/dist/deployment-key.js.map +1 -0
- package/dist/describe.d.ts +15 -175
- package/dist/describe.js +122 -35
- package/dist/describe.js.map +1 -1
- package/dist/description.d.ts +532 -0
- package/dist/description.js +381 -0
- package/dist/description.js.map +1 -0
- package/dist/direct.js +7 -0
- package/dist/direct.js.map +1 -1
- package/dist/drift.d.ts +1 -1
- package/dist/drift.js +1 -1
- package/dist/drift.js.map +1 -1
- package/dist/env.d.ts +2 -0
- package/dist/env.js +2 -2
- package/dist/env.js.map +1 -1
- package/dist/fake.d.ts +13 -1
- package/dist/fake.js +70 -0
- package/dist/fake.js.map +1 -1
- package/dist/index.d.ts +11 -3
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/ledger.d.ts +2 -0
- package/dist/ledger.js +1 -1
- package/dist/ledger.js.map +1 -1
- package/dist/lint.d.ts +0 -9
- package/dist/lint.js +2 -17
- package/dist/lint.js.map +1 -1
- package/dist/load.d.ts +85 -0
- package/dist/load.js +391 -0
- package/dist/load.js.map +1 -0
- package/dist/lockfile.d.ts +2 -0
- package/dist/lockfile.js +8 -3
- package/dist/lockfile.js.map +1 -1
- package/dist/op.d.ts +22 -5
- package/dist/op.js +20 -2
- package/dist/op.js.map +1 -1
- package/dist/outline.d.ts +5 -0
- package/dist/outline.js +46 -5
- package/dist/outline.js.map +1 -1
- package/dist/paths.d.ts +18 -2
- package/dist/paths.js +19 -7
- package/dist/paths.js.map +1 -1
- package/dist/plugin.d.ts +0 -11
- package/dist/plugin.js +3 -18
- package/dist/plugin.js.map +1 -1
- package/dist/policy.d.ts +2 -0
- package/dist/policy.js.map +1 -1
- package/dist/resource.d.ts +10 -4
- package/dist/resource.js +11 -4
- package/dist/resource.js.map +1 -1
- package/dist/resources.d.ts +33 -76
- package/dist/resources.js +219 -227
- package/dist/resources.js.map +1 -1
- package/dist/run.d.ts +4 -0
- package/dist/run.js.map +1 -1
- package/dist/sandbox.d.ts +5 -2
- package/dist/sandbox.js +56 -7
- package/dist/sandbox.js.map +1 -1
- package/dist/scenario.d.ts +5 -0
- package/dist/scenario.js +3 -2
- package/dist/scenario.js.map +1 -1
- package/dist/scenarios.js +7 -1
- package/dist/scenarios.js.map +1 -1
- package/dist/schema.js +8 -0
- package/dist/schema.js.map +1 -1
- package/dist/secret-store-check.d.ts +11 -0
- package/dist/secret-store-check.js +76 -0
- package/dist/secret-store-check.js.map +1 -0
- package/dist/secret-store.d.ts +106 -0
- package/dist/secret-store.js +228 -0
- package/dist/secret-store.js.map +1 -0
- package/dist/secret.d.ts +2 -0
- package/dist/secret.js +32 -0
- package/dist/secret.js.map +1 -1
- package/dist/shared.d.ts +21 -11
- package/dist/shared.js +41 -7
- package/dist/shared.js.map +1 -1
- package/dist/sites.d.ts +4 -93
- package/dist/sites.js +76 -84
- package/dist/sites.js.map +1 -1
- package/dist/steps.d.ts +3 -0
- package/dist/steps.js.map +1 -1
- package/dist/version.d.ts +2 -1
- package/dist/version.js +2 -1
- package/dist/version.js.map +1 -1
- package/dist/wakeup-driver.js +15 -6
- package/dist/wakeup-driver.js.map +1 -1
- package/dist/worker.js +12 -8
- package/dist/worker.js.map +1 -1
- package/dist/writer.d.ts +53 -14
- package/dist/writer.js +113 -43
- package/dist/writer.js.map +1 -1
- package/oxlint.json +1 -5
- package/package.json +6 -1
- package/src/apply-steps.ts +5 -2
- package/src/apply.ts +54 -21
- package/src/approvals.ts +7 -1
- package/src/apps.ts +71 -86
- package/src/ast.ts +6 -6
- package/src/authentication.ts +191 -0
- package/src/call-workflow.ts +5 -4
- package/src/call.ts +52 -9
- package/src/cedar.ts +14 -1
- package/src/change-steps.ts +7 -4
- package/src/change.ts +10 -0
- package/src/client.ts +346 -45
- package/src/collection.ts +10 -2
- package/src/config.ts +107 -19
- package/src/connection.ts +912 -0
- package/src/credentials.ts +94 -281
- package/src/db.ts +34 -2
- package/src/define.ts +7 -2
- package/src/definitions.ts +31 -0
- package/src/deployment-key.ts +23 -0
- package/src/describe.ts +150 -227
- package/src/description.ts +426 -0
- package/src/direct.ts +7 -0
- package/src/drift.ts +10 -2
- package/src/env.ts +4 -2
- package/src/fake.ts +71 -0
- package/src/index.ts +53 -1
- package/src/ledger.ts +3 -1
- package/src/lint.ts +2 -17
- package/src/load.ts +466 -0
- package/src/lockfile.ts +10 -3
- package/src/op.ts +41 -7
- package/src/outline.ts +53 -7
- package/src/paths.ts +21 -6
- package/src/plugin.ts +3 -24
- package/src/policy.ts +2 -0
- package/src/resource.ts +24 -6
- package/src/resources.ts +246 -301
- package/src/run.ts +4 -0
- package/src/sandbox.ts +61 -7
- package/src/scenario.ts +24 -6
- package/src/scenarios.ts +7 -1
- package/src/schema.ts +10 -0
- package/src/secret-store-check.ts +93 -0
- package/src/secret-store.ts +314 -0
- package/src/secret.ts +29 -0
- package/src/shared.ts +44 -10
- package/src/sites.ts +85 -179
- package/src/steps.ts +3 -2
- package/src/version.ts +2 -1
- package/src/wakeup-driver.ts +22 -6
- package/src/worker.ts +12 -8
- package/src/writer.ts +145 -56
- package/dist/datafile.d.ts +0 -97
- package/dist/datafile.js +0 -479
- package/dist/datafile.js.map +0 -1
- package/src/datafile.ts +0 -601
package/dist/datafile.js
DELETED
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
import { basename, dirname, join, relative } from "node:path";
|
|
2
|
-
import { inside, nearestDir, RELATIVE } from "./paths.js";
|
|
3
|
-
import { SECRET_NAME } from "./secret.js";
|
|
4
|
-
import { checkCollection, errorMessage } from "./shared.js";
|
|
5
|
-
/** A name in a data file that refers to a declared resource: one imported from a data file, or exported by this one. */
|
|
6
|
-
export class Reference {
|
|
7
|
-
name;
|
|
8
|
-
constructor(name) {
|
|
9
|
-
this.name = name;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
const REFERENCE = Symbol.for("sanoma.reference");
|
|
13
|
-
Object.defineProperty(Reference.prototype, REFERENCE, { value: true });
|
|
14
|
-
/** True for a `Reference`, made by any copy of this package: read by a registered symbol, not `instanceof`. */
|
|
15
|
-
export const isReference = (value) => typeof value === "object" && value !== null && REFERENCE in value;
|
|
16
|
-
/** A connector's constructors entry: a package specifier that ends in `/resources`. */
|
|
17
|
-
const CONSTRUCTORS = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*\/resources$/;
|
|
18
|
-
/**
|
|
19
|
-
* Where a data file imports `secret` from, and `sanoma`, the runtime's own resource constructors
|
|
20
|
-
* (its people: `sanoma.person`, `.agent`, `.group`); checked before `CONSTRUCTORS`, which they match too.
|
|
21
|
-
*/
|
|
22
|
-
export const SECRET_ENTRIES = new Set(["sanoma/resources", "@sanoma-ai/workflows/resources"]);
|
|
23
|
-
/** Where `resources/data.ts` imports `collection` from, and the only imports it may make. */
|
|
24
|
-
export const DATA_ENTRIES = new Set(["sanoma/data", "@sanoma-ai/workflows/data"]);
|
|
25
|
-
/**
|
|
26
|
-
* The one data file that holds collections, relative to `resources/`. Workflows and the runtime
|
|
27
|
-
* import it, so it imports only `collection` from "sanoma/data" and holds nothing else.
|
|
28
|
-
*/
|
|
29
|
-
export const COLLECTIONS_FILE = "data.ts";
|
|
30
|
-
const COLLECTION_CALL = '`export const <name> = collection({ name: "…", key: "…", fields: { … } })`';
|
|
31
|
-
const COLLECTIONS_ONLY = "resources/data.ts holds collections only, since workflows and the runtime import it: " +
|
|
32
|
-
`\`import { collection } from "sanoma/data"\` and ${COLLECTION_CALL}; declare a connector's resources in another data file`;
|
|
33
|
-
const SECRET_CALL = '`secret("NAME")` or `secret("NAME", { generate: true })`, NAME upper case (A-Z, 0-9 and _)';
|
|
34
|
-
const SHAPE = "a data file holds only imports, `export const <name> = <vendor>.<type>({ … })` and `export default [ … ]`";
|
|
35
|
-
const IMPORTS = "import resource constructors from a connector's resources entry " +
|
|
36
|
-
'(`import { github } from "@sanoma-ai/connector-github/resources"`) ' +
|
|
37
|
-
'and resources from other data files (`import { site } from "./github.ts"`), and `secret` from "sanoma/resources"';
|
|
38
|
-
const VALUES = "write a string, number, boolean, null, object or array, or name a declared resource";
|
|
39
|
-
/**
|
|
40
|
-
* Reads a data file's program without running it: its imports, each `export const` resource
|
|
41
|
-
* with its fields evaluated, and everything outside the data-file subset as a problem that says
|
|
42
|
-
* what to write instead.
|
|
43
|
-
*
|
|
44
|
-
* The subset: named imports, from a connector's `…/resources` entry or a `.ts` data file;
|
|
45
|
-
* `export const <name> = <vendor>.<type>({ … })`, one per statement, its argument built of
|
|
46
|
-
* strings (template literals without `${}` too), numbers, booleans, null, objects and arrays,
|
|
47
|
-
* and names of resources this file declares or imports; and `export default [a, b]`.
|
|
48
|
-
* `resources/data.ts` (`COLLECTIONS_FILE`) is the exception, the one data file workflows and the
|
|
49
|
-
* runtime import: it imports only `collection` from "sanoma/data", and each `export const` is
|
|
50
|
-
* `collection({ … })` with its values written out (`DataFile.collections`). No other data file
|
|
51
|
-
* declares a collection, and none imports one.
|
|
52
|
-
*
|
|
53
|
-
* `root` is the directory relative imports must stay in: by default the nearest `resources/`
|
|
54
|
-
* directory above `filename`, else the file's own.
|
|
55
|
-
*/
|
|
56
|
-
export function readDataFile(program, filename, root = nearestDir(filename, ["resources"])) {
|
|
57
|
-
const problems = [];
|
|
58
|
-
const fail = (node, message) => problems.push({ start: node.start, end: node.end, message });
|
|
59
|
-
const imports = [];
|
|
60
|
-
const exports = [];
|
|
61
|
-
const collections = [];
|
|
62
|
-
const collectionsFile = relative(root, filename) === COLLECTIONS_FILE;
|
|
63
|
-
// What the file may hold, for the problems that say so.
|
|
64
|
-
const shape = collectionsFile ? COLLECTIONS_ONLY : SHAPE;
|
|
65
|
-
// Names a refused import or declaration binds: reported once, where they are bound.
|
|
66
|
-
const refused = new Set();
|
|
67
|
-
// The local names of `secret`, and of `collection`.
|
|
68
|
-
const secrets = new Set();
|
|
69
|
-
const collectionCalls = new Set();
|
|
70
|
-
// Imports and top-level names first, each once: imports are hoisted, and a reference may name
|
|
71
|
-
// a resource declared further down. An unexported const is refused where it is declared, not
|
|
72
|
-
// again where it is used.
|
|
73
|
-
const bound = new Set();
|
|
74
|
-
const bind = (id) => {
|
|
75
|
-
if (bound.has(id.name))
|
|
76
|
-
fail(id, `${id.name} is declared twice in this file: give each its own name`);
|
|
77
|
-
bound.add(id.name);
|
|
78
|
-
};
|
|
79
|
-
const declared = new Set();
|
|
80
|
-
for (const s of program.body) {
|
|
81
|
-
if (s.type === "ImportDeclaration") {
|
|
82
|
-
for (const sp of s.specifiers)
|
|
83
|
-
bind(sp.local);
|
|
84
|
-
readImport(s);
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
const decl = s.type === "ExportNamedDeclaration" ? s.declaration : s;
|
|
88
|
-
if (decl?.type !== "VariableDeclaration")
|
|
89
|
-
continue;
|
|
90
|
-
for (const d of decl.declarations) {
|
|
91
|
-
if (d.id.type !== "Identifier")
|
|
92
|
-
continue;
|
|
93
|
-
bind(d.id);
|
|
94
|
-
(decl === s ? refused : declared).add(d.id.name);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
for (const s of program.body) {
|
|
98
|
-
switch (s.type) {
|
|
99
|
-
case "ImportDeclaration":
|
|
100
|
-
break;
|
|
101
|
-
case "ExportNamedDeclaration":
|
|
102
|
-
readExport(s);
|
|
103
|
-
break;
|
|
104
|
-
case "ExportDefaultDeclaration":
|
|
105
|
-
readDefault(s);
|
|
106
|
-
break;
|
|
107
|
-
case "ExportAllDeclaration":
|
|
108
|
-
fail(s, `export * is not allowed in a data file: ${shape}`);
|
|
109
|
-
break;
|
|
110
|
-
case "VariableDeclaration": {
|
|
111
|
-
const name = s.declarations[0]?.id?.name;
|
|
112
|
-
fail(s, name === undefined
|
|
113
|
-
? `an unexported declaration is not allowed in a data file: ${shape}`
|
|
114
|
-
: `\`${s.kind} ${name}\` is not allowed in a data file: export it as ${collectionsFile ? `a collection, \`export const ${name} = collection({ … })\`` : `a resource, \`export const ${name} = <vendor>.<type>({ … })\``}, or write its value where it is used`);
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
default:
|
|
118
|
-
fail(s, `${describe(s)} is not allowed in a data file: ${shape}`);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function readImport(s) {
|
|
122
|
-
const spec = s.source.value;
|
|
123
|
-
if (s.importKind === "type") {
|
|
124
|
-
fail(s, "`import type` is not allowed in a data file: it holds values only, and the constructors type them");
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
if (collectionsFile !== DATA_ENTRIES.has(spec)) {
|
|
128
|
-
fail(s.source, collectionsFile
|
|
129
|
-
? `import "${spec}" is not allowed in resources/data.ts: ${COLLECTIONS_ONLY}`
|
|
130
|
-
: `import "${spec}" is not allowed here: collections are declared in resources/data.ts, the one data file workflows and the runtime import; move it there`);
|
|
131
|
-
for (const sp of s.specifiers)
|
|
132
|
-
refused.add(sp.local.name);
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const refusal = whyRefused(spec);
|
|
136
|
-
if (refusal) {
|
|
137
|
-
fail(s.source, `import "${spec}" is not allowed in a data file: ${refusal}`);
|
|
138
|
-
for (const sp of s.specifiers)
|
|
139
|
-
refused.add(sp.local.name);
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (!s.specifiers.length) {
|
|
143
|
-
fail(s, `import "${spec}" is not allowed in a data file: it imports nothing, and a data file runs no code`);
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
// The one name each of these entries gives a data file.
|
|
147
|
-
const [only, locals] = SECRET_ENTRIES.has(spec)
|
|
148
|
-
? ["secret", secrets]
|
|
149
|
-
: DATA_ENTRIES.has(spec)
|
|
150
|
-
? ["collection", collectionCalls]
|
|
151
|
-
: [];
|
|
152
|
-
if (locals) {
|
|
153
|
-
for (const sp of s.specifiers) {
|
|
154
|
-
const imported = sp.type === "ImportSpecifier" && sp.importKind !== "type" && (sp.imported.name ?? sp.imported.value);
|
|
155
|
-
if (imported === only) {
|
|
156
|
-
locals.add(sp.local.name);
|
|
157
|
-
}
|
|
158
|
-
else if (imported === "sanoma" && SECRET_ENTRIES.has(spec)) {
|
|
159
|
-
// The runtime's own constructors, matched to its connector as a connector's are.
|
|
160
|
-
imports.push({ kind: "constructors", source: spec, imported, local: sp.local.name, start: sp.start });
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
const [names, allowed] = SECRET_ENTRIES.has(spec)
|
|
164
|
-
? ["`secret` and `sanoma`", `${only}, sanoma`]
|
|
165
|
-
: [`\`${only}\``, only];
|
|
166
|
-
fail(sp, `a data file imports only ${names} from "${spec}": \`import { ${allowed} } from "${spec}"\``);
|
|
167
|
-
refused.add(sp.local.name);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
for (const sp of s.specifiers) {
|
|
173
|
-
if (sp.type !== "ImportSpecifier") {
|
|
174
|
-
const how = sp.type === "ImportNamespaceSpecifier" ? `import * as ${sp.local.name}` : `import ${sp.local.name}`;
|
|
175
|
-
fail(sp, `${how} is not allowed in a data file: import the names you use, \`import { name } from "${spec}"\``);
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
if (sp.importKind === "type") {
|
|
179
|
-
fail(sp, "`type` imports are not allowed in a data file: it holds values only, and the constructors type them");
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
const imported = sp.imported.name ?? sp.imported.value;
|
|
183
|
-
const kind = RELATIVE.test(spec) ? "file" : "constructors";
|
|
184
|
-
imports.push({ kind, source: spec, imported, local: sp.local.name, start: sp.start });
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
/** Why an import's specifier is not allowed in a data file, or undefined when it is. */
|
|
188
|
-
function whyRefused(spec) {
|
|
189
|
-
if (!RELATIVE.test(spec))
|
|
190
|
-
return CONSTRUCTORS.test(spec) || DATA_ENTRIES.has(spec) ? undefined : IMPORTS;
|
|
191
|
-
if (!spec.endsWith(".ts"))
|
|
192
|
-
return "name the data file with its `.ts` extension";
|
|
193
|
-
if (join(dirname(filename), spec) === join(root, COLLECTIONS_FILE)) {
|
|
194
|
-
return "resources/data.ts holds collections, which no resource names; import resources from other data files";
|
|
195
|
-
}
|
|
196
|
-
if (!inside(root, join(dirname(filename), spec))) {
|
|
197
|
-
return `it reaches outside ${basename(root)}/; import only other data files`;
|
|
198
|
-
}
|
|
199
|
-
return undefined;
|
|
200
|
-
}
|
|
201
|
-
function readExport(s) {
|
|
202
|
-
const decl = s.declaration;
|
|
203
|
-
if (!decl) {
|
|
204
|
-
fail(s, s.source
|
|
205
|
-
? `export … from "${s.source.value}" is not allowed in a data file: import what you reference, and export only resources declared here`
|
|
206
|
-
: "export { … } is not allowed in a data file: export each resource where it is declared, `export const name = <vendor>.<type>({ … })`");
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
if (decl.type !== "VariableDeclaration") {
|
|
210
|
-
fail(s, `${describe(decl)} is not allowed in a data file: ${shape}`);
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
213
|
-
if (decl.kind !== "const") {
|
|
214
|
-
fail(s, `\`export ${decl.kind}\` is not allowed in a data file: use \`export const\``);
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
if (decl.declarations.length !== 1) {
|
|
218
|
-
fail(s, "declare one resource per `export const`");
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
const [d] = decl.declarations;
|
|
222
|
-
if (d.id.type !== "Identifier") {
|
|
223
|
-
fail(d.id, "an `export const` names one resource: `export const name = <vendor>.<type>({ … })`");
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
const name = d.id.name;
|
|
227
|
-
// A second declaration of the name was reported where it is bound.
|
|
228
|
-
if (exports.some((e) => e.name === name) || collections.some((c) => c.export === name))
|
|
229
|
-
return;
|
|
230
|
-
const init = d.init;
|
|
231
|
-
const callee = init?.type === "CallExpression" ? init.callee : undefined;
|
|
232
|
-
// A name a refused import binds was reported with the import.
|
|
233
|
-
const head = callee?.type === "MemberExpression" ? callee.object : callee;
|
|
234
|
-
if (head?.type === "Identifier" && refused.has(head.name))
|
|
235
|
-
return;
|
|
236
|
-
if (collectionsFile) {
|
|
237
|
-
readCollection(s, init, name);
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
if (callee?.type !== "MemberExpression" ||
|
|
241
|
-
callee.computed ||
|
|
242
|
-
callee.object.type !== "Identifier" ||
|
|
243
|
-
callee.property.type !== "Identifier") {
|
|
244
|
-
fail(init ?? d, `export const ${name} must be a resource constructor call, \`<vendor>.<type>({ … })\`, with <vendor> imported from a connector's resources entry`);
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
const vendor = callee.object.name;
|
|
248
|
-
const type = callee.property.name;
|
|
249
|
-
if (imports.find((i) => i.local === vendor)?.kind !== "constructors") {
|
|
250
|
-
fail(callee.object, `${vendor} is not a connector's resource constructors: import it from the connector's resources entry, \`import { ${vendor} } from "@sanoma-ai/connector-${vendor}/resources"\``);
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
const [arg] = init.arguments;
|
|
254
|
-
if (init.arguments.length !== 1 || arg.type !== "ObjectExpression") {
|
|
255
|
-
fail(init, `${vendor}.${type} takes one object literal: \`${vendor}.${type}({ … })\``);
|
|
256
|
-
return;
|
|
257
|
-
}
|
|
258
|
-
const desired = value(arg);
|
|
259
|
-
if (desired !== undefined) {
|
|
260
|
-
exports.push({ name, vendor, type, desired: desired, start: s.start, end: s.end });
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
/** An `export const` in resources/data.ts: a collection, its declaration plain values `collection()` takes. */
|
|
264
|
-
function readCollection(s, init, name) {
|
|
265
|
-
if (init?.type !== "CallExpression" ||
|
|
266
|
-
init.callee.type !== "Identifier" ||
|
|
267
|
-
!collectionCalls.has(init.callee.name)) {
|
|
268
|
-
fail(init ?? s, `export const ${name} must be a collection: ${COLLECTIONS_ONLY}`);
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
const [arg] = init.arguments;
|
|
272
|
-
if (init.arguments.length !== 1 || arg.type !== "ObjectExpression") {
|
|
273
|
-
fail(init, `collection() takes one object literal: ${COLLECTION_CALL}`);
|
|
274
|
-
return;
|
|
275
|
-
}
|
|
276
|
-
const declaration = value(arg);
|
|
277
|
-
if (declaration === undefined) {
|
|
278
|
-
// What value() refused it reported; the collection is still declared here, which the
|
|
279
|
-
// runtime runs, when its name is written out.
|
|
280
|
-
const named = arg.properties.find((p) => p.type === "Property" && !p.computed && keyName(p.key) === "name")?.value;
|
|
281
|
-
if (named?.type === "Literal" && typeof named.value === "string") {
|
|
282
|
-
collections.push({ export: name, name: named.value, start: s.start, end: s.end });
|
|
283
|
-
}
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
if (Object.keys(declaration).some((k) => !DECLARATION_KEYS.has(k)) || namesDeclaration(declaration)) {
|
|
287
|
-
fail(arg, `collection() takes \`{ name, key, fields, title? }\`, its values written out: ${COLLECTION_CALL}`);
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
try {
|
|
291
|
-
checkCollection(declaration);
|
|
292
|
-
}
|
|
293
|
-
catch (err) {
|
|
294
|
-
fail(arg, errorMessage(err));
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
collections.push({ export: name, name: declaration.name, start: s.start, end: s.end });
|
|
298
|
-
}
|
|
299
|
-
function readDefault(s) {
|
|
300
|
-
if (collectionsFile) {
|
|
301
|
-
fail(s, `export default is not allowed in resources/data.ts: ${COLLECTIONS_ONLY}`);
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
const list = s.declaration;
|
|
305
|
-
if (list.type !== "ArrayExpression") {
|
|
306
|
-
fail(list, "export default must list this file's resources: `export default [a, b]`");
|
|
307
|
-
return;
|
|
308
|
-
}
|
|
309
|
-
for (const el of list.elements) {
|
|
310
|
-
if (el?.type !== "Identifier") {
|
|
311
|
-
fail(el ?? list, "export default must list this file's resources by name: `export default [a, b]`");
|
|
312
|
-
}
|
|
313
|
-
else if (!declared.has(el.name)) {
|
|
314
|
-
fail(el, `${el.name} is not declared in this file: export default lists this file's resources`);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
/** The value an expression stands for, or undefined (with a problem) when the subset has none. */
|
|
319
|
-
function value(node) {
|
|
320
|
-
switch (node.type) {
|
|
321
|
-
case "Literal":
|
|
322
|
-
if (node.regex)
|
|
323
|
-
return refuse(node, "a regular expression is not allowed in a data file: write it as a string");
|
|
324
|
-
if (node.bigint !== undefined && node.bigint !== null)
|
|
325
|
-
return refuse(node, "a bigint is not allowed in a data file: write a number, or a string");
|
|
326
|
-
return node.value;
|
|
327
|
-
case "TemplateLiteral":
|
|
328
|
-
if (node.expressions.length) {
|
|
329
|
-
return refuse(node, "a template with `${…}` is not allowed in a data file: write the string out");
|
|
330
|
-
}
|
|
331
|
-
return node.quasis[0].value.cooked;
|
|
332
|
-
case "UnaryExpression":
|
|
333
|
-
if (node.operator === "-" && node.argument.type === "Literal" && typeof node.argument.value === "number") {
|
|
334
|
-
return -node.argument.value;
|
|
335
|
-
}
|
|
336
|
-
return refuse(node, `\`${node.operator}\` is not allowed in a data file: write the value out`);
|
|
337
|
-
case "ArrayExpression": {
|
|
338
|
-
const items = [];
|
|
339
|
-
let ok = true;
|
|
340
|
-
for (const el of node.elements) {
|
|
341
|
-
const item = el === null
|
|
342
|
-
? refuse(node, "an empty array slot is not allowed in a data file: write null")
|
|
343
|
-
: el.type === "SpreadElement"
|
|
344
|
-
? refuse(el, "a spread is not allowed in a data file: write the items out, so the reader sees each")
|
|
345
|
-
: value(el);
|
|
346
|
-
if (item === undefined)
|
|
347
|
-
ok = false;
|
|
348
|
-
else
|
|
349
|
-
items.push(item);
|
|
350
|
-
}
|
|
351
|
-
return ok ? items : undefined;
|
|
352
|
-
}
|
|
353
|
-
case "ObjectExpression": {
|
|
354
|
-
const fields = new Map();
|
|
355
|
-
let ok = true;
|
|
356
|
-
for (const p of node.properties) {
|
|
357
|
-
const field = property(p);
|
|
358
|
-
if (field && fields.has(field[0]))
|
|
359
|
-
fail(p, `${field[0]} is given twice: give each field once`);
|
|
360
|
-
if (!field || fields.has(field[0]))
|
|
361
|
-
ok = false;
|
|
362
|
-
else
|
|
363
|
-
fields.set(...field);
|
|
364
|
-
}
|
|
365
|
-
// fromEntries makes each field an own property, even one named `__proto__`.
|
|
366
|
-
return ok ? Object.fromEntries(fields) : undefined;
|
|
367
|
-
}
|
|
368
|
-
case "Identifier":
|
|
369
|
-
return reference(node);
|
|
370
|
-
case "MemberExpression": {
|
|
371
|
-
let base = node;
|
|
372
|
-
while (base.type === "MemberExpression")
|
|
373
|
-
base = base.object;
|
|
374
|
-
if (base.type === "Identifier" && base.name === "process") {
|
|
375
|
-
return refuse(node, "process is not allowed in a data file: it is read without running, so it cannot read the environment; write the value out, and leave secrets to drivers");
|
|
376
|
-
}
|
|
377
|
-
return refuse(node, "member access is not allowed in a data file: write the value out, or name the resource itself (`site`), not one of its fields");
|
|
378
|
-
}
|
|
379
|
-
case "CallExpression":
|
|
380
|
-
if (node.callee.type === "Identifier" && secrets.has(node.callee.name))
|
|
381
|
-
return readSecret(node);
|
|
382
|
-
if (node.callee.type === "Identifier" && collectionCalls.has(node.callee.name)) {
|
|
383
|
-
return refuse(node, `a collection is declared at the top of resources/data.ts: ${COLLECTION_CALL}`);
|
|
384
|
-
}
|
|
385
|
-
if (node.callee.type === "Identifier" && node.callee.name === "secret" && !bound.has("secret")) {
|
|
386
|
-
return refuse(node, `import secret to name one: \`import { secret } from "sanoma/resources"\``);
|
|
387
|
-
}
|
|
388
|
-
return refuse(node, node.callee.type === "MemberExpression" &&
|
|
389
|
-
node.callee.object.type === "Identifier" &&
|
|
390
|
-
imports.some((i) => i.kind === "constructors" && i.local === node.callee.object.name)
|
|
391
|
-
? "a resource is declared at the top of a data file: give it its own `export const` and name it here"
|
|
392
|
-
: "a call is not allowed in a data file: write the value out; the reader never runs code");
|
|
393
|
-
case "NewExpression":
|
|
394
|
-
return refuse(node, "`new` is not allowed in a data file: write the value out (a date as an ISO 8601 string)");
|
|
395
|
-
case "ArrowFunctionExpression":
|
|
396
|
-
case "FunctionExpression":
|
|
397
|
-
return refuse(node, "a function is not allowed in a data file: a field holds a value, and code belongs in a workflow");
|
|
398
|
-
case "TSAsExpression":
|
|
399
|
-
case "TSSatisfiesExpression":
|
|
400
|
-
case "TSTypeAssertion":
|
|
401
|
-
case "TSNonNullExpression":
|
|
402
|
-
return refuse(node, "a type assertion is not allowed in a data file: leave it out; the constructor types the value");
|
|
403
|
-
default:
|
|
404
|
-
return refuse(node, `${describe(node)} is not allowed in a data file: ${VALUES}`);
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
function property(p) {
|
|
408
|
-
if (p.type === "SpreadElement") {
|
|
409
|
-
return refuse(p, "a spread is not allowed in a data file: write the fields out, so the reader sees each");
|
|
410
|
-
}
|
|
411
|
-
if (p.kind !== "init" || p.method) {
|
|
412
|
-
return refuse(p, "a method or accessor is not allowed in a data file: a field holds a value");
|
|
413
|
-
}
|
|
414
|
-
if (p.computed)
|
|
415
|
-
return refuse(p.key, "a computed key is not allowed in a data file: write the field's name");
|
|
416
|
-
const key = keyName(p.key);
|
|
417
|
-
if (key === undefined)
|
|
418
|
-
return refuse(p.key, "write the field's name, or a string");
|
|
419
|
-
if (key === "$secret")
|
|
420
|
-
return refuse(p.key, `name a secret with ${SECRET_CALL}`);
|
|
421
|
-
const v = value(p.value);
|
|
422
|
-
return v === undefined ? undefined : [key, v];
|
|
423
|
-
}
|
|
424
|
-
/** A `secret(…)` call's marker: literal arguments only. */
|
|
425
|
-
function readSecret(node) {
|
|
426
|
-
const [name, options, ...extra] = node.arguments;
|
|
427
|
-
if (name?.type !== "Literal" || typeof name.value !== "string" || extra.length) {
|
|
428
|
-
return refuse(node, `write the secret's name as a string: ${SECRET_CALL}`);
|
|
429
|
-
}
|
|
430
|
-
if (!SECRET_NAME.test(name.value))
|
|
431
|
-
return refuse(name, `${JSON.stringify(name.value)} is not a secret's name: ${SECRET_CALL}`);
|
|
432
|
-
if (options === undefined)
|
|
433
|
-
return { $secret: name.value };
|
|
434
|
-
const [generate, ...others] = options.type === "ObjectExpression" ? options.properties : [];
|
|
435
|
-
if (others.length ||
|
|
436
|
-
generate?.type !== "Property" ||
|
|
437
|
-
generate.computed ||
|
|
438
|
-
(generate.key.name ?? generate.key.value) !== "generate" ||
|
|
439
|
-
generate.value.type !== "Literal" ||
|
|
440
|
-
typeof generate.value.value !== "boolean") {
|
|
441
|
-
return refuse(options, `a secret's options are \`{ generate: true }\` or none: ${SECRET_CALL}`);
|
|
442
|
-
}
|
|
443
|
-
return generate.value.value ? { $secret: name.value, generate: true } : { $secret: name.value };
|
|
444
|
-
}
|
|
445
|
-
function reference(node) {
|
|
446
|
-
const name = node.name;
|
|
447
|
-
if (name === "undefined")
|
|
448
|
-
return refuse(node, "undefined is not allowed in a data file: leave the field out, or write null");
|
|
449
|
-
const imported = imports.find((i) => i.local === name);
|
|
450
|
-
if (imported?.kind === "constructors") {
|
|
451
|
-
return refuse(node, `${name} is a connector's resource constructors, not a resource: name a declared resource`);
|
|
452
|
-
}
|
|
453
|
-
if (imported || declared.has(name))
|
|
454
|
-
return new Reference(name);
|
|
455
|
-
if (refused.has(name))
|
|
456
|
-
return undefined;
|
|
457
|
-
return refuse(node, `${name} is not a resource this file declares or imports from a data file: write the value out, or import the resource`);
|
|
458
|
-
}
|
|
459
|
-
function refuse(node, message) {
|
|
460
|
-
fail(node, message);
|
|
461
|
-
return undefined;
|
|
462
|
-
}
|
|
463
|
-
return { imports, exports, collections, declared: collectionsFile ? [] : [...declared], problems };
|
|
464
|
-
}
|
|
465
|
-
/** What `collection()` reads of its declaration. */
|
|
466
|
-
const DECLARATION_KEYS = new Set(["name", "key", "fields", "title"]);
|
|
467
|
-
/** True when a value names a declaration: a collection's declaration is plain values only. */
|
|
468
|
-
const namesDeclaration = (v) => v instanceof Reference || (typeof v === "object" && v !== null && Object.values(v).some(namesDeclaration));
|
|
469
|
-
/** A property's name: an identifier's, or a literal's as a string; undefined for any other key. */
|
|
470
|
-
export const keyName = (key) => key.type === "Identifier" ? key.name : key.type === "Literal" ? String(key.value) : undefined;
|
|
471
|
-
/** A node's kind, for a message: `a function declaration`, `an if statement`. */
|
|
472
|
-
function describe(node) {
|
|
473
|
-
const words = String(node.type)
|
|
474
|
-
.replace(/^TS/, "TypeScript ")
|
|
475
|
-
.replace(/([a-z])([A-Z])/g, "$1 $2")
|
|
476
|
-
.toLowerCase();
|
|
477
|
-
return `${/^[aeiou]/.test(words) ? "an" : "a"} ${words}`;
|
|
478
|
-
}
|
|
479
|
-
//# sourceMappingURL=datafile.js.map
|
package/dist/datafile.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"datafile.js","sourceRoot":"","sources":["../src/datafile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE9D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAe,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAc5D,wHAAwH;AACxH,MAAM,OAAO,SAAS;IACX,IAAI,CAAS;IACtB,YAAY,IAAY;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;AACjD,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAEvE,+GAA+G;AAC/G,MAAM,CAA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