twentythree-cli 1.0.2 → 1.3.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/bin/dev.js CHANGED
File without changes
@@ -0,0 +1,87 @@
1
+ require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_lib_term_map = require("../../lib/term-map.cjs");
3
+ const require_lib_base_command = require("../../lib/base-command.cjs");
4
+ const require_lib_output = require("../../lib/output.cjs");
5
+ let _oclif_core = require("@oclif/core");
6
+ //#region src/commands/app/list.ts
7
+ /**
8
+ * App list command — returns paginated list of player design apps on the workspace.
9
+ */
10
+ var AppList = class AppList extends require_lib_base_command.AuthenticatedCommand {
11
+ static description = "List player design apps on the active workspace";
12
+ static examples = [
13
+ "<%= config.bin %> app list",
14
+ "<%= config.bin %> app list --app-id 42",
15
+ "<%= config.bin %> app list --page 2 --size 50",
16
+ "<%= config.bin %> app list --json"
17
+ ];
18
+ static enableJsonFlag = true;
19
+ static agentMetadata = {
20
+ api_endpoint: "POST /app/list",
21
+ auth_scope: "read",
22
+ output_shape: {
23
+ type: "table",
24
+ columns: [
25
+ "ID",
26
+ "Name",
27
+ "Type",
28
+ "Description"
29
+ ]
30
+ },
31
+ side_effects: "none"
32
+ };
33
+ static flags = {
34
+ ...require_lib_base_command.AuthenticatedCommand.baseFlags,
35
+ "app-id": _oclif_core.Flags.integer({
36
+ description: "Filter results to a specific app ID",
37
+ required: false
38
+ }),
39
+ page: _oclif_core.Flags.integer({
40
+ description: "Page offset",
41
+ required: false
42
+ }),
43
+ size: _oclif_core.Flags.integer({
44
+ description: "Number of results per page (default 20, max 100)",
45
+ required: false
46
+ })
47
+ };
48
+ static args = {};
49
+ async run() {
50
+ const { flags } = await this.parse(AppList);
51
+ this.printWorkspaceHeader();
52
+ const body = {};
53
+ if (flags["app-id"] !== void 0) body.app_id = flags["app-id"];
54
+ if (flags.page !== void 0) body.p = flags.page;
55
+ if (flags.size !== void 0) body.size = flags.size;
56
+ const { data, error } = await this.apiClient.POST("/app/list", {
57
+ body,
58
+ headers: { "Content-Type": "application/x-www-form-urlencoded" }
59
+ });
60
+ if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
61
+ const apps = data?.apps ?? data?.data ?? [];
62
+ if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
63
+ ok: true,
64
+ data: apps,
65
+ summary: "App list",
66
+ breadcrumbs: [{ domain: this.activeWorkspace.domain }, { resource: "app" }]
67
+ });
68
+ if (apps.length === 0) {
69
+ this.log("No apps found.");
70
+ return;
71
+ }
72
+ const table = require_lib_output.renderTable([
73
+ "ID",
74
+ "Name",
75
+ "Type",
76
+ "Description"
77
+ ], apps.map((a) => [
78
+ String(a.app_id ?? a.id ?? ""),
79
+ String(a.name ?? ""),
80
+ String(a.type ?? ""),
81
+ String(a.description ?? "")
82
+ ]));
83
+ this.log(table.toString());
84
+ }
85
+ };
86
+ //#endregion
87
+ module.exports = AppList;
@@ -0,0 +1,51 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_lib_term_map = require("../../lib/term-map.cjs");
3
+ const require_lib_base_command = require("../../lib/base-command.cjs");
4
+ const require_lib_output = require("../../lib/output.cjs");
5
+ let _oclif_core = require("@oclif/core");
6
+ let chalk = require("chalk");
7
+ chalk = require_runtime.__toESM(chalk);
8
+ //#region src/commands/app/remove-thumbnail.ts
9
+ /**
10
+ * App remove-thumbnail command — removes the custom thumbnail for an app, reverting to default.
11
+ *
12
+ * Threat mitigations:
13
+ * T-08-05: extends AuthenticatedCommand — anonymous mode rejected
14
+ */
15
+ var AppRemoveThumbnail = class AppRemoveThumbnail extends require_lib_base_command.AuthenticatedCommand {
16
+ static description = "Remove the custom thumbnail for an app, reverting to the default";
17
+ static examples = ["<%= config.bin %> app remove-thumbnail 42", "<%= config.bin %> app remove-thumbnail 42 --json"];
18
+ static enableJsonFlag = true;
19
+ static agentMetadata = {
20
+ api_endpoint: "POST /app/remove-thumbnail",
21
+ auth_scope: "write",
22
+ output_shape: { type: "key-value" },
23
+ side_effects: "updates"
24
+ };
25
+ static flags = { ...require_lib_base_command.AuthenticatedCommand.baseFlags };
26
+ static args = { id: _oclif_core.Args.string({
27
+ description: "App ID",
28
+ required: true
29
+ }) };
30
+ async run() {
31
+ const { args } = await this.parse(AppRemoveThumbnail);
32
+ this.printWorkspaceHeader();
33
+ const { data, error } = await this.apiClient.POST("/app/remove-thumbnail", {
34
+ body: { app_id: Number(args.id) },
35
+ headers: { "Content-Type": "application/x-www-form-urlencoded" }
36
+ });
37
+ if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
38
+ this.log(chalk.default.green(`Thumbnail removed for app ${args.id}`));
39
+ if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
40
+ ok: true,
41
+ data,
42
+ summary: `Thumbnail removed for app ${args.id}`,
43
+ breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
44
+ resource: "app",
45
+ id: args.id
46
+ }]
47
+ });
48
+ }
49
+ };
50
+ //#endregion
51
+ module.exports = AppRemoveThumbnail;
@@ -0,0 +1,78 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_lib_term_map = require("../../lib/term-map.cjs");
3
+ const require_lib_base_command = require("../../lib/base-command.cjs");
4
+ const require_lib_output = require("../../lib/output.cjs");
5
+ let _oclif_core = require("@oclif/core");
6
+ let chalk = require("chalk");
7
+ chalk = require_runtime.__toESM(chalk);
8
+ let node_fs = require("node:fs");
9
+ node_fs = require_runtime.__toESM(node_fs);
10
+ let node_path = require("node:path");
11
+ node_path = require_runtime.__toESM(node_path);
12
+ //#region src/commands/app/set-thumbnail.ts
13
+ /**
14
+ * App set-thumbnail command — uploads and sets a custom thumbnail image for an app.
15
+ *
16
+ * Uses direct multipart POST with bodySerializer to create FormData.
17
+ * Per D-3: NOT the chunked engine — thumbnail images use direct multipart upload.
18
+ *
19
+ * Threat mitigations:
20
+ * T-08-08: Validates file exists via fs.existsSync before reading
21
+ * T-08-05: extends AuthenticatedCommand — anonymous mode rejected
22
+ */
23
+ var AppSetThumbnail = class AppSetThumbnail extends require_lib_base_command.AuthenticatedCommand {
24
+ static description = "Upload and set a custom thumbnail image for an app";
25
+ static examples = ["<%= config.bin %> app set-thumbnail ./thumbnail.png --app-id 42", "<%= config.bin %> app set-thumbnail ./thumbnail.jpg --app-id 42 --json"];
26
+ static enableJsonFlag = true;
27
+ static agentMetadata = {
28
+ api_endpoint: "POST /app/set-thumbnail",
29
+ auth_scope: "write",
30
+ output_shape: { type: "key-value" },
31
+ side_effects: "updates"
32
+ };
33
+ static flags = {
34
+ ...require_lib_base_command.AuthenticatedCommand.baseFlags,
35
+ "app-id": _oclif_core.Flags.integer({
36
+ description: "App ID to update",
37
+ required: true
38
+ })
39
+ };
40
+ static args = { file: _oclif_core.Args.string({
41
+ description: "Path to the thumbnail image file",
42
+ required: true
43
+ }) };
44
+ async run() {
45
+ const { args, flags } = await this.parse(AppSetThumbnail);
46
+ this.printWorkspaceHeader();
47
+ const filePath = node_path.resolve(args.file);
48
+ if (!node_fs.existsSync(filePath)) this.error(`File not found: ${filePath}`, { exit: 1 });
49
+ const fileBuffer = node_fs.readFileSync(filePath);
50
+ const fileName = node_path.basename(filePath);
51
+ const fileBlob = new Blob([fileBuffer]);
52
+ const { data, error } = await this.apiClient.POST("/app/set-thumbnail", {
53
+ body: {
54
+ app_id: flags["app-id"],
55
+ file: fileBlob
56
+ },
57
+ bodySerializer(body) {
58
+ const fd = new FormData();
59
+ for (const [k, v] of Object.entries(body)) if (v !== void 0) if (v instanceof Blob) fd.append(k, v, fileName);
60
+ else fd.append(k, String(v));
61
+ return fd;
62
+ }
63
+ });
64
+ if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
65
+ this.log(chalk.default.green(`Thumbnail set for app ${flags["app-id"]}`));
66
+ if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
67
+ ok: true,
68
+ data,
69
+ summary: `Thumbnail set for app ${flags["app-id"]}`,
70
+ breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
71
+ resource: "app",
72
+ id: String(flags["app-id"])
73
+ }]
74
+ });
75
+ }
76
+ };
77
+ //#endregion
78
+ module.exports = AppSetThumbnail;
@@ -1,9 +1,10 @@
1
1
  const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
