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 +0 -0
- package/dist/commands/app/list.cjs +87 -0
- package/dist/commands/app/remove-thumbnail.cjs +51 -0
- package/dist/commands/app/set-thumbnail.cjs +78 -0
- package/dist/commands/autocomplete/index.cjs +6 -5
- package/dist/commands/player/remove-thumbnail.cjs +51 -0
- package/dist/commands/player/set-thumbnail.cjs +76 -0
- package/dist/commands/player/update.cjs +1 -1
- package/dist/commands/thumbnail/preview-scss.cjs +59 -0
- package/dist/commands/video/section/generate.cjs +54 -0
- package/dist/commands/video/subtitle/archive.cjs +22 -56
- package/dist/commands/video/update.cjs +12 -1
- package/dist/commands/webinar/series/update.cjs +10 -0
- package/dist/commands/webinar/update.cjs +12 -1
- package/dist/lib/base-command.cjs +30 -2
- package/dist/lib/detect-shell.cjs +13 -0
- package/dist/upload/chunked-upload.cjs +2 -1
- package/oclif.manifest.json +4968 -4412
- package/package.json +13 -11
|
@@ -58,6 +58,15 @@ var WebinarUpdate = class WebinarUpdate extends require_lib_base_command.Authent
|
|
|
58
58
|
allowNo: true,
|
|
59
59
|
required: false
|
|
60
60
|
}),
|
|
61
|
+
"seo-policy": _oclif_core.Flags.string({
|
|
62
|
+
description: "SEO policy for the webinar: index, noindex, or empty string to reset",
|
|
63
|
+
options: [
|
|
64
|
+
"",
|
|
65
|
+
"index",
|
|
66
|
+
"noindex"
|
|
67
|
+
],
|
|
68
|
+
required: false
|
|
69
|
+
}),
|
|
61
70
|
"draft-p": _oclif_core.Flags.string({
|
|
62
71
|
hidden: true,
|
|
63
72
|
required: false
|
|
@@ -90,7 +99,8 @@ var WebinarUpdate = class WebinarUpdate extends require_lib_base_command.Authent
|
|
|
90
99
|
flags.draft,
|
|
91
100
|
flags.publish,
|
|
92
101
|
flags["draft-p"],
|
|
93
|
-
flags["published-p"]
|
|
102
|
+
flags["published-p"],
|
|
103
|
+
flags["seo-policy"]
|
|
94
104
|
].some((v) => v !== void 0);
|
|
95
105
|
const body = { live_id: webinarId };
|
|
96
106
|
if (!metadataFlagsProvided && !this.jsonEnabled()) {
|
|
@@ -170,6 +180,7 @@ var WebinarUpdate = class WebinarUpdate extends require_lib_base_command.Authent
|
|
|
170
180
|
if (draftVal !== void 0) body.draft_p = draftVal ? 1 : 0;
|
|
171
181
|
const publishVal = require_lib_output.parseBoolParam(flags.publish, flags["published-p"]);
|
|
172
182
|
if (publishVal !== void 0) body.published_p = publishVal ? 1 : 0;
|
|
183
|
+
if (flags["seo-policy"] !== void 0) body.seo_policy = flags["seo-policy"];
|
|
173
184
|
}
|
|
174
185
|
const { data: updateData, error: updateError } = await this.apiClient.POST("/live/update", {
|
|
175
186
|
body,
|
|
@@ -7,6 +7,7 @@ let _oclif_core = require("@oclif/core");
|
|
|
7
7
|
let chalk = require("chalk");
|
|
8
8
|
chalk = require_runtime.__toESM(chalk);
|
|
9
9
|
let _clack_prompts = require("@clack/prompts");
|
|
10
|
+
_clack_prompts = require_runtime.__toESM(_clack_prompts);
|
|
10
11
|
//#region src/lib/base-command.ts
|
|
11
12
|
var BaseCommand = class extends _oclif_core.Command {
|
|
12
13
|
static enableJsonFlag = true;
|
|
@@ -71,7 +72,7 @@ var BaseCommand = class extends _oclif_core.Command {
|
|
|
71
72
|
const result = require_auth_workspace_config.findWorkspace(workspaceFlagValue, require_auth_workspace_config.getWorkspaces());
|
|
72
73
|
if (result === null) this.error(`No workspace matching '${workspaceFlagValue}' found — run \`twentythree workspace list\` to see available workspaces`, { exit: 1 });
|
|
73
74
|
else if (Array.isArray(result)) {
|
|
74
|
-
const chosen = await
|
|
75
|
+
const chosen = await _clack_prompts.select({
|
|
75
76
|
message: `Multiple workspaces match '${workspaceFlagValue}'. Select one:`,
|
|
76
77
|
options: result.map((w) => ({
|
|
77
78
|
value: w.domain,
|
|
@@ -79,7 +80,9 @@ var BaseCommand = class extends _oclif_core.Command {
|
|
|
79
80
|
}))
|
|
80
81
|
});
|
|
81
82
|
if (typeof chosen === "symbol") this.error("Workspace selection cancelled", { exit: 1 });
|
|
82
|
-
|
|
83
|
+
const found = require_auth_workspace_config.getWorkspaceForDomain(chosen);
|
|
84
|
+
if (!found) this.error(`Workspace '${chosen}' could not be resolved — try running \`twentythree workspace list\``, { exit: 1 });
|
|
85
|
+
resolved = found;
|
|
83
86
|
} else resolved = result;
|
|
84
87
|
} else {
|
|
85
88
|
const activeDomain = require_auth_workspace_config.getActiveWorkspace();
|
|
@@ -100,6 +103,31 @@ var BaseCommand = class extends _oclif_core.Command {
|
|
|
100
103
|
token: this.activeWorkspace.bearer_token || void 0
|
|
101
104
|
});
|
|
102
105
|
}
|
|
106
|
+
async catch(err) {
|
|
107
|
+
if (!process.stdin.isTTY) return super.catch(err);
|
|
108
|
+
if (err.constructor.name !== "FailedFlagValidationError") return super.catch(err);
|
|
109
|
+
const flagNames = [...err.message.matchAll(/Missing required flag ([^\n]+)/g)].map((m) => m[1]);
|
|
110
|
+
if (flagNames.length === 0) return super.catch(err);
|
|
111
|
+
const inputFlags = err.parse?.input?.flags ?? {};
|
|
112
|
+
_clack_prompts.intro("Missing required input");
|
|
113
|
+
const extraArgv = [];
|
|
114
|
+
for (const flagName of flagNames) {
|
|
115
|
+
const flagDef = inputFlags[flagName];
|
|
116
|
+
const label = flagDef?.description ?? flagDef?.summary ?? flagName;
|
|
117
|
+
const value = await _clack_prompts.text({
|
|
118
|
+
message: label,
|
|
119
|
+
validate: (v) => !v || v.trim().length === 0 ? "Value is required" : void 0
|
|
120
|
+
});
|
|
121
|
+
if (_clack_prompts.isCancel(value)) {
|
|
122
|
+
_clack_prompts.cancel("Cancelled");
|
|
123
|
+
throw new _oclif_core.Errors.CLIError("Cancelled", { exit: 0 });
|
|
124
|
+
}
|
|
125
|
+
extraArgv.push(`--${flagName}`, value);
|
|
126
|
+
}
|
|
127
|
+
_clack_prompts.outro("Running command...");
|
|
128
|
+
const newArgv = [...this.argv ?? [], ...extraArgv];
|
|
129
|
+
await this.config.runCommand(this.id, newArgv);
|
|
130
|
+
}
|
|
103
131
|
/**
|
|
104
132
|
* Print the [domain] workspace header in dim style.
|
|
105
133
|
* Call at the top of every command's run() method (AUTH-04).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/lib/detect-shell.ts
|
|
3
|
+
/**
|
|
4
|
+
* Detect shell from the $SHELL environment variable.
|
|
5
|
+
* Returns 'zsh', 'bash', or null for unrecognized / unset shells.
|
|
6
|
+
*/
|
|
7
|
+
function detectShell(shellEnv) {
|
|
8
|
+
if (shellEnv.endsWith("zsh")) return "zsh";
|
|
9
|
+
if (shellEnv.endsWith("bash")) return "bash";
|
|
10
|
+
return null;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
exports.detectShell = detectShell;
|
|
@@ -71,7 +71,8 @@ async function uploadChunked(params) {
|
|
|
71
71
|
async function uploadFn(chunk) {
|
|
72
72
|
try {
|
|
73
73
|
const sliceBuffer = await readSlice(filePath, chunk.start, chunk.end);
|
|
74
|
-
const
|
|
74
|
+
const arrayBuffer = sliceBuffer.buffer.slice(sliceBuffer.byteOffset, sliceBuffer.byteOffset + sliceBuffer.byteLength);
|
|
75
|
+
const blob = new Blob([arrayBuffer]);
|
|
75
76
|
const formData = new FormData();
|
|
76
77
|
formData.append(tokenFieldName, uploadToken);
|
|
77
78
|
formData.append("file", blob, filename);
|