deepline 0.1.66 → 0.1.67
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/dist/cli/index.js +385 -2
- package/dist/cli/index.mjs +385 -2
- package/dist/index.d.mts +78 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +60 -2
- package/dist/index.mjs +60 -2
- package/dist/repo/sdk/src/client.ts +73 -0
- package/dist/repo/sdk/src/http.ts +9 -1
- package/dist/repo/sdk/src/release.ts +2 -2
- package/dist/repo/sdk/src/types.ts +59 -0
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -229,10 +229,10 @@ var import_node_path2 = require("path");
|
|
|
229
229
|
|
|
230
230
|
// src/release.ts
|
|
231
231
|
var SDK_RELEASE = {
|
|
232
|
-
version: "0.1.
|
|
232
|
+
version: "0.1.67",
|
|
233
233
|
apiContract: "2026-05-play-bootstrap-dataset-summary",
|
|
234
234
|
supportPolicy: {
|
|
235
|
-
latest: "0.1.
|
|
235
|
+
latest: "0.1.67",
|
|
236
236
|
minimumSupported: "0.1.53",
|
|
237
237
|
deprecatedBelow: "0.1.53"
|
|
238
238
|
}
|
|
@@ -483,6 +483,9 @@ var HttpClient = class {
|
|
|
483
483
|
headers
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
+
async patch(path, body, headers) {
|
|
487
|
+
return this.request(path, { method: "PATCH", body, headers });
|
|
488
|
+
}
|
|
486
489
|
/**
|
|
487
490
|
* Send a DELETE request.
|
|
488
491
|
*
|
|
@@ -1606,6 +1609,61 @@ var DeeplineClient = class {
|
|
|
1606
1609
|
return this.http.delete(`/api/v2/plays/${encodedName}`);
|
|
1607
1610
|
}
|
|
1608
1611
|
// ——————————————————————————————————————————————————————————
|
|
1612
|
+
// Plays — public share pages
|
|
1613
|
+
// ——————————————————————————————————————————————————————————
|
|
1614
|
+
/**
|
|
1615
|
+
* Current share status for a play: the public page (if any), the published
|
|
1616
|
+
* copy, and the revision picker. Read-only.
|
|
1617
|
+
*/
|
|
1618
|
+
async getSharePage(name) {
|
|
1619
|
+
const encodedName = encodeURIComponent(name);
|
|
1620
|
+
return this.http.get(`/api/v2/plays/${encodedName}/share`);
|
|
1621
|
+
}
|
|
1622
|
+
/**
|
|
1623
|
+
* Publish (or repoint) the play's public share page to a revision. Requires
|
|
1624
|
+
* `acknowledgedUnlisted: true` — the page is publicly viewable. Org-admin only.
|
|
1625
|
+
*/
|
|
1626
|
+
async publishSharePage(name, request) {
|
|
1627
|
+
const encodedName = encodeURIComponent(name);
|
|
1628
|
+
return this.http.post(
|
|
1629
|
+
`/api/v2/plays/${encodedName}/share`,
|
|
1630
|
+
request
|
|
1631
|
+
);
|
|
1632
|
+
}
|
|
1633
|
+
/**
|
|
1634
|
+
* Update share-page settings (SEO indexing, credit-cost / latency display)
|
|
1635
|
+
* without moving the published pointer. Org-admin only.
|
|
1636
|
+
*/
|
|
1637
|
+
async updateSharePage(name, request) {
|
|
1638
|
+
const encodedName = encodeURIComponent(name);
|
|
1639
|
+
return this.http.patch(
|
|
1640
|
+
`/api/v2/plays/${encodedName}/share`,
|
|
1641
|
+
request
|
|
1642
|
+
);
|
|
1643
|
+
}
|
|
1644
|
+
/**
|
|
1645
|
+
* Unshare: hard-delete the play's public page and its cards. Returns the
|
|
1646
|
+
* fresh status (now `share: null`). Org-admin only. Idempotent — a no-op when
|
|
1647
|
+
* the play was never published.
|
|
1648
|
+
*/
|
|
1649
|
+
async unpublishSharePage(name) {
|
|
1650
|
+
const encodedName = encodeURIComponent(name);
|
|
1651
|
+
return this.http.delete(
|
|
1652
|
+
`/api/v2/plays/${encodedName}/share`
|
|
1653
|
+
);
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Regenerate the LLM landing-page copy for a revision (defaults to the
|
|
1657
|
+
* published one). Org-admin only.
|
|
1658
|
+
*/
|
|
1659
|
+
async regenerateSharePage(name, request = {}) {
|
|
1660
|
+
const encodedName = encodeURIComponent(name);
|
|
1661
|
+
return this.http.post(
|
|
1662
|
+
`/api/v2/plays/${encodedName}/share/regenerate`,
|
|
1663
|
+
request
|
|
1664
|
+
);
|
|
1665
|
+
}
|
|
1666
|
+
// ——————————————————————————————————————————————————————————
|
|
1609
1667
|
// Plays — high-level orchestration
|
|
1610
1668
|
// ——————————————————————————————————————————————————————————
|
|
1611
1669
|
/**
|
|
@@ -12096,6 +12154,331 @@ Examples:
|
|
|
12096
12154
|
...options.json ? ["--json"] : []
|
|
12097
12155
|
]);
|
|
12098
12156
|
});
|
|
12157
|
+
const share = play.command("share").description(
|
|
12158
|
+
"Manage a play's public, unlisted share page (advanced \u2014 exposes play code)."
|
|
12159
|
+
).addHelpText(
|
|
12160
|
+
"after",
|
|
12161
|
+
`
|
|
12162
|
+
Concepts:
|
|
12163
|
+
A share page is a public, unlisted, SEO-indexable landing page for a play,
|
|
12164
|
+
pinned to one revision. Publish only after the play has run successfully.
|
|
12165
|
+
|
|
12166
|
+
NOT RECOMMENDED by default. Only publish when the user has explicitly asked
|
|
12167
|
+
to share this play AND has confirmed they accept the risks below. When in
|
|
12168
|
+
doubt, leave the play unpublished.
|
|
12169
|
+
|
|
12170
|
+
What is exposed:
|
|
12171
|
+
Run results and row-level data are NEVER exposed. But the page renders the
|
|
12172
|
+
play's STRUCTURE and anything baked into its source code: step names,
|
|
12173
|
+
input/output field names, tool ids, step descriptions/prompts, and any
|
|
12174
|
+
hardcoded string literals or comments in the play file. If the source
|
|
12175
|
+
contains PII, internal domains/emails, secrets-by-mistake, or proprietary
|
|
12176
|
+
business logic, publishing makes it publicly viewable and search-indexable.
|
|
12177
|
+
|
|
12178
|
+
Review the play source for sensitive content before publishing. Use
|
|
12179
|
+
--seo noindex to keep the page out of search engines if you must share it.
|
|
12180
|
+
|
|
12181
|
+
Examples:
|
|
12182
|
+
deepline plays share status company-to-contact --json
|
|
12183
|
+
deepline plays share publish company-to-contact --yes
|
|
12184
|
+
deepline plays share publish company-to-contact --version 3 --seo noindex --yes
|
|
12185
|
+
deepline plays share update company-to-contact --show-latency --json
|
|
12186
|
+
deepline plays share regenerate company-to-contact --json
|
|
12187
|
+
deepline plays share unpublish company-to-contact --yes
|
|
12188
|
+
`
|
|
12189
|
+
);
|
|
12190
|
+
share.command("status <play>").description("Show a play's share-page status and revision picker.").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (playName, options) => {
|
|
12191
|
+
process.exitCode = await handlePlayShareStatus([
|
|
12192
|
+
playName,
|
|
12193
|
+
...options.json ? ["--json"] : []
|
|
12194
|
+
]);
|
|
12195
|
+
});
|
|
12196
|
+
share.command("publish <play>").description(
|
|
12197
|
+
"Publish/repoint a PUBLIC page to a revision. Advanced; not recommended unless explicitly requested and risks confirmed."
|
|
12198
|
+
).option("--latest", "Publish the newest revision (default).").option("--version <n>", "Publish a specific version number.").option("--revision-id <id>", "Publish a specific revision id.").option("--seo <mode>", "SEO indexing: index | noindex.").option("--show-cost", "Show average Deepline credit cost on the page.").option("--show-latency", "Show average latency on the page.").option("--no-run-check", 'Skip the "must have a completed run" gate.').option(
|
|
12199
|
+
"-y, --yes",
|
|
12200
|
+
"Confirm public exposure of the play code/structure (required)."
|
|
12201
|
+
).option("--dry-run", "Show the planned publish without writing.").option("--json", "Emit JSON output. Also automatic when stdout is piped").addHelpText(
|
|
12202
|
+
"after",
|
|
12203
|
+
`
|
|
12204
|
+
WARNING \u2014 not recommended by default.
|
|
12205
|
+
Only run when the user has explicitly asked to share this play AND has
|
|
12206
|
+
confirmed they accept the exposure risks. Otherwise, do not publish.
|
|
12207
|
+
|
|
12208
|
+
Mutates cloud state. Creates a PUBLIC, SEO-indexable (unless --seo noindex),
|
|
12209
|
+
unlisted page; requires --yes to acknowledge it is publicly viewable.
|
|
12210
|
+
|
|
12211
|
+
Run results and row data are NEVER exposed. The page DOES expose the play's
|
|
12212
|
+
code/structure: step names, input/output field names, tool ids, step
|
|
12213
|
+
descriptions/prompts, and any hardcoded literals or comments in the source.
|
|
12214
|
+
This may reveal PII, internal domains/emails, or proprietary logic if such
|
|
12215
|
+
content lives in the play file. Review the source before publishing.
|
|
12216
|
+
|
|
12217
|
+
Exit codes: 0 ok; 2 usage/missing --yes; 4 play or version not found;
|
|
12218
|
+
7 no successful run for the play.
|
|
12219
|
+
|
|
12220
|
+
Examples:
|
|
12221
|
+
deepline plays share publish company-to-contact --yes
|
|
12222
|
+
deepline plays share publish company-to-contact --version 3 --seo noindex --yes --json
|
|
12223
|
+
`
|
|
12224
|
+
).action(async (playName, options) => {
|
|
12225
|
+
process.exitCode = await handlePlaySharePublish([
|
|
12226
|
+
playName,
|
|
12227
|
+
...options.latest ? ["--latest"] : [],
|
|
12228
|
+
...options.version ? ["--version", String(options.version)] : [],
|
|
12229
|
+
...options.revisionId ? ["--revision-id", options.revisionId] : [],
|
|
12230
|
+
...options.seo ? ["--seo", options.seo] : [],
|
|
12231
|
+
...options.showCost ? ["--show-cost"] : [],
|
|
12232
|
+
...options.showLatency ? ["--show-latency"] : [],
|
|
12233
|
+
...options.runCheck === false ? ["--no-run-check"] : [],
|
|
12234
|
+
...options.yes ? ["--yes"] : [],
|
|
12235
|
+
...options.dryRun ? ["--dry-run"] : [],
|
|
12236
|
+
...options.json ? ["--json"] : []
|
|
12237
|
+
]);
|
|
12238
|
+
});
|
|
12239
|
+
share.command("update <play>").description("Update share-page settings without moving the pointer.").option("--seo <mode>", "SEO indexing: index | noindex.").option("--show-cost", "Show average Deepline credit cost.").option("--hide-cost", "Hide average Deepline credit cost.").option("--show-latency", "Show average latency.").option("--hide-latency", "Hide average latency.").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (playName, options) => {
|
|
12240
|
+
process.exitCode = await handlePlayShareUpdate([
|
|
12241
|
+
playName,
|
|
12242
|
+
...options.seo ? ["--seo", options.seo] : [],
|
|
12243
|
+
...options.showCost ? ["--show-cost"] : [],
|
|
12244
|
+
...options.hideCost ? ["--hide-cost"] : [],
|
|
12245
|
+
...options.showLatency ? ["--show-latency"] : [],
|
|
12246
|
+
...options.hideLatency ? ["--hide-latency"] : [],
|
|
12247
|
+
...options.json ? ["--json"] : []
|
|
12248
|
+
]);
|
|
12249
|
+
});
|
|
12250
|
+
share.command("regenerate <play>").description("Regenerate the public page's LLM copy for a revision.").option("--version <n>", "Regenerate a specific version number.").option("--revision-id <id>", "Regenerate a specific revision id.").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (playName, options) => {
|
|
12251
|
+
process.exitCode = await handlePlayShareRegenerate([
|
|
12252
|
+
playName,
|
|
12253
|
+
...options.version ? ["--version", String(options.version)] : [],
|
|
12254
|
+
...options.revisionId ? ["--revision-id", options.revisionId] : [],
|
|
12255
|
+
...options.json ? ["--json"] : []
|
|
12256
|
+
]);
|
|
12257
|
+
});
|
|
12258
|
+
share.command("unpublish <play>").description(
|
|
12259
|
+
"Unshare: permanently delete the public page (frees it). Requires --yes."
|
|
12260
|
+
).option("-y, --yes", "Confirm taking the public page down (required).").option("--json", "Emit JSON output. Also automatic when stdout is piped").addHelpText(
|
|
12261
|
+
"after",
|
|
12262
|
+
`
|
|
12263
|
+
Mutates cloud state. Hard-deletes the page + its generated cards; the URL stops
|
|
12264
|
+
resolving. Org-admin only. Exit codes: 0 ok; 2 usage/missing --yes; 4 play not
|
|
12265
|
+
found.
|
|
12266
|
+
|
|
12267
|
+
Examples:
|
|
12268
|
+
deepline plays share unpublish company-to-contact --yes
|
|
12269
|
+
`
|
|
12270
|
+
).action(async (playName, options) => {
|
|
12271
|
+
process.exitCode = await handlePlayShareUnpublish([
|
|
12272
|
+
playName,
|
|
12273
|
+
...options.yes ? ["--yes"] : [],
|
|
12274
|
+
...options.json ? ["--json"] : []
|
|
12275
|
+
]);
|
|
12276
|
+
});
|
|
12277
|
+
}
|
|
12278
|
+
function shareFlagValue(args, flag) {
|
|
12279
|
+
const i = args.indexOf(flag);
|
|
12280
|
+
return i >= 0 && i + 1 < args.length ? args[i + 1] : void 0;
|
|
12281
|
+
}
|
|
12282
|
+
async function handlePlayShareStatus(args) {
|
|
12283
|
+
const target = args[0];
|
|
12284
|
+
if (!target) {
|
|
12285
|
+
console.error("Usage: deepline plays share status <play> [--json]");
|
|
12286
|
+
return 2;
|
|
12287
|
+
}
|
|
12288
|
+
const name = parseReferencedPlayTarget2(target).playName;
|
|
12289
|
+
const status = await new DeeplineClient().getSharePage(name);
|
|
12290
|
+
if (argsWantJson(args)) {
|
|
12291
|
+
process.stdout.write(`${JSON.stringify(status)}
|
|
12292
|
+
`);
|
|
12293
|
+
return 0;
|
|
12294
|
+
}
|
|
12295
|
+
if (!status.share) {
|
|
12296
|
+
console.log(`${status.playName}: not published.`);
|
|
12297
|
+
console.log(
|
|
12298
|
+
` Publish: deepline plays share publish ${status.playName} --yes`
|
|
12299
|
+
);
|
|
12300
|
+
return 0;
|
|
12301
|
+
}
|
|
12302
|
+
console.log(`${status.playName}: published v${status.share.publishedVersion}`);
|
|
12303
|
+
console.log(` url: ${status.share.publicPath}`);
|
|
12304
|
+
console.log(` seo: ${status.share.seoIndexing}`);
|
|
12305
|
+
console.log(
|
|
12306
|
+
` show: cost=${status.share.showAverageDeeplineCost} latency=${status.share.showAverageLatency}`
|
|
12307
|
+
);
|
|
12308
|
+
return 0;
|
|
12309
|
+
}
|
|
12310
|
+
async function handlePlaySharePublish(args) {
|
|
12311
|
+
const target = args[0];
|
|
12312
|
+
if (!target) {
|
|
12313
|
+
console.error(
|
|
12314
|
+
"Usage: deepline plays share publish <play> (--latest | --version <n> | --revision-id <id>) --yes [--seo index|noindex] [--show-cost] [--show-latency] [--json]"
|
|
12315
|
+
);
|
|
12316
|
+
return 2;
|
|
12317
|
+
}
|
|
12318
|
+
if (!args.includes("--yes")) {
|
|
12319
|
+
console.error(
|
|
12320
|
+
"Publishing creates a PUBLIC, SEO-indexable page. NOT recommended unless\nyou explicitly intend to share this play and accept the risks.\nRun results stay private, but the page exposes the play CODE: step names,\nfield names, tool ids, prompts/descriptions, and any hardcoded literals or\ncomments in the source \u2014 which may reveal PII or proprietary logic.\nReview the play source, then re-run with --yes to confirm."
|
|
12321
|
+
);
|
|
12322
|
+
return 2;
|
|
12323
|
+
}
|
|
12324
|
+
const name = parseReferencedPlayTarget2(target).playName;
|
|
12325
|
+
const client = new DeeplineClient();
|
|
12326
|
+
let revisionId = shareFlagValue(args, "--revision-id");
|
|
12327
|
+
let resolvedVersion;
|
|
12328
|
+
if (!revisionId) {
|
|
12329
|
+
const versions = await client.listPlayVersions(name);
|
|
12330
|
+
if (versions.length === 0) {
|
|
12331
|
+
console.error(
|
|
12332
|
+
`No saved revisions for ${name}. Run \`deepline plays set-live ${name}\` first.`
|
|
12333
|
+
);
|
|
12334
|
+
return 4;
|
|
12335
|
+
}
|
|
12336
|
+
const versionFlag = shareFlagValue(args, "--version");
|
|
12337
|
+
const chosen = versionFlag ? versions.find((r) => r.version === Number(versionFlag)) : versions[0];
|
|
12338
|
+
if (!chosen) {
|
|
12339
|
+
console.error(`Version ${versionFlag} not found for ${name}.`);
|
|
12340
|
+
return 4;
|
|
12341
|
+
}
|
|
12342
|
+
if (!chosen._id) {
|
|
12343
|
+
console.error("Resolved revision is missing an id.");
|
|
12344
|
+
return 5;
|
|
12345
|
+
}
|
|
12346
|
+
revisionId = chosen._id;
|
|
12347
|
+
resolvedVersion = chosen.version;
|
|
12348
|
+
}
|
|
12349
|
+
if (!args.includes("--no-run-check")) {
|
|
12350
|
+
const runs = await client.listRuns({ play: name });
|
|
12351
|
+
const hasCompleted = runs.some(
|
|
12352
|
+
(r) => String(r.status).toLowerCase() === "completed"
|
|
12353
|
+
);
|
|
12354
|
+
if (!hasCompleted) {
|
|
12355
|
+
const message = `No completed run for ${name}. Publish a play only after it has run successfully. (Override with --no-run-check.)`;
|
|
12356
|
+
if (argsWantJson(args)) {
|
|
12357
|
+
process.stdout.write(
|
|
12358
|
+
`${JSON.stringify({ ok: false, code: "NO_SUCCESSFUL_RUN", message, next: `deepline plays run ${name} --wait` })}
|
|
12359
|
+
`
|
|
12360
|
+
);
|
|
12361
|
+
} else {
|
|
12362
|
+
console.error(message);
|
|
12363
|
+
console.error(` deepline plays run ${name} --wait`);
|
|
12364
|
+
}
|
|
12365
|
+
return 7;
|
|
12366
|
+
}
|
|
12367
|
+
}
|
|
12368
|
+
const seo = shareFlagValue(args, "--seo");
|
|
12369
|
+
const seoIndexing = seo === "index" ? "index" : seo === "noindex" ? "noindex" : void 0;
|
|
12370
|
+
const request = {
|
|
12371
|
+
revisionId,
|
|
12372
|
+
acknowledgedUnlisted: true,
|
|
12373
|
+
showAverageDeeplineCost: args.includes("--show-cost"),
|
|
12374
|
+
showAverageLatency: args.includes("--show-latency"),
|
|
12375
|
+
...seoIndexing ? { seoIndexing } : {}
|
|
12376
|
+
};
|
|
12377
|
+
if (args.includes("--dry-run")) {
|
|
12378
|
+
const plan = { dryRun: true, name, version: resolvedVersion, ...request };
|
|
12379
|
+
if (argsWantJson(args)) {
|
|
12380
|
+
process.stdout.write(`${JSON.stringify(plan)}
|
|
12381
|
+
`);
|
|
12382
|
+
} else {
|
|
12383
|
+
console.log(
|
|
12384
|
+
`Would publish ${name}${resolvedVersion ? ` v${resolvedVersion}` : ""} (revision ${revisionId}).`
|
|
12385
|
+
);
|
|
12386
|
+
}
|
|
12387
|
+
return 0;
|
|
12388
|
+
}
|
|
12389
|
+
const status = await client.publishSharePage(name, request);
|
|
12390
|
+
if (argsWantJson(args)) {
|
|
12391
|
+
process.stdout.write(`${JSON.stringify(status)}
|
|
12392
|
+
`);
|
|
12393
|
+
return 0;
|
|
12394
|
+
}
|
|
12395
|
+
console.log(
|
|
12396
|
+
`Published ${name}${status.share ? ` v${status.share.publishedVersion}` : ""}: ${status.share?.publicPath ?? ""}`
|
|
12397
|
+
);
|
|
12398
|
+
if (status.warning) {
|
|
12399
|
+
console.error(`warning: ${status.warning}`);
|
|
12400
|
+
}
|
|
12401
|
+
return 0;
|
|
12402
|
+
}
|
|
12403
|
+
async function handlePlayShareUpdate(args) {
|
|
12404
|
+
const target = args[0];
|
|
12405
|
+
if (!target) {
|
|
12406
|
+
console.error(
|
|
12407
|
+
"Usage: deepline plays share update <play> [--seo index|noindex] [--show-cost|--hide-cost] [--show-latency|--hide-latency] [--json]"
|
|
12408
|
+
);
|
|
12409
|
+
return 2;
|
|
12410
|
+
}
|
|
12411
|
+
const name = parseReferencedPlayTarget2(target).playName;
|
|
12412
|
+
const seo = shareFlagValue(args, "--seo");
|
|
12413
|
+
const seoIndexing = seo === "index" ? "index" : seo === "noindex" ? "noindex" : void 0;
|
|
12414
|
+
const request = {
|
|
12415
|
+
...args.includes("--show-cost") ? { showAverageDeeplineCost: true } : args.includes("--hide-cost") ? { showAverageDeeplineCost: false } : {},
|
|
12416
|
+
...args.includes("--show-latency") ? { showAverageLatency: true } : args.includes("--hide-latency") ? { showAverageLatency: false } : {},
|
|
12417
|
+
...seoIndexing ? { seoIndexing } : {}
|
|
12418
|
+
};
|
|
12419
|
+
const status = await new DeeplineClient().updateSharePage(name, request);
|
|
12420
|
+
if (argsWantJson(args)) {
|
|
12421
|
+
process.stdout.write(`${JSON.stringify(status)}
|
|
12422
|
+
`);
|
|
12423
|
+
return 0;
|
|
12424
|
+
}
|
|
12425
|
+
console.log(`Updated ${name} share settings.`);
|
|
12426
|
+
return 0;
|
|
12427
|
+
}
|
|
12428
|
+
async function handlePlayShareRegenerate(args) {
|
|
12429
|
+
const target = args[0];
|
|
12430
|
+
if (!target) {
|
|
12431
|
+
console.error(
|
|
12432
|
+
"Usage: deepline plays share regenerate <play> [--version <n> | --revision-id <id>] [--json]"
|
|
12433
|
+
);
|
|
12434
|
+
return 2;
|
|
12435
|
+
}
|
|
12436
|
+
const name = parseReferencedPlayTarget2(target).playName;
|
|
12437
|
+
const client = new DeeplineClient();
|
|
12438
|
+
let revisionId = shareFlagValue(args, "--revision-id");
|
|
12439
|
+
const versionFlag = shareFlagValue(args, "--version");
|
|
12440
|
+
if (!revisionId && versionFlag) {
|
|
12441
|
+
const versions = await client.listPlayVersions(name);
|
|
12442
|
+
const chosen = versions.find((r) => r.version === Number(versionFlag));
|
|
12443
|
+
if (!chosen?._id) {
|
|
12444
|
+
console.error(`Version ${versionFlag} not found for ${name}.`);
|
|
12445
|
+
return 4;
|
|
12446
|
+
}
|
|
12447
|
+
revisionId = chosen._id;
|
|
12448
|
+
}
|
|
12449
|
+
const status = await client.regenerateSharePage(
|
|
12450
|
+
name,
|
|
12451
|
+
revisionId ? { revisionId } : {}
|
|
12452
|
+
);
|
|
12453
|
+
if (argsWantJson(args)) {
|
|
12454
|
+
process.stdout.write(`${JSON.stringify(status)}
|
|
12455
|
+
`);
|
|
12456
|
+
return 0;
|
|
12457
|
+
}
|
|
12458
|
+
console.log(`Regenerated public copy for ${name}.`);
|
|
12459
|
+
return 0;
|
|
12460
|
+
}
|
|
12461
|
+
async function handlePlayShareUnpublish(args) {
|
|
12462
|
+
const target = args[0];
|
|
12463
|
+
if (!target) {
|
|
12464
|
+
console.error("Usage: deepline plays share unpublish <play> --yes [--json]");
|
|
12465
|
+
return 2;
|
|
12466
|
+
}
|
|
12467
|
+
if (!args.includes("--yes")) {
|
|
12468
|
+
console.error(
|
|
12469
|
+
"Unpublishing permanently deletes the public page and frees its URL.\nRe-run with --yes to confirm."
|
|
12470
|
+
);
|
|
12471
|
+
return 2;
|
|
12472
|
+
}
|
|
12473
|
+
const name = parseReferencedPlayTarget2(target).playName;
|
|
12474
|
+
const status = await new DeeplineClient().unpublishSharePage(name);
|
|
12475
|
+
if (argsWantJson(args)) {
|
|
12476
|
+
process.stdout.write(`${JSON.stringify(status)}
|
|
12477
|
+
`);
|
|
12478
|
+
return 0;
|
|
12479
|
+
}
|
|
12480
|
+
console.log(`Unpublished ${name}; the public page has been removed.`);
|
|
12481
|
+
return 0;
|
|
12099
12482
|
}
|
|
12100
12483
|
|
|
12101
12484
|
// src/cli/commands/tools.ts
|