- let _oclif_core = require("@oclif/core");
2
+ const require_lib_base_command = require("../../lib/base-command.cjs");
3
+ const require_lib_detect_shell = require("../../lib/detect-shell.cjs");
3
4
  let _clack_prompts = require("@clack/prompts");
4
5
  _clack_prompts = require_runtime.__toESM(_clack_prompts);
5
6
  //#region src/commands/autocomplete/index.ts
6
- var Autocomplete = class Autocomplete extends _oclif_core.Command {
7
+ var Autocomplete = class Autocomplete extends require_lib_base_command.BaseCommand {
7
8
  static description = "Set up tab completion for your shell";
8
9
  static agentMetadata = {
9
10
  api_endpoint: "interactive",
@@ -12,11 +13,11 @@ var Autocomplete = class Autocomplete extends _oclif_core.Command {
12
13
  side_effects: "creates"
13
14
  };
14
15
  static examples = ["<%= config.bin %> autocomplete"];
16
+ async init() {}
15
17
  async run() {
16
18
  await this.parse(Autocomplete);
17
19
  _clack_prompts.intro("Tab completion setup");
18
- const rawShell = process.env.SHELL ?? "";
19
- const detectedShell = rawShell.endsWith("zsh") ? "zsh" : rawShell.endsWith("bash") ? "bash" : null;
20
+ const detectedShell = require_lib_detect_shell.detectShell(process.env.SHELL ?? "");
20
21
  let shell;
21
22
  if (detectedShell) {
22
23
  const confirm = await _clack_prompts.confirm({ message: `Detected shell: ${detectedShell}. Set up completion for ${detectedShell}?` });
@@ -70,7 +71,7 @@ var Autocomplete = class Autocomplete extends _oclif_core.Command {
70
71
  return;
71
72
  }
72
73
  const rcFile = shell === "zsh" ? "~/.zshrc" : "~/.bashrc";
73
- const evalLine = `printf "$(twentythree autocomplete script ${shell})" >> ${rcFile}; source ${rcFile}`;
74
+ const evalLine = `grep -qF 'twentythree autocomplete script ${shell}' ${rcFile} || printf "$(twentythree autocomplete script ${shell})" >> ${rcFile}; source ${rcFile}`;
74
75
  _clack_prompts.note(`Add tab completion to your shell by running:\n\n ${evalLine}\n\nThen restart your terminal or run: source ${rcFile}`, "Setup instructions");
75
76
  _clack_prompts.outro("After setup, try: twentythree video <TAB>");
76
77
  }
@@ -0,0 +1,51 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_lib_term_map = require("../../lib/term-map.cjs");
3
+ const require_lib_base_command = require("../../lib/base-command.cjs");
4
+ const require_lib_output = require("../../lib/output.cjs");
5
+ let _oclif_core = require("@oclif/core");
6
+ let chalk = require("chalk");
7
+ chalk = require_runtime.__toESM(chalk);
8
+ //#region src/commands/player/remove-thumbnail.ts
9
+ /**
10
+ * Player remove-thumbnail command — removes the custom thumbnail for a player,
11
+ * reverting it to the default generated thumbnail image.
12
+ *
13
+ * Maps to POST /player/remove-thumbnail.
14
+ */
15
+ var PlayerRemoveThumbnail = class PlayerRemoveThumbnail extends require_lib_base_command.AuthenticatedCommand {
16
+ static description = "Remove the custom thumbnail for a player, reverting to the default";
17
+ static examples = ["<%= config.bin %> player remove-thumbnail 42", "<%= config.bin %> player remove-thumbnail 42 --json"];
18
+ static enableJsonFlag = true;
19
+ static agentMetadata = {
20
+ api_endpoint: "POST /player/remove-thumbnail",
21
+ auth_scope: "write",
22
+ output_shape: { type: "key-value" },
23
+ side_effects: "updates"
24
+ };
25
+ static flags = { ...require_lib_base_command.AuthenticatedCommand.baseFlags };
26
+ static args = { id: _oclif_core.Args.string({
27
+ description: "Player ID",
28
+ required: true
29
+ }) };
30
+ async run() {
31
+ const { args } = await this.parse(PlayerRemoveThumbnail);
32
+ this.printWorkspaceHeader();
33
+ const { data, error } = await this.apiClient.POST("/player/remove-thumbnail", {
34
+ body: { player_id: Number(args.id) },
35
+ headers: { "Content-Type": "application/x-www-form-urlencoded" }
36
+ });
37
+ if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
38
+ this.log(chalk.default.green(`Thumbnail removed for player ${args.id}`));
39
+ if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
40
+ ok: true,
41
+ data,
42
+ summary: `Thumbnail removed for player ${args.id}`,
43
+ breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
44
+ resource: "player",
45
+ id: args.id
46
+ }]
47
+ });
48
+ }
49
+ };
50
+ //#endregion
51
+ module.exports = PlayerRemoveThumbnail;
@@ -0,0 +1,76 @@
1
+ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_lib_term_map = require("../../lib/term-map.cjs");
3
+ const require_lib_base_command = require("../../lib/base-command.cjs");
4
+ const require_lib_output = require("../../lib/output.cjs");
5
+ let _oclif_core = require("@oclif/core");
6
+ let chalk = require("chalk");
7
+ chalk = require_runtime.__toESM(chalk);
8
+ let node_fs = require("node:fs");
9
+ node_fs = require_runtime.__toESM(node_fs);
10
+ let node_path = require("node:path");
11
+ node_path = require_runtime.__toESM(node_path);
12
+ //#region src/commands/player/set-thumbnail.ts
13
+ /**
14
+ * Player set-thumbnail command — uploads and sets a custom thumbnail image for a player.
15
+ *
16
+ * Uses direct multipart POST with bodySerializer to create FormData.
17
+ * Per D-3: NOT the chunked engine — thumbnail images use direct multipart upload.
18
+ *
19
+ * Maps to POST /player/set-thumbnail.
20
+ */
21
+ var PlayerSetThumbnail = class PlayerSetThumbnail extends require_lib_base_command.AuthenticatedCommand {
22
+ static description = "Upload and set a custom thumbnail image for a player";
23
+ static examples = ["<%= config.bin %> player set-thumbnail ./thumbnail.png --player-id 42", "<%= config.bin %> player set-thumbnail ./thumbnail.jpg --player-id 42 --json"];
24
+ static enableJsonFlag = true;
25
+ static agentMetadata = {
26
+ api_endpoint: "POST /player/set-thumbnail",
27
+ auth_scope: "write",
28
+ output_shape: { type: "key-value" },
29
+ side_effects: "updates"
30
+ };
31
+ static flags = {
32
+ ...require_lib_base_command.AuthenticatedCommand.baseFlags,
33
+ "player-id": _oclif_core.Flags.integer({
34
+ description: "Player ID to update",
35
+ required: true
36
+ })
37
+ };
38
+ static args = { file: _oclif_core.Args.string({
39
+ description: "Path to the thumbnail image file",
40
+ required: true
41
+ }) };
42
+ async run() {
43
+ const { args, flags } = await this.parse(PlayerSetThumbnail);
44
+ this.printWorkspaceHeader();
45
+ const filePath = node_path.resolve(args.file);
46
+ if (!node_fs.existsSync(filePath)) this.error(`File not found: ${filePath}`, { exit: 1 });
47
+ const fileBuffer = node_fs.readFileSync(filePath);
48
+ const fileName = node_path.basename(filePath);
49
+ const fileBlob = new Blob([fileBuffer]);
50
+ const { data, error } = await this.apiClient.POST("/player/set-thumbnail", {
51
+ body: {
52
+ player_id: flags["player-id"],
53
+ file: fileBlob
54
+ },
55
+ bodySerializer(body) {
56
+ const fd = new FormData();
57
+ for (const [k, v] of Object.entries(body)) if (v !== void 0) if (v instanceof Blob) fd.append(k, v, fileName);
58
+ else fd.append(k, String(v));
59
+ return fd;
60
+ }
61
+ });
62
+ if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
63
+ this.log(chalk.default.green(`Thumbnail set for player ${flags["player-id"]}`));
64
+ if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
65
+ ok: true,
66
+ data,
67
+ summary: `Thumbnail set for player ${flags["player-id"]}`,
68
+ breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
69
+ resource: "player",
70
+ id: String(flags["player-id"])
71
+ }]
72
+ });
73
+ }
74
+ };
75
+ //#endregion
76
+ module.exports = PlayerSetThumbnail;
@@ -48,7 +48,7 @@ var PlayerUpdate = class PlayerUpdate extends require_lib_base_command.Authentic
48
48
  const { args, flags } = await this.parse(PlayerUpdate);
