@fluidgrids/cli 2026.1028.2 → 2026.1031.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.
Files changed (69) hide show
  1. package/README.md +102 -3
  2. package/dist/code-first/api.d.ts +244 -0
  3. package/dist/code-first/api.d.ts.map +1 -1
  4. package/dist/code-first/api.js +148 -4
  5. package/dist/code-first/api.js.map +1 -1
  6. package/dist/code-first/code-upload.d.ts +2 -1
  7. package/dist/code-first/code-upload.d.ts.map +1 -1
  8. package/dist/code-first/code-upload.js +5 -1
  9. package/dist/code-first/code-upload.js.map +1 -1
  10. package/dist/code-first/commands/runs.d.ts +80 -14
  11. package/dist/code-first/commands/runs.d.ts.map +1 -1
  12. package/dist/code-first/commands/runs.js +281 -20
  13. package/dist/code-first/commands/runs.js.map +1 -1
  14. package/dist/code-first/commands/suite.d.ts +57 -0
  15. package/dist/code-first/commands/suite.d.ts.map +1 -0
  16. package/dist/code-first/commands/suite.js +197 -0
  17. package/dist/code-first/commands/suite.js.map +1 -0
  18. package/dist/code-first/commands/versions.d.ts +52 -3
  19. package/dist/code-first/commands/versions.d.ts.map +1 -1
  20. package/dist/code-first/commands/versions.js +177 -3
  21. package/dist/code-first/commands/versions.js.map +1 -1
  22. package/dist/code-first/durable-operations.d.ts +1 -2
  23. package/dist/code-first/durable-operations.d.ts.map +1 -1
  24. package/dist/code-first/durable-operations.js +1 -2
  25. package/dist/code-first/durable-operations.js.map +1 -1
  26. package/dist/code-first/index.d.ts +2 -1
  27. package/dist/code-first/index.d.ts.map +1 -1
  28. package/dist/code-first/index.js +2 -1
  29. package/dist/code-first/index.js.map +1 -1
  30. package/dist/code-first/junit.d.ts +24 -0
  31. package/dist/code-first/junit.d.ts.map +1 -0
  32. package/dist/code-first/junit.js +163 -0
  33. package/dist/code-first/junit.js.map +1 -0
  34. package/dist/code-first/lowering.d.ts +13 -0
  35. package/dist/code-first/lowering.d.ts.map +1 -1
  36. package/dist/code-first/lowering.js +24 -1
  37. package/dist/code-first/lowering.js.map +1 -1
  38. package/dist/code-first/operations.d.ts +1 -3
  39. package/dist/code-first/operations.d.ts.map +1 -1
  40. package/dist/code-first/operations.js +1 -3
  41. package/dist/code-first/operations.js.map +1 -1
  42. package/dist/code-first/parity-operations.d.ts +44 -0
  43. package/dist/code-first/parity-operations.d.ts.map +1 -0
  44. package/dist/code-first/parity-operations.js +211 -0
  45. package/dist/code-first/parity-operations.js.map +1 -0
  46. package/dist/code-first/parity.d.ts +83 -0
  47. package/dist/code-first/parity.d.ts.map +1 -0
  48. package/dist/code-first/parity.js +301 -0
  49. package/dist/code-first/parity.js.map +1 -0
  50. package/dist/code-first/redact.d.ts +31 -0
  51. package/dist/code-first/redact.d.ts.map +1 -0
  52. package/dist/code-first/redact.js +150 -0
  53. package/dist/code-first/redact.js.map +1 -0
  54. package/dist/code-first/register.d.ts +9 -1
  55. package/dist/code-first/register.d.ts.map +1 -1
  56. package/dist/code-first/register.js +171 -26
  57. package/dist/code-first/register.js.map +1 -1
  58. package/dist/code-first/shared.d.ts +2 -0
  59. package/dist/code-first/shared.d.ts.map +1 -1
  60. package/dist/code-first/shared.js +1 -0
  61. package/dist/code-first/shared.js.map +1 -1
  62. package/dist/code-first/test-suite-operations.d.ts +16 -0
  63. package/dist/code-first/test-suite-operations.d.ts.map +1 -0
  64. package/dist/code-first/test-suite-operations.js +44 -0
  65. package/dist/code-first/test-suite-operations.js.map +1 -0
  66. package/dist/program.d.ts.map +1 -1
  67. package/dist/program.js +1 -0
  68. package/dist/program.js.map +1 -1
  69. package/package.json +2 -2
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Option parsing shared by the durable-function parity commands (BOFF-9905
3
+ * B19, spec code-first 11): run targets (`--workflow-id` with `--key`), the
4
+ * workflow-id policies, durations, the completion callback and the start
5
+ * options of `runs start`.
6
+ *
7
+ * The service is the authority on every value (it refuses with VALIDATION or,
8
+ * without fluidgrids.durable-parity, FEATURE_DISABLED); the CLI only checks
9
+ * what it can say better up front, and never takes a secret from argv.
10
+ */
11
+ import type { DurableRun, IdConflictPolicy, IdReusePolicy, RunGroupBy, RunRef, RunTarget, StartWorkflowInput, VersioningBehavior } from './api.js';
12
+ import { type CommandEnv } from './shared.js';
13
+ /** `--workflow-id <id> --key <workflowKey> [--first-run-id <id>]`. */
14
+ export interface TargetOptions {
15
+ workflowId?: string;
16
+ key?: string;
17
+ firstRunId?: string;
18
+ }
19
+ /**
20
+ * The run a command acts on: the positional run id, or the latest run of a
21
+ * workflow id. Exactly one of the two forms.
22
+ */
23
+ export declare function runRefOf(runId: string | undefined, options: TargetOptions): RunRef;
24
+ export declare function describeTarget(target: RunTarget): string;
25
+ /** The latest run of a target with its parity fields, or NOT_FOUND. */
26
+ export declare function resolveTarget(env: CommandEnv, target: RunTarget): Promise<DurableRun>;
27
+ /** The run id of a reference (a target resolves to its latest run). */
28
+ export declare function resolveRunId(env: CommandEnv, ref: RunRef): Promise<string>;
29
+ export declare const ID_REUSE_POLICIES: readonly IdReusePolicy[];
30
+ export declare const ID_CONFLICT_POLICIES: readonly IdConflictPolicy[];
31
+ export declare const VERSIONING_BEHAVIORS: readonly VersioningBehavior[];
32
+ export declare const RUN_GROUP_BY: readonly RunGroupBy[];
33
+ export declare function parseIdReuse(raw: string | undefined): IdReusePolicy | undefined;
34
+ export declare function parseIdConflict(raw: string | undefined): IdConflictPolicy | undefined;
35
+ export declare function parseVersioning(raw: string | undefined, flag: string): VersioningBehavior | undefined;
36
+ /** `--group-by status,task-queue`: at most two distinct columns. */
37
+ export declare function parseGroupBy(raw: string | undefined): RunGroupBy[];
38
+ /**
39
+ * A duration as the service takes it: a whole number of milliseconds, or what the workflow IR's
40
+ * `durationMs` reads (`1.5s`, `5m`, `2h`, `7d`, `2w`, ISO 8601 `PT2H` or `P1W`). This is the same
41
+ * check the service runs (`parseDurationMs` in wspace-workflow-svc), so the CLI neither refuses a
42
+ * value the service takes nor sends one it refuses. The service checks the limits (30 days for a
43
+ * start delay, 120 s for a task timeout).
44
+ */
45
+ export declare function parseDuration(raw: string | undefined, flag: string): string | undefined;
46
+ /** `--priority 1..5` (1 is the highest). */
47
+ export declare function parsePriority(raw: string | undefined): number | undefined;
48
+ /**
49
+ * `--callback-header 'Name: value'` (repeatable) and `--callback-header-env 'Name=ENV_VAR'`
50
+ * (repeatable; the value is read from the environment, so a credential stays out of argv).
51
+ * Errors name the option and its position, never the argument: a malformed entry usually still
52
+ * holds a bearer token.
53
+ */
54
+ export declare function parseHeaders(raw: readonly string[] | undefined, fromEnv?: {
55
+ env: CommandEnv;
56
+ entries: readonly string[] | undefined;
57
+ }): Record<string, string> | undefined;
58
+ /** The callback signing secret, read from the named environment variable (never from argv). */
59
+ export declare function readSecretEnv(env: CommandEnv, name: string | undefined): string | undefined;
60
+ /** A JSON object option (`--memo`). */
61
+ export declare function parseJsonObject(raw: string | undefined, flag: string): Record<string, unknown> | undefined;
62
+ /** The parity options of `runs start`. */
63
+ export interface ParityStartOptions {
64
+ workflowId?: string;
65
+ idReuse?: string;
66
+ idConflict?: string;
67
+ delay?: string;
68
+ runTimeout?: string;
69
+ executionTimeout?: string;
70
+ taskTimeout?: string;
71
+ summary?: string;
72
+ detailsFile?: string;
73
+ memo?: string;
74
+ callback?: string;
75
+ callbackHeader?: string[];
76
+ callbackHeaderEnv?: string[];
77
+ callbackSecretEnv?: string;
78
+ priority?: string;
79
+ versioningBehavior?: string;
80
+ }
81
+ /** The parity fields of a StartWorkflowInput from `runs start` options; empty without any. */
82
+ export declare function parityStartFields(env: CommandEnv, options: ParityStartOptions): Partial<StartWorkflowInput>;
83
+ //# sourceMappingURL=parity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parity.d.ts","sourceRoot":"","sources":["../../src/code-first/parity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,MAAM,EACN,SAAS,EACT,kBAAkB,E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AAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,8FAA8F;AAC9F,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAgE7B"}
@@ -0,0 +1,301 @@
1
+ /**
2
+ * Option parsing shared by the durable-function parity commands (BOFF-9905
3
+ * B19, spec code-first 11): run targets (`--workflow-id` with `--key`), the
4
+ * workflow-id policies, durations, the completion callback and the start
5
+ * options of `runs start`.
6
+ *
7
+ * The service is the authority on every value (it refuses with VALIDATION or,
8
+ * without fluidgrids.durable-parity, FEATURE_DISABLED); the CLI only checks
9
+ * what it can say better up front, and never takes a secret from argv.
10
+ */
11
+ import { readFileSync } from 'fs';
12
+ import { resolve } from 'path';
13
+ import { CliUserError } from '@burdenoff/cli-sdk/core';
14
+ import { durationMs } from '@fluidgrids/workflows/ir';
15
+ import { describeError, parseJsonOption } from './shared.js';
16
+ /**
17
+ * The run a command acts on: the positional run id, or the latest run of a
18
+ * workflow id. Exactly one of the two forms.
19
+ */
20
+ export function runRefOf(runId, options) {
21
+ const targeted = options.workflowId !== undefined ||
22
+ options.key !== undefined ||
23
+ options.firstRunId !== undefined;
24
+ if (!targeted) {
25
+ if (runId === undefined || runId.trim() === '') {
26
+ throw new CliUserError('Give a run id, or --workflow-id with --key.');
27
+ }
28
+ return { runId };
29
+ }
30
+ if (runId !== undefined) {
31
+ throw new CliUserError('Give a run id or --workflow-id with --key, not both.');
32
+ }
33
+ const workflowId = options.workflowId?.trim() ?? '';
34
+ const key = options.key?.trim() ?? '';
35
+ if (workflowId === '' || key === '') {
36
+ throw new CliUserError('--workflow-id and --key go together (the workflow id of that key).');
37
+ }
38
+ const target = { workflowKey: key, workflowId };
39
+ if (options.firstRunId !== undefined) {
40
+ if (options.firstRunId.trim() === '')
41
+ throw new CliUserError('--first-run-id cannot be empty.');
42
+ target.firstRunId = options.firstRunId;
43
+ }
44
+ return { target };
45
+ }
46
+ export function describeTarget(target) {
47
+ return `workflow id ${target.workflowId} of ${target.workflowKey}`;
48
+ }
49
+ /** The latest run of a target with its parity fields, or NOT_FOUND. */
50
+ export async function resolveTarget(env, target) {
51
+ const run = await env.api.runByWorkflowId(target);
52
+ if (!run)
53
+ throw new CliUserError(`No run with ${describeTarget(target)} (NOT_FOUND)`);
54
+ return run;
55
+ }
56
+ /** The run id of a reference (a target resolves to its latest run). */
57
+ export async function resolveRunId(env, ref) {
58
+ return 'runId' in ref ? ref.runId : (await resolveTarget(env, ref.target)).id;
59
+ }
60
+ /** An enum option given as `use-existing`, `USE_EXISTING` or `use_existing`. */
61
+ function parseEnum(raw, flag, allowed) {
62
+ if (raw === undefined)
63
+ return undefined;
64
+ const normal = raw.trim().toUpperCase().replace(/-/g, '_');
65
+ const match = allowed.find((value) => value === normal);
66
+ if (match === undefined) {
67
+ const shown = allowed.map((value) => value.toLowerCase().replace(/_/g, '-'));
68
+ throw new CliUserError(`Invalid value '${raw}' for ${flag}. Allowed: ${shown.join(', ')}`);
69
+ }
70
+ return match;
71
+ }
72
+ export const ID_REUSE_POLICIES = [
73
+ 'ALLOW_DUPLICATE',
74
+ 'ALLOW_DUPLICATE_FAILED_ONLY',
75
+ 'REJECT_DUPLICATE',
76
+ ];
77
+ export const ID_CONFLICT_POLICIES = [
78
+ 'FAIL',
79
+ 'USE_EXISTING',
80
+ 'TERMINATE_EXISTING',
81
+ ];
82
+ export const VERSIONING_BEHAVIORS = ['PINNED', 'AUTO_UPGRADE'];
83
+ export const RUN_GROUP_BY = [
84
+ 'STATUS',
85
+ 'WORKFLOW_KEY',
86
+ 'EXECUTION_KIND',
87
+ 'TASK_QUEUE',
88
+ ];
89
+ export function parseIdReuse(raw) {
90
+ return parseEnum(raw, '--id-reuse', ID_REUSE_POLICIES);
91
+ }
92
+ export function parseIdConflict(raw) {
93
+ return parseEnum(raw, '--id-conflict', ID_CONFLICT_POLICIES);
94
+ }
95
+ export function parseVersioning(raw, flag) {
96
+ return parseEnum(raw, flag, VERSIONING_BEHAVIORS);
97
+ }
98
+ /** `--group-by status,task-queue`: at most two distinct columns. */
99
+ export function parseGroupBy(raw) {
100
+ if (raw === undefined)
101
+ return [];
102
+ const columns = [];
103
+ for (const part of raw.split(',')) {
104
+ const column = parseEnum(part.trim() === '' ? undefined : part, '--group-by', RUN_GROUP_BY);
105
+ if (column)
106
+ columns.push(column);
107
+ }
108
+ const distinct = [...new Set(columns)];
109
+ if (distinct.length === 0)
110
+ throw new CliUserError('--group-by needs a column.');
111
+ if (distinct.length > 2)
112
+ throw new CliUserError('--group-by takes at most two columns.');
113
+ return distinct;
114
+ }
115
+ /**
116
+ * A duration as the service takes it: a whole number of milliseconds, or what the workflow IR's
117
+ * `durationMs` reads (`1.5s`, `5m`, `2h`, `7d`, `2w`, ISO 8601 `PT2H` or `P1W`). This is the same
118
+ * check the service runs (`parseDurationMs` in wspace-workflow-svc), so the CLI neither refuses a
119
+ * value the service takes nor sends one it refuses. The service checks the limits (30 days for a
120
+ * start delay, 120 s for a task timeout).
121
+ */
122
+ export function parseDuration(raw, flag) {
123
+ if (raw === undefined)
124
+ return undefined;
125
+ const value = raw.trim();
126
+ if (/^\d+$/.test(value))
127
+ return value;
128
+ const ms = value === '' ? undefined : durationMs(value, 'ms');
129
+ if (ms === undefined || !Number.isFinite(ms)) {
130
+ throw new CliUserError(`Invalid value '${raw}' for ${flag}: expected milliseconds or a duration such as 1.5s, 5m, 2h, 2w or PT2H.`);
131
+ }
132
+ return value;
133
+ }
134
+ /** `--priority 1..5` (1 is the highest). */
135
+ export function parsePriority(raw) {
136
+ if (raw === undefined)
137
+ return undefined;
138
+ if (!/^[1-5]$/.test(raw.trim())) {
139
+ throw new CliUserError(`Invalid value '${raw}' for --priority: expected 1 (highest) to 5.`);
140
+ }
141
+ return Number(raw.trim());
142
+ }
143
+ /** Header names the callback cannot set (the service refuses them too). */
144
+ const RESERVED_HEADER = /^(host|content-.*|user-agent|x-fluidgrids-.*|connection|keep-alive|transfer-encoding|te|trailer|upgrade|proxy-.*)$/i;
145
+ const HEADER_NAME = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
146
+ const ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/;
147
+ function addHeader(headers, name, value) {
148
+ if (RESERVED_HEADER.test(name)) {
149
+ throw new CliUserError(`--callback-header cannot set ${name}.`);
150
+ }
151
+ const lower = name.toLowerCase();
152
+ if (Object.keys(headers).some((existing) => existing.toLowerCase() === lower)) {
153
+ throw new CliUserError(`--callback-header ${name} is given twice.`);
154
+ }
155
+ Object.defineProperty(headers, name, {
156
+ value,
157
+ enumerable: true,
158
+ writable: true,
159
+ configurable: true,
160
+ });
161
+ }
162
+ /**
163
+ * `--callback-header 'Name: value'` (repeatable) and `--callback-header-env 'Name=ENV_VAR'`
164
+ * (repeatable; the value is read from the environment, so a credential stays out of argv).
165
+ * Errors name the option and its position, never the argument: a malformed entry usually still
166
+ * holds a bearer token.
167
+ */
168
+ export function parseHeaders(raw, fromEnv) {
169
+ const envEntries = fromEnv?.entries ?? [];
170
+ if ((raw === undefined || raw.length === 0) && envEntries.length === 0)
171
+ return undefined;
172
+ const headers = {};
173
+ (raw ?? []).forEach((entry, index) => {
174
+ const at = entry.indexOf(':');
175
+ const name = (at < 0 ? '' : entry.slice(0, at)).trim();
176
+ if (!HEADER_NAME.test(name)) {
177
+ throw new CliUserError(`Invalid --callback-header #${index + 1}: expected 'Name: value' with a header name before the colon (the argument is not printed).`);
178
+ }
179
+ addHeader(headers, name, entry.slice(at + 1).trim());
180
+ });
181
+ envEntries.forEach((entry, index) => {
182
+ const at = entry.indexOf('=');
183
+ const name = (at < 0 ? '' : entry.slice(0, at)).trim();
184
+ const variable = at < 0 ? '' : entry.slice(at + 1).trim();
185
+ if (!HEADER_NAME.test(name) || !ENV_NAME.test(variable)) {
186
+ throw new CliUserError(`Invalid --callback-header-env #${index + 1}: expected 'Name=ENV_VAR' (the argument is not printed).`);
187
+ }
188
+ const value = fromEnv?.env.getEnv(variable);
189
+ if (value === undefined || value.trim() === '') {
190
+ throw new CliUserError(`The environment variable ${variable} (--callback-header-env ${name}) is empty or unset.`);
191
+ }
192
+ addHeader(headers, name, value.trim());
193
+ });
194
+ return headers;
195
+ }
196
+ /** The callback signing secret, read from the named environment variable (never from argv). */
197
+ export function readSecretEnv(env, name) {
198
+ if (name === undefined)
199
+ return undefined;
200
+ if (!ENV_NAME.test(name)) {
201
+ throw new CliUserError(`Invalid environment variable name for --callback-secret-env.`);
202
+ }
203
+ const value = env.getEnv(name);
204
+ if (value === undefined || value.trim() === '') {
205
+ throw new CliUserError(`The environment variable ${name} (--callback-secret-env) is empty or unset.`);
206
+ }
207
+ if (value.length < 16 || value.length > 512) {
208
+ throw new CliUserError(`The signing secret in ${name} must be 16 to 512 characters long (it has ${value.length}).`);
209
+ }
210
+ return value;
211
+ }
212
+ /** A JSON object option (`--memo`). */
213
+ export function parseJsonObject(raw, flag) {
214
+ const value = parseJsonOption(raw, flag);
215
+ if (value === undefined)
216
+ return undefined;
217
+ if (typeof value !== 'object' || value === null || Array.isArray(value)) {
218
+ throw new CliUserError(`${flag} must be a JSON object.`);
219
+ }
220
+ // Checked above to be a plain JSON object.
221
+ return value;
222
+ }
223
+ /** The parity fields of a StartWorkflowInput from `runs start` options; empty without any. */
224
+ export function parityStartFields(env, options) {
225
+ const fields = {};
226
+ if (options.workflowId !== undefined) {
227
+ if (options.workflowId.trim() === '')
228
+ throw new CliUserError('--workflow-id cannot be empty.');
229
+ fields.workflowId = options.workflowId;
230
+ }
231
+ const reuse = parseIdReuse(options.idReuse);
232
+ if (reuse)
233
+ fields.idReusePolicy = reuse;
234
+ const conflict = parseIdConflict(options.idConflict);
235
+ if (conflict)
236
+ fields.idConflictPolicy = conflict;
237
+ if (conflict === 'TERMINATE_EXISTING' && fields.workflowId === undefined) {
238
+ throw new CliUserError('--id-conflict terminate-existing needs --workflow-id.');
239
+ }
240
+ const delay = parseDuration(options.delay, '--delay');
241
+ if (delay)
242
+ fields.startDelay = delay;
243
+ const runTimeout = parseDuration(options.runTimeout, '--run-timeout');
244
+ if (runTimeout)
245
+ fields.runTimeout = runTimeout;
246
+ const executionTimeout = parseDuration(options.executionTimeout, '--execution-timeout');
247
+ if (executionTimeout)
248
+ fields.executionTimeout = executionTimeout;
249
+ const taskTimeout = parseDuration(options.taskTimeout, '--task-timeout');
250
+ if (taskTimeout)
251
+ fields.workflowTaskTimeout = taskTimeout;
252
+ if (options.summary !== undefined)
253
+ fields.summary = options.summary;
254
+ if (options.detailsFile !== undefined) {
255
+ const path = resolve(env.cwd(), options.detailsFile);
256
+ try {
257
+ fields.details = readFileSync(path, 'utf8');
258
+ }
259
+ catch (error) {
260
+ throw new CliUserError(`Cannot read --details-file ${options.detailsFile}: ${describeError(error)}`);
261
+ }
262
+ }
263
+ const memo = parseJsonObject(options.memo, '--memo');
264
+ if (memo)
265
+ fields.context = memo;
266
+ const headers = parseHeaders(options.callbackHeader, {
267
+ env,
268
+ entries: options.callbackHeaderEnv,
269
+ });
270
+ const secret = readSecretEnv(env, options.callbackSecretEnv);
271
+ if (options.callback === undefined) {
272
+ if (headers || secret !== undefined) {
273
+ throw new CliUserError('--callback-header, --callback-header-env and --callback-secret-env need --callback <url>.');
274
+ }
275
+ }
276
+ else {
277
+ let url;
278
+ try {
279
+ url = new URL(options.callback);
280
+ }
281
+ catch {
282
+ throw new CliUserError(`--callback must be an http(s) URL.`);
283
+ }
284
+ if (url.protocol !== 'https:' && url.protocol !== 'http:') {
285
+ throw new CliUserError(`--callback must be an http(s) URL.`);
286
+ }
287
+ fields.completionCallbackUrl = options.callback;
288
+ if (headers)
289
+ fields.completionCallbackHeaders = headers;
290
+ if (secret !== undefined)
291
+ fields.completionCallbackSigningSecret = secret;
292
+ }
293
+ const priority = parsePriority(options.priority);
294
+ if (priority !== undefined)
295
+ fields.priority = priority;
296
+ const versioning = parseVersioning(options.versioningBehavior, '--versioning-behavior');
297
+ if (versioning)
298
+ fields.versioningBehavior = versioning;
299
+ return fields;
300
+ }
301
+ //# sourceMappingURL=parity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parity.js","sourceRoot":"","sources":["../../src/code-first/parity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAYtD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AAS9E;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAyB,EAAE,OAAsB;IACxE,MAAM,QAAQ,GACZ,OAAO,CAAC,UAAU,KAAK,SAAS;QAChC,OAAO,CAAC,GAAG,KAAK,SAAS;QACzB,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC;IACnC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC/C,MAAM,IAAI,YAAY,CAAC,6CAA6C,CAAC,CAAC;QACxE,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;IACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,YAAY,CAAC,sDAAsD,CAAC,CAAC;IACjF,CAAC;IACD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,EAA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AAG,OAAO,CAAC;QACxD,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM,CAAC,+BAA+B,GAAG,MAAM,CAAC;IAC5E,CAAC;IACD,MAAM,QAAQ,GAAG,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,QAAQ,KAAK,SAAS;QAAE,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IACvD,MAAM,UAAU,GAAG,eAAe,CAAC,OAAO,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC;IACxF,IAAI,UAAU;QAAE,MAAM,CAAC,kBAAkB,GAAG,UAAU,CAAC;IACvD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Keep credentials that travel in GraphQL variables out of anything the CLI prints.
3
+ *
4
+ * graphql-request's ClientError builds its `message` from
5
+ * `JSON.stringify({ response, request: { query, variables } })`, and the cli-sdk error printer
6
+ * falls back to that message whenever the response carries no GraphQL error (a 413 from the
7
+ * gateway's body limit, a 502 from a load balancer, a WAF page). Parity starts carry the
8
+ * completion-callback signing secret and headers in their variables, so without this the CLI
9
+ * printed them on stderr (BOFF-9905 B19-P8).
10
+ */
11
+ export declare const REDACTED = "[REDACTED]";
12
+ /** Deep copy of `value` with every credential value replaced by {@link REDACTED}. */
13
+ export declare function redactVariables(value: unknown): unknown;
14
+ /** Every credential string inside `value` (the values {@link redactVariables} replaces). */
15
+ export declare function collectSecrets(value: unknown, into?: string[]): string[];
16
+ /** Replace every occurrence of each secret (and its JSON-escaped form) in `text`. */
17
+ export declare function scrubSecrets(text: string, secrets: readonly string[]): string;
18
+ /**
19
+ * Strip the request variables out of a gateway error before anything prints it.
20
+ *
21
+ * - An error whose message is a graphql-request ClientError dump (cli-sdk rethrows the
22
+ * ClientError message as a plain Error) keeps only the part before the dump. When that is
23
+ * `GraphQL Error (Code: N)`, the response had no GraphQL error (an HTML 413 or 502 page), and
24
+ * the error becomes a CliUserError, or a CliAuthError for 401/403, naming the status only.
25
+ * - A raw ClientError (an Error with `response` and `request`) is handled the same way from its
26
+ * `response`; with a GraphQL error it keeps its class, its message becomes that error alone and
27
+ * its `request.variables` are redacted.
28
+ * - Every message and stack left has the secrets in `variables` scrubbed.
29
+ */
30
+ export declare function sanitizeGatewayError(err: unknown, variables: Record<string, unknown>): unknown;
31
+ //# sourceMappingURL=redact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/code-first/redact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,eAAO,MAAM,QAAQ,eAAe,CAAC;AAYrC,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAcvD;AAED,4FAA4F;AAC5F,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAgB5E;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAQ7E;AAsCD;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAyB9F"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Keep credentials that travel in GraphQL variables out of anything the CLI prints.
3
+ *
4
+ * graphql-request's ClientError builds its `message` from
5
+ * `JSON.stringify({ response, request: { query, variables } })`, and the cli-sdk error printer
6
+ * falls back to that message whenever the response carries no GraphQL error (a 413 from the
7
+ * gateway's body limit, a 502 from a load balancer, a WAF page). Parity starts carry the
8
+ * completion-callback signing secret and headers in their variables, so without this the CLI
9
+ * printed them on stderr (BOFF-9905 B19-P8).
10
+ */
11
+ import { CliAuthError, CliUserError } from '@burdenoff/cli-sdk/core';
12
+ export const REDACTED = '[REDACTED]';
13
+ /** Variable keys whose values are credentials, whatever their prefix or case. */
14
+ const SENSITIVE_KEY = /(secret|token|password|passphrase|authorization|credential|apikey|api_key)/i;
15
+ /** Keys whose value is a map of header names to (often credential) values. */
16
+ const HEADER_MAP_KEY = /headers$/i;
17
+ function isRecord(value) {
18
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
19
+ }
20
+ /** Deep copy of `value` with every credential value replaced by {@link REDACTED}. */
21
+ export function redactVariables(value) {
22
+ if (Array.isArray(value))
23
+ return value.map((item) => redactVariables(item));
24
+ if (!isRecord(value))
25
+ return value;
26
+ const out = {};
27
+ for (const [key, inner] of Object.entries(value)) {
28
+ if (SENSITIVE_KEY.test(key)) {
29
+ out[key] = inner === null || inner === undefined ? inner : REDACTED;
30
+ }
31
+ else if (HEADER_MAP_KEY.test(key) && isRecord(inner)) {
32
+ out[key] = Object.fromEntries(Object.keys(inner).map((name) => [name, REDACTED]));
33
+ }
34
+ else {
35
+ out[key] = redactVariables(inner);
36
+ }
37
+ }
38
+ return out;
39
+ }
40
+ /** Every credential string inside `value` (the values {@link redactVariables} replaces). */
41
+ export function collectSecrets(value, into = []) {
42
+ if (Array.isArray(value)) {
43
+ for (const item of value)
44
+ collectSecrets(item, into);
45
+ return into;
46
+ }
47
+ if (!isRecord(value))
48
+ return into;
49
+ for (const [key, inner] of Object.entries(value)) {
50
+ if (SENSITIVE_KEY.test(key) && typeof inner === 'string') {
51
+ into.push(inner);
52
+ }
53
+ else if (HEADER_MAP_KEY.test(key) && isRecord(inner)) {
54
+ for (const header of Object.values(inner))
55
+ if (typeof header === 'string')
56
+ into.push(header);
57
+ }
58
+ else {
59
+ collectSecrets(inner, into);
60
+ }
61
+ }
62
+ return into;
63
+ }
64
+ /** Replace every occurrence of each secret (and its JSON-escaped form) in `text`. */
65
+ export function scrubSecrets(text, secrets) {
66
+ let out = text;
67
+ for (const secret of secrets) {
68
+ if (secret.length === 0)
69
+ continue;
70
+ const escaped = JSON.stringify(secret).slice(1, -1);
71
+ for (const form of new Set([secret, escaped]))
72
+ out = out.split(form).join(REDACTED);
73
+ }
74
+ return out;
75
+ }
76
+ function firstGraphQLMessage(response) {
77
+ const errors = response['errors'];
78
+ if (!Array.isArray(errors))
79
+ return undefined;
80
+ const first = errors[0];
81
+ if (!isRecord(first))
82
+ return undefined;
83
+ const message = first['message'];
84
+ return typeof message === 'string' && message.length > 0 ? message : undefined;
85
+ }
86
+ /** graphql-request's ClientError message: `<first GraphQL error | GraphQL Error (Code: N)>: <JSON>`. */
87
+ const CLIENT_ERROR_DUMP = ': {"response":';
88
+ const NO_GRAPHQL_ERROR = /^GraphQL Error \(Code: (\d{3})\)$/;
89
+ /** Remove a ClientError dump (it ends at the end of its line: JSON escapes newlines). */
90
+ function dropDump(text) {
91
+ const start = text.indexOf(CLIENT_ERROR_DUMP);
92
+ if (start < 0)
93
+ return text;
94
+ const end = text.indexOf('\n', start);
95
+ return end < 0 ? text.slice(0, start) : text.slice(0, start) + text.slice(end);
96
+ }
97
+ function httpStatusError(status) {
98
+ const what = `The workspace gateway answered HTTP ${status ?? 'error'} with no GraphQL error.`;
99
+ if (status === 401 || status === 403) {
100
+ return new CliAuthError(what, {
101
+ hint: 'Run `fluidgrids auth login` again, or check FLUIDGRIDS_TOKEN.',
102
+ });
103
+ }
104
+ return new CliUserError(what, status === 413
105
+ ? { hint: 'The request is larger than the gateway accepts.' }
106
+ : { hint: 'Retry; if it persists, check the gateway status.' });
107
+ }
108
+ /**
109
+ * Strip the request variables out of a gateway error before anything prints it.
110
+ *
111
+ * - An error whose message is a graphql-request ClientError dump (cli-sdk rethrows the
112
+ * ClientError message as a plain Error) keeps only the part before the dump. When that is
113
+ * `GraphQL Error (Code: N)`, the response had no GraphQL error (an HTML 413 or 502 page), and
114
+ * the error becomes a CliUserError, or a CliAuthError for 401/403, naming the status only.
115
+ * - A raw ClientError (an Error with `response` and `request`) is handled the same way from its
116
+ * `response`; with a GraphQL error it keeps its class, its message becomes that error alone and
117
+ * its `request.variables` are redacted.
118
+ * - Every message and stack left has the secrets in `variables` scrubbed.
119
+ */
120
+ export function sanitizeGatewayError(err, variables) {
121
+ if (!(err instanceof Error))
122
+ return err;
123
+ const secrets = collectSecrets(variables);
124
+ const response = Reflect.get(err, 'response');
125
+ const request = Reflect.get(err, 'request');
126
+ if (isRecord(response) && isRecord(request)) {
127
+ const status = response['status'];
128
+ const graphQLMessage = firstGraphQLMessage(response);
129
+ if (graphQLMessage === undefined) {
130
+ return httpStatusError(typeof status === 'number' ? status : undefined);
131
+ }
132
+ err.message = graphQLMessage;
133
+ Reflect.set(err, 'request', { ...request, variables: redactVariables(request['variables']) });
134
+ }
135
+ else {
136
+ const dump = err.message.indexOf(CLIENT_ERROR_DUMP);
137
+ if (dump >= 0) {
138
+ const head = err.message.slice(0, dump);
139
+ const noGraphQLError = NO_GRAPHQL_ERROR.exec(head);
140
+ if (noGraphQLError)
141
+ return httpStatusError(Number(noGraphQLError[1]));
142
+ err.message = head;
143
+ }
144
+ }
145
+ err.message = scrubSecrets(err.message, secrets);
146
+ if (typeof err.stack === 'string')
147
+ err.stack = scrubSecrets(dropDump(err.stack), secrets);
148
+ return err;
149
+ }
150
+ //# sourceMappingURL=redact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/code-first/redact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAC;AAErC,iFAAiF;AACjF,MAAM,aAAa,GAAG,6EAA6E,CAAC;AAEpG,8EAA8E;AAC9E,MAAM,cAAc,GAAG,WAAW,CAAC;AAEnC,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;A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C,CAAC,EAAE,CAAC,CAAC;IAChG,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QACpD,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;YACd,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;YACxC,MAAM,cAAc,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACnD,IAAI,cAAc;gBAAE,OAAO,eAAe,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACtE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;QACrB,CAAC;IACH,CAAC;IACD,GAAG,CAAC,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ;QAAE,GAAG,CAAC,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;IAC1F,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -21,7 +21,15 @@ export declare function registerInterface(program: Command, env: CommandEnv): vo
21
21
  /**
22
22
  * Durable-function commands (Phase B): `runs start|describe|history|signal|
23
23
  * terminate|stack` on the cli-sdk `runs` group, plus the top-level `history`,
24
- * `signal`, `replay`, `test`, `run` and `versions list`.
24
+ * `signal`, `replay`, `test`, `run` and `versions list`. `test <workflowKey>`
25
+ * runs a workflow's saved test cases on the service instead (BOFF-9960).
26
+ *
27
+ * Durable-function parity (BOFF-9905 B19): the parity options of `runs start`,
28
+ * run targets (`--workflow-id --key`) on `runs describe|history|signal|cancel|
29
+ * terminate|stack|result`, `runs describe --pending`, `runs result
30
+ * --follow-runs`, `runs count`, `runs stack --metadata`, and `versions
31
+ * rollout|rollout delete|drainage|override`. `runs cancel` replaces the cli-sdk
32
+ * command of the same name.
25
33
  */
26
34
  export declare function registerDurable(program: Command, env: CommandEnv): void;
27
35
  //# sourceMappingURL=register.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/code-first/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC,OAAO,EAEL,KAAK,UAAU,EAGhB,MAAM,aAAa,CAAC;AAQrB,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAgBpE;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAavE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAkBpE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAgCpE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAYpE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAgBxE;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAetE;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAUzE;AAoCD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI,CAmHvE"}
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../src/code-first/register.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG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