twentythree-cli 1.0.0 → 1.0.1
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/action/add.cjs +1 -1
- package/dist/commands/action/delete.cjs +1 -1
- package/dist/commands/action/exclude.cjs +1 -1
- package/dist/commands/action/get.cjs +1 -1
- package/dist/commands/action/include.cjs +1 -1
- package/dist/commands/action/list.cjs +1 -1
- package/dist/commands/action/types.cjs +1 -1
- package/dist/commands/action/update.cjs +1 -1
- package/dist/commands/action/upload.cjs +1 -1
- package/dist/commands/analytics/conversions/index.cjs +1 -1
- package/dist/commands/analytics/conversions/timeseries.cjs +1 -1
- package/dist/commands/analytics/conversions/totals.cjs +1 -1
- package/dist/commands/analytics/live/event-timeseries.cjs +1 -1
- package/dist/commands/analytics/live/event-totals.cjs +1 -1
- package/dist/commands/analytics/live/event.cjs +1 -1
- package/dist/commands/analytics/live/index.cjs +1 -1
- package/dist/commands/analytics/live/timeseries.cjs +1 -1
- package/dist/commands/analytics/live/totals.cjs +1 -1
- package/dist/commands/analytics/live/weekday/timeseries.cjs +1 -1
- package/dist/commands/analytics/live/weekday/totals.cjs +1 -1
- package/dist/commands/analytics/live/weekday.cjs +1 -1
- package/dist/commands/analytics/usage/devices/timeseries.cjs +1 -1
- package/dist/commands/analytics/usage/devices/totals.cjs +1 -1
- package/dist/commands/analytics/usage/devices.cjs +1 -1
- package/dist/commands/analytics/usage/domains/totals.cjs +1 -1
- package/dist/commands/analytics/usage/domains.cjs +1 -1
- package/dist/commands/analytics/usage/locations/totals.cjs +1 -1
- package/dist/commands/analytics/usage/locations.cjs +1 -1
- package/dist/commands/analytics/usage/sourceids/totals.cjs +1 -1
- package/dist/commands/analytics/usage/sourceids.cjs +1 -1
- package/dist/commands/analytics/usage/sources/totals.cjs +1 -1
- package/dist/commands/analytics/usage/sources.cjs +1 -1
- package/dist/commands/analytics/usage/spots/timeseries.cjs +1 -1
- package/dist/commands/analytics/usage/spots/totals.cjs +1 -1
- package/dist/commands/analytics/usage/spots.cjs +1 -1
- package/dist/commands/analytics/usage/storage.cjs +1 -1
- package/dist/commands/analytics/usage/traffic/timeseries.cjs +1 -1
- package/dist/commands/analytics/usage/traffic/totals.cjs +1 -1
- package/dist/commands/analytics/usage/traffic.cjs +1 -1
- package/dist/commands/analytics/video/index.cjs +1 -1
- package/dist/commands/analytics/video/performance/timeseries.cjs +1 -1
- package/dist/commands/analytics/video/performance/totals.cjs +1 -1
- package/dist/commands/analytics/video/performance.cjs +1 -1
- package/dist/commands/analytics/video/published/timeseries.cjs +1 -1
- package/dist/commands/analytics/video/published/totals.cjs +1 -1
- package/dist/commands/analytics/video/published.cjs +1 -1
- package/dist/commands/analytics/video/timeseries.cjs +1 -1
- package/dist/commands/analytics/video/totals.cjs +1 -1
- package/dist/commands/analytics/video/weekday/timeseries.cjs +1 -1
- package/dist/commands/analytics/video/weekday/totals.cjs +1 -1
- package/dist/commands/analytics/video/weekday.cjs +1 -1
- package/dist/commands/app/add.cjs +1 -1
- package/dist/commands/app/delete.cjs +1 -1
- package/dist/commands/app/update.cjs +1 -1
- package/dist/commands/audience/companies.cjs +1 -1
- package/dist/commands/audience/field/list.cjs +1 -1
- package/dist/commands/audience/field/remove.cjs +1 -1
- package/dist/commands/audience/field/set.cjs +1 -1
- package/dist/commands/audience/field/types.cjs +1 -1
- package/dist/commands/audience/funnel.cjs +1 -1
- package/dist/commands/audience/identity-sources.cjs +1 -1
- package/dist/commands/audience/list-collectors.cjs +1 -1
- package/dist/commands/audience/list.cjs +1 -1
- package/dist/commands/audience/metrics.cjs +1 -1
- package/dist/commands/audience/register.cjs +1 -1
- package/dist/commands/audience/remove.cjs +1 -1
- package/dist/commands/audience/search.cjs +1 -1
- package/dist/commands/audience/timelines.cjs +1 -1
- package/dist/commands/audience/unregister.cjs +1 -1
- package/dist/commands/auth/credentials.cjs +1 -1
- package/dist/commands/category/create.cjs +2 -2
- package/dist/commands/category/delete.cjs +1 -1
- package/dist/commands/category/list.cjs +2 -2
- package/dist/commands/category/update.cjs +2 -2
- package/dist/commands/collector/exclude.cjs +1 -1
- package/dist/commands/collector/include.cjs +1 -1
- package/dist/commands/collector/list.cjs +1 -1
- package/dist/commands/comment/add.cjs +1 -1
- package/dist/commands/comment/clone.cjs +1 -1
- package/dist/commands/comment/delete.cjs +1 -1
- package/dist/commands/comment/list.cjs +1 -1
- package/dist/commands/comment/promote.cjs +1 -1
- package/dist/commands/comment/reaction/add.cjs +1 -1
- package/dist/commands/comment/reaction/list.cjs +1 -1
- package/dist/commands/comment/reaction/remove.cjs +1 -1
- package/dist/commands/comment/set-order.cjs +1 -1
- package/dist/commands/comment/update.cjs +1 -1
- package/dist/commands/openupload/list.cjs +2 -2
- package/dist/commands/openupload/update-file.cjs +1 -1
- package/dist/commands/player/delete.cjs +1 -1
- package/dist/commands/player/embed-versions.cjs +1 -1
- package/dist/commands/player/embed.cjs +1 -1
- package/dist/commands/player/list.cjs +1 -1
- package/dist/commands/player/styles.cjs +1 -1
- package/dist/commands/player/update.cjs +1 -1
- package/dist/commands/poll/add.cjs +1 -1
- package/dist/commands/poll/answer.cjs +1 -1
- package/dist/commands/poll/list.cjs +1 -1
- package/dist/commands/poll/remove.cjs +1 -1
- package/dist/commands/poll/set-options.cjs +1 -1
- package/dist/commands/poll/update.cjs +1 -1
- package/dist/commands/presentation/page/link-locations.cjs +1 -1
- package/dist/commands/presentation/setting/list.cjs +1 -1
- package/dist/commands/presentation/setting/update.cjs +1 -1
- package/dist/commands/protection/protect.cjs +1 -1
- package/dist/commands/protection/unprotect.cjs +1 -1
- package/dist/commands/protection/verify.cjs +1 -1
- package/dist/commands/session/get-token.cjs +1 -1
- package/dist/commands/session/redeem-token.cjs +1 -1
- package/dist/commands/setting/update.cjs +2 -2
- package/dist/commands/site/get.cjs +3 -3
- package/dist/commands/site/search.cjs +1 -1
- package/dist/commands/spot/check.cjs +1 -1
- package/dist/commands/spot/create.cjs +1 -1
- package/dist/commands/spot/delete.cjs +1 -1
- package/dist/commands/spot/list.cjs +2 -2
- package/dist/commands/spot/reset-version.cjs +1 -1
- package/dist/commands/spot/set-videos.cjs +1 -1
- package/dist/commands/spot/update.cjs +2 -2
- package/dist/commands/tag/list.cjs +1 -1
- package/dist/commands/tag/related.cjs +1 -1
- package/dist/commands/thumbnail/add.cjs +1 -1
- package/dist/commands/thumbnail/data.cjs +1 -1
- package/dist/commands/thumbnail/delete.cjs +1 -1
- package/dist/commands/thumbnail/duplicate.cjs +1 -1
- package/dist/commands/thumbnail/file/delete.cjs +1 -1
- package/dist/commands/thumbnail/file/list.cjs +1 -1
- package/dist/commands/thumbnail/file/upload.cjs +1 -1
- package/dist/commands/thumbnail/list.cjs +1 -1
- package/dist/commands/thumbnail/update.cjs +1 -1
- package/dist/commands/user/create.cjs +2 -2
- package/dist/commands/user/get-login-token.cjs +1 -1
- package/dist/commands/user/get.cjs +2 -2
- package/dist/commands/user/list.cjs +1 -1
- package/dist/commands/user/redeem-login-token.cjs +1 -1
- package/dist/commands/user/send-invitation.cjs +1 -1
- package/dist/commands/user/update.cjs +1 -1
- package/dist/commands/video/frame.cjs +1 -1
- package/dist/commands/video/get.cjs +2 -2
- package/dist/commands/video/list.cjs +2 -2
- package/dist/commands/video/replace.cjs +1 -1
- package/dist/commands/video/section/create.cjs +1 -1
- package/dist/commands/video/section/delete.cjs +1 -1
- package/dist/commands/video/section/list.cjs +2 -2
- package/dist/commands/video/section/set-thumbnail.cjs +1 -1
- package/dist/commands/video/section/update.cjs +1 -1
- package/dist/commands/video/subtitle/archive.cjs +2 -2
- package/dist/commands/video/subtitle/create.cjs +2 -2
- package/dist/commands/video/subtitle/data.cjs +3 -1
- package/dist/commands/video/subtitle/delete.cjs +1 -1
- package/dist/commands/video/subtitle/duplicate.cjs +2 -2
- package/dist/commands/video/subtitle/list.cjs +2 -2
- package/dist/commands/video/subtitle/locales.cjs +1 -1
- package/dist/commands/video/subtitle/set-primary.cjs +1 -1
- package/dist/commands/video/subtitle/types.cjs +1 -1
- package/dist/commands/video/subtitle/update.cjs +3 -3
- package/dist/commands/video/subtitle/upload.cjs +2 -2
- package/dist/commands/video/transcoding-progress.cjs +2 -2
- package/dist/commands/video/update.cjs +4 -4
- package/dist/commands/webhook/events.cjs +2 -2
- package/dist/commands/webhook/list.cjs +1 -1
- package/dist/commands/webhook/sample.cjs +1 -1
- package/dist/commands/webhook/subscribe.cjs +1 -1
- package/dist/commands/webhook/unsubscribe.cjs +1 -1
- package/dist/commands/webinar/attachment/delete.cjs +1 -1
- package/dist/commands/webinar/attachment/list.cjs +2 -2
- package/dist/commands/webinar/attachment/set-hidden.cjs +1 -1
- package/dist/commands/webinar/clips.cjs +1 -1
- package/dist/commands/webinar/create.cjs +3 -3
- package/dist/commands/webinar/delete.cjs +1 -1
- package/dist/commands/webinar/highlights.cjs +1 -1
- package/dist/commands/webinar/list-formats.cjs +1 -1
- package/dist/commands/webinar/list.cjs +3 -3
- package/dist/commands/webinar/log.cjs +1 -1
- package/dist/commands/webinar/mail/add.cjs +1 -1
- package/dist/commands/webinar/mail/list.cjs +1 -1
- package/dist/commands/webinar/mail/remove.cjs +1 -1
- package/dist/commands/webinar/mail/send.cjs +1 -1
- package/dist/commands/webinar/mail/test.cjs +1 -1
- package/dist/commands/webinar/mail/update.cjs +1 -1
- package/dist/commands/webinar/metrics.cjs +1 -1
- package/dist/commands/webinar/queued-video/add.cjs +1 -1
- package/dist/commands/webinar/queued-video/remove.cjs +1 -1
- package/dist/commands/webinar/recording/split.cjs +1 -1
- package/dist/commands/webinar/recording/start.cjs +1 -1
- package/dist/commands/webinar/recording/status.cjs +1 -1
- package/dist/commands/webinar/recording/stop.cjs +1 -1
- package/dist/commands/webinar/repeat.cjs +1 -1
- package/dist/commands/webinar/room/connect.cjs +1 -1
- package/dist/commands/webinar/room/info.cjs +1 -1
- package/dist/commands/webinar/room/send-recording.cjs +1 -1
- package/dist/commands/webinar/room/themes.cjs +1 -1
- package/dist/commands/webinar/section/add.cjs +1 -1
- package/dist/commands/webinar/section/list.cjs +1 -1
- package/dist/commands/webinar/section/remove.cjs +1 -1
- package/dist/commands/webinar/section/update.cjs +1 -1
- package/dist/commands/webinar/series/apply-recurrence.cjs +1 -1
- package/dist/commands/webinar/series/cancel.cjs +1 -1
- package/dist/commands/webinar/series/create.cjs +1 -1
- package/dist/commands/webinar/series/delete.cjs +1 -1
- package/dist/commands/webinar/series/list.cjs +1 -1
- package/dist/commands/webinar/series/mapped-objects.cjs +1 -1
- package/dist/commands/webinar/series/metrics.cjs +1 -1
- package/dist/commands/webinar/series/recurrences.cjs +1 -1
- package/dist/commands/webinar/series/set-ondemand.cjs +1 -1
- package/dist/commands/webinar/series/skip-recurrence.cjs +1 -1
- package/dist/commands/webinar/series/update.cjs +1 -1
- package/dist/commands/webinar/speaker/add-from-speaker.cjs +1 -1
- package/dist/commands/webinar/speaker/add-from-user.cjs +1 -1
- package/dist/commands/webinar/speaker/add.cjs +1 -1
- package/dist/commands/webinar/speaker/cancel-guest-request.cjs +1 -1
- package/dist/commands/webinar/speaker/connection-types.cjs +1 -1
- package/dist/commands/webinar/speaker/library.cjs +1 -1
- package/dist/commands/webinar/speaker/list.cjs +1 -1
- package/dist/commands/webinar/speaker/remove-avatar.cjs +1 -1
- package/dist/commands/webinar/speaker/remove.cjs +1 -1
- package/dist/commands/webinar/speaker/request-guest.cjs +1 -1
- package/dist/commands/webinar/speaker/send-invitation.cjs +1 -1
- package/dist/commands/webinar/speaker/set-order.cjs +1 -1
- package/dist/commands/webinar/speaker/update.cjs +1 -1
- package/dist/commands/webinar/transcription/connect.cjs +1 -1
- package/dist/commands/webinar/transcription/list.cjs +1 -1
- package/dist/commands/webinar/transcription/locales.cjs +1 -1
- package/dist/commands/webinar/transcription/transcriptionlist.cjs +1 -1
- package/dist/commands/webinar/update.cjs +4 -4
- package/dist/lib/base-command.cjs +1 -1
- package/dist/lib/output.cjs +33 -0
- package/dist/upload/chunk-pool.cjs +4 -1
- package/oclif.manifest.json +2264 -2264
- package/package.json +11 -15
|
@@ -45,7 +45,7 @@ var WebinarSpeakerRequestGuest = class WebinarSpeakerRequestGuest extends requir
|
|
|
45
45
|
},
|
|
46
46
|
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
47
47
|
});
|
|
48
|
-
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
48
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
|
|
49
49
|
this.log(chalk.default.green("Guest request sent"));
|
|
50
50
|
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
51
51
|
ok: true,
|
|
@@ -45,7 +45,7 @@ var WebinarSpeakerSendInvitation = class WebinarSpeakerSendInvitation extends re
|
|
|
45
45
|
},
|
|
46
46
|
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
47
47
|
});
|
|
48
|
-
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
48
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
|
|
49
49
|
this.log(chalk.default.green("Speaker invitation sent"));
|
|
50
50
|
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
51
51
|
ok: true,
|
|
@@ -71,7 +71,7 @@ var WebinarSpeakerSetOrder = class WebinarSpeakerSetOrder extends require_lib_ba
|
|
|
71
71
|
},
|
|
72
72
|
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
73
73
|
});
|
|
74
|
-
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
74
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
|
|
75
75
|
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
76
76
|
ok: true,
|
|
77
77
|
data,
|
|
@@ -73,7 +73,7 @@ var WebinarSpeakerUpdate = class WebinarSpeakerUpdate extends require_lib_base_c
|
|
|
73
73
|
body,
|
|
74
74
|
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
75
75
|
});
|
|
76
|
-
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
76
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
|
|
77
77
|
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
78
78
|
ok: true,
|
|
79
79
|
data,
|
|
@@ -48,7 +48,7 @@ var WebinarTranscriptionConnect = class WebinarTranscriptionConnect extends requ
|
|
|
48
48
|
body,
|
|
49
49
|
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
50
50
|
});
|
|
51
|
-
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
51
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
|
|
52
52
|
this.log(chalk.default.green("Transcription connected"));
|
|
53
53
|
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
54
54
|
ok: true,
|
|
@@ -53,7 +53,7 @@ var WebinarTranscriptionList = class WebinarTranscriptionList extends require_li
|
|
|
53
53
|
live_id: Number(args.id),
|
|
54
54
|
token
|
|
55
55
|
} } });
|
|
56
|
-
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
56
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
|
|
57
57
|
const items = Array.isArray(data?.data) ? data.data : data?.data ? [data.data] : [];
|
|
58
58
|
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
59
59
|
ok: true,
|
|
@@ -49,7 +49,7 @@ var WebinarTranscriptionLocales = class WebinarTranscriptionLocales extends requ
|
|
|
49
49
|
live_id: Number(args.id),
|
|
50
50
|
token
|
|
51
51
|
} } });
|
|
52
|
-
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
52
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
|
|
53
53
|
const items = Array.isArray(data?.data) ? data.data : data?.data ? [data.data] : Array.isArray(data) ? data : [];
|
|
54
54
|
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
55
55
|
ok: true,
|
|
@@ -37,7 +37,7 @@ var WebinarTranscriptionTranscriptionlist = class WebinarTranscriptionTranscript
|
|
|
37
37
|
await this.parse(WebinarTranscriptionTranscriptionlist);
|
|
38
38
|
this.printWorkspaceHeader();
|
|
39
39
|
const { data, error } = await this.apiClient.GET("/live/transcriptionlist", { params: { query: {} } });
|
|
40
|
-
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
40
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
|
|
41
41
|
const items = Array.isArray(data?.data) ? data.data : data?.data ? [data.data] : Array.isArray(data) ? data : [];
|
|
42
42
|
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
43
43
|
ok: true,
|
|
@@ -95,7 +95,7 @@ var WebinarUpdate = class WebinarUpdate extends require_lib_base_command.Authent
|
|
|
95
95
|
const body = { live_id: webinarId };
|
|
96
96
|
if (!metadataFlagsProvided && !this.jsonEnabled()) {
|
|
97
97
|
const { data, error } = await this.apiClient.GET("/live/list", { params: { query: { live_id: webinarId } } });
|
|
98
|
-
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
98
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(error)), { exit: 1 });
|
|
99
99
|
const resp = data;
|
|
100
100
|
let current;
|
|
101
101
|
if (Array.isArray(resp?.data)) current = resp.data[0];
|
|
@@ -166,16 +166,16 @@ var WebinarUpdate = class WebinarUpdate extends require_lib_base_command.Authent
|
|
|
166
166
|
if (flags.description !== void 0) body.description = flags.description;
|
|
167
167
|
if (flags.status !== void 0) body.live_status = flags.status;
|
|
168
168
|
if (flags["live-date"] !== void 0) body.start_time = flags["live-date"];
|
|
169
|
-
const draftVal = parseBoolParam(flags.draft, flags["draft-p"]);
|
|
169
|
+
const draftVal = require_lib_output.parseBoolParam(flags.draft, flags["draft-p"]);
|
|
170
170
|
if (draftVal !== void 0) body.draft_p = draftVal ? 1 : 0;
|
|
171
|
-
const publishVal = parseBoolParam(flags.publish, flags["published-p"]);
|
|
171
|
+
const publishVal = require_lib_output.parseBoolParam(flags.publish, flags["published-p"]);
|
|
172
172
|
if (publishVal !== void 0) body.published_p = publishVal ? 1 : 0;
|
|
173
173
|
}
|
|
174
174
|
const { data: updateData, error: updateError } = await this.apiClient.POST("/live/update", {
|
|
175
175
|
body,
|
|
176
176
|
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
177
177
|
});
|
|
178
|
-
if (updateError) this.error(require_lib_term_map.applyCliTerms(formatApiError(updateError)), { exit: 1 });
|
|
178
|
+
if (updateError) this.error(require_lib_term_map.applyCliTerms(require_lib_output.formatApiError(updateError)), { exit: 1 });
|
|
179
179
|
this.log(chalk.default.green(`Webinar ${args.id} updated`));
|
|
180
180
|
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
181
181
|
ok: true,
|
|
@@ -128,7 +128,7 @@ var AuthenticatedCommand = class extends BaseCommand {
|
|
|
128
128
|
async fetchVideoToken(videoId) {
|
|
129
129
|
const { data, error } = await this.apiClient.GET("/photo/list", { params: { query: {
|
|
130
130
|
photo_id: Number(videoId),
|
|
131
|
-
include_unpublished_p: 1
|
|
131
|
+
include_unpublished_p: "1"
|
|
132
132
|
} } });
|
|
133
133
|
if (error) this.error(`Could not look up video ${videoId}: ${error}`, { exit: 1 });
|
|
134
134
|
const resp = data;
|
package/dist/lib/output.cjs
CHANGED
|
@@ -59,6 +59,37 @@ function formatBytes(bytes) {
|
|
|
59
59
|
return `${bytes} B`;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
|
+
* Serialize an openapi-fetch error to a readable string.
|
|
63
|
+
* Handles plain objects (JSON error bodies) that String() would render as "[object Object]".
|
|
64
|
+
*/
|
|
65
|
+
function formatApiError(error) {
|
|
66
|
+
if (error === null || error === void 0) return "Unknown error";
|
|
67
|
+
if (typeof error === "string") return error;
|
|
68
|
+
if (error instanceof Error) return error.message;
|
|
69
|
+
if (typeof error === "object") {
|
|
70
|
+
const e = error;
|
|
71
|
+
const msg = e?.message ?? e?.error ?? e?.error_description ?? e?.detail;
|
|
72
|
+
if (msg) return String(msg);
|
|
73
|
+
return JSON.stringify(error);
|
|
74
|
+
}
|
|
75
|
+
return String(error);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Resolves a boolean API parameter from:
|
|
79
|
+
* 1. A hidden raw _p-suffixed string alternative (e.g. --published-p 1)
|
|
80
|
+
* 2. A primary CLI boolean flag with allowNo (e.g. --publish / --no-publish)
|
|
81
|
+
*
|
|
82
|
+
* Returns undefined when neither is provided — the param is omitted from the request.
|
|
83
|
+
* Accepts '1'/'0', 'true'/'false', 'yes'/'no' for the string alternative.
|
|
84
|
+
*/
|
|
85
|
+
function parseBoolParam(primary, alt) {
|
|
86
|
+
if (alt !== void 0) {
|
|
87
|
+
const v = alt.toLowerCase();
|
|
88
|
+
return v === "1" || v === "true" || v === "yes";
|
|
89
|
+
}
|
|
90
|
+
return primary;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
62
93
|
* Resolve a potentially relative URL to an absolute URL using the workspace domain.
|
|
63
94
|
*
|
|
64
95
|
* - If url is undefined or empty, return it unchanged.
|
|
@@ -76,7 +107,9 @@ function resolveUrl(url, baseUrl) {
|
|
|
76
107
|
exports.EXIT_CANCELLED = EXIT_CANCELLED;
|
|
77
108
|
exports.EXIT_ERROR = EXIT_ERROR;
|
|
78
109
|
exports.EXIT_SUCCESS = EXIT_SUCCESS;
|
|
110
|
+
exports.formatApiError = formatApiError;
|
|
79
111
|
exports.formatBytes = formatBytes;
|
|
80
112
|
exports.formatJsonOutput = formatJsonOutput;
|
|
113
|
+
exports.parseBoolParam = parseBoolParam;
|
|
81
114
|
exports.renderTable = renderTable;
|
|
82
115
|
exports.resolveUrl = resolveUrl;
|
|
@@ -28,7 +28,10 @@ async function uploadChunkPool(params) {
|
|
|
28
28
|
onChunkComplete?.(chunk, response);
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
if (response.status === 500)
|
|
31
|
+
if (response.status === 500) {
|
|
32
|
+
const detail = response.data?.error ?? response.data?.message ?? JSON.stringify(response.data);
|
|
33
|
+
throw new Error(`Upload rejected by server (500)${detail ? `: ${detail}` : ""}`);
|
|
34
|
+
}
|
|
32
35
|
if (attempt >= maxRetries) throw new Error(`Chunk ${chunk.number} failed after ${maxRetries} retries`);
|
|
33
36
|
await delayFn(Math.min(1e3 * Math.pow(2, attempt), 3e4));
|
|
34
37
|
attempt++;
|