@sanoma-ai/workflows 0.9.1 → 0.10.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 +167 -50
- 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 +7 -24
- package/dist/apps.js +51 -67
- 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 +24 -0
- package/dist/authentication.js +68 -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 +34 -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 +10 -6
- package/dist/client.js +96 -43
- 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 +9 -0
- package/dist/config.js +45 -9
- package/dist/config.js.map +1 -1
- package/dist/connection.d.ts +168 -0
- package/dist/connection.js +327 -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 +21 -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 +9 -177
- package/dist/describe.js +71 -34
- 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 +3 -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/index.d.ts +10 -2
- 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 +1 -16
- package/dist/lint.js.map +1 -1
- package/dist/load.d.ts +74 -0
- package/dist/load.js +357 -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 +10 -1
- package/dist/op.js +1 -1
- package/dist/op.js.map +1 -1
- package/dist/outline.js +13 -4
- package/dist/outline.js.map +1 -1
- package/dist/paths.d.ts +18 -0
- package/dist/paths.js +21 -3
- 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 +2 -0
- package/dist/run.js.map +1 -1
- package/dist/sandbox.d.ts +1 -1
- package/dist/sandbox.js +5 -2
- package/dist/sandbox.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/shared.d.ts +17 -11
- package/dist/shared.js +34 -7
- package/dist/shared.js.map +1 -1
- package/dist/sites.d.ts +4 -93
- package/dist/sites.js +61 -84
- package/dist/sites.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 +0 -5
- package/package.json +5 -1
- package/src/apply-steps.ts +5 -2
- package/src/apply.ts +54 -21
- package/src/approvals.ts +7 -1
- package/src/apps.ts +54 -85
- package/src/ast.ts +6 -6
- package/src/authentication.ts +74 -0
- package/src/call-workflow.ts +5 -4
- package/src/call.ts +53 -9
- package/src/cedar.ts +14 -1
- package/src/change-steps.ts +7 -4
- package/src/change.ts +10 -0
- package/src/client.ts +108 -41
- package/src/collection.ts +10 -2
- package/src/config.ts +62 -8
- package/src/connection.ts +446 -0
- package/src/credentials.ts +94 -281
- package/src/db.ts +21 -2
- package/src/define.ts +7 -2
- package/src/definitions.ts +31 -0
- package/src/deployment-key.ts +23 -0
- package/src/describe.ts +102 -230
- package/src/description.ts +426 -0
- package/src/direct.ts +3 -0
- package/src/drift.ts +10 -2
- package/src/env.ts +4 -2
- package/src/index.ts +42 -1
- package/src/ledger.ts +3 -1
- package/src/lint.ts +1 -16
- package/src/load.ts +437 -0
- package/src/lockfile.ts +10 -3
- package/src/op.ts +10 -1
- package/src/outline.ts +18 -5
- package/src/paths.ts +24 -2
- 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 +2 -0
- package/src/sandbox.ts +6 -2
- 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/shared.ts +35 -10
- package/src/sites.ts +70 -180
- 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
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
// `@sanoma-ai/workflows/description`: what `describeConfig` answers, as zod schemas, and its
|
|
2
|
+
// types inferred from them. zod only, no Node: a page can parse a description it is sent, and the
|
|
3
|
+
// app extends `ConfigDescriptionSchema` with what it adds (`AppConfigSchema`).
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { EFFECTS, FIELD_TYPES } from "./shared.js";
|
|
6
|
+
/** A JSON Schema (draft 2020-12), as `jsonSchemaOf` writes one. */
|
|
7
|
+
const JsonSchema = z.record(z.string(), z.unknown());
|
|
8
|
+
/** Where a declaration is: its file, relative to the root with `/`, and the export that holds it (`default` for a default export). */
|
|
9
|
+
export const AtSchema = z.strictObject({ file: z.string(), export: z.string() });
|
|
10
|
+
/** Something wrong in a file, at a line and column from 1 (UTF-16 code units). */
|
|
11
|
+
export const LintProblemSchema = z.strictObject({ line: z.number(), column: z.number(), message: z.string() });
|
|
12
|
+
/**
|
|
13
|
+
* Something wrong in a company's files (a data file, an app's `app.ts`, a site's `site.ts`), or in
|
|
14
|
+
* finding them: at a place in the file when an error's stack gives one, else at an export.
|
|
15
|
+
*/
|
|
16
|
+
export const ResourceProblemSchema = z.strictObject({
|
|
17
|
+
/**
|
|
18
|
+
* The file, relative to the config's root, with `/`: `resources/identity/github.ts`. Absent
|
|
19
|
+
* when the problem is the config's: it has no root.
|
|
20
|
+
*/
|
|
21
|
+
file: z.string().optional(),
|
|
22
|
+
/** The export it is about: `website`, or `default`. */
|
|
23
|
+
export: z.string().optional(),
|
|
24
|
+
/** From 1. */
|
|
25
|
+
line: z.number().optional(),
|
|
26
|
+
/** From 1, in UTF-16 code units. */
|
|
27
|
+
column: z.number().optional(),
|
|
28
|
+
message: z.string(),
|
|
29
|
+
});
|
|
30
|
+
/** A problem at a file, relative to the root: an app's, a site's. */
|
|
31
|
+
const FileProblemSchema = ResourceProblemSchema.extend({ file: z.string() });
|
|
32
|
+
/** A declaration's named connection: which grant of its vendor it is applied with. */
|
|
33
|
+
const ConnectionRefSchema = z.strictObject({
|
|
34
|
+
$connection: z.string(),
|
|
35
|
+
vendor: z.string(),
|
|
36
|
+
revision: z.string().optional(),
|
|
37
|
+
});
|
|
38
|
+
/** A resource a data file declares, as loading the file made it. */
|
|
39
|
+
export const DeclaredResourceSchema = z.strictObject({
|
|
40
|
+
/** `<file>#<export>`, the file relative to the config's root, with `/`: `resources/identity/github.ts#website`. */
|
|
41
|
+
id: z.string(),
|
|
42
|
+
/** The data file it is declared in, as `id` names it: `resources/identity/github.ts`. */
|
|
43
|
+
file: z.string(),
|
|
44
|
+
vendor: z.string(),
|
|
45
|
+
type: z.string(),
|
|
46
|
+
/** What people call it: its identity, else its export's name. */
|
|
47
|
+
name: z.string(),
|
|
48
|
+
/** The import id that finds it unbound: what its type's `find` makes of its fields; absent when the type has none. */
|
|
49
|
+
identity: z.string().optional(),
|
|
50
|
+
/** The vendor's id of the object the lockfile binds it to (`LOCKFILE`); absent when unbound. */
|
|
51
|
+
binding: z.string().optional(),
|
|
52
|
+
/** Its file and export. */
|
|
53
|
+
at: AtSchema,
|
|
54
|
+
/** Its fields, as its type checked them: each resource it names as that resource's `name`. */
|
|
55
|
+
desired: z.record(z.string(), z.unknown()),
|
|
56
|
+
connection: ConnectionRefSchema.optional(),
|
|
57
|
+
/**
|
|
58
|
+
* Where it names another declared resource: the field's dotted path (a list item's with its
|
|
59
|
+
* index, `teams.0`) to that resource's id.
|
|
60
|
+
*/
|
|
61
|
+
refs: z.record(z.string(), z.string()),
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* A collection `resources/data.ts` declares: where it is, for its declaration on Hosting. Its fields are
|
|
65
|
+
* the collection's own (`describeConfig`'s `collections`), from the same file, which the runtime
|
|
66
|
+
* imports.
|
|
67
|
+
*/
|
|
68
|
+
export const DeclaredCollectionSchema = z.strictObject({
|
|
69
|
+
/** `<file>#<export>`, as a resource's: `resources/data.ts#outbound`. */
|
|
70
|
+
id: z.string(),
|
|
71
|
+
/** `resources/data.ts`, or an app's `apps/<app>/resources/data.ts`. */
|
|
72
|
+
file: z.string(),
|
|
73
|
+
/** The collection's name, its operations' middle segments (`data.<name>.get`): an app's with its app, `crm.contacts`. */
|
|
74
|
+
name: z.string(),
|
|
75
|
+
/** Its file and export. */
|
|
76
|
+
at: AtSchema,
|
|
77
|
+
});
|
|
78
|
+
/** A lockfile binding no data file declares, by its key (`<file>#<export>`). */
|
|
79
|
+
const OrphanSchema = z.strictObject({
|
|
80
|
+
key: z.string(),
|
|
81
|
+
type: z.string(),
|
|
82
|
+
id: z.string(),
|
|
83
|
+
connection: ConnectionRefSchema.optional(),
|
|
84
|
+
});
|
|
85
|
+
/** An app: a folder of `apps/`, and what its `app.ts` declares. */
|
|
86
|
+
export const AppEntrySchema = z.strictObject({
|
|
87
|
+
/** The folder's name, which prefixes what it declares (`crm.contacts`) and is the app's title. */
|
|
88
|
+
name: z.string(),
|
|
89
|
+
/** The folder, relative to the root, with `/`: `apps/crm`. */
|
|
90
|
+
dir: z.string(),
|
|
91
|
+
/** `defineApp({ source })` in its `app.ts`: the repository it was taken from; absent for the company's own app. */
|
|
92
|
+
source: z.string().optional(),
|
|
93
|
+
/** Its `app.ts`'s default export, when it has the file. */
|
|
94
|
+
at: AtSchema.optional(),
|
|
95
|
+
});
|
|
96
|
+
/** A call a site's code makes: `<RunForm workflow="…" />`, or a use of `api`. */
|
|
97
|
+
export const SiteCallSchema = z.strictObject({
|
|
98
|
+
/** What it calls: a workflow, a collection (`api.data.<name>.<op>`) or an operation (`api.<vendor>.<resource>.<op>`). */
|
|
99
|
+
kind: z.enum(["workflow", "collection", "op"]),
|
|
100
|
+
/**
|
|
101
|
+
* The workflow's name (`RunForm`'s `workflow`, or the workflow whose `apiNameOf` is the name
|
|
102
|
+
* `api` gives; that name itself when none is), the collection's name, or the operation's id.
|
|
103
|
+
*/
|
|
104
|
+
target: z.string(),
|
|
105
|
+
/**
|
|
106
|
+
* What it calls of the workflow (`start`, or a read of its runs: `result`, `latest`, …) or the
|
|
107
|
+
* collection (`list`, `save`, …), as written; absent for a workflow called as itself or by
|
|
108
|
+
* `RunForm`, which starts it, and for an operation.
|
|
109
|
+
*/
|
|
110
|
+
method: z.string().optional(),
|
|
111
|
+
/** `<RunForm workflow="…" />` or a call on `api`, from `sanoma/site`. */
|
|
112
|
+
via: z.enum(["RunForm", "api"]),
|
|
113
|
+
/** The file, relative to the config's root, with `/`: `sites/sales/routes/index.tsx`. */
|
|
114
|
+
file: z.string(),
|
|
115
|
+
/** From 1. */
|
|
116
|
+
line: z.number(),
|
|
117
|
+
/** From 1, in UTF-16 code units. */
|
|
118
|
+
column: z.number(),
|
|
119
|
+
/**
|
|
120
|
+
* The path of the page the file is, from its `createFileRoute` (or `createLazyFileRoute`) id: groups and pathless
|
|
121
|
+
* segments left out, no trailing slash (`/sites/sales`). Absent for a file that is no page,
|
|
122
|
+
* such as a component's.
|
|
123
|
+
*/
|
|
124
|
+
page: z.string().optional(),
|
|
125
|
+
});
|
|
126
|
+
/** A page of a site: a route file's path, and for a page per content entry the kind it reads. */
|
|
127
|
+
export const SitePageSchema = z.strictObject({
|
|
128
|
+
/** As `SiteCall.page` has it: `/sites/www`, `/sites/www/blog/$slug`. */
|
|
129
|
+
path: z.string(),
|
|
130
|
+
/**
|
|
131
|
+
* For a path with one parameter (`$slug`), the content kind whose entries are its pages: the one
|
|
132
|
+
* kind its file reads by that parameter, `content.<kind>.get(params.slug)` (or `slug`,
|
|
133
|
+
* destructured) with `content` from `sanoma/site`.
|
|
134
|
+
*/
|
|
135
|
+
content: z.string().optional(),
|
|
136
|
+
/**
|
|
137
|
+
* `false` when its route says `staticData: { sitemap: false }`, written out: the sitemap leaves it
|
|
138
|
+
* out. Its index route's `sitemap` (`true` or `false`) decides over a layout's at its path; a
|
|
139
|
+
* pathless or group layout's says nothing.
|
|
140
|
+
*/
|
|
141
|
+
sitemap: z.literal(false).optional(),
|
|
142
|
+
});
|
|
143
|
+
/** A site, `sites/<name>/` or an app's `apps/<app>/sites/<name>/`, and what it calls. */
|
|
144
|
+
export const SiteEntrySchema = z.strictObject({
|
|
145
|
+
/** Its folder's name, `<app>/<name>` for an app's (`siteKey`): where it is mounted, `/sites/<name>`. */
|
|
146
|
+
name: z.string(),
|
|
147
|
+
/** The app whose folder holds it (`apps/<app>/sites/`); absent for one at the root. */
|
|
148
|
+
app: z.string().optional(),
|
|
149
|
+
/** Its `site.ts`'s default export, when it has the file. */
|
|
150
|
+
at: AtSchema.optional(),
|
|
151
|
+
/** `defineSite({ title })` in its `site.ts`. */
|
|
152
|
+
title: z.string().optional(),
|
|
153
|
+
/** `defineSite({ icon })` in its `site.ts`: a Lucide icon's name, as written. */
|
|
154
|
+
icon: z.string().optional(),
|
|
155
|
+
/** `defineSite({ public: true })`: served to visitors, not people. */
|
|
156
|
+
public: z.literal(true).optional(),
|
|
157
|
+
/** `defineSite({ login })`, the connector whose login half signs visitors in: one that names none is among `problems`. */
|
|
158
|
+
login: z.string().optional(),
|
|
159
|
+
/**
|
|
160
|
+
* `defineSite({ locales })`, a public site's languages, the first its default: kept only when
|
|
161
|
+
* every one is a `LOCALE`, written once, on a public site with no login; else a problem.
|
|
162
|
+
*/
|
|
163
|
+
locales: z.array(z.string()).optional(),
|
|
164
|
+
/** The host a public site answers on: set by `startApp` from its `domains`, never by `readSites`. */
|
|
165
|
+
domain: z.string().optional(),
|
|
166
|
+
/** Its pages, by path: one for each path its `routes/` files give (a layout and its index are one). */
|
|
167
|
+
pages: z.array(SitePageSchema),
|
|
168
|
+
/** Its calls, by file and then in the file's order. */
|
|
169
|
+
calls: z.array(SiteCallSchema),
|
|
170
|
+
/**
|
|
171
|
+
* Each call to a workflow, a collection or an operation the config does not have, or to an
|
|
172
|
+
* operation a page may not call directly, or, on a public site, that no policy lets a visitor
|
|
173
|
+
* make, at its file; then what is wrong in its `site.ts`.
|
|
174
|
+
*/
|
|
175
|
+
problems: z.array(FileProblemSchema),
|
|
176
|
+
/**
|
|
177
|
+
* On a public site, each page with one parameter whose file reads content the sitemap cannot
|
|
178
|
+
* tie to it (`SitePage.content`), so the sitemap lists none of its pages: at the first read.
|
|
179
|
+
*/
|
|
180
|
+
warnings: z.array(LintProblemSchema.extend({ file: z.string() })),
|
|
181
|
+
});
|
|
182
|
+
/** `manual`, or the schedule a workflow starts on (`defineWorkflow`'s `trigger`). */
|
|
183
|
+
const TriggerSchema = z.union([
|
|
184
|
+
z.literal("manual"),
|
|
185
|
+
z.strictObject({ schedule: z.string(), timezone: z.string().optional() }),
|
|
186
|
+
]);
|
|
187
|
+
/** What a workflow is, read from its definition: enough to draw a start form and show what it may call. */
|
|
188
|
+
export const WorkflowEntrySchema = z.strictObject({
|
|
189
|
+
/** Its name: `<app>.<name>` for one an app's folder defines. */
|
|
190
|
+
name: z.string(),
|
|
191
|
+
/** The app whose folder defines it (`apps/<app>/workflows/`); absent for one at the root. */
|
|
192
|
+
app: z.string().optional(),
|
|
193
|
+
title: z.string().optional(),
|
|
194
|
+
/** `manual`, or the schedule it starts on (`defineWorkflow`'s `trigger`). */
|
|
195
|
+
trigger: TriggerSchema,
|
|
196
|
+
/**
|
|
197
|
+
* Set for a workflow the runtime adds itself, `drift`, `apply` or `call`, rather than the config: a label. It
|
|
198
|
+
* starts like any other.
|
|
199
|
+
*/
|
|
200
|
+
builtin: z.literal(true).optional(),
|
|
201
|
+
/** The input, as JSON Schema (draft 2020-12), from the zod schema. */
|
|
202
|
+
input: JsonSchema,
|
|
203
|
+
/** Operation ids the workflow may call, in the order declared. */
|
|
204
|
+
ops: z.array(z.string()),
|
|
205
|
+
/** Built-ins the workflow may call. */
|
|
206
|
+
builtins: z.array(z.enum(["approval", "sleep", "all"])),
|
|
207
|
+
/** The file that defined it, absolute. */
|
|
208
|
+
file: z.string(),
|
|
209
|
+
/** What its `run` calls, in order, read from its file (`outlineWorkflow`), which the worker holds its runs to. */
|
|
210
|
+
outline: z.custom(),
|
|
211
|
+
/**
|
|
212
|
+
* What is wrong in its file, by position: what `lintWorkflow` finds (syntax, an import a
|
|
213
|
+
* workflow may not make, `instanceof` against the runtime's error classes, what the outline
|
|
214
|
+
* cannot draw in each `run`), read the one way the outline is, so a check sees what the
|
|
215
|
+
* worker refuses; and, at 1:1, an outline error that is the file's (it cannot be read, or holds
|
|
216
|
+
* no workflow of this name). A file defining several workflows gives each its problems. Empty
|
|
217
|
+
* for the built-in `drift`, which the package's tests hold to the lint.
|
|
218
|
+
*/
|
|
219
|
+
problems: z.array(LintProblemSchema),
|
|
220
|
+
/**
|
|
221
|
+
* The text the outline's spans index into: the workflow's file, with `\n` line endings.
|
|
222
|
+
* Absent only when the outline is `{ error }`. Whole files: a server may keep it from clients.
|
|
223
|
+
*/
|
|
224
|
+
source: z.string().optional(),
|
|
225
|
+
});
|
|
226
|
+
/** What an operation is, read from its connector: enough to badge it and show its contract. */
|
|
227
|
+
export const OpEntrySchema = z.strictObject({
|
|
228
|
+
id: z.string(),
|
|
229
|
+
vendor: z.string(),
|
|
230
|
+
resource: z.string(),
|
|
231
|
+
name: z.string(),
|
|
232
|
+
effect: z.enum(EFFECTS),
|
|
233
|
+
idempotent: z.boolean(),
|
|
234
|
+
description: z.string().optional(),
|
|
235
|
+
/** How a scenario's steps name it: Cucumber expressions over its input's fields. */
|
|
236
|
+
phrases: z.strictObject({ given: z.string().optional(), expect: z.string().optional() }).optional(),
|
|
237
|
+
/** Whether it may be called directly, outside a run (`isDirect`): the one rule, read here, never derived again. */
|
|
238
|
+
direct: z.boolean(),
|
|
239
|
+
/** What a call sends, as JSON Schema (`io: "input"`: fields with defaults are optional). */
|
|
240
|
+
input: JsonSchema,
|
|
241
|
+
/** What a call returns once its schema has parsed the vendor's reply (`io: "output"`). */
|
|
242
|
+
output: JsonSchema,
|
|
243
|
+
});
|
|
244
|
+
/** Who a vendor is, from its connector's `VendorInfo`: enough to name it, show its logo and link to its connector. */
|
|
245
|
+
export const VendorEntrySchema = z.strictObject({
|
|
246
|
+
/** The connector's `title`, else the vendor's id. */
|
|
247
|
+
title: z.string(),
|
|
248
|
+
/** The logo as `data:image/svg+xml` URLs, for an `<img>`: `dark` is for dark backgrounds. */
|
|
249
|
+
logo: z.strictObject({ src: z.string(), dark: z.string().optional() }).optional(),
|
|
250
|
+
/** The connector's npm package name. */
|
|
251
|
+
package: z.string().optional(),
|
|
252
|
+
/** The connector package's `homepage` from its package.json: where its code and README are, as an https URL. */
|
|
253
|
+
homepage: z.string().optional(),
|
|
254
|
+
/** Whether the vendor's connector attaches a fake (`withSetup`), for sandbox runs. */
|
|
255
|
+
fake: z.boolean(),
|
|
256
|
+
/**
|
|
257
|
+
* The environment variables its driver declares (`defineDriver`'s `env`), in declared order:
|
|
258
|
+
* each name, its one-line manual and whether it may be unset; never a value or a status
|
|
259
|
+
* (`SanomaClient.credentials` says those). Absent when its driver declares none.
|
|
260
|
+
*/
|
|
261
|
+
credentials: z
|
|
262
|
+
.array(z.strictObject({ name: z.string(), description: z.string().optional(), optional: z.literal(true).optional() }))
|
|
263
|
+
.optional(),
|
|
264
|
+
});
|
|
265
|
+
/**
|
|
266
|
+
* The contracts a resource type meets, from its spec: `host`, `database` and `wakeup` (`Host`,
|
|
267
|
+
* `Database`, `Wakeup`), and `source` for a type a host's `source` names (the repository it clones).
|
|
268
|
+
*/
|
|
269
|
+
export const CAPABILITIES = ["host", "database", "wakeup", "source"];
|
|
270
|
+
/** A resource type a connector declares with `defineResource`. */
|
|
271
|
+
export const ResourceTypeEntrySchema = z.strictObject({
|
|
272
|
+
/** `<vendor>.<type>`, such as `github.repository`. */
|
|
273
|
+
id: z.string(),
|
|
274
|
+
vendor: z.string(),
|
|
275
|
+
type: z.string(),
|
|
276
|
+
title: z.string(),
|
|
277
|
+
/** How a declared resource's identity is made, such as `name` or `repository_id:pattern`; absent when it is found only by its binding. */
|
|
278
|
+
identity: z.string().optional(),
|
|
279
|
+
/** Its flagged fields, by dotted path. */
|
|
280
|
+
fields: z.custom(),
|
|
281
|
+
/**
|
|
282
|
+
* Its state, as a read returns it, as JSON Schema (`io: "output"`), with `$id`
|
|
283
|
+
* `sanoma:resource-type/<id>`: the operations' contracts `$ref` it instead of repeating it.
|
|
284
|
+
*/
|
|
285
|
+
schema: JsonSchema,
|
|
286
|
+
/** Its operations' ids, sorted: `<id>.import` and `<id>.read`, and for a writable type its change operations. */
|
|
287
|
+
ops: z.array(z.string()),
|
|
288
|
+
/** The contracts it meets (`CAPABILITIES`), in that order; absent when it meets none. */
|
|
289
|
+
capabilities: z.array(z.enum(CAPABILITIES)).optional(),
|
|
290
|
+
});
|
|
291
|
+
/** A collection's field as declared: its type, or `{ type, optional }`, or `{ enum, optional }`. */
|
|
292
|
+
const FieldSchema = z.union([
|
|
293
|
+
z.enum(FIELD_TYPES),
|
|
294
|
+
z.strictObject({ type: z.enum(FIELD_TYPES), optional: z.literal(true).optional() }),
|
|
295
|
+
z.strictObject({ enum: z.tuple([z.string()], z.string()).readonly(), optional: z.literal(true).optional() }),
|
|
296
|
+
]);
|
|
297
|
+
/** A collection the config declares (`collection()`). */
|
|
298
|
+
export const CollectionEntrySchema = z.strictObject({
|
|
299
|
+
/** Its name: `<app>.<name>` for one an app's `resources/data.ts` declares. */
|
|
300
|
+
name: z.string(),
|
|
301
|
+
/** The app whose folder declares it (`apps/<app>/resources/data.ts`); absent for one at the root. */
|
|
302
|
+
app: z.string().optional(),
|
|
303
|
+
title: z.string().optional(),
|
|
304
|
+
/** The field each record is found by. */
|
|
305
|
+
key: z.string(),
|
|
306
|
+
/** Its fields as declared. */
|
|
307
|
+
fields: z.record(z.string(), FieldSchema),
|
|
308
|
+
/** What `save` accepts, as JSON Schema, with `$id` `sanoma:collection/<name>`. */
|
|
309
|
+
record: JsonSchema,
|
|
310
|
+
/** Its operations' ids: `data.<name>.get`, `.list`, `.save` and `.delete`. */
|
|
311
|
+
ops: z.array(z.string()),
|
|
312
|
+
/** Where `resources/data.ts` declares it, read as the data files are; absent for one declared elsewhere. */
|
|
313
|
+
declared: DeclaredCollectionSchema.optional(),
|
|
314
|
+
});
|
|
315
|
+
/**
|
|
316
|
+
* A plain-JSON description of what a config can do: its workflows, the operations they call,
|
|
317
|
+
* and whether a policy gates them. The app server builds it from the config and sends it to the
|
|
318
|
+
* browser, so the UI shows exactly what the worker enforces. Never written by hand.
|
|
319
|
+
*/
|
|
320
|
+
export const ConfigDescriptionSchema = z.strictObject({
|
|
321
|
+
secrets: z
|
|
322
|
+
.strictObject({
|
|
323
|
+
store: z.string(),
|
|
324
|
+
namespace: z.string(),
|
|
325
|
+
bindings: z.record(z.string(), z.strictObject({ path: z.string(), management: z.enum(["sanoma", "external"]), store: z.string() })),
|
|
326
|
+
})
|
|
327
|
+
.optional(),
|
|
328
|
+
connections: z
|
|
329
|
+
.array(z.strictObject({
|
|
330
|
+
id: z.string(),
|
|
331
|
+
vendor: z.string(),
|
|
332
|
+
method: z.string(),
|
|
333
|
+
scopes: z.array(z.string()).readonly(),
|
|
334
|
+
account: z.string().optional(),
|
|
335
|
+
default: z.boolean(),
|
|
336
|
+
}))
|
|
337
|
+
.optional(),
|
|
338
|
+
appName: z.string(),
|
|
339
|
+
/** The application version runs started now are stamped with. */
|
|
340
|
+
version: z.string(),
|
|
341
|
+
workflows: z.array(WorkflowEntrySchema),
|
|
342
|
+
ops: z.array(OpEntrySchema),
|
|
343
|
+
/** Every vendor the operations are from, by its id (an `OpEntry`'s `vendor`). */
|
|
344
|
+
vendors: z.record(z.string(), VendorEntrySchema),
|
|
345
|
+
/** The resource types the connectors declare, by `id`. */
|
|
346
|
+
resourceTypes: z.array(ResourceTypeEntrySchema),
|
|
347
|
+
/** The config's collections, by name. */
|
|
348
|
+
collections: z.array(CollectionEntrySchema),
|
|
349
|
+
/**
|
|
350
|
+
* The resources the data files under `resources/` declare, by file and then in file order,
|
|
351
|
+
* less any with a problem and any that names one.
|
|
352
|
+
*/
|
|
353
|
+
resources: z.array(DeclaredResourceSchema),
|
|
354
|
+
/** Each binding in the lockfile (`LOCKFILE`) whose key no data file declares, as `loadDataFiles` reports it. */
|
|
355
|
+
orphans: z.array(OrphanSchema),
|
|
356
|
+
/**
|
|
357
|
+
* What is wrong in the data files (`loadDataFiles`) and the apps (a folder of `apps/` that is no
|
|
358
|
+
* app, an `app.ts` that cannot be read, a collection or site at the root named as an app is),
|
|
359
|
+
* each at its file, relative to the root, and its line and column or its export. A workflow's are on its entry.
|
|
360
|
+
*/
|
|
361
|
+
problems: z.array(ResourceProblemSchema),
|
|
362
|
+
/** The apps under `apps/` (`readApps`), by name. Each workflow, collection and site an app declares names it (`app`). */
|
|
363
|
+
apps: z.array(AppEntrySchema),
|
|
364
|
+
/**
|
|
365
|
+
* `defined` when the root has `policies/**\/*.cedar` (else the policy is `allowAll`), with their
|
|
366
|
+
* `version`, or while they have `problems` (`policyProblems`), none: then every call and start is
|
|
367
|
+
* refused. `files` are those files as read (`readPolicyFiles`): the root's, then each app's.
|
|
368
|
+
*/
|
|
369
|
+
policy: z.strictObject({
|
|
370
|
+
defined: z.boolean(),
|
|
371
|
+
version: z.string().optional(),
|
|
372
|
+
problems: z.array(z.string()).optional(),
|
|
373
|
+
files: z.array(z.strictObject({ file: z.string(), text: z.string() })),
|
|
374
|
+
}),
|
|
375
|
+
/**
|
|
376
|
+
* The sites under `sites/`, by name, with what each calls (`readSites`), and its calls to what
|
|
377
|
+
* the config does not have as its problems; none when the root has no `sites/`.
|
|
378
|
+
*/
|
|
379
|
+
sites: z.array(SiteEntrySchema),
|
|
380
|
+
});
|
|
381
|
+
//# sourceMappingURL=description.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description.js","sourceRoot":"","sources":["../src/description.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,kGAAkG;AAClG,+EAA+E;AAC/E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEnD,mEAAmE;AACnE,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAErD,sIAAsI;AACtI,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAGjF,kFAAkF;AAClF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAG/G;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,YAAY,CAAC;IAClD;;;OAGG;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,uDAAuD;IACvD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,cAAc;IACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,oCAAoC;IACp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AAC,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;KACvE,CAAC;IACF;;;OAGG;IACH,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC;CAChC,CAAC,CAAC"}
|
package/dist/direct.js
CHANGED
|
@@ -10,5 +10,8 @@ import { APPS_LIST, DATA_VENDOR } from "./shared.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export const isDirect = (op, types) => op.vendor === DATA_VENDOR ||
|
|
12
12
|
op.id === APPS_LIST ||
|
|
13
|
+
op.id === "sanoma.connection.disconnect" ||
|
|
14
|
+
op.id === "sanoma.connection.bind" ||
|
|
15
|
+
op.id === "sanoma.connection.create" ||
|
|
13
16
|
(op.effect === "read" && op.vendor !== "sanoma" && !isResourceOp(op, types));
|
|
14
17
|
//# sourceMappingURL=direct.js.map
|
package/dist/direct.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"direct.js","sourceRoot":"","sources":["../src/direct.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,EAAqD,EACrD,KAAmC,EAC1B,EAAE,CACX,EAAE,CAAC,MAAM,KAAK,WAAW;IACzB,EAAE,CAAC,EAAE,KAAK,SAAS;IACnB,CAAC,EAAE,CAAC,MAAM,KAAK,MAAM,IAAI,EAAE,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"direct.js","sourceRoot":"","sources":["../src/direct.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,EAAqD,EACrD,KAAmC,EAC1B,EAAE,CACX,EAAE,CAAC,MAAM,KAAK,WAAW;IACzB,EAAE,CAAC,EAAE,KAAK,SAAS;IACnB,EAAE,CAAC,EAAE,KAAK,8BAA8B;IACxC,EAAE,CAAC,EAAE,KAAK,wBAAwB;IAClC,EAAE,CAAC,EAAE,KAAK,0BAA0B;IACpC,CAAC,EAAE,CAAC,MAAM,KAAK,MAAM,IAAI,EAAE,CAAC,MAAM,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC"}
|
package/dist/drift.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export declare const DriftInput: z.ZodObject<{}, z.core.$strict>;
|
|
|
53
53
|
* write-only values, and the problems.
|
|
54
54
|
*/
|
|
55
55
|
export interface DriftDeclared {
|
|
56
|
-
resources: Pick<DeclaredResource, "id" | "vendor" | "type" | "name" | "identity" | "binding" | "desired" | "refs">[];
|
|
56
|
+
resources: Pick<DeclaredResource, "id" | "vendor" | "type" | "name" | "identity" | "binding" | "desired" | "refs" | "connection">[];
|
|
57
57
|
problems: ResourceProblem[];
|
|
58
58
|
}
|
|
59
59
|
type State = Record<string, unknown>;
|
package/dist/drift.js
CHANGED
|
@@ -120,7 +120,7 @@ export function driftWorkflow(types, ops, drivers, declared) {
|
|
|
120
120
|
found.set(resource.id, by);
|
|
121
121
|
else {
|
|
122
122
|
try {
|
|
123
|
-
found.set(resource.id, observed(await ctx[resource.vendor][resource.type].import({ id: by.id })));
|
|
123
|
+
found.set(resource.id, observed(await ctx[resource.vendor][resource.type].import({ id: by.id }, { connection: resource.connection })));
|
|
124
124
|
}
|
|
125
125
|
catch (err) {
|
|
126
126
|
if (isRunControlError(err))
|
package/dist/drift.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drift.js","sourceRoot":"","sources":["../src/drift.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAA2B,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAmB,YAAY,EAAE,WAAW,EAAiB,OAAO,EAAE,MAAM,eAAe,CAAC;AAEnG,OAAO,EAAuB,YAAY,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA8C7C;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"drift.js","sourceRoot":"","sources":["../src/drift.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAA2B,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAmB,YAAY,EAAE,WAAW,EAAiB,OAAO,EAAE,MAAM,eAAe,CAAC;AAEnG,OAAO,EAAuB,YAAY,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAC;AAG7D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AA8C7C;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAqBhD,2HAA2H;AAC3H,MAAM,SAAS,GAAG,gDAAgD,CAAC;AAOnE,gGAAgG;AAChG,kGAAkG;AAClG,iGA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EAAE,EAAE,IAAI,EAAE,CAAC;IAC/C,MAAM,MAAM,GACV,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACnH,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACrF,CAAC"}
|
package/dist/env.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { SecretLocation } from "./secret-store.ts";
|
|
1
2
|
import type { Driver, DriverEnv } from "./op.ts";
|
|
2
3
|
/** One environment variable a driver declares in `env`, and whether its value lets the driver run: never the value. */
|
|
3
4
|
export interface CredentialStatus {
|
|
5
|
+
location?: SecretLocation;
|
|
4
6
|
/** The variable's name, such as `GHOST_ADMIN_API_KEY`. */
|
|
5
7
|
name: string;
|
|
6
8
|
/** Its one-line manual, from its schema's `.describe()`. */
|
package/dist/env.js
CHANGED
|
@@ -67,10 +67,10 @@ function credentialStatus(name, schema, value) {
|
|
|
67
67
|
function check(schema, value) {
|
|
68
68
|
try {
|
|
69
69
|
const { success, error } = schema.safeParse(value);
|
|
70
|
-
return { success, ...(error && { problem:
|
|
70
|
+
return { success, ...(error && { problem: "does not match the required format" }) };
|
|
71
71
|
}
|
|
72
72
|
catch {
|
|
73
|
-
return { success: false, problem: "
|
|
73
|
+
return { success: false, problem: "does not match the required format" };
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
/** A schema's `.describe()`, also through `.optional()`, `.default()` and `.prefault()` in any order. */
|
package/dist/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA6B9C;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAC3B,OAAoC,EACpC,MAA4C;IAE5C,MAAM,GAAG,GAAG,IAAI,GAAG,EAA8B,CAAC;IAClD,KAAK,MAAM,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,OAAO;QAAE,IAAI,GAAG;YAAE,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3F,OAAO,GAAG,CAAC;AACb,CAAC;AAED,wGAAwG;AACxG,MAAM,UAAU,UAAU,CAAC,GAAc,EAAE,MAA4C;IACrF,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC;AACtH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,MAAc,EAAE,QAAqC;IAChF,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,IAAI,CAAC,OAAO,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACjC,CAAC,CAAC,MAAM,KAAK,SAAS;QACpB,CAAC,CAA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ACjD,QAAQ,EAAE,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,OAAO;QAC1C,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QAChE,GAAG,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,CAAC;KAC1C,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,KAAK,CAAC,MAAiB,EAAE,KAAyB;IACzD,IAAI,CAAC;QACH,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACnD,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,OAAO,EAAE,oCAAoC,EAAE,CAAC,EAAE,CAAC;IACtF,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,oCAAoC,EAAE,CAAC;IAC3E,CAAC;AACH,CAAC;AAED,yGAAyG;AACzG,SAAS,aAAa,CAAC,MAAiB;IACtC,IAAI,CAAC,GAA0B,MAAM,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW;QAAE,CAAC,GAAG,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAE,CAA6B,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACpG,OAAO,CAAC,EAAE,WAAW,CAAC;AACxB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,16 +3,18 @@ export { SanomaPackageField, vendorInfo } from "./vendor-info.ts";
|
|
|
3
3
|
export { defineWorkflow, Principal, type ApprovalRequest, type ApprovalResult, type ApprovalState, type Approver, type Builtin, type Ctx, type SleepRequest, type StepOptions, type Trigger, type Use, type WorkflowDefinition, } from "./define.ts";
|
|
4
4
|
export { compareDeclared, type Declared, type Declaring, defineResource, diffDeclared, type FieldReference, type PlanAction, type References, type Resource, type ResourceFields, type ResourceOps, type ResourceSpec, withoutWriteOnly, } from "./resource.ts";
|
|
5
5
|
export { declaredWakeup, defineConfig, resolveConfig, resolveDatabaseUrl, type ResolvedConfig, type SanomaConfig, } from "./config.ts";
|
|
6
|
-
export { type
|
|
6
|
+
export { type AppEntry, readApps } from "./apps.ts";
|
|
7
|
+
export { type AppDefinition, defineApp } from "./definitions.ts";
|
|
7
8
|
export { appFolders, APPS_DIR, filesUnder, kindDirs } from "./paths.ts";
|
|
8
9
|
export { isCollection } from "./collection.ts";
|
|
9
10
|
export { type CredentialStatus, credentialsOf } from "./env.ts";
|
|
10
11
|
export { APPLY_WORKFLOW, ApplyInput, type ApplyPlan, type ApplyReport, type ApplyResult, type PlanAnswer, type PlanStep, } from "./apply.ts";
|
|
11
12
|
export { CALL_WORKFLOW, CallInput } from "./call-workflow.ts";
|
|
12
|
-
export { type ChangeDecision, type ChangeDeploy, type ChangeEvent, ChangeFacts, ChangeInput, changeOps, type ChangeReport, type ChangeState, type ChangeVerified, runtimeHold, touchesOf, } from "./change.ts";
|
|
13
|
+
export { ADMIN, type ChangeDecision, type ChangeDeploy, type ChangeEvent, ChangeFacts, ChangeInput, changeOps, type ChangeReport, type ChangeState, type ChangeVerified, isRules, mayDeclarePeople, runtimeHold, touchesOf, } from "./change.ts";
|
|
13
14
|
export { isDirect } from "./direct.ts";
|
|
14
15
|
export { DRIFT_WORKFLOW, type DriftDeclared, type DriftField, type DriftReport, type DriftResult, type DriftStatus, } from "./drift.ts";
|
|
15
16
|
export type { DeclaredResource, ResourceProblem } from "./resources.ts";
|
|
17
|
+
export { peopleSources } from "./resources.ts";
|
|
16
18
|
export { allow, allowAll, approve, approvedFor, type Decision, deny, type Policy, type PolicyCall, type PolicyOp, policyOpOf, type PreviewAnswer, type PreviewRequest, type RecordedDecision, VISITOR_DENIED, } from "./policy.ts";
|
|
17
19
|
export { cedarPolicy, type CedarPolicySource, loadPolicies, POLICIES_DIR, type PolicyProblem, readPolicyFiles, validatePolicies, } from "./cedar.ts";
|
|
18
20
|
export { ApprovalPendingError, errorCode, type ErrorCode, vendorCodeOf, type ErrorInfo, type InputIssue, invalidInput, NotAdmittedError, PolicyDeniedError, RejectedError, SanomaError, WithdrawnError, } from "./errors.ts";
|
|
@@ -35,3 +37,9 @@ export { dbosClient } from "./db.ts";
|
|
|
35
37
|
export { AGENTS, ANONYMOUS, ANONYMOUS_PRINCIPAL, approverLabel, approverOf, CHANGE_CLOSE, CHANGE_EVENT, CHANGE_MERGE, CHANGE_OPEN, CHANGE_REVIEW, CHANGE_TOPIC, CHANGE_WORKFLOW, declaresPeople, type PeopleResource, personOf, principalOf, RUNTIME_AGENTS, HOST_CHECK_AGENT, SCHEDULE_AGENT, credentialReady, DEFAULT_SLEEP_NAME, ENDED_STATUSES, errorMessage, isEnded, isLoopback, isVisitor, mayDecide, problemAt, problemLine, RUN_STATUSES, type RunStatus, VISITORS, visitorPrincipal, warningLine, } from "./shared.ts";
|
|
36
38
|
export { defineDriver, type DriverImpl, type OpIdOf } from "./op.ts";
|
|
37
39
|
export { defineSteps, type Expect, type RunView, type Seed, type Steps } from "./steps.ts";
|
|
40
|
+
export { SecretAccess, SecretStoreError, checkSecretConfiguration, memorySecretStore, type SecretAddress, type SecretBinding, type SecretConfiguration, type SecretLocation, type SecretStore, type SecretStoreCapabilities, type SecretStoreErrorCode, type SecretValue, } from "./secret-store.ts";
|
|
41
|
+
export { defineAuthentication, checkAuthenticationStore, encodeCredentials, decodeCredentials, type Authentication, } from "./authentication.ts";
|
|
42
|
+
export { checkSecretStore, type SecretStoreCheck } from "./secret-store-check.ts";
|
|
43
|
+
export { postgresSecretStore } from "./credentials.ts";
|
|
44
|
+
export { deploymentKey } from "./deployment-key.ts";
|
|
45
|
+
export { defineConnection, defineConnectionRule, connectionRef, connectionOps, type ConnectionRef, type ConnectionDefinition, type ConnectionRule, type ConnectionSnapshot, } from "./connection.ts";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,8 @@ export { defineWorkflow, Principal, } from "./define.js";
|
|
|
4
4
|
export { compareDeclared, defineResource, diffDeclared, withoutWriteOnly, } from "./resource.js";
|
|
5
5
|
export { declaredWakeup, defineConfig, resolveConfig, resolveDatabaseUrl, } from "./config.js";
|
|
6
6
|
// An app's `app.ts` (`defineApp`), and where the launcher finds an app's workflows and data file.
|
|
7
|
-
export {
|
|
7
|
+
export { readApps } from "./apps.js";
|
|
8
|
+
export { defineApp } from "./definitions.js";
|
|
8
9
|
export { appFolders, APPS_DIR, filesUnder, kindDirs } from "./paths.js";
|
|
9
10
|
// `sanoma` itself (the people types' constructors) is at `@sanoma-ai/workflows/resources`, for data files.
|
|
10
11
|
// `collection()` itself is at `@sanoma-ai/workflows/data`, for `resources/data.ts`; this tells one apart, as the launcher does.
|
|
@@ -12,9 +13,10 @@ export { isCollection } from "./collection.js";
|
|
|
12
13
|
export { credentialsOf } from "./env.js";
|
|
13
14
|
export { APPLY_WORKFLOW, ApplyInput, } from "./apply.js";
|
|
14
15
|
export { CALL_WORKFLOW, CallInput } from "./call-workflow.js";
|
|
15
|
-
export { ChangeFacts, ChangeInput, changeOps, runtimeHold, touchesOf, } from "./change.js";
|
|
16
|
+
export { ADMIN, ChangeFacts, ChangeInput, changeOps, isRules, mayDeclarePeople, runtimeHold, touchesOf, } from "./change.js";
|
|
16
17
|
export { isDirect } from "./direct.js";
|
|
17
18
|
export { DRIFT_WORKFLOW, } from "./drift.js";
|
|
19
|
+
export { peopleSources } from "./resources.js";
|
|
18
20
|
export { allow, allowAll, approve, approvedFor, deny, policyOpOf, VISITOR_DENIED, } from "./policy.js";
|
|
19
21
|
export { cedarPolicy, loadPolicies, POLICIES_DIR, readPolicyFiles, validatePolicies, } from "./cedar.js";
|
|
20
22
|
export { ApprovalPendingError, errorCode, vendorCodeOf, invalidInput, NotAdmittedError, PolicyDeniedError, RejectedError, SanomaError, WithdrawnError, } from "./errors.js";
|
|
@@ -41,4 +43,10 @@ export { defineDriver } from "./op.js";
|
|
|
41
43
|
// Steps for Gherkin tests, as data; Cucumber runs them from `@sanoma-ai/workflows/scenario`.
|
|
42
44
|
export { defineSteps } from "./steps.js";
|
|
43
45
|
// defineFake lives at `@sanoma-ai/workflows/fake`: test tooling, not runtime.
|
|
46
|
+
export { SecretAccess, SecretStoreError, checkSecretConfiguration, memorySecretStore, } from "./secret-store.js";
|
|
47
|
+
export { defineAuthentication, checkAuthenticationStore, encodeCredentials, decodeCredentials, } from "./authentication.js";
|
|
48
|
+
export { checkSecretStore } from "./secret-store-check.js";
|
|
49
|
+
export { postgresSecretStore } from "./credentials.js";
|
|
50
|
+
export { deploymentKey } from "./deployment-key.js";
|
|
51
|
+
export { defineConnection, defineConnectionRule, connectionRef, connectionOps, } from "./connection.js";
|
|
44
52
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAOhB,eAAe,EACf,WAAW,EAEX,IAAI,EACJ,YAAY,EAOZ,eAAe,EAEf,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EACL,cAAc,EACd,SAAS,GAYV,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,eAAe,EAGf,cAAc,EACd,YAAY,EAQZ,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,aAAa,EACb,kBAAkB,GAGnB,MAAM,aAAa,CAAC;AACrB,kGAAkG;AAClG,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAOhB,eAAe,EACf,WAAW,EAEX,IAAI,EAC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X,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,WAAW,EACX,YAAY,EAEZ,QAAQ,EACR,gBAAgB,EAChB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,kFAAkF;AAClF,kGAAkG;AAClG,uDAAuD;AACvD,OAAO,EAAE,YAAY,EAAgC,MAAM,SAAS,CAAC;AACrE,6FAA6F;AAC7F,OAAO,EAAE,WAAW,EAAoD,MAAM,YAAY,CAAC;AAC3F,8EAA8E;AAC9E,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,GASlB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAyB,MAAM,yBAAyB,CAAC;AAElF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,aAAa,GAKd,MAAM,iBAAiB,CAAC"}
|
package/dist/ledger.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ConnectionSnapshot } from "./connection.ts";
|
|
1
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
3
|
import { type Db } from "./db.ts";
|
|
3
4
|
import type { Approver, Principal } from "./define.ts";
|
|
@@ -33,6 +34,7 @@ export type LedgerRecord = {
|
|
|
33
34
|
scheduledFor?: string;
|
|
34
35
|
} | {
|
|
35
36
|
type: "op.called";
|
|
37
|
+
connection?: ConnectionSnapshot;
|
|
36
38
|
op: string;
|
|
37
39
|
/**
|
|
38
40
|
* The outline node of the call that made it (`OutlineNode.path`): where the step is in the
|
package/dist/ledger.js
CHANGED
|
@@ -39,7 +39,7 @@ function serialize(record) {
|
|
|
39
39
|
}
|
|
40
40
|
/** The line `jsonlLedger` writes for a record: its JSON and a newline. */
|
|
41
41
|
const lineOf = (record) => `${serialize(record)}\n`;
|
|
42
|
-
const COMPARED = ["type", "input", "decision", "error", "output"];
|
|
42
|
+
const COMPARED = ["type", "input", "decision", "error", "output", "connection"];
|
|
43
43
|
/**
|
|
44
44
|
* The first record with an id stands. Says so when a later one with that id differs where it
|
|
45
45
|
* matters, showing both, so a replay that went another way can be told from a retry. Compared
|