deepline 0.2.69 → 0.2.70
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/bundling-sources/sdk/src/client.ts +13 -2
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +15 -5
- package/dist/cli/index.js +143 -22
- package/dist/cli/index.mjs +143 -22
- package/dist/index.d.mts +19 -7
- package/dist/index.d.ts +19 -7
- package/dist/index.js +12 -3
- package/dist/index.mjs +12 -3
- package/package.json +1 -1
|
@@ -69,6 +69,7 @@ import type {
|
|
|
69
69
|
PublishPlayVersionResult,
|
|
70
70
|
StartPlayRunRequest,
|
|
71
71
|
DeletePlayResult,
|
|
72
|
+
RestorePlayResult,
|
|
72
73
|
SharePageStatus,
|
|
73
74
|
PublishSharePageRequest,
|
|
74
75
|
UpdateSharePageRequest,
|
|
@@ -4066,14 +4067,24 @@ export class DeeplineClient {
|
|
|
4066
4067
|
}
|
|
4067
4068
|
|
|
4068
4069
|
/**
|
|
4069
|
-
*
|
|
4070
|
-
*
|
|
4070
|
+
* Move an org-owned play to Trash. This disables its active triggers while
|
|
4071
|
+
* retaining its revisions and run history so it can be restored. Deepline
|
|
4072
|
+
* prebuilt plays are read-only.
|
|
4071
4073
|
*/
|
|
4072
4074
|
async deletePlay(name: string): Promise<DeletePlayResult> {
|
|
4073
4075
|
const encodedName = encodeURIComponent(name);
|
|
4074
4076
|
return this.http.delete<DeletePlayResult>(`/api/v2/plays/${encodedName}`);
|
|
4075
4077
|
}
|
|
4076
4078
|
|
|
4079
|
+
/** Restore an org-owned play that was previously moved to Trash. */
|
|
4080
|
+
async restorePlay(name: string): Promise<RestorePlayResult> {
|
|
4081
|
+
const encodedName = encodeURIComponent(name);
|
|
4082
|
+
return this.http.post<RestorePlayResult>(
|
|
4083
|
+
`/api/v2/plays/${encodedName}/restore`,
|
|
4084
|
+
{},
|
|
4085
|
+
);
|
|
4086
|
+
}
|
|
4087
|
+
|
|
4077
4088
|
// ——————————————————————————————————————————————————————————
|
|
4078
4089
|
// Plays — public share pages
|
|
4079
4090
|
// ——————————————————————————————————————————————————————————
|
|
@@ -183,7 +183,7 @@ export const SDK_RELEASE = {
|
|
|
183
183
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
184
184
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
185
185
|
// release keeps lazy paging semantics independent of row residency.
|
|
186
|
-
version: '0.2.
|
|
186
|
+
version: '0.2.70',
|
|
187
187
|
contracts: {
|
|
188
188
|
api: {
|
|
189
189
|
name: 'sdk-http-api',
|
|
@@ -1547,14 +1547,24 @@ export interface PublishPlayVersionResult {
|
|
|
1547
1547
|
}
|
|
1548
1548
|
|
|
1549
1549
|
/**
|
|
1550
|
-
* Result returned after
|
|
1550
|
+
* Result returned after moving an org-owned play to Trash.
|
|
1551
|
+
*
|
|
1552
|
+
* `deletePlay` is retained as the SDK method name for compatibility, but play
|
|
1553
|
+
* deletion is soft: revisions and run history remain available if the play is
|
|
1554
|
+
* restored.
|
|
1551
1555
|
*/
|
|
1552
1556
|
export interface DeletePlayResult {
|
|
1553
|
-
|
|
1557
|
+
archived: boolean;
|
|
1558
|
+
alreadyArchived: boolean;
|
|
1559
|
+
name: string;
|
|
1560
|
+
archivedBindingCount: number;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
/** Result returned after restoring an org-owned play from Trash. */
|
|
1564
|
+
export interface RestorePlayResult {
|
|
1565
|
+
restored: boolean;
|
|
1566
|
+
alreadyActive?: boolean;
|
|
1554
1567
|
name: string;
|
|
1555
|
-
deletedRevisionCount: number;
|
|
1556
|
-
deletedBindingCount: number;
|
|
1557
|
-
deletedRunCount: number;
|
|
1558
1568
|
}
|
|
1559
1569
|
|
|
1560
1570
|
// ——————————————————————————————————————————————————————————
|
package/dist/cli/index.js
CHANGED
|
@@ -1044,7 +1044,7 @@ var SDK_RELEASE = {
|
|
|
1044
1044
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
1045
1045
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
1046
1046
|
// release keeps lazy paging semantics independent of row residency.
|
|
1047
|
-
version: "0.2.
|
|
1047
|
+
version: "0.2.70",
|
|
1048
1048
|
contracts: {
|
|
1049
1049
|
api: {
|
|
1050
1050
|
name: "sdk-http-api",
|
|
@@ -6050,13 +6050,22 @@ var DeeplineClient = class {
|
|
|
6050
6050
|
);
|
|
6051
6051
|
}
|
|
6052
6052
|
/**
|
|
6053
|
-
*
|
|
6054
|
-
*
|
|
6053
|
+
* Move an org-owned play to Trash. This disables its active triggers while
|
|
6054
|
+
* retaining its revisions and run history so it can be restored. Deepline
|
|
6055
|
+
* prebuilt plays are read-only.
|
|
6055
6056
|
*/
|
|
6056
6057
|
async deletePlay(name) {
|
|
6057
6058
|
const encodedName = encodeURIComponent(name);
|
|
6058
6059
|
return this.http.delete(`/api/v2/plays/${encodedName}`);
|
|
6059
6060
|
}
|
|
6061
|
+
/** Restore an org-owned play that was previously moved to Trash. */
|
|
6062
|
+
async restorePlay(name) {
|
|
6063
|
+
const encodedName = encodeURIComponent(name);
|
|
6064
|
+
return this.http.post(
|
|
6065
|
+
`/api/v2/plays/${encodedName}/restore`,
|
|
6066
|
+
{}
|
|
6067
|
+
);
|
|
6068
|
+
}
|
|
6060
6069
|
// ——————————————————————————————————————————————————————————
|
|
6061
6070
|
// Plays — public share pages
|
|
6062
6071
|
// ——————————————————————————————————————————————————————————
|
|
@@ -24673,15 +24682,32 @@ async function handlePlayPublish(args) {
|
|
|
24673
24682
|
async function handlePlayDelete(args) {
|
|
24674
24683
|
const playName = args[0];
|
|
24675
24684
|
if (!playName) {
|
|
24676
|
-
console.error(
|
|
24677
|
-
|
|
24685
|
+
console.error(
|
|
24686
|
+
"Usage: deepline plays delete <play-name> --yes [--dry-run] [--json]"
|
|
24687
|
+
);
|
|
24688
|
+
return 2;
|
|
24678
24689
|
}
|
|
24679
|
-
|
|
24690
|
+
if (looksLikeRunId(playName)) {
|
|
24691
|
+
console.error(
|
|
24692
|
+
formatPlayCommandReceivedRunIdError({
|
|
24693
|
+
command: "delete",
|
|
24694
|
+
runId: playName
|
|
24695
|
+
})
|
|
24696
|
+
);
|
|
24697
|
+
return 2;
|
|
24698
|
+
}
|
|
24699
|
+
if (isFileTarget(playName) || looksLikeFilePath(playName)) {
|
|
24700
|
+
console.error(
|
|
24701
|
+
"Refusing to delete a local file. This command only moves a saved org-owned play to Trash."
|
|
24702
|
+
);
|
|
24703
|
+
return 2;
|
|
24704
|
+
}
|
|
24705
|
+
const confirmed = args.includes("--yes") || args.includes("-y");
|
|
24680
24706
|
if (!confirmed) {
|
|
24681
24707
|
console.error(
|
|
24682
|
-
"Refusing to
|
|
24708
|
+
"Refusing to move the play to Trash without --yes. This stops active triggers; the play can be restored later."
|
|
24683
24709
|
);
|
|
24684
|
-
return
|
|
24710
|
+
return 2;
|
|
24685
24711
|
}
|
|
24686
24712
|
const client2 = new DeeplineClient();
|
|
24687
24713
|
let detail;
|
|
@@ -24689,27 +24715,103 @@ async function handlePlayDelete(args) {
|
|
|
24689
24715
|
detail = await client2.getPlay(parseReferencedPlayTarget2(playName).playName);
|
|
24690
24716
|
} catch (error) {
|
|
24691
24717
|
console.error(error instanceof Error ? error.message : String(error));
|
|
24692
|
-
return
|
|
24718
|
+
return 5;
|
|
24693
24719
|
}
|
|
24694
24720
|
if (detail.play.ownerType === "deepline" || detail.play.origin === "prebuilt") {
|
|
24695
24721
|
console.error(
|
|
24696
|
-
`Cannot
|
|
24722
|
+
`Cannot move prebuilt play to Trash: ${formatPlayReference(detail.play)}`
|
|
24697
24723
|
);
|
|
24698
|
-
return
|
|
24724
|
+
return 2;
|
|
24699
24725
|
}
|
|
24700
|
-
const
|
|
24701
|
-
|
|
24702
|
-
);
|
|
24726
|
+
const resolvedName = parseReferencedPlayTarget2(
|
|
24727
|
+
formatPlayReference(detail.play)
|
|
24728
|
+
).playName;
|
|
24729
|
+
if (args.includes("--dry-run")) {
|
|
24730
|
+
const result2 = {
|
|
24731
|
+
ok: true,
|
|
24732
|
+
dryRun: true,
|
|
24733
|
+
name: resolvedName,
|
|
24734
|
+
plannedMutation: "move saved org-owned play to Trash and stop triggers"
|
|
24735
|
+
};
|
|
24736
|
+
if (argsWantJson(args)) {
|
|
24737
|
+
process.stdout.write(`${JSON.stringify(result2)}
|
|
24738
|
+
`);
|
|
24739
|
+
} else {
|
|
24740
|
+
process.stdout.write(
|
|
24741
|
+
`Dry run: would move ${result2.name} to Trash and stop its active triggers.
|
|
24742
|
+
`
|
|
24743
|
+
);
|
|
24744
|
+
}
|
|
24745
|
+
return 0;
|
|
24746
|
+
}
|
|
24747
|
+
const result = await client2.deletePlay(resolvedName);
|
|
24703
24748
|
if (argsWantJson(args)) {
|
|
24704
24749
|
process.stdout.write(`${JSON.stringify(result)}
|
|
24705
24750
|
`);
|
|
24706
|
-
return result.
|
|
24751
|
+
return result.archived || result.alreadyArchived ? 0 : 4;
|
|
24752
|
+
}
|
|
24753
|
+
if (result.alreadyArchived) {
|
|
24754
|
+
process.stdout.write(`Play ${result.name} is already in Trash.
|
|
24755
|
+
`);
|
|
24756
|
+
return 0;
|
|
24757
|
+
}
|
|
24758
|
+
if (!result.archived) {
|
|
24759
|
+
console.error(`Play not found: ${result.name}`);
|
|
24760
|
+
return 4;
|
|
24707
24761
|
}
|
|
24708
24762
|
process.stdout.write(
|
|
24709
|
-
`
|
|
24763
|
+
`Moved ${result.name} to Trash: stopped bindings=${result.archivedBindingCount}
|
|
24710
24764
|
`
|
|
24711
24765
|
);
|
|
24712
|
-
return
|
|
24766
|
+
return 0;
|
|
24767
|
+
}
|
|
24768
|
+
async function handlePlayRestore(args) {
|
|
24769
|
+
const playName = args[0];
|
|
24770
|
+
if (!playName) {
|
|
24771
|
+
console.error("Usage: deepline plays restore <play-name> [--json]");
|
|
24772
|
+
return 2;
|
|
24773
|
+
}
|
|
24774
|
+
if (looksLikeRunId(playName)) {
|
|
24775
|
+
console.error(
|
|
24776
|
+
formatPlayCommandReceivedRunIdError({
|
|
24777
|
+
command: "restore",
|
|
24778
|
+
runId: playName
|
|
24779
|
+
})
|
|
24780
|
+
);
|
|
24781
|
+
return 2;
|
|
24782
|
+
}
|
|
24783
|
+
if (isFileTarget(playName) || looksLikeFilePath(playName)) {
|
|
24784
|
+
console.error(
|
|
24785
|
+
"Refusing to restore a local file. This command only restores a saved org-owned play from Trash."
|
|
24786
|
+
);
|
|
24787
|
+
return 2;
|
|
24788
|
+
}
|
|
24789
|
+
const client2 = new DeeplineClient();
|
|
24790
|
+
try {
|
|
24791
|
+
const result = await client2.restorePlay(
|
|
24792
|
+
parseReferencedPlayTarget2(playName).playName
|
|
24793
|
+
);
|
|
24794
|
+
if (argsWantJson(args)) {
|
|
24795
|
+
process.stdout.write(`${JSON.stringify(result)}
|
|
24796
|
+
`);
|
|
24797
|
+
return result.restored || result.alreadyActive ? 0 : 4;
|
|
24798
|
+
}
|
|
24799
|
+
if (result.alreadyActive) {
|
|
24800
|
+
process.stdout.write(`Play ${result.name} is already active.
|
|
24801
|
+
`);
|
|
24802
|
+
return 0;
|
|
24803
|
+
}
|
|
24804
|
+
if (!result.restored) {
|
|
24805
|
+
console.error(`Play not found: ${result.name}`);
|
|
24806
|
+
return 4;
|
|
24807
|
+
}
|
|
24808
|
+
process.stdout.write(`Restored ${result.name} from Trash.
|
|
24809
|
+
`);
|
|
24810
|
+
return 0;
|
|
24811
|
+
} catch (error) {
|
|
24812
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
24813
|
+
return 5;
|
|
24814
|
+
}
|
|
24713
24815
|
}
|
|
24714
24816
|
function registerPlayCommands(program) {
|
|
24715
24817
|
const play = program.command("plays").description("Search, validate, run, and manage cloud plays.").addHelpText(
|
|
@@ -25094,21 +25196,40 @@ Examples:
|
|
|
25094
25196
|
...options.json ? ["--json"] : []
|
|
25095
25197
|
]);
|
|
25096
25198
|
});
|
|
25097
|
-
play.command("delete <target>").description("
|
|
25199
|
+
play.command("delete <target>").description("Move an org-owned play to Trash and stop its triggers.").addHelpText(
|
|
25098
25200
|
"after",
|
|
25099
25201
|
`
|
|
25100
25202
|
Notes:
|
|
25101
|
-
|
|
25102
|
-
|
|
25203
|
+
Soft delete. Moves an org-owned play to Trash and stops active triggers while
|
|
25204
|
+
retaining revisions and run history. Prebuilt/read-only plays are refused.
|
|
25205
|
+
Use --yes for noninteractive runs. Restore later with \`plays restore\`.
|
|
25103
25206
|
|
|
25104
25207
|
Examples:
|
|
25105
|
-
deepline plays delete my-play
|
|
25208
|
+
deepline plays delete my-play --yes
|
|
25106
25209
|
deepline plays delete my-play --yes --json
|
|
25210
|
+
deepline plays delete my-play --yes --dry-run --json
|
|
25107
25211
|
`
|
|
25108
|
-
).option("-y, --yes", "Confirm deletion").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (target, options) => {
|
|
25212
|
+
).option("-y, --yes", "Confirm deletion").option("--dry-run", "Show the planned archive without mutating the play").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (target, options) => {
|
|
25109
25213
|
process.exitCode = await handlePlayDelete([
|
|
25110
25214
|
target,
|
|
25111
25215
|
...options.yes ? ["--yes"] : [],
|
|
25216
|
+
...options.dryRun ? ["--dry-run"] : [],
|
|
25217
|
+
...options.json ? ["--json"] : []
|
|
25218
|
+
]);
|
|
25219
|
+
});
|
|
25220
|
+
play.command("restore <target>").description("Restore an org-owned play from Trash.").addHelpText(
|
|
25221
|
+
"after",
|
|
25222
|
+
`
|
|
25223
|
+
Notes:
|
|
25224
|
+
Restoring re-enables the saved play and recreates its trigger bindings.
|
|
25225
|
+
|
|
25226
|
+
Examples:
|
|
25227
|
+
deepline plays restore my-play
|
|
25228
|
+
deepline plays restore my-play --json
|
|
25229
|
+
`
|
|
25230
|
+
).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (target, options) => {
|
|
25231
|
+
process.exitCode = await handlePlayRestore([
|
|
25232
|
+
target,
|
|
25112
25233
|
...options.json ? ["--json"] : []
|
|
25113
25234
|
]);
|
|
25114
25235
|
});
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1030,7 +1030,7 @@ var SDK_RELEASE = {
|
|
|
1030
1030
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
1031
1031
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
1032
1032
|
// release keeps lazy paging semantics independent of row residency.
|
|
1033
|
-
version: "0.2.
|
|
1033
|
+
version: "0.2.70",
|
|
1034
1034
|
contracts: {
|
|
1035
1035
|
api: {
|
|
1036
1036
|
name: "sdk-http-api",
|
|
@@ -6036,13 +6036,22 @@ var DeeplineClient = class {
|
|
|
6036
6036
|
);
|
|
6037
6037
|
}
|
|
6038
6038
|
/**
|
|
6039
|
-
*
|
|
6040
|
-
*
|
|
6039
|
+
* Move an org-owned play to Trash. This disables its active triggers while
|
|
6040
|
+
* retaining its revisions and run history so it can be restored. Deepline
|
|
6041
|
+
* prebuilt plays are read-only.
|
|
6041
6042
|
*/
|
|
6042
6043
|
async deletePlay(name) {
|
|
6043
6044
|
const encodedName = encodeURIComponent(name);
|
|
6044
6045
|
return this.http.delete(`/api/v2/plays/${encodedName}`);
|
|
6045
6046
|
}
|
|
6047
|
+
/** Restore an org-owned play that was previously moved to Trash. */
|
|
6048
|
+
async restorePlay(name) {
|
|
6049
|
+
const encodedName = encodeURIComponent(name);
|
|
6050
|
+
return this.http.post(
|
|
6051
|
+
`/api/v2/plays/${encodedName}/restore`,
|
|
6052
|
+
{}
|
|
6053
|
+
);
|
|
6054
|
+
}
|
|
6046
6055
|
// ——————————————————————————————————————————————————————————
|
|
6047
6056
|
// Plays — public share pages
|
|
6048
6057
|
// ——————————————————————————————————————————————————————————
|
|
@@ -24725,15 +24734,32 @@ async function handlePlayPublish(args) {
|
|
|
24725
24734
|
async function handlePlayDelete(args) {
|
|
24726
24735
|
const playName = args[0];
|
|
24727
24736
|
if (!playName) {
|
|
24728
|
-
console.error(
|
|
24729
|
-
|
|
24737
|
+
console.error(
|
|
24738
|
+
"Usage: deepline plays delete <play-name> --yes [--dry-run] [--json]"
|
|
24739
|
+
);
|
|
24740
|
+
return 2;
|
|
24730
24741
|
}
|
|
24731
|
-
|
|
24742
|
+
if (looksLikeRunId(playName)) {
|
|
24743
|
+
console.error(
|
|
24744
|
+
formatPlayCommandReceivedRunIdError({
|
|
24745
|
+
command: "delete",
|
|
24746
|
+
runId: playName
|
|
24747
|
+
})
|
|
24748
|
+
);
|
|
24749
|
+
return 2;
|
|
24750
|
+
}
|
|
24751
|
+
if (isFileTarget(playName) || looksLikeFilePath(playName)) {
|
|
24752
|
+
console.error(
|
|
24753
|
+
"Refusing to delete a local file. This command only moves a saved org-owned play to Trash."
|
|
24754
|
+
);
|
|
24755
|
+
return 2;
|
|
24756
|
+
}
|
|
24757
|
+
const confirmed = args.includes("--yes") || args.includes("-y");
|
|
24732
24758
|
if (!confirmed) {
|
|
24733
24759
|
console.error(
|
|
24734
|
-
"Refusing to
|
|
24760
|
+
"Refusing to move the play to Trash without --yes. This stops active triggers; the play can be restored later."
|
|
24735
24761
|
);
|
|
24736
|
-
return
|
|
24762
|
+
return 2;
|
|
24737
24763
|
}
|
|
24738
24764
|
const client2 = new DeeplineClient();
|
|
24739
24765
|
let detail;
|
|
@@ -24741,27 +24767,103 @@ async function handlePlayDelete(args) {
|
|
|
24741
24767
|
detail = await client2.getPlay(parseReferencedPlayTarget2(playName).playName);
|
|
24742
24768
|
} catch (error) {
|
|
24743
24769
|
console.error(error instanceof Error ? error.message : String(error));
|
|
24744
|
-
return
|
|
24770
|
+
return 5;
|
|
24745
24771
|
}
|
|
24746
24772
|
if (detail.play.ownerType === "deepline" || detail.play.origin === "prebuilt") {
|
|
24747
24773
|
console.error(
|
|
24748
|
-
`Cannot
|
|
24774
|
+
`Cannot move prebuilt play to Trash: ${formatPlayReference(detail.play)}`
|
|
24749
24775
|
);
|
|
24750
|
-
return
|
|
24776
|
+
return 2;
|
|
24751
24777
|
}
|
|
24752
|
-
const
|
|
24753
|
-
|
|
24754
|
-
);
|
|
24778
|
+
const resolvedName = parseReferencedPlayTarget2(
|
|
24779
|
+
formatPlayReference(detail.play)
|
|
24780
|
+
).playName;
|
|
24781
|
+
if (args.includes("--dry-run")) {
|
|
24782
|
+
const result2 = {
|
|
24783
|
+
ok: true,
|
|
24784
|
+
dryRun: true,
|
|
24785
|
+
name: resolvedName,
|
|
24786
|
+
plannedMutation: "move saved org-owned play to Trash and stop triggers"
|
|
24787
|
+
};
|
|
24788
|
+
if (argsWantJson(args)) {
|
|
24789
|
+
process.stdout.write(`${JSON.stringify(result2)}
|
|
24790
|
+
`);
|
|
24791
|
+
} else {
|
|
24792
|
+
process.stdout.write(
|
|
24793
|
+
`Dry run: would move ${result2.name} to Trash and stop its active triggers.
|
|
24794
|
+
`
|
|
24795
|
+
);
|
|
24796
|
+
}
|
|
24797
|
+
return 0;
|
|
24798
|
+
}
|
|
24799
|
+
const result = await client2.deletePlay(resolvedName);
|
|
24755
24800
|
if (argsWantJson(args)) {
|
|
24756
24801
|
process.stdout.write(`${JSON.stringify(result)}
|
|
24757
24802
|
`);
|
|
24758
|
-
return result.
|
|
24803
|
+
return result.archived || result.alreadyArchived ? 0 : 4;
|
|
24804
|
+
}
|
|
24805
|
+
if (result.alreadyArchived) {
|
|
24806
|
+
process.stdout.write(`Play ${result.name} is already in Trash.
|
|
24807
|
+
`);
|
|
24808
|
+
return 0;
|
|
24809
|
+
}
|
|
24810
|
+
if (!result.archived) {
|
|
24811
|
+
console.error(`Play not found: ${result.name}`);
|
|
24812
|
+
return 4;
|
|
24759
24813
|
}
|
|
24760
24814
|
process.stdout.write(
|
|
24761
|
-
`
|
|
24815
|
+
`Moved ${result.name} to Trash: stopped bindings=${result.archivedBindingCount}
|
|
24762
24816
|
`
|
|
24763
24817
|
);
|
|
24764
|
-
return
|
|
24818
|
+
return 0;
|
|
24819
|
+
}
|
|
24820
|
+
async function handlePlayRestore(args) {
|
|
24821
|
+
const playName = args[0];
|
|
24822
|
+
if (!playName) {
|
|
24823
|
+
console.error("Usage: deepline plays restore <play-name> [--json]");
|
|
24824
|
+
return 2;
|
|
24825
|
+
}
|
|
24826
|
+
if (looksLikeRunId(playName)) {
|
|
24827
|
+
console.error(
|
|
24828
|
+
formatPlayCommandReceivedRunIdError({
|
|
24829
|
+
command: "restore",
|
|
24830
|
+
runId: playName
|
|
24831
|
+
})
|
|
24832
|
+
);
|
|
24833
|
+
return 2;
|
|
24834
|
+
}
|
|
24835
|
+
if (isFileTarget(playName) || looksLikeFilePath(playName)) {
|
|
24836
|
+
console.error(
|
|
24837
|
+
"Refusing to restore a local file. This command only restores a saved org-owned play from Trash."
|
|
24838
|
+
);
|
|
24839
|
+
return 2;
|
|
24840
|
+
}
|
|
24841
|
+
const client2 = new DeeplineClient();
|
|
24842
|
+
try {
|
|
24843
|
+
const result = await client2.restorePlay(
|
|
24844
|
+
parseReferencedPlayTarget2(playName).playName
|
|
24845
|
+
);
|
|
24846
|
+
if (argsWantJson(args)) {
|
|
24847
|
+
process.stdout.write(`${JSON.stringify(result)}
|
|
24848
|
+
`);
|
|
24849
|
+
return result.restored || result.alreadyActive ? 0 : 4;
|
|
24850
|
+
}
|
|
24851
|
+
if (result.alreadyActive) {
|
|
24852
|
+
process.stdout.write(`Play ${result.name} is already active.
|
|
24853
|
+
`);
|
|
24854
|
+
return 0;
|
|
24855
|
+
}
|
|
24856
|
+
if (!result.restored) {
|
|
24857
|
+
console.error(`Play not found: ${result.name}`);
|
|
24858
|
+
return 4;
|
|
24859
|
+
}
|
|
24860
|
+
process.stdout.write(`Restored ${result.name} from Trash.
|
|
24861
|
+
`);
|
|
24862
|
+
return 0;
|
|
24863
|
+
} catch (error) {
|
|
24864
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
24865
|
+
return 5;
|
|
24866
|
+
}
|
|
24765
24867
|
}
|
|
24766
24868
|
function registerPlayCommands(program) {
|
|
24767
24869
|
const play = program.command("plays").description("Search, validate, run, and manage cloud plays.").addHelpText(
|
|
@@ -25146,21 +25248,40 @@ Examples:
|
|
|
25146
25248
|
...options.json ? ["--json"] : []
|
|
25147
25249
|
]);
|
|
25148
25250
|
});
|
|
25149
|
-
play.command("delete <target>").description("
|
|
25251
|
+
play.command("delete <target>").description("Move an org-owned play to Trash and stop its triggers.").addHelpText(
|
|
25150
25252
|
"after",
|
|
25151
25253
|
`
|
|
25152
25254
|
Notes:
|
|
25153
|
-
|
|
25154
|
-
|
|
25255
|
+
Soft delete. Moves an org-owned play to Trash and stops active triggers while
|
|
25256
|
+
retaining revisions and run history. Prebuilt/read-only plays are refused.
|
|
25257
|
+
Use --yes for noninteractive runs. Restore later with \`plays restore\`.
|
|
25155
25258
|
|
|
25156
25259
|
Examples:
|
|
25157
|
-
deepline plays delete my-play
|
|
25260
|
+
deepline plays delete my-play --yes
|
|
25158
25261
|
deepline plays delete my-play --yes --json
|
|
25262
|
+
deepline plays delete my-play --yes --dry-run --json
|
|
25159
25263
|
`
|
|
25160
|
-
).option("-y, --yes", "Confirm deletion").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (target, options) => {
|
|
25264
|
+
).option("-y, --yes", "Confirm deletion").option("--dry-run", "Show the planned archive without mutating the play").option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (target, options) => {
|
|
25161
25265
|
process.exitCode = await handlePlayDelete([
|
|
25162
25266
|
target,
|
|
25163
25267
|
...options.yes ? ["--yes"] : [],
|
|
25268
|
+
...options.dryRun ? ["--dry-run"] : [],
|
|
25269
|
+
...options.json ? ["--json"] : []
|
|
25270
|
+
]);
|
|
25271
|
+
});
|
|
25272
|
+
play.command("restore <target>").description("Restore an org-owned play from Trash.").addHelpText(
|
|
25273
|
+
"after",
|
|
25274
|
+
`
|
|
25275
|
+
Notes:
|
|
25276
|
+
Restoring re-enables the saved play and recreates its trigger bindings.
|
|
25277
|
+
|
|
25278
|
+
Examples:
|
|
25279
|
+
deepline plays restore my-play
|
|
25280
|
+
deepline plays restore my-play --json
|
|
25281
|
+
`
|
|
25282
|
+
).option("--json", "Emit JSON output. Also automatic when stdout is piped").action(async (target, options) => {
|
|
25283
|
+
process.exitCode = await handlePlayRestore([
|
|
25284
|
+
target,
|
|
25164
25285
|
...options.json ? ["--json"] : []
|
|
25165
25286
|
]);
|
|
25166
25287
|
});
|
package/dist/index.d.mts
CHANGED
|
@@ -1634,14 +1634,23 @@ interface PublishPlayVersionResult {
|
|
|
1634
1634
|
triggerBindings?: unknown;
|
|
1635
1635
|
}
|
|
1636
1636
|
/**
|
|
1637
|
-
* Result returned after
|
|
1637
|
+
* Result returned after moving an org-owned play to Trash.
|
|
1638
|
+
*
|
|
1639
|
+
* `deletePlay` is retained as the SDK method name for compatibility, but play
|
|
1640
|
+
* deletion is soft: revisions and run history remain available if the play is
|
|
1641
|
+
* restored.
|
|
1638
1642
|
*/
|
|
1639
1643
|
interface DeletePlayResult {
|
|
1640
|
-
|
|
1644
|
+
archived: boolean;
|
|
1645
|
+
alreadyArchived: boolean;
|
|
1646
|
+
name: string;
|
|
1647
|
+
archivedBindingCount: number;
|
|
1648
|
+
}
|
|
1649
|
+
/** Result returned after restoring an org-owned play from Trash. */
|
|
1650
|
+
interface RestorePlayResult {
|
|
1651
|
+
restored: boolean;
|
|
1652
|
+
alreadyActive?: boolean;
|
|
1641
1653
|
name: string;
|
|
1642
|
-
deletedRevisionCount: number;
|
|
1643
|
-
deletedBindingCount: number;
|
|
1644
|
-
deletedRunCount: number;
|
|
1645
1654
|
}
|
|
1646
1655
|
/** Owner-facing view of a play's public share page. */
|
|
1647
1656
|
interface SharePageOwnerView {
|
|
@@ -3428,10 +3437,13 @@ declare class DeeplineClient {
|
|
|
3428
3437
|
*/
|
|
3429
3438
|
publishPlayVersion(name: string, request?: PublishPlayVersionRequest): Promise<PublishPlayVersionResult>;
|
|
3430
3439
|
/**
|
|
3431
|
-
*
|
|
3432
|
-
*
|
|
3440
|
+
* Move an org-owned play to Trash. This disables its active triggers while
|
|
3441
|
+
* retaining its revisions and run history so it can be restored. Deepline
|
|
3442
|
+
* prebuilt plays are read-only.
|
|
3433
3443
|
*/
|
|
3434
3444
|
deletePlay(name: string): Promise<DeletePlayResult>;
|
|
3445
|
+
/** Restore an org-owned play that was previously moved to Trash. */
|
|
3446
|
+
restorePlay(name: string): Promise<RestorePlayResult>;
|
|
3435
3447
|
/**
|
|
3436
3448
|
* Current share status for a play: the public page (if any), the published
|
|
3437
3449
|
* copy, and the revision picker. Read-only.
|
package/dist/index.d.ts
CHANGED
|
@@ -1634,14 +1634,23 @@ interface PublishPlayVersionResult {
|
|
|
1634
1634
|
triggerBindings?: unknown;
|
|
1635
1635
|
}
|
|
1636
1636
|
/**
|
|
1637
|
-
* Result returned after
|
|
1637
|
+
* Result returned after moving an org-owned play to Trash.
|
|
1638
|
+
*
|
|
1639
|
+
* `deletePlay` is retained as the SDK method name for compatibility, but play
|
|
1640
|
+
* deletion is soft: revisions and run history remain available if the play is
|
|
1641
|
+
* restored.
|
|
1638
1642
|
*/
|
|
1639
1643
|
interface DeletePlayResult {
|
|
1640
|
-
|
|
1644
|
+
archived: boolean;
|
|
1645
|
+
alreadyArchived: boolean;
|
|
1646
|
+
name: string;
|
|
1647
|
+
archivedBindingCount: number;
|
|
1648
|
+
}
|
|
1649
|
+
/** Result returned after restoring an org-owned play from Trash. */
|
|
1650
|
+
interface RestorePlayResult {
|
|
1651
|
+
restored: boolean;
|
|
1652
|
+
alreadyActive?: boolean;
|
|
1641
1653
|
name: string;
|
|
1642
|
-
deletedRevisionCount: number;
|
|
1643
|
-
deletedBindingCount: number;
|
|
1644
|
-
deletedRunCount: number;
|
|
1645
1654
|
}
|
|
1646
1655
|
/** Owner-facing view of a play's public share page. */
|
|
1647
1656
|
interface SharePageOwnerView {
|
|
@@ -3428,10 +3437,13 @@ declare class DeeplineClient {
|
|
|
3428
3437
|
*/
|
|
3429
3438
|
publishPlayVersion(name: string, request?: PublishPlayVersionRequest): Promise<PublishPlayVersionResult>;
|
|
3430
3439
|
/**
|
|
3431
|
-
*
|
|
3432
|
-
*
|
|
3440
|
+
* Move an org-owned play to Trash. This disables its active triggers while
|
|
3441
|
+
* retaining its revisions and run history so it can be restored. Deepline
|
|
3442
|
+
* prebuilt plays are read-only.
|
|
3433
3443
|
*/
|
|
3434
3444
|
deletePlay(name: string): Promise<DeletePlayResult>;
|
|
3445
|
+
/** Restore an org-owned play that was previously moved to Trash. */
|
|
3446
|
+
restorePlay(name: string): Promise<RestorePlayResult>;
|
|
3435
3447
|
/**
|
|
3436
3448
|
* Current share status for a play: the public page (if any), the published
|
|
3437
3449
|
* copy, and the revision picker. Read-only.
|
package/dist/index.js
CHANGED
|
@@ -780,7 +780,7 @@ var SDK_RELEASE = {
|
|
|
780
780
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
781
781
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
782
782
|
// release keeps lazy paging semantics independent of row residency.
|
|
783
|
-
version: "0.2.
|
|
783
|
+
version: "0.2.70",
|
|
784
784
|
contracts: {
|
|
785
785
|
api: {
|
|
786
786
|
name: "sdk-http-api",
|
|
@@ -5786,13 +5786,22 @@ var DeeplineClient = class {
|
|
|
5786
5786
|
);
|
|
5787
5787
|
}
|
|
5788
5788
|
/**
|
|
5789
|
-
*
|
|
5790
|
-
*
|
|
5789
|
+
* Move an org-owned play to Trash. This disables its active triggers while
|
|
5790
|
+
* retaining its revisions and run history so it can be restored. Deepline
|
|
5791
|
+
* prebuilt plays are read-only.
|
|
5791
5792
|
*/
|
|
5792
5793
|
async deletePlay(name) {
|
|
5793
5794
|
const encodedName = encodeURIComponent(name);
|
|
5794
5795
|
return this.http.delete(`/api/v2/plays/${encodedName}`);
|
|
5795
5796
|
}
|
|
5797
|
+
/** Restore an org-owned play that was previously moved to Trash. */
|
|
5798
|
+
async restorePlay(name) {
|
|
5799
|
+
const encodedName = encodeURIComponent(name);
|
|
5800
|
+
return this.http.post(
|
|
5801
|
+
`/api/v2/plays/${encodedName}/restore`,
|
|
5802
|
+
{}
|
|
5803
|
+
);
|
|
5804
|
+
}
|
|
5796
5805
|
// ——————————————————————————————————————————————————————————
|
|
5797
5806
|
// Plays — public share pages
|
|
5798
5807
|
// ——————————————————————————————————————————————————————————
|
package/dist/index.mjs
CHANGED
|
@@ -703,7 +703,7 @@ var SDK_RELEASE = {
|
|
|
703
703
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
704
704
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
705
705
|
// release keeps lazy paging semantics independent of row residency.
|
|
706
|
-
version: "0.2.
|
|
706
|
+
version: "0.2.70",
|
|
707
707
|
contracts: {
|
|
708
708
|
api: {
|
|
709
709
|
name: "sdk-http-api",
|
|
@@ -5709,13 +5709,22 @@ var DeeplineClient = class {
|
|
|
5709
5709
|
);
|
|
5710
5710
|
}
|
|
5711
5711
|
/**
|
|
5712
|
-
*
|
|
5713
|
-
*
|
|
5712
|
+
* Move an org-owned play to Trash. This disables its active triggers while
|
|
5713
|
+
* retaining its revisions and run history so it can be restored. Deepline
|
|
5714
|
+
* prebuilt plays are read-only.
|
|
5714
5715
|
*/
|
|
5715
5716
|
async deletePlay(name) {
|
|
5716
5717
|
const encodedName = encodeURIComponent(name);
|
|
5717
5718
|
return this.http.delete(`/api/v2/plays/${encodedName}`);
|
|
5718
5719
|
}
|
|
5720
|
+
/** Restore an org-owned play that was previously moved to Trash. */
|
|
5721
|
+
async restorePlay(name) {
|
|
5722
|
+
const encodedName = encodeURIComponent(name);
|
|
5723
|
+
return this.http.post(
|
|
5724
|
+
`/api/v2/plays/${encodedName}/restore`,
|
|
5725
|
+
{}
|
|
5726
|
+
);
|
|
5727
|
+
}
|
|
5719
5728
|
// ——————————————————————————————————————————————————————————
|
|
5720
5729
|
// Plays — public share pages
|
|
5721
5730
|
// ——————————————————————————————————————————————————————————
|