@fluidgrids/cli 2026.1028.1 → 2026.1029.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 +100 -3
- package/dist/code-first/api.d.ts +380 -0
- package/dist/code-first/api.d.ts.map +1 -1
- package/dist/code-first/api.js +256 -1
- package/dist/code-first/api.js.map +1 -1
- package/dist/code-first/code-upload.d.ts +53 -0
- package/dist/code-first/code-upload.d.ts.map +1 -0
- package/dist/code-first/code-upload.js +165 -0
- package/dist/code-first/code-upload.js.map +1 -0
- package/dist/code-first/commands/hotfix.d.ts +54 -0
- package/dist/code-first/commands/hotfix.d.ts.map +1 -0
- package/dist/code-first/commands/hotfix.js +225 -0
- package/dist/code-first/commands/hotfix.js.map +1 -0
- package/dist/code-first/commands/push.d.ts +47 -1
- package/dist/code-first/commands/push.d.ts.map +1 -1
- package/dist/code-first/commands/push.js +115 -19
- package/dist/code-first/commands/push.js.map +1 -1
- package/dist/code-first/commands/replay.d.ts +44 -0
- package/dist/code-first/commands/replay.d.ts.map +1 -0
- package/dist/code-first/commands/replay.js +238 -0
- package/dist/code-first/commands/replay.js.map +1 -0
- package/dist/code-first/commands/runs.d.ts +160 -0
- package/dist/code-first/commands/runs.d.ts.map +1 -0
- package/dist/code-first/commands/runs.js +565 -0
- package/dist/code-first/commands/runs.js.map +1 -0
- package/dist/code-first/commands/validate.d.ts +4 -0
- package/dist/code-first/commands/validate.d.ts.map +1 -1
- package/dist/code-first/commands/validate.js +31 -6
- package/dist/code-first/commands/validate.js.map +1 -1
- package/dist/code-first/commands/versions.d.ts +63 -0
- package/dist/code-first/commands/versions.d.ts.map +1 -0
- package/dist/code-first/commands/versions.js +204 -0
- package/dist/code-first/commands/versions.js.map +1 -0
- package/dist/code-first/durable-operations.d.ts +41 -0
- package/dist/code-first/durable-operations.d.ts.map +1 -0
- package/dist/code-first/durable-operations.js +135 -0
- package/dist/code-first/durable-operations.js.map +1 -0
- package/dist/code-first/history.d.ts +30 -0
- package/dist/code-first/history.d.ts.map +1 -0
- package/dist/code-first/history.js +139 -0
- package/dist/code-first/history.js.map +1 -0
- package/dist/code-first/imports.d.ts +22 -0
- package/dist/code-first/imports.d.ts.map +1 -0
- package/dist/code-first/imports.js +67 -0
- package/dist/code-first/imports.js.map +1 -0
- package/dist/code-first/index.d.ts +4 -1
- package/dist/code-first/index.d.ts.map +1 -1
- package/dist/code-first/index.js +6 -2
- package/dist/code-first/index.js.map +1 -1
- package/dist/code-first/lowering.d.ts +53 -1
- package/dist/code-first/lowering.d.ts.map +1 -1
- package/dist/code-first/lowering.js +126 -6
- package/dist/code-first/lowering.js.map +1 -1
- package/dist/code-first/operations.d.ts +1 -3
- package/dist/code-first/operations.d.ts.map +1 -1
- package/dist/code-first/operations.js +1 -3
- package/dist/code-first/operations.js.map +1 -1
- package/dist/code-first/parity-operations.d.ts +44 -0
- package/dist/code-first/parity-operations.d.ts.map +1 -0
- package/dist/code-first/parity-operations.js +211 -0
- package/dist/code-first/parity-operations.js.map +1 -0
- package/dist/code-first/parity.d.ts +83 -0
- package/dist/code-first/parity.d.ts.map +1 -0
- package/dist/code-first/parity.js +301 -0
- package/dist/code-first/parity.js.map +1 -0
- package/dist/code-first/presigned.d.ts +21 -0
- package/dist/code-first/presigned.d.ts.map +1 -0
- package/dist/code-first/presigned.js +85 -0
- package/dist/code-first/presigned.js.map +1 -0
- package/dist/code-first/project.d.ts +9 -0
- package/dist/code-first/project.d.ts.map +1 -1
- package/dist/code-first/project.js +22 -0
- package/dist/code-first/project.js.map +1 -1
- package/dist/code-first/python.d.ts +11 -0
- package/dist/code-first/python.d.ts.map +1 -1
- package/dist/code-first/python.js +31 -1
- package/dist/code-first/python.js.map +1 -1
- package/dist/code-first/redact.d.ts +31 -0
- package/dist/code-first/redact.d.ts.map +1 -0
- package/dist/code-first/redact.js +150 -0
- package/dist/code-first/redact.js.map +1 -0
- package/dist/code-first/register.d.ts +13 -0
- package/dist/code-first/register.d.ts.map +1 -1
- package/dist/code-first/register.js +275 -2
- package/dist/code-first/register.js.map +1 -1
- package/dist/code-first/remote.d.ts.map +1 -1
- package/dist/code-first/remote.js +6 -0
- package/dist/code-first/remote.js.map +1 -1
- package/dist/code-first/replay.d.ts +36 -0
- package/dist/code-first/replay.d.ts.map +1 -0
- package/dist/code-first/replay.js +52 -0
- package/dist/code-first/replay.js.map +1 -0
- package/dist/code-first/shared.d.ts +14 -0
- package/dist/code-first/shared.d.ts.map +1 -1
- package/dist/code-first/shared.js +37 -0
- package/dist/code-first/shared.js.map +1 -1
- package/package.json +2 -2
|
@@ -11,6 +11,7 @@ import { explainUnresolved, placeholderRef } from '../connections.js';
|
|
|
11
11
|
import { lowerProject } from '../lowering.js';
|
|
12
12
|
import { assertProjectWorkspace, loadProject } from '../project.js';
|
|
13
13
|
import { projectConnectionIndex } from '../remote.js';
|
|
14
|
+
import { durableSummary } from './push.js';
|
|
14
15
|
import { emit, requireKnownKeys } from '../shared.js';
|
|
15
16
|
export async function runValidate(env, keys, options) {
|
|
16
17
|
if (options.offline && options.remote) {
|
|
@@ -44,6 +45,19 @@ export async function runValidate(env, keys, options) {
|
|
|
44
45
|
: lowered.workflows;
|
|
45
46
|
if (selected.length === 0)
|
|
46
47
|
throw new CliUserError('The project defines no workflows.');
|
|
48
|
+
// Durable-function findings `push` refuses (Phase C features, refused
|
|
49
|
+
// activity types), on the workflow they belong to; a finding no workflow of
|
|
50
|
+
// the project claims goes to the project-level list.
|
|
51
|
+
const owner = (issue) => lowered.workflows.find((workflow) => issue.key !== undefined ? workflow.key === issue.key : workflow.path === issue.module);
|
|
52
|
+
const durableIssue = (issue) => ({
|
|
53
|
+
source: 'local',
|
|
54
|
+
code: issue.code,
|
|
55
|
+
message: issue.message,
|
|
56
|
+
path: issue.module,
|
|
57
|
+
});
|
|
58
|
+
const projectErrors = lowered.issues
|
|
59
|
+
.filter((issue) => owner(issue) === undefined)
|
|
60
|
+
.map(durableIssue);
|
|
47
61
|
const items = [];
|
|
48
62
|
for (const workflow of selected) {
|
|
49
63
|
const local = validate(workflow.definition, { strict: options.strict === true });
|
|
@@ -54,7 +68,10 @@ export async function runValidate(env, keys, options) {
|
|
|
54
68
|
...(issue.nodeId ? { nodeId: issue.nodeId } : {}),
|
|
55
69
|
...(issue.path ? { path: issue.path } : {}),
|
|
56
70
|
});
|
|
57
|
-
const errors =
|
|
71
|
+
const errors = [
|
|
72
|
+
...lowered.issues.filter((issue) => owner(issue) === workflow).map(durableIssue),
|
|
73
|
+
...local.errors.map(toIssue),
|
|
74
|
+
];
|
|
58
75
|
const warnings = local.warnings.map(toIssue);
|
|
59
76
|
if (options.remote) {
|
|
60
77
|
const remote = await env.api.validateDefinition(workflow.definition, options.strict === true);
|
|
@@ -82,6 +99,8 @@ export async function runValidate(env, keys, options) {
|
|
|
82
99
|
const result = {
|
|
83
100
|
strict: options.strict === true,
|
|
84
101
|
connectionsChecked: connectionIndex !== undefined,
|
|
102
|
+
valid: projectErrors.length === 0 && items.every((item) => item.valid),
|
|
103
|
+
errors: projectErrors,
|
|
85
104
|
workflows: items,
|
|
86
105
|
};
|
|
87
106
|
const line = (key, level, issue) => {
|
|
@@ -89,10 +108,13 @@ export async function runValidate(env, keys, options) {
|
|
|
89
108
|
const code = issue.code ? `${issue.code} ` : '';
|
|
90
109
|
return `${key}: ${level} ${code}${where ? `(${where}) ` : ''}${issue.message}${issue.source === 'service' ? ' [service]' : ''}`;
|
|
91
110
|
};
|
|
92
|
-
const details =
|
|
93
|
-
...
|
|
94
|
-
...
|
|
95
|
-
|
|
111
|
+
const details = [
|
|
112
|
+
...projectErrors.map((issue) => line('project', 'error', issue)),
|
|
113
|
+
...items.flatMap((item) => [
|
|
114
|
+
...item.errors.map((issue) => line(item.key, 'error', issue)),
|
|
115
|
+
...item.warnings.map((issue) => line(item.key, 'warning', issue)),
|
|
116
|
+
]),
|
|
117
|
+
];
|
|
96
118
|
if (!result.connectionsChecked)
|
|
97
119
|
details.push('Connection names were not resolved (--offline).');
|
|
98
120
|
details.push(...lowered.warnings);
|
|
@@ -107,8 +129,11 @@ export async function runValidate(env, keys, options) {
|
|
|
107
129
|
]),
|
|
108
130
|
}, details);
|
|
109
131
|
const invalid = items.filter((item) => !item.valid).map((item) => item.key);
|
|
132
|
+
if (projectErrors.length > 0)
|
|
133
|
+
invalid.unshift('the project');
|
|
110
134
|
if (invalid.length > 0) {
|
|
111
|
-
|
|
135
|
+
const durable = lowered.issues.length > 0 ? `; ${durableSummary(lowered.issues)}` : '';
|
|
136
|
+
throw new CliUserError(`Invalid: ${invalid.join(', ')}${durable}`);
|
|
112
137
|
}
|
|
113
138
|
return result;
|
|
114
139
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/code-first/commands/validate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAwB,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/code-first/commands/validate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAwB,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAyC,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAA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Y,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `fluidgrids versions list <key>`: every stored version of a workflow with
|
|
3
|
+
* the code bundle it references (`workflowCodeBundle`), so the build each
|
|
4
|
+
* version runs, the builds a hotfix kept compatible and when it was replaced
|
|
5
|
+
* are visible.
|
|
6
|
+
*
|
|
7
|
+
* Durable-function parity (BOFF-9905 B19, spec code-first 11 §2.27; each
|
|
8
|
+
* needs fluidgrids.durable-parity, which the service checks):
|
|
9
|
+
*
|
|
10
|
+
* | Command | Operation |
|
|
11
|
+
* |---|---|
|
|
12
|
+
* | `versions rollout <key>` | `workflowRollouts` |
|
|
13
|
+
* | `versions rollout <key> --to <version> --percent <n>` | `setWorkflowRollout` |
|
|
14
|
+
* | `versions rollout delete <key>` | `deleteWorkflowRollout` |
|
|
15
|
+
* | `versions drainage <key> <version>` | `workflowVersionDrainage` |
|
|
16
|
+
* | `versions override <runId> --pin <version> \| --auto-upgrade \| --clear` | `setWorkflowRunVersioningOverride` |
|
|
17
|
+
*/
|
|
18
|
+
import type { CodeBundleInfo, DurableRun, RemoteVersion, VersionDrainage, WorkflowRollout } from '../api.js';
|
|
19
|
+
import { type TargetOptions } from '../parity.js';
|
|
20
|
+
import { type CommandEnv, type OutputOptions } from '../shared.js';
|
|
21
|
+
export interface VersionRow extends RemoteVersion {
|
|
22
|
+
bundle: CodeBundleInfo | null;
|
|
23
|
+
}
|
|
24
|
+
export declare function runVersionsList(env: CommandEnv, workflowKey: string, options: OutputOptions): Promise<VersionRow[]>;
|
|
25
|
+
export interface RolloutOptions extends OutputOptions {
|
|
26
|
+
to?: string;
|
|
27
|
+
percent?: string;
|
|
28
|
+
from?: string;
|
|
29
|
+
environment?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Without `--to`: the workflow's rollouts. With `--to` and `--percent`: create
|
|
33
|
+
* or change the PROD rollout (`percent: 100` promotes the version through the
|
|
34
|
+
* activation check and removes the rollout).
|
|
35
|
+
*/
|
|
36
|
+
export declare function runRollout(env: CommandEnv, workflowKey: string, options: RolloutOptions): Promise<WorkflowRollout[] | WorkflowRollout>;
|
|
37
|
+
export interface RolloutDeleteOptions extends OutputOptions {
|
|
38
|
+
environment?: string;
|
|
39
|
+
force?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Merge what the parent `versions rollout` command parsed into the `delete` options. Options typed
|
|
43
|
+
* before `delete` (`rollout --environment STAGING delete k`) land on the parent; the environment
|
|
44
|
+
* is honoured when it does not contradict the subcommand's own, and the setter-only options are
|
|
45
|
+
* refused so a delete never silently ignores them.
|
|
46
|
+
*/
|
|
47
|
+
export declare function rolloutDeleteOptions(options: RolloutDeleteOptions, parent: Record<string, unknown>): RolloutDeleteOptions;
|
|
48
|
+
/** Remove a rollout: every automatic start runs the ACTIVE version again. */
|
|
49
|
+
export declare function runRolloutDelete(env: CommandEnv, workflowKey: string, options: RolloutDeleteOptions): Promise<boolean>;
|
|
50
|
+
/** Whether a version's bundle still serves open runs. */
|
|
51
|
+
export declare function runDrainage(env: CommandEnv, workflowKey: string, version: string, options: OutputOptions): Promise<VersionDrainage>;
|
|
52
|
+
export interface OverrideOptions extends OutputOptions, TargetOptions {
|
|
53
|
+
pin?: string;
|
|
54
|
+
autoUpgrade?: boolean;
|
|
55
|
+
clear?: boolean;
|
|
56
|
+
reason?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Set or remove a run's versioning override. A change that moves the run to
|
|
60
|
+
* another bundle is replay-checked by the service first (`pendingOverride`).
|
|
61
|
+
*/
|
|
62
|
+
export declare function runOverride(env: CommandEnv, runId: string | undefined, options: OverrideOptions): Promise<DurableRun>;
|
|
63
|
+
//# sourceMappingURL=versions.d.ts.map
|
|
@@ -0,0 +1 @@
|
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UAAU,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,OAAO,CAAC,CA2BlB;AAID,yDAAyD;AACzD,wBAAsB,WAAW,CAC/B,GAAG,EAAE,UAAU,EACf,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,eAAe,CAAC,CAe1B;AAID,MAAM,WAAW,eAAgB,SAAQ,aAAa,EAAE,aAAa;IACnE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,UAAU,CAAC,CAkCrB"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `fluidgrids versions list <key>`: every stored version of a workflow with
|
|
3
|
+
* the code bundle it references (`workflowCodeBundle`), so the build each
|
|
4
|
+
* version runs, the builds a hotfix kept compatible and when it was replaced
|
|
5
|
+
* are visible.
|
|
6
|
+
*
|
|
7
|
+
* Durable-function parity (BOFF-9905 B19, spec code-first 11 §2.27; each
|
|
8
|
+
* needs fluidgrids.durable-parity, which the service checks):
|
|
9
|
+
*
|
|
10
|
+
* | Command | Operation |
|
|
11
|
+
* |---|---|
|
|
12
|
+
* | `versions rollout <key>` | `workflowRollouts` |
|
|
13
|
+
* | `versions rollout <key> --to <version> --percent <n>` | `setWorkflowRollout` |
|
|
14
|
+
* | `versions rollout delete <key>` | `deleteWorkflowRollout` |
|
|
15
|
+
* | `versions drainage <key> <version>` | `workflowVersionDrainage` |
|
|
16
|
+
* | `versions override <runId> --pin <version> \| --auto-upgrade \| --clear` | `setWorkflowRunVersioningOverride` |
|
|
17
|
+
*/
|
|
18
|
+
import { createInterface } from 'readline/promises';
|
|
19
|
+
import { CliUserError } from '@burdenoff/cli-sdk/core';
|
|
20
|
+
import { runRefOf } from '../parity.js';
|
|
21
|
+
import { sortVersions } from '../remote.js';
|
|
22
|
+
import { emit, parseChoice } from '../shared.js';
|
|
23
|
+
export async function runVersionsList(env, workflowKey, options) {
|
|
24
|
+
const versions = sortVersions(await env.api.workflowVersions(workflowKey));
|
|
25
|
+
const rows = [];
|
|
26
|
+
for (const version of versions) {
|
|
27
|
+
rows.push({ ...version, bundle: await env.api.codeBundle(workflowKey, version.version) });
|
|
28
|
+
}
|
|
29
|
+
emit(env, options, rows, {
|
|
30
|
+
headers: ['Version', 'Status', 'Active', 'Created', 'Build', 'SDK', 'Replaced'],
|
|
31
|
+
rows: rows.map((row) => [
|
|
32
|
+
row.version,
|
|
33
|
+
row.status,
|
|
34
|
+
row.isActive ? 'yes' : 'no',
|
|
35
|
+
row.createdAt,
|
|
36
|
+
row.bundle ? row.bundle.buildId : '-',
|
|
37
|
+
row.bundle ? row.bundle.sdkVersion : '-',
|
|
38
|
+
row.bundle?.replacedAt ?? '-',
|
|
39
|
+
]),
|
|
40
|
+
});
|
|
41
|
+
return rows;
|
|
42
|
+
}
|
|
43
|
+
const ENVIRONMENTS = ['PROD', 'STAGING', 'DEV'];
|
|
44
|
+
function rolloutRows(rollouts) {
|
|
45
|
+
return rollouts.map((rollout) => [
|
|
46
|
+
rollout.environment,
|
|
47
|
+
rollout.fromVersion,
|
|
48
|
+
rollout.toVersion,
|
|
49
|
+
`${rollout.percent}%`,
|
|
50
|
+
`${rollout.verifiedPercent}%`,
|
|
51
|
+
rollout.activationCheck
|
|
52
|
+
? `${rollout.activationCheck.kind ?? 'CHECK'} ${rollout.activationCheck.status}`
|
|
53
|
+
: '-',
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
function checkLine(check, what) {
|
|
57
|
+
if (!check || check.status === 'REPLACED' || check.status === 'REJECTED')
|
|
58
|
+
return [];
|
|
59
|
+
return [
|
|
60
|
+
`${what} waits for replay check ${check.id} (${check.kind ?? 'CHECK'} ${check.status}): the affected runs move only once they replay against the new bundle.`,
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
/** `0` to `100`. */
|
|
64
|
+
function parsePercent(raw) {
|
|
65
|
+
if (raw === undefined || !/^\d{1,3}$/.test(raw.trim()) || Number(raw) > 100) {
|
|
66
|
+
throw new CliUserError(`Invalid value '${raw ?? ''}' for --percent: expected 0 to 100.`);
|
|
67
|
+
}
|
|
68
|
+
return Number(raw.trim());
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Without `--to`: the workflow's rollouts. With `--to` and `--percent`: create
|
|
72
|
+
* or change the PROD rollout (`percent: 100` promotes the version through the
|
|
73
|
+
* activation check and removes the rollout).
|
|
74
|
+
*/
|
|
75
|
+
export async function runRollout(env, workflowKey, options) {
|
|
76
|
+
const headers = ['Environment', 'From', 'To', 'Percent', 'Verified', 'Check'];
|
|
77
|
+
if (options.to === undefined && options.percent === undefined) {
|
|
78
|
+
const rollouts = await env.api.workflowRollouts(workflowKey);
|
|
79
|
+
emit(env, options, rollouts, { headers, rows: rolloutRows(rollouts) }, rollouts.length === 0 ? [`${workflowKey} has no rollout.`] : []);
|
|
80
|
+
return rollouts;
|
|
81
|
+
}
|
|
82
|
+
if (options.to === undefined || options.to.trim() === '') {
|
|
83
|
+
throw new CliUserError('--percent needs --to <version>.');
|
|
84
|
+
}
|
|
85
|
+
const input = {
|
|
86
|
+
toVersion: options.to,
|
|
87
|
+
percent: parsePercent(options.percent),
|
|
88
|
+
};
|
|
89
|
+
if (options.from !== undefined)
|
|
90
|
+
input.fromVersion = options.from;
|
|
91
|
+
const environment = parseChoice(options.environment?.toUpperCase(), '--environment', ENVIRONMENTS);
|
|
92
|
+
if (environment)
|
|
93
|
+
input.environment = environment;
|
|
94
|
+
const rollout = await env.api.setWorkflowRollout(workflowKey, input);
|
|
95
|
+
const details = [
|
|
96
|
+
rollout.promoted
|
|
97
|
+
? `${rollout.toVersion} is promoted: it becomes the ACTIVE version${rollout.activationCheck ? ' once its activation check passes' : ''}.`
|
|
98
|
+
: `${rollout.percent}% of new automatic starts of ${workflowKey} run ${rollout.toVersion}.`,
|
|
99
|
+
...checkLine(rollout.activationCheck, 'The rollout'),
|
|
100
|
+
];
|
|
101
|
+
emit(env, options, rollout, { headers, rows: rolloutRows([rollout]) }, details);
|
|
102
|
+
return rollout;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Merge what the parent `versions rollout` command parsed into the `delete` options. Options typed
|
|
106
|
+
* before `delete` (`rollout --environment STAGING delete k`) land on the parent; the environment
|
|
107
|
+
* is honoured when it does not contradict the subcommand's own, and the setter-only options are
|
|
108
|
+
* refused so a delete never silently ignores them.
|
|
109
|
+
*/
|
|
110
|
+
export function rolloutDeleteOptions(options, parent) {
|
|
111
|
+
for (const flag of ['to', 'percent', 'from']) {
|
|
112
|
+
if (parent[flag] !== undefined) {
|
|
113
|
+
throw new CliUserError(`--${flag} does not apply to \`versions rollout delete\`.`);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const inherited = parent['environment'];
|
|
117
|
+
if (typeof inherited !== 'string')
|
|
118
|
+
return options;
|
|
119
|
+
if (options.environment !== undefined && options.environment !== inherited) {
|
|
120
|
+
throw new CliUserError(`Conflicting --environment values '${inherited}' and '${options.environment}'.`);
|
|
121
|
+
}
|
|
122
|
+
return { ...options, environment: inherited };
|
|
123
|
+
}
|
|
124
|
+
async function confirm(question) {
|
|
125
|
+
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
126
|
+
try {
|
|
127
|
+
const answer = await rl.question(`${question} [y/N] `);
|
|
128
|
+
return /^y(es)?$/i.test(answer.trim());
|
|
129
|
+
}
|
|
130
|
+
finally {
|
|
131
|
+
rl.close();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/** Remove a rollout: every automatic start runs the ACTIVE version again. */
|
|
135
|
+
export async function runRolloutDelete(env, workflowKey, options) {
|
|
136
|
+
const environment = parseChoice(options.environment?.toUpperCase(), '--environment', ENVIRONMENTS);
|
|
137
|
+
if (!options.force) {
|
|
138
|
+
if (!env.interactive()) {
|
|
139
|
+
throw new CliUserError(`Removing the rollout of ${workflowKey} needs confirmation.`, {
|
|
140
|
+
hint: 'Pass --force to remove it without a prompt.',
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (!(await confirm(`Remove the rollout of ${workflowKey}? New starts run the ACTIVE version.`))) {
|
|
144
|
+
throw new CliUserError('Aborted: nothing was changed.');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const removed = await env.api.deleteWorkflowRollout(workflowKey, environment);
|
|
148
|
+
emit(env, options, { workflowKey, removed }, { headers: ['Workflow', 'Removed'], rows: [[workflowKey, removed ? 'yes' : 'no']] }, [removed ? `The rollout of ${workflowKey} is removed.` : `${workflowKey} had no rollout.`]);
|
|
149
|
+
return removed;
|
|
150
|
+
}
|
|
151
|
+
// ----------------------------------------------------------- versions drainage
|
|
152
|
+
/** Whether a version's bundle still serves open runs. */
|
|
153
|
+
export async function runDrainage(env, workflowKey, version, options) {
|
|
154
|
+
const drainage = await env.api.versionDrainage(workflowKey, version);
|
|
155
|
+
emit(env, options, drainage, {
|
|
156
|
+
headers: ['Version', 'Status', 'Open runs', 'Last run', 'Rollout target'],
|
|
157
|
+
rows: [
|
|
158
|
+
[
|
|
159
|
+
drainage.version,
|
|
160
|
+
drainage.status,
|
|
161
|
+
String(drainage.openRuns),
|
|
162
|
+
drainage.lastRunStartedAt ?? '-',
|
|
163
|
+
drainage.rolloutTarget ? 'yes' : 'no',
|
|
164
|
+
],
|
|
165
|
+
],
|
|
166
|
+
});
|
|
167
|
+
return drainage;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Set or remove a run's versioning override. A change that moves the run to
|
|
171
|
+
* another bundle is replay-checked by the service first (`pendingOverride`).
|
|
172
|
+
*/
|
|
173
|
+
export async function runOverride(env, runId, options) {
|
|
174
|
+
const chosen = [options.pin !== undefined, options.autoUpgrade === true, options.clear === true];
|
|
175
|
+
if (chosen.filter(Boolean).length !== 1) {
|
|
176
|
+
throw new CliUserError('Give exactly one of --pin <version>, --auto-upgrade or --clear.');
|
|
177
|
+
}
|
|
178
|
+
let override = null;
|
|
179
|
+
if (options.pin !== undefined) {
|
|
180
|
+
if (options.pin.trim() === '')
|
|
181
|
+
throw new CliUserError('--pin needs a version.');
|
|
182
|
+
override = { behavior: 'PINNED', version: options.pin };
|
|
183
|
+
}
|
|
184
|
+
else if (options.autoUpgrade) {
|
|
185
|
+
override = { behavior: 'AUTO_UPGRADE' };
|
|
186
|
+
}
|
|
187
|
+
const ref = runRefOf(runId, options);
|
|
188
|
+
const run = await env.api.setRunVersioningOverride(ref, override, options.reason);
|
|
189
|
+
const versioning = run.versioning;
|
|
190
|
+
const rows = [
|
|
191
|
+
['Run', run.id],
|
|
192
|
+
['Behavior', versioning?.behavior ?? '-'],
|
|
193
|
+
[
|
|
194
|
+
'Override',
|
|
195
|
+
versioning?.override
|
|
196
|
+
? `${versioning.override.behavior}${versioning.override.version ? ` ${versioning.override.version}` : ''}`
|
|
197
|
+
: '-',
|
|
198
|
+
],
|
|
199
|
+
['Serving version', versioning?.servingVersion ?? run.version],
|
|
200
|
+
];
|
|
201
|
+
emit(env, options, run, { headers: ['Field', 'Value'], rows }, checkLine(versioning?.pendingOverride, 'The override'));
|
|
202
|
+
return run;
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../src/code-first/commands/versions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAA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OAAO,CAAC;KAC/D,CAAC;IACF,IAAI,CACF,GAAG,EACH,OAAO,EACP,GAAG,EACH,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,EACrC,SAAS,CAAC,UAAU,EAAE,eAAe,EAAE,cAAc,CAAC,CACvD,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL documents for durable functions (managed tier-2 workflows, BOFF-9905
|
|
3
|
+
* Phase B): code bundle upload and hotfix, durable run start, history, signal,
|
|
4
|
+
* terminate and stack trace.
|
|
5
|
+
*
|
|
6
|
+
* Every document targets the WORKSPACE gateway (wspace-workflow-svc). The names
|
|
7
|
+
* and shapes are the Phase B contract (PLAN-B §5 B8 and B9, spec 08 §4). They
|
|
8
|
+
* are validated by `tests/code-first/durable-operations.test.ts` against the
|
|
9
|
+
* vendored supergraph.
|
|
10
|
+
*
|
|
11
|
+
* The service gates every operation that starts new durable work
|
|
12
|
+
* (`prepareWorkflowCodeUpload`, `replaceWorkflowVersionCode`, `startWorkflow`,
|
|
13
|
+
* `signalWorkflowRun` on a DURABLE_FN run, and versions with a `codeBundle`) on
|
|
14
|
+
* the `fluidgrids.durable-functions` feature flag, fail closed. A workspace
|
|
15
|
+
* without the flag gets a GraphQL error that the CLI prints as it is; the CLI
|
|
16
|
+
* never decides the flag itself.
|
|
17
|
+
*/
|
|
18
|
+
/** A presigned bundle PUT (skipped when `alreadyStored`) and a presigned source PUT. */
|
|
19
|
+
export declare const CF_PREPARE_WORKFLOW_CODE_UPLOAD = "\n mutation FluidgridsCodePrepareWorkflowCodeUpload($input: PrepareWorkflowCodeUploadInput!) {\n prepareWorkflowCodeUpload(input: $input) {\n uploadId\n bundle { url method headers expiresAt alreadyStored }\n source { url method headers expiresAt alreadyStored }\n }\n }\n";
|
|
20
|
+
/** Hotfix: replace the bundle of an existing version; an asynchronous, replay-verified job. */
|
|
21
|
+
export declare const CF_REPLACE_WORKFLOW_VERSION_CODE = "\n mutation FluidgridsCodeReplaceWorkflowVersionCode(\n $workflowKey: String!\n $version: String!\n $codeBundle: CodeBundleInput!\n $verifyReplay: Boolean\n ) {\n replaceWorkflowVersionCode(\n workflowKey: $workflowKey\n version: $version\n codeBundle: $codeBundle\n verifyReplay: $verifyReplay\n ) { \n id status buildId previousBuildId verifiedRuns\n violations { runId seq message }\n }\n }\n";
|
|
22
|
+
/** Poll a hotfix job. */
|
|
23
|
+
export declare const CF_WORKFLOW_CODE_REPLACE = "\n query FluidgridsCodeWorkflowCodeReplace($id: ID!) {\n workflowCodeReplace(id: $id) { \n id status buildId previousBuildId verifiedRuns\n violations { runId seq message }\n }\n }\n";
|
|
24
|
+
/** The code bundle a version references, or null for a version without code. */
|
|
25
|
+
export declare const CF_WORKFLOW_CODE_BUNDLE = "\n query FluidgridsCodeWorkflowCodeBundle($workflowKey: String!, $version: String!) {\n workflowCodeBundle(workflowKey: $workflowKey, version: $version) {\n id buildId language sdkVersion entry exports determinism\n bundleBytes sourceBytes compatibleBuildIds replacedAt createdAt\n }\n }\n";
|
|
26
|
+
/** Start a root durable-function run (DB18). */
|
|
27
|
+
export declare const CF_START_WORKFLOW = "\n mutation FluidgridsCodeStartWorkflow($input: StartWorkflowInput!) {\n startWorkflow(input: $input) {\n existing\n run { \n id workflowId workflowKey version status mode triggerNodeId\n executionKind workflowFn taskQueue buildId historyLength parentClosePolicy\n parentRunId rootRunId cancelRequestedAt\n createdAt startedAt completedAt errorMessage errorType\n determinism { failing cause attempts since lastFailureSeq message }\n }\n }\n }\n";
|
|
28
|
+
/** One run with its durable fields. */
|
|
29
|
+
export declare const CF_DESCRIBE_RUN = "\n query FluidgridsCodeDescribeRun($id: ID!) {\n workflowRun(id: $id) { \n id workflowId workflowKey version status mode triggerNodeId\n executionKind workflowFn taskQueue buildId historyLength parentClosePolicy\n parentRunId rootRunId cancelRequestedAt\n createdAt startedAt completedAt errorMessage errorType\n determinism { failing cause attempts since lastFailureSeq message }\n }\n }\n";
|
|
30
|
+
/** One page of a run's event history. */
|
|
31
|
+
export declare const CF_WORKFLOW_RUN_HISTORY = "\n query FluidgridsCodeWorkflowRunHistory($runId: ID!, $after: Int, $limit: Int) {\n workflowRunHistory(runId: $runId, after: $after, limit: $limit) {\n events { runId seq type taskId payload payloadUrl createdAt }\n nextAfter hasMore historyLength historyBytes\n }\n }\n";
|
|
32
|
+
export declare const CF_SIGNAL_WORKFLOW_RUN = "\n mutation FluidgridsCodeSignalWorkflowRun(\n $runId: ID!\n $name: String!\n $payload: JSON\n $idempotencyKey: String\n ) {\n signalWorkflowRun(runId: $runId, name: $name, payload: $payload, idempotencyKey: $idempotencyKey) {\n accepted delivered buffered forwardedToRunId seq duplicate\n }\n }\n";
|
|
33
|
+
/** Terminate a run of either kind; no code runs (durable) and no node runs (graph). */
|
|
34
|
+
export declare const CF_TERMINATE_WORKFLOW_RUN = "\n mutation FluidgridsCodeTerminateWorkflowRun($runId: ID!, $reason: String) {\n terminateWorkflowRun(runId: $runId, reason: $reason) { id status completedAt errorMessage }\n }\n";
|
|
35
|
+
/** The built-in `__stack_trace` / `__enhanced_stack_trace` query, replayed in the service. */
|
|
36
|
+
export declare const CF_WORKFLOW_RUN_STACK_TRACE = "\n query FluidgridsCodeWorkflowRunStackTrace($runId: ID!, $enhanced: Boolean) {\n workflowRunStackTrace(runId: $runId, enhanced: $enhanced) { trace enhanced }\n }\n";
|
|
37
|
+
/** Runs of one workflow key (newest first), for `push --hotfix --replay-sample`. */
|
|
38
|
+
export declare const CF_LIST_RUNS = "\n query FluidgridsCodeListRuns($input: ListWorkflowRunsInput!) {\n workflowRuns(input: $input) {\n items { id workflowKey version status executionKind }\n hasMore\n }\n }\n";
|
|
39
|
+
/** Trigger a stored version from one of its trigger nodes (`fluidgrids run`). */
|
|
40
|
+
export declare const CF_TRIGGER_WORKFLOW = "\n mutation FluidgridsCodeTriggerWorkflow($input: TriggerWorkflowInput!) {\n triggerWorkflow(input: $input) { runId status workflowKey version triggerNodeId }\n }\n";
|
|
41
|
+
//# sourceMappingURL=durable-operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-operations.d.ts","sourceRoot":"","sources":["../../src/code-first/durable-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,wFAAwF;AACxF,eAAO,MAAM,+BAA+B,4SAQ3C,CAAC;AAOF,+FAA+F;AAC/F,eAAO,MAAM,gCAAgC,2bAc5C,CAAC;AAEF,yBAAyB;AACzB,eAAO,MAAM,wBAAwB,kMAIpC,CAAC;AAEF,gFAAgF;AAChF,eAAO,MAAM,uBAAuB,wTAOnC,CAAC;AAWF,gDAAgD;AAChD,eAAO,MAAM,iBAAiB,ydAO7B,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,eAAe,qZAI3B,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,uBAAuB,sSAOnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,wUAWlC,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,yBAAyB,4LAIrC,CAAC;AAEF,8FAA8F;AAC9F,eAAO,MAAM,2BAA2B,8KAIvC,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,YAAY,oMAOxB,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,8KAI/B,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphQL documents for durable functions (managed tier-2 workflows, BOFF-9905
|
|
3
|
+
* Phase B): code bundle upload and hotfix, durable run start, history, signal,
|
|
4
|
+
* terminate and stack trace.
|
|
5
|
+
*
|
|
6
|
+
* Every document targets the WORKSPACE gateway (wspace-workflow-svc). The names
|
|
7
|
+
* and shapes are the Phase B contract (PLAN-B §5 B8 and B9, spec 08 §4). They
|
|
8
|
+
* are validated by `tests/code-first/durable-operations.test.ts` against the
|
|
9
|
+
* vendored supergraph.
|
|
10
|
+
*
|
|
11
|
+
* The service gates every operation that starts new durable work
|
|
12
|
+
* (`prepareWorkflowCodeUpload`, `replaceWorkflowVersionCode`, `startWorkflow`,
|
|
13
|
+
* `signalWorkflowRun` on a DURABLE_FN run, and versions with a `codeBundle`) on
|
|
14
|
+
* the `fluidgrids.durable-functions` feature flag, fail closed. A workspace
|
|
15
|
+
* without the flag gets a GraphQL error that the CLI prints as it is; the CLI
|
|
16
|
+
* never decides the flag itself.
|
|
17
|
+
*/
|
|
18
|
+
const PRESIGNED_PUT_FIELDS = 'url method headers expiresAt alreadyStored';
|
|
19
|
+
/** A presigned bundle PUT (skipped when `alreadyStored`) and a presigned source PUT. */
|
|
20
|
+
export const CF_PREPARE_WORKFLOW_CODE_UPLOAD = `
|
|
21
|
+
mutation FluidgridsCodePrepareWorkflowCodeUpload($input: PrepareWorkflowCodeUploadInput!) {
|
|
22
|
+
prepareWorkflowCodeUpload(input: $input) {
|
|
23
|
+
uploadId
|
|
24
|
+
bundle { ${PRESIGNED_PUT_FIELDS} }
|
|
25
|
+
source { ${PRESIGNED_PUT_FIELDS} }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
const CODE_REPLACE_FIELDS = `
|
|
30
|
+
id status buildId previousBuildId verifiedRuns
|
|
31
|
+
violations { runId seq message }
|
|
32
|
+
`;
|
|
33
|
+
/** Hotfix: replace the bundle of an existing version; an asynchronous, replay-verified job. */
|
|
34
|
+
export const CF_REPLACE_WORKFLOW_VERSION_CODE = `
|
|
35
|
+
mutation FluidgridsCodeReplaceWorkflowVersionCode(
|
|
36
|
+
$workflowKey: String!
|
|
37
|
+
$version: String!
|
|
38
|
+
$codeBundle: CodeBundleInput!
|
|
39
|
+
$verifyReplay: Boolean
|
|
40
|
+
) {
|
|
41
|
+
replaceWorkflowVersionCode(
|
|
42
|
+
workflowKey: $workflowKey
|
|
43
|
+
version: $version
|
|
44
|
+
codeBundle: $codeBundle
|
|
45
|
+
verifyReplay: $verifyReplay
|
|
46
|
+
) { ${CODE_REPLACE_FIELDS} }
|
|
47
|
+
}
|
|
48
|
+
`;
|
|
49
|
+
/** Poll a hotfix job. */
|
|
50
|
+
export const CF_WORKFLOW_CODE_REPLACE = `
|
|
51
|
+
query FluidgridsCodeWorkflowCodeReplace($id: ID!) {
|
|
52
|
+
workflowCodeReplace(id: $id) { ${CODE_REPLACE_FIELDS} }
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
/** The code bundle a version references, or null for a version without code. */
|
|
56
|
+
export const CF_WORKFLOW_CODE_BUNDLE = `
|
|
57
|
+
query FluidgridsCodeWorkflowCodeBundle($workflowKey: String!, $version: String!) {
|
|
58
|
+
workflowCodeBundle(workflowKey: $workflowKey, version: $version) {
|
|
59
|
+
id buildId language sdkVersion entry exports determinism
|
|
60
|
+
bundleBytes sourceBytes compatibleBuildIds replacedAt createdAt
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
/** Run fields the durable commands print. */
|
|
65
|
+
const DURABLE_RUN_FIELDS = `
|
|
66
|
+
id workflowId workflowKey version status mode triggerNodeId
|
|
67
|
+
executionKind workflowFn taskQueue buildId historyLength parentClosePolicy
|
|
68
|
+
parentRunId rootRunId cancelRequestedAt
|
|
69
|
+
createdAt startedAt completedAt errorMessage errorType
|
|
70
|
+
determinism { failing cause attempts since lastFailureSeq message }
|
|
71
|
+
`;
|
|
72
|
+
/** Start a root durable-function run (DB18). */
|
|
73
|
+
export const CF_START_WORKFLOW = `
|
|
74
|
+
mutation FluidgridsCodeStartWorkflow($input: StartWorkflowInput!) {
|
|
75
|
+
startWorkflow(input: $input) {
|
|
76
|
+
existing
|
|
77
|
+
run { ${DURABLE_RUN_FIELDS} }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
/** One run with its durable fields. */
|
|
82
|
+
export const CF_DESCRIBE_RUN = `
|
|
83
|
+
query FluidgridsCodeDescribeRun($id: ID!) {
|
|
84
|
+
workflowRun(id: $id) { ${DURABLE_RUN_FIELDS} }
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
/** One page of a run's event history. */
|
|
88
|
+
export const CF_WORKFLOW_RUN_HISTORY = `
|
|
89
|
+
query FluidgridsCodeWorkflowRunHistory($runId: ID!, $after: Int, $limit: Int) {
|
|
90
|
+
workflowRunHistory(runId: $runId, after: $after, limit: $limit) {
|
|
91
|
+
events { runId seq type taskId payload payloadUrl createdAt }
|
|
92
|
+
nextAfter hasMore historyLength historyBytes
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`;
|
|
96
|
+
export const CF_SIGNAL_WORKFLOW_RUN = `
|
|
97
|
+
mutation FluidgridsCodeSignalWorkflowRun(
|
|
98
|
+
$runId: ID!
|
|
99
|
+
$name: String!
|
|
100
|
+
$payload: JSON
|
|
101
|
+
$idempotencyKey: String
|
|
102
|
+
) {
|
|
103
|
+
signalWorkflowRun(runId: $runId, name: $name, payload: $payload, idempotencyKey: $idempotencyKey) {
|
|
104
|
+
accepted delivered buffered forwardedToRunId seq duplicate
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
/** Terminate a run of either kind; no code runs (durable) and no node runs (graph). */
|
|
109
|
+
export const CF_TERMINATE_WORKFLOW_RUN = `
|
|
110
|
+
mutation FluidgridsCodeTerminateWorkflowRun($runId: ID!, $reason: String) {
|
|
111
|
+
terminateWorkflowRun(runId: $runId, reason: $reason) { id status completedAt errorMessage }
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
/** The built-in `__stack_trace` / `__enhanced_stack_trace` query, replayed in the service. */
|
|
115
|
+
export const CF_WORKFLOW_RUN_STACK_TRACE = `
|
|
116
|
+
query FluidgridsCodeWorkflowRunStackTrace($runId: ID!, $enhanced: Boolean) {
|
|
117
|
+
workflowRunStackTrace(runId: $runId, enhanced: $enhanced) { trace enhanced }
|
|
118
|
+
}
|
|
119
|
+
`;
|
|
120
|
+
/** Runs of one workflow key (newest first), for `push --hotfix --replay-sample`. */
|
|
121
|
+
export const CF_LIST_RUNS = `
|
|
122
|
+
query FluidgridsCodeListRuns($input: ListWorkflowRunsInput!) {
|
|
123
|
+
workflowRuns(input: $input) {
|
|
124
|
+
items { id workflowKey version status executionKind }
|
|
125
|
+
hasMore
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
`;
|
|
129
|
+
/** Trigger a stored version from one of its trigger nodes (`fluidgrids run`). */
|
|
130
|
+
export const CF_TRIGGER_WORKFLOW = `
|
|
131
|
+
mutation FluidgridsCodeTriggerWorkflow($input: TriggerWorkflowInput!) {
|
|
132
|
+
triggerWorkflow(input: $input) { runId status workflowKey version triggerNodeId }
|
|
133
|
+
}
|
|
134
|
+
`;
|
|
135
|
+
//# sourceMappingURL=durable-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"durable-operations.js","sourceRoot":"","sources":["../../src/code-first/durable-operations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,oBAAoB,GAAG,4CAA4C,CAAC;AAE1E,wFAAwF;AACxF,MAAM,CAAC,MAAM,+BAA+B,GAAG;;;;iBAI9B,oBAAoB;iBACpB,oBAAoB;;;CAGpC,CAAC;AAEF,MAAM,mBAAmB,GAAG;;;CAG3B,CAAC;AAEF,+FAA+F;AAC/F,MAAM,CAAC,MAAM,gCAAgC,GAAG;;;;;;;;;;;;UAYtC,mBAAmB;;CAE5B,CAAC;AAEF,yBAAyB;AACzB,MAAM,CAAC,MAAM,wBAAwB,GAAG;;qCAEH,mBAAmB;;CAEvD,CAAC;AAEF,gFAAgF;AAChF,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;CAOtC,CAAC;AAEF,6CAA6C;AAC7C,MAAM,kBAAkB,GAAG;;;;;;CAM1B,CAAC;AAEF,gDAAgD;AAChD,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;cAInB,kBAAkB;;;CAG/B,CAAC;AAEF,uCAAuC;AACvC,MAAM,CAAC,MAAM,eAAe,GAAG;;6BAEF,kBAAkB;;CAE9C,CAAC;AAEF,yCAAyC;AACzC,MAAM,CAAC,MAAM,uBAAuB,GAAG;;;;;;;CAOtC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;;;;;;;;CAWrC,CAAC;AAEF,uFAAuF;AACvF,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;CAIxC,CAAC;AAEF,8FAA8F;AAC9F,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;CAI1C,CAAC;AAEF,oFAAoF;AACpF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;CAO3B,CAAC;AAEF,iFAAiF;AACjF,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;CAIlC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A durable run's history as a `fluidgrids.history` file (C-HIST,
|
|
3
|
+
* `schema/history-file.schema.json` of `@fluidgrids/workflows`): every page of
|
|
4
|
+
* `workflowRunHistory`, with offloaded payloads fetched through their
|
|
5
|
+
* presigned `payloadUrl` and inlined, so the file replays on its own.
|
|
6
|
+
*/
|
|
7
|
+
import { type HistoryFile, type RunEventRecord } from '@fluidgrids/workflows/history';
|
|
8
|
+
import { type DurableRun } from './api.js';
|
|
9
|
+
import { type CommandEnv } from './shared.js';
|
|
10
|
+
/** Events per `workflowRunHistory` page (the service's default and maximum). */
|
|
11
|
+
export declare const HISTORY_PAGE_SIZE = 500;
|
|
12
|
+
/** Largest offloaded payload the CLI reads (the service's resolved-bytes cap). */
|
|
13
|
+
export declare const MAX_OFFLOADED_PAYLOAD_BYTES: number;
|
|
14
|
+
export interface FetchedHistory {
|
|
15
|
+
run: DurableRun;
|
|
16
|
+
file: HistoryFile;
|
|
17
|
+
historyBytes: number;
|
|
18
|
+
}
|
|
19
|
+
/** The run's events, every page, offloaded payloads inlined. */
|
|
20
|
+
export declare function fetchRunEvents(env: CommandEnv, runId: string): Promise<{
|
|
21
|
+
events: RunEventRecord[];
|
|
22
|
+
historyBytes: number;
|
|
23
|
+
}>;
|
|
24
|
+
/** Refuse a run that has no event history (a canvas run). */
|
|
25
|
+
export declare function assertDurable(run: DurableRun): void;
|
|
26
|
+
/** Download a durable run's history as a validated history file. */
|
|
27
|
+
export declare function fetchHistory(env: CommandEnv, runId: string): Promise<FetchedHistory>;
|
|
28
|
+
/** Read and validate a history file from disk. */
|
|
29
|
+
export declare function parseHistoryText(text: string, path: string): HistoryFile;
|
|
30
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/code-first/history.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,cAAc,EAEpB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAa,KAAK,UAAU,EAAuB,MAAM,UAAU,CAAC;AAE3E,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAE7D,gFAAgF;AAChF,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,kFAAkF;AAClF,eAAO,MAAM,2BAA2B,QAAmB,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,UAAU,CAAC;IAChB,IAAI,EAAE,WAAW,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAoDD,gEAAgE;AAChE,wBAAsB,cAAc,CAClC,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC;IAAE,MAAM,EAAE,cAAc,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CA2B7D;AAED,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAOnD;AAED,oEAAoE;AACpE,wBAAsB,YAAY,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAmC1F;AAED,kDAAkD;AAClD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAWxE"}
|