49
49
  this.printWorkspaceHeader();
50
50
  const body = { player_id: Number(args.id) };
51
- if (flags.name !== void 0) body.name = flags.name;
51
+ if (flags.name !== void 0) body.player_name = flags.name;
52
52
  if (flags.description !== void 0) body.description = flags.description;
53
53
  if (flags.data !== void 0) {
54
54
  let extra;
@@ -0,0 +1,59 @@
1
+ require("../../_virtual/_rolldown/runtime.cjs");
2
+ const require_lib_term_map = require("../../lib/term-map.cjs");
3
+ const require_lib_base_command = require("../../lib/base-command.cjs");
4
+ const require_lib_output = require("../../lib/output.cjs");
5
+ let _oclif_core = require("@oclif/core");
6
+ //#region src/commands/thumbnail/preview-scss.ts
7
+ /**
8
+ * Thumbnail preview-scss command — prerenders SCSS into CSS for previewing
9
+ * thumbnail templates without saving changes.
10
+ *
11
+ * Maps to POST /thumbnail/template/preview-scss.
12
+ */
13
+ var ThumbnailPreviewScss = class ThumbnailPreviewScss extends require_lib_base_command.AuthenticatedCommand {
14
+ static description = "Preview SCSS compiled to CSS for a thumbnail template";
15
+ static examples = ["<%= config.bin %> thumbnail preview-scss 42 --scss \".title { font-size: 32px; }\"", "<%= config.bin %> thumbnail preview-scss 42 --scss \".title { color: red; }\" --json"];
16
+ static enableJsonFlag = true;
17
+ static agentMetadata = {
18
+ api_endpoint: "POST /thumbnail/template/preview-scss",
19
+ auth_scope: "admin",
20
+ output_shape: { type: "key-value" },
21
+ side_effects: "none"
22
+ };
23
+ static flags = {
24
+ ...require_lib_base_command.AuthenticatedCommand.baseFlags,
25
+ scss: _oclif_core.Flags.string({
26
+ description: "SCSS styles to prerender into CSS",
27
+ required: true
28
+ })
29
+ };
30
+ static args = { id: _oclif_core.Args.string({
31
+ description: "Thumbnail template ID",
32
+ required: true
33
+ }) };
34
+ async run() {
35
+ const { args, flags } = await this.parse(ThumbnailPreviewScss);
36
+ this.printWorkspaceHeader();
37
+ const { data, error } = await this.apiClient.POST("/thumbnail/template/preview-scss", {
38
+ body: {
39
+ thumbnail_template_id: Number(args.id),
40
+ scss_template: flags.scss
41
+ },
42
+ headers: { "Content-Type": "application/x-www-form-urlencoded" }
43
+ });
44
+ if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
45
+ if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
46
+ ok: true,
47
+ data,
48
+ summary: `SCSS preview for thumbnail template ${args.id}`,
49
+ breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
50
+ resource: "thumbnail",
51
+ id: args.id
52
+ }]
53
+ });
54
+ const result = data?.data ?? data;
55
+ this.log(JSON.stringify(result, null, 2));
56
+ }
57
+ };
58
+ //#endregion
59
+ module.exports = ThumbnailPreviewScss;
@@ -0,0 +1,54 @@
1
+ const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
+ const require_lib_term_map = require("../../../lib/term-map.cjs");
3
+ const require_lib_base_command = require("../../../lib/base-command.cjs");
4
+ const require_lib_output = require("../../../lib/output.cjs");
5
+ let _oclif_core = require("@oclif/core");
6
+ let chalk = require("chalk");
7
+ chalk = require_runtime.__toESM(chalk);
8
+ //#region src/commands/video/section/generate.ts
9
+ /**
10
+ * Video section generate command — AI-generates sections from a video transcript.
11
+ *
12
+ * Replaces all existing sections. Requires a transcript to be available.
13
+ */
14
+ var VideoSectionGenerate = class VideoSectionGenerate extends require_lib_base_command.AuthenticatedCommand {
15
+ static description = "Automatically generate sections for a video using AI (requires transcript)";
16
+ static examples = ["<%= config.bin %> video section generate 12345", "<%= config.bin %> video section generate 12345 --json"];
17
+ static enableJsonFlag = true;
18
+ static agentMetadata = {
19
+ api_endpoint: "POST /photo/section/generate",
20
+ auth_scope: "write",
21
+ output_shape: { type: "key-value" },
22
+ side_effects: "creates"
23
+ };
24
+ static flags = { ...require_lib_base_command.AuthenticatedCommand.baseFlags };
25
+ static args = { id: _oclif_core.Args.string({
26
+ description: "Video ID",
27
+ required: true
28
+ }) };
29
+ async run() {
30
+ const { args } = await this.parse(VideoSectionGenerate);
31
+ this.printWorkspaceHeader();
32
+ const { data, error } = await this.apiClient.POST("/photo/section/generate", {
33
+ body: { photo_id: Number(args.id) },
34
+ headers: { "Content-Type": "application/x-www-form-urlencoded" }
35
+ });
36
+ if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
37
+ this.log(chalk.default.green(`Sections generated for video ${args.id}`));
38
+ if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
39
+ ok: true,
40
+ data,
41
+ summary: `Sections generated for video ${args.id}`,
42
+ breadcrumbs: [
43
+ { domain: this.activeWorkspace.domain },
44
+ {
45
+ resource: "video",
46
+ id: args.id
47
+ },
48
+ { resource: "section" }
49
+ ]
50
+ });
51
+ }
52
+ };
53
+ //#endregion
54
+ module.exports = VideoSectionGenerate;
@@ -1,75 +1,41 @@
1
- const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
2
1
  const require_lib_term_map = require("../../../lib/term-map.cjs");
