@fluidgrids/cli 2026.1113.2 → 2026.1113.4
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 +11 -0
- package/dist/cli.js +51 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -227,8 +227,19 @@ fluidgrids test --replay histories/ # the project tests, then ever
|
|
|
227
227
|
fluidgrids push --hotfix v3 --replay-sample 20 # replace the code of v3 (replay-verified by the service)
|
|
228
228
|
fluidgrids versions list approvals # versions with the bundle each one runs
|
|
229
229
|
fluidgrids run lead-enrichment --wait # trigger a canvas workflow from its trigger node
|
|
230
|
+
fluidgrids run lead-enrichment --workflow-id customer-7 --id-conflict use-existing --delay 5m
|
|
230
231
|
```
|
|
231
232
|
|
|
233
|
+
- **Canvas start options.** `fluidgrids run` takes `--workflow-id`,
|
|
234
|
+
`--id-conflict` (fail, use-existing or terminate-existing) and `--delay`
|
|
235
|
+
(spec `code-first` 11 §2.1 and §2.23; they need `fluidgrids.durable-parity`,
|
|
236
|
+
and a delay is for PRODUCTION runs only). `terminate-existing` ends the open
|
|
237
|
+
run of the workflow id first: it is sent as `triggerWorkflowTerminateExisting`,
|
|
238
|
+
which needs the workflow-run delete permission, and the CLI asks for
|
|
239
|
+
confirmation unless `--force` is given. Without these flags, the trigger
|
|
240
|
+
node's own `workflowId`, `idConflictPolicy` and `startDelay` (if it sets
|
|
241
|
+
them) apply.
|
|
242
|
+
|
|
232
243
|
- **Push.** The bundle is one ES module built with the pinned esbuild, so its
|
|
233
244
|
`buildId` (`sha256` of the bytes) is the one the service computes for the same
|
|
234
245
|
files. `push` asks `prepareWorkflowCodeUpload` for presigned uploads, sends the
|
package/dist/cli.js
CHANGED
|
@@ -928,6 +928,10 @@ var PRESIGNED_PUT_FIELDS = "url method headers expiresAt alreadyStored", CF_PREP
|
|
|
928
928
|
mutation FluidgridsCodeTriggerWorkflow($input: TriggerWorkflowInput!) {
|
|
929
929
|
triggerWorkflow(input: $input) { runId status workflowKey version triggerNodeId }
|
|
930
930
|
}
|
|
931
|
+
`, CF_TRIGGER_WORKFLOW_TERMINATE_EXISTING = `
|
|
932
|
+
mutation FluidgridsCodeTriggerWorkflowTerminateExisting($input: TriggerWorkflowInput!) {
|
|
933
|
+
triggerWorkflowTerminateExisting(input: $input) { runId status workflowKey version triggerNodeId }
|
|
934
|
+
}
|
|
931
935
|
`;
|
|
932
936
|
var init_durable_operations = __esm(() => {
|
|
933
937
|
CF_PREPARE_WORKFLOW_CODE_UPLOAD = `
|
|
@@ -1450,6 +1454,10 @@ function createCodeFirstApi(ctx) {
|
|
|
1450
1454
|
return rows.slice(0, limit);
|
|
1451
1455
|
},
|
|
1452
1456
|
async triggerWorkflow(input) {
|
|
1457
|
+
if (input.idConflictPolicy === "TERMINATE_EXISTING") {
|
|
1458
|
+
const data = await request(CF_TRIGGER_WORKFLOW_TERMINATE_EXISTING, { input });
|
|
1459
|
+
return data.triggerWorkflowTerminateExisting;
|
|
1460
|
+
}
|
|
1453
1461
|
const data = await request(CF_TRIGGER_WORKFLOW, {
|
|
1454
1462
|
input
|
|
1455
1463
|
});
|
|
@@ -3713,7 +3721,11 @@ var init_replay = () => {};
|
|
|
3713
3721
|
import { diffDefinitions, irHash as irHash4, validate } from "@fluidgrids/workflows/ir";
|
|
3714
3722
|
import { CliUserError as CliUserError20 } from "@burdenoff/cli-sdk/core";
|
|
3715
3723
|
function durableSummary(issues) {
|
|
3716
|
-
|
|
3724
|
+
if (issues.some((issue) => issue.code === "durable.phaseC"))
|
|
3725
|
+
return "The project uses durable-function features that arrive in Phase C";
|
|
3726
|
+
if (issues.length > 0 && issues.every((issue) => issue.code === USER_ACTIVITY_ON_MANAGED))
|
|
3727
|
+
return "The project runs a user activity on the managed queue, which has no worker for user activities; declare each activity on a self-hosted task queue";
|
|
3728
|
+
return "The project uses durable-function features this release refuses";
|
|
3717
3729
|
}
|
|
3718
3730
|
function assertNoDurableIssues(issues) {
|
|
3719
3731
|
if (issues.length === 0)
|
|
@@ -3963,6 +3975,7 @@ async function runPush(env, keys, options) {
|
|
|
3963
3975
|
}, details);
|
|
3964
3976
|
return result;
|
|
3965
3977
|
}
|
|
3978
|
+
var USER_ACTIVITY_ON_MANAGED = "taskQueue.userActivityOnManaged";
|
|
3966
3979
|
var init_push = __esm(() => {
|
|
3967
3980
|
init_code_upload();
|
|
3968
3981
|
init_connections();
|
|
@@ -5939,6 +5952,29 @@ async function runCount(env, options) {
|
|
|
5939
5952
|
}, details);
|
|
5940
5953
|
return counted;
|
|
5941
5954
|
}
|
|
5955
|
+
function canvasStartFields(options) {
|
|
5956
|
+
const fields = {};
|
|
5957
|
+
if (options.workflowId !== undefined) {
|
|
5958
|
+
if (options.workflowId.trim() === "")
|
|
5959
|
+
throw new CliUserError31("--workflow-id cannot be empty.");
|
|
5960
|
+
fields.workflowId = options.workflowId;
|
|
5961
|
+
}
|
|
5962
|
+
const conflict = parseIdConflict(options.idConflict);
|
|
5963
|
+
if (conflict) {
|
|
5964
|
+
if (conflict !== "FAIL" && fields.workflowId === undefined) {
|
|
5965
|
+
throw new CliUserError31(`--id-conflict ${options.idConflict ?? ""} needs --workflow-id.`);
|
|
5966
|
+
}
|
|
5967
|
+
fields.idConflictPolicy = conflict;
|
|
5968
|
+
}
|
|
5969
|
+
const delay = parseDuration(options.delay, "--delay");
|
|
5970
|
+
if (delay) {
|
|
5971
|
+
if (options.test) {
|
|
5972
|
+
throw new CliUserError31("--delay applies to PRODUCTION runs only; drop --test or --delay.");
|
|
5973
|
+
}
|
|
5974
|
+
fields.startDelay = delay;
|
|
5975
|
+
}
|
|
5976
|
+
return fields;
|
|
5977
|
+
}
|
|
5942
5978
|
function triggerNodeIds(definition) {
|
|
5943
5979
|
if (!isRecord16(definition) || !isRecord16(definition["data"]))
|
|
5944
5980
|
return [];
|
|
@@ -5971,12 +6007,24 @@ async function runRun(env, workflowKey, options) {
|
|
|
5971
6007
|
if (input !== undefined && !isRecord16(input)) {
|
|
5972
6008
|
throw new CliUserError31("--input must be a JSON object for a trigger.");
|
|
5973
6009
|
}
|
|
6010
|
+
const startFields = canvasStartFields(options);
|
|
6011
|
+
if (startFields.idConflictPolicy === "TERMINATE_EXISTING" && !options.force) {
|
|
6012
|
+
const question = `Terminate the open run of workflow id ${startFields.workflowId ?? ""} of ${workflowKey} (if any) and start a new one?`;
|
|
6013
|
+
if (!env.interactive()) {
|
|
6014
|
+
throw new CliUserError31("--id-conflict terminate-existing needs confirmation.", {
|
|
6015
|
+
hint: "Pass --force to terminate the open run without a prompt."
|
|
6016
|
+
});
|
|
6017
|
+
}
|
|
6018
|
+
if (!await confirm(question))
|
|
6019
|
+
throw new CliUserError31("Aborted: nothing was changed.");
|
|
6020
|
+
}
|
|
5974
6021
|
const trigger = await env.api.triggerWorkflow({
|
|
5975
6022
|
workflowKey,
|
|
5976
6023
|
version: target.version,
|
|
5977
6024
|
triggerNodeId,
|
|
5978
6025
|
...input !== undefined ? { triggerData: input } : {},
|
|
5979
|
-
...options.test ? { mode: "TEST" } : {}
|
|
6026
|
+
...options.test ? { mode: "TEST" } : {},
|
|
6027
|
+
...startFields
|
|
5980
6028
|
});
|
|
5981
6029
|
const result = { trigger };
|
|
5982
6030
|
if (options.wait) {
|
|
@@ -10648,7 +10696,7 @@ function registerDurable(program, env) {
|
|
|
10648
10696
|
await Promise.resolve().then(() => init_replay2());
|
|
10649
10697
|
await runTest(env, codeFirst);
|
|
10650
10698
|
});
|
|
10651
|
-
program.command("run <workflowKey>").description("Trigger a workflow from its version's trigger node, optionally waiting for the result").option("--wf-version <version>", "Version (default: the active version, else the newest)").option("--trigger-node <id>", "Trigger node (default: the only one)").option("-i, --input <json>", "Trigger data (a JSON object)").option("--test", "Run in TEST mode instead of PRODUCTION").option("--wait", "Wait for the run to finish").option(...WAIT_OPTIONS.timeout).option(...WAIT_OPTIONS.poll).option(...OUTPUT_OPTION).action(async (workflowKey, options, command) => {
|
|
10699
|
+
program.command("run <workflowKey>").description("Trigger a workflow from its version's trigger node, optionally waiting for the result").option("--wf-version <version>", "Version (default: the active version, else the newest)").option("--trigger-node <id>", "Trigger node (default: the only one)").option("-i, --input <json>", "Trigger data (a JSON object)").option("--test", "Run in TEST mode instead of PRODUCTION").option("--workflow-id <id>", "Workflow id: unique among the open runs of the key").option("--id-conflict <policy>", "When an open run has the workflow id: fail, use-existing or terminate-existing").option("--delay <duration>", "Start delay (ms, or 1.5s, 5m, 2h, 2w, PT2H; at most 30 days; not with --test)").option("--force", "With --id-conflict terminate-existing: skip the confirmation prompt").option("--wait", "Wait for the run to finish").option(...WAIT_OPTIONS.timeout).option(...WAIT_OPTIONS.poll).option(...OUTPUT_OPTION).action(async (workflowKey, options, command) => {
|
|
10652
10700
|
await Promise.resolve().then(() => init_runs());
|
|
10653
10701
|
await runRun(env, workflowKey, withGlobalFormat(options, command));
|
|
10654
10702
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluidgrids/cli",
|
|
3
|
-
"version": "2026.1113.
|
|
3
|
+
"version": "2026.1113.4",
|
|
4
4
|
"description": "CLI tool for FluidGrids — workflow automation management (thin shell over @burdenoff/cli-sdk)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@burdenoff/cli-sdk": "2026.1109.1",
|
|
58
|
-
"@fluidgrids/workflows": "2026.
|
|
58
|
+
"@fluidgrids/workflows": "2026.1113.1",
|
|
59
59
|
"@napi-rs/keyring": "2.1.1",
|
|
60
60
|
"commander": "^14.0.3",
|
|
61
61
|
"esbuild": "0.28.2",
|