@revturbine/cli 0.4.0 → 0.5.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 +1 -1
- package/dist/cli.js +14 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ Commands that read a config name the version explicitly — there is no default:
|
|
|
63
63
|
| `upload` | Stage a Config File as the open draft. |
|
|
64
64
|
| `launch` | Take a config live: validate (launch gate) → submit → approve → deploy. `launch <file>` or `launch --draft`. |
|
|
65
65
|
| `discard` | Archive the open draft (`--yes`). |
|
|
66
|
-
| `
|
|
66
|
+
| `restore` | Stage a draft that restores a past release from its frozen snapshot; `--launch` takes it live. Halts if a draft is open. |
|
|
67
67
|
| `status` | The live Release and the open draft, side by side. |
|
|
68
68
|
| `history` | The Release Version Log, newest first. |
|
|
69
69
|
| `preview` | The open draft's staged changes. |
|
package/dist/cli.js
CHANGED
|
@@ -5890,7 +5890,7 @@ Command groups:
|
|
|
5890
5890
|
Auth & meta login, logout, signup, whoami, schema, docs
|
|
5891
5891
|
Download download
|
|
5892
5892
|
Check validate, diff, show
|
|
5893
|
-
Stage/launch upload, launch, discard,
|
|
5893
|
+
Stage/launch upload, launch, discard, restore
|
|
5894
5894
|
Inspect status, history, preview, evaluate
|
|
5895
5895
|
|
|
5896
5896
|
Version selectors (no defaults \u2014 a command that reads a config requires one):
|
|
@@ -5916,7 +5916,7 @@ Common workflows:
|
|
|
5916
5916
|
# Inspect and roll back
|
|
5917
5917
|
revturbine status
|
|
5918
5918
|
revturbine history
|
|
5919
|
-
revturbine
|
|
5919
|
+
revturbine restore <playbook-version-id> --launch
|
|
5920
5920
|
|
|
5921
5921
|
Exit-code classes: 0 ok \xB7 1 unexpected \xB7 2 usage \xB7 3 auth \xB7 4 validation
|
|
5922
5922
|
blocked \xB7 5 conflict/stale \xB7 6 network \xB7 7 server error.
|
|
@@ -5924,7 +5924,7 @@ blocked \xB7 5 conflict/stale \xB7 6 network \xB7 7 server error.
|
|
|
5924
5924
|
Auth:
|
|
5925
5925
|
Most commands need a token \u2014 run \`login\` first. Credentials live at
|
|
5926
5926
|
~/.revturbine/credentials.json (0600); the token's tenant is used by default,
|
|
5927
|
-
override with -t/--tenant-id. Mutating commands (discard,
|
|
5927
|
+
override with -t/--tenant-id. Mutating commands (discard, restore) prompt
|
|
5928
5928
|
for confirmation unless --yes.
|
|
5929
5929
|
|
|
5930
5930
|
Full reference: ${DOCS_URL}
|
|
@@ -6172,7 +6172,7 @@ program.command("upload").description("Stage a Config File as the open draft (PO
|
|
|
6172
6172
|
if (playbookVersionId) diagRaw(` playbook_version_id: ${playbookVersionId}`);
|
|
6173
6173
|
diag("Launch it with `revturbine launch --draft`, or from the UI (Drafts & Releases).");
|
|
6174
6174
|
});
|
|
6175
|
-
program.command("launch").description("Take a config live as a new Release: validate (launch gate), then submit \u2192 approve \u2192 deploy. Synchronous.").argument("[file]", "Config File to upload and launch directly").option("--draft", "Launch the already-open draft").option("-u, --url <url>", "RevTurbine instance URL", DEFAULT_URL).option("-t, --tenant-id <id>", "x-tenant-id (defaults to the stored token tenant)").option("--yes", "Accepted for parity with discard/
|
|
6175
|
+
program.command("launch").description("Take a config live as a new Release: validate (launch gate), then submit \u2192 approve \u2192 deploy. Synchronous.").argument("[file]", "Config File to upload and launch directly").option("--draft", "Launch the already-open draft").option("-u, --url <url>", "RevTurbine instance URL", DEFAULT_URL).option("-t, --tenant-id <id>", "x-tenant-id (defaults to the stored token tenant)").option("--yes", "Accepted for parity with discard/restore; launch has no confirmation prompt").action(async (file, opts) => {
|
|
6176
6176
|
const [sel] = requireSelectors(opts, file ? [file] : [], { count: 1, allowed: ["file", "draft"], command: "launch" });
|
|
6177
6177
|
const conn = connect(opts.url, opts.tenantId);
|
|
6178
6178
|
let playbookVersionId;
|
|
@@ -6201,17 +6201,22 @@ program.command("discard").description("Discard (archive) the open draft so a fr
|
|
|
6201
6201
|
if (!res.ok) httpFail(conn, "discard", res.status, json);
|
|
6202
6202
|
diag(`\u2713 Discarded draft ${playbookVersionId}.`);
|
|
6203
6203
|
});
|
|
6204
|
-
program.command("
|
|
6204
|
+
program.command("restore").description("Stage a draft that restores a past release (from its frozen snapshot); `--launch` takes it live. Halts if a draft is already open.").argument("<playbook-version-id>", "The deployed playbook version to restore (see `history`)").option("--launch", "Launch the restoring draft immediately (gate + submit \u2192 approve \u2192 deploy)").option("-u, --url <url>", "RevTurbine instance URL", DEFAULT_URL).option("-t, --tenant-id <id>", "x-tenant-id (defaults to the stored token tenant)").option("--yes", "Skip the confirmation prompt").action(async (playbookVersionId, opts) => {
|
|
6205
6205
|
const conn = connect(opts.url, opts.tenantId);
|
|
6206
6206
|
await confirmOrExit(
|
|
6207
|
-
`
|
|
6207
|
+
`Restore playbook version ${playbookVersionId} on ${conn.url}?${opts.launch ? " --launch will take it LIVE." : " (stages a draft; launch separately)"}`,
|
|
6208
6208
|
!!opts.yes
|
|
6209
6209
|
);
|
|
6210
6210
|
const { res, json } = await postJson(conn, `/api/playbook-versions/${playbookVersionId}/rollback`, {});
|
|
6211
|
-
if (!res.ok) httpFail(conn, "
|
|
6212
|
-
diag(`\u2713 Rollback requested for playbook version ${playbookVersionId}.`);
|
|
6211
|
+
if (!res.ok) httpFail(conn, "restore", res.status, json);
|
|
6213
6212
|
const reverting = json?.item?.id ?? json?.playbook_version_id;
|
|
6214
|
-
|
|
6213
|
+
diag(`\u2713 Staged a restoring draft from ${playbookVersionId}${reverting ? ` (${reverting})` : ""}.`);
|
|
6214
|
+
if (!opts.launch) {
|
|
6215
|
+
diag("Launch it with `revturbine launch --draft`, or discard it with `revturbine discard --yes`.");
|
|
6216
|
+
return;
|
|
6217
|
+
}
|
|
6218
|
+
if (!reverting) fail(EXIT.SERVER, "No reverting draft id returned \u2014 cannot launch.");
|
|
6219
|
+
await launchDraft(conn, reverting);
|
|
6215
6220
|
});
|
|
6216
6221
|
program.command("status").description("The current live Release and the open draft, side by side.").option("-u, --url <url>", "RevTurbine instance URL", DEFAULT_URL).option("-t, --tenant-id <id>", "x-tenant-id (defaults to the stored token tenant)").option("--json", "Machine-readable output").action(async (opts) => {
|
|
6217
6222
|
const conn = connect(opts.url, opts.tenantId);
|
package/package.json
CHANGED