3
2
  const require_lib_base_command = require("../../../lib/base-command.cjs");
4
3
  const require_lib_output = require("../../../lib/output.cjs");
5
- let _oclif_core = require("@oclif/core");
6
- let chalk = require("chalk");
7
- chalk = require_runtime.__toESM(chalk);
8
4
  //#region src/commands/video/subtitle/archive.ts
9
5
  /**
10
- * Video subtitle archive command — triggers workspace-level subtitle archive transcription
11
- * or checks transcription progress.
6
+ * Video subtitle archive command — checks workspace-level subtitle archive transcription progress.
12
7
  *
13
- * Without --progress: POST /photo/subtitle/archive/transcribe
14
- * Queues all eligible workspace videos for automatic transcription.
15
- *
16
- * With --progress: POST /photo/subtitle/archive/get-progress
8
+ * POST /photo/subtitle/archive/get-progress
17
9
  * Returns a breakdown of the archive transcription queue by status.
18
10
  *
19
- * Both operations are workspace-level (not video-specific).
11
+ * Note: The /photo/subtitle/archive/transcribe endpoint has been removed from the API.
20
12
  */
21
- var VideoSubtitleArchive = class VideoSubtitleArchive extends require_lib_base_command.AuthenticatedCommand {
22
- static description = "Manage workspace subtitle archive transcription";
23
- static examples = [
24
- "<%= config.bin %> video subtitle archive",
25
- "<%= config.bin %> video subtitle archive --progress",
26
- "<%= config.bin %> video subtitle archive --progress --json"
27
- ];
13
+ var VideoSubtitleArchive = class extends require_lib_base_command.AuthenticatedCommand {
14
+ static description = "Check workspace subtitle archive transcription progress";
15
+ static examples = ["<%= config.bin %> video subtitle archive", "<%= config.bin %> video subtitle archive --json"];
28
16
  static enableJsonFlag = true;
29
17
  static agentMetadata = {
30
- api_endpoint: "POST /photo/subtitle/archive/transcribe",
18
+ api_endpoint: "POST /photo/subtitle/archive/get-progress",
31
19
  auth_scope: "write",
32
20
  output_shape: { type: "key-value" },
33
- side_effects: "creates"
34
- };
35
- static flags = {
36
- ...require_lib_base_command.AuthenticatedCommand.baseFlags,
37
- progress: _oclif_core.Flags.boolean({
38
- description: "Check transcription progress instead of triggering transcription",
39
- default: false
40
- })
21
+ side_effects: "none"
41
22
  };
23
+ static flags = { ...require_lib_base_command.AuthenticatedCommand.baseFlags };
42
24
  async run() {
43
- const { flags } = await this.parse(VideoSubtitleArchive);
44
25
  this.printWorkspaceHeader();
45
- if (flags.progress) {
46
- const { data, error } = await this.apiClient.POST("/photo/subtitle/archive/get-progress", {
47
- body: {},
48
- headers: { "Content-Type": "application/x-www-form-urlencoded" }
49
- });
50
- if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
51
- if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
52
- ok: true,
53
- data,
54
- summary: "Subtitle archive transcription progress",
55
- breadcrumbs: [{ domain: this.activeWorkspace.domain }, { resource: "subtitle-archive" }]
56
- });
57
- const progress = data?.data ?? data;
58
- this.log(JSON.stringify(progress, null, 2));
59
- } else {
60
- const { data, error } = await this.apiClient.POST("/photo/subtitle/archive/transcribe", {
61
- body: {},
62
- headers: { "Content-Type": "application/x-www-form-urlencoded" }
63
- });
64
- if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
65
- this.log(chalk.default.green("Transcription started for all videos in the workspace archive"));
66
- if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
67
- ok: true,
68
- data,
69
- summary: "Transcription started for all videos in the workspace archive",
70
- breadcrumbs: [{ domain: this.activeWorkspace.domain }, { resource: "subtitle-archive" }]
71
- });
72
- }
26
+ const { data, error } = await this.apiClient.POST("/photo/subtitle/archive/get-progress", {
27
+ body: {},
28
+ headers: { "Content-Type": "application/x-www-form-urlencoded" }
29
+ });
30
+ if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
31
+ if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
32
+ ok: true,
33
+ data,
34
+ summary: "Subtitle archive transcription progress",
35
+ breadcrumbs: [{ domain: this.activeWorkspace.domain }, { resource: "subtitle-archive" }]
36
+ });
37
+ const progress = data?.data ?? data;
38
+ this.log(JSON.stringify(progress, null, 2));
73
39
  }
74
40
  };
75
41
  //#endregion
@@ -71,6 +71,15 @@ var VideoUpdate = class VideoUpdate extends require_lib_base_command.Authenticat
71
71
  allowNo: true,
72
72
  required: false
73
73
  }),
74
+ "seo-policy": _oclif_core.Flags.string({
75
+ description: "SEO policy for the video: index, noindex, or empty string to reset",
76
+ options: [
77
+ "",
78
+ "index",
79
+ "noindex"
80
+ ],
81
+ required: false
82
+ }),
74
83
  "published-p": _oclif_core.Flags.string({
75
84
  hidden: true,
76
85
  required: false
@@ -104,7 +113,8 @@ var VideoUpdate = class VideoUpdate extends require_lib_base_command.Authenticat
104
113
  flags["360"],
105
114
  flags["published-p"],
106
115
  flags["promoted-p"],
107
- flags["video-360-p"]
116
+ flags["video-360-p"],
117
+ flags["seo-policy"]
108
118
  ].some((v) => v !== void 0);
109
119
  const body = { photo_id: videoId };
110
120
  if (!metadataFlagsProvided && !this.jsonEnabled()) {
@@ -165,6 +175,7 @@ var VideoUpdate = class VideoUpdate extends require_lib_base_command.Authenticat
165
175
  if (promoteVal !== void 0) body.promoted_p = promoteVal ? 1 : 0;
166
176
  if (flags["publish-date"] !== void 0) body["publish_date"] = flags["publish-date"];
167
177
  if (video360Val !== void 0) body.video_360_p = video360Val ? 1 : 0;
178
+ if (flags["seo-policy"] !== void 0) body.seo_policy = flags["seo-policy"];
168
179
  }
169
180
  const { data: updateData, error: updateError } = await this.apiClient.POST("/photo/update", {
170
181
  body,
@@ -32,6 +32,15 @@ var WebinarSeriesUpdate = class WebinarSeriesUpdate extends require_lib_base_com
32
32
  description: _oclif_core.Flags.string({
33
33
  description: "Series description",
34
34
  required: false
35
+ }),
36
+ "seo-policy": _oclif_core.Flags.string({
37
+ description: "SEO policy for the series: index, noindex, or empty string to reset",
38
+ options: [
39
+ "",
40
+ "index",
41
+ "noindex"
42
+ ],
43
+ required: false
35
44
  })
36
45
  };
37
46
  static args = { id: _oclif_core.Args.string({
@@ -50,6 +59,7 @@ var WebinarSeriesUpdate = class WebinarSeriesUpdate extends require_lib_base_com
50
59
  const body = { live_series_id: Number(args.id) };
51
60
  if (flags.name !== void 0) body.name = flags.name;
52
61
  if (flags.description !== void 0) body.description = flags.description;
62
+ if (flags["seo-policy"] !== void 0) body.seo_policy = flags["seo-policy"];
53
63
  const { data, error } = await this.apiClient.POST("/live/series/update", {
54
64
  body,
55
65
  headers: { "Content-Type": "application/x-www-form-urlencoded" }