twentythree-cli 1.0.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/README.md +25 -0
- package/bin/dev.cmd +2 -0
- package/bin/dev.js +28 -0
- package/bin/run.cmd +2 -0
- package/bin/run.js +23 -0
- package/dist/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/api/client.cjs +24 -0
- package/dist/api/types.cjs +0 -0
- package/dist/auth/credential-store.cjs +22 -0
- package/dist/auth/token-refresh.cjs +70 -0
- package/dist/auth/workspace-config.cjs +61 -0
- package/dist/commands/action/add.cjs +75 -0
- package/dist/commands/action/delete.cjs +64 -0
- package/dist/commands/action/exclude.cjs +70 -0
- package/dist/commands/action/get.cjs +112 -0
- package/dist/commands/action/include.cjs +70 -0
- package/dist/commands/action/list.cjs +119 -0
- package/dist/commands/action/types.cjs +63 -0
- package/dist/commands/action/update.cjs +86 -0
- package/dist/commands/action/upload.cjs +89 -0
- package/dist/commands/analytics/conversions/index.cjs +83 -0
- package/dist/commands/analytics/conversions/timeseries.cjs +83 -0
- package/dist/commands/analytics/conversions/totals.cjs +83 -0
- package/dist/commands/analytics/live/event-timeseries.cjs +86 -0
- package/dist/commands/analytics/live/event-totals.cjs +86 -0
- package/dist/commands/analytics/live/event.cjs +88 -0
- package/dist/commands/analytics/live/index.cjs +89 -0
- package/dist/commands/analytics/live/timeseries.cjs +85 -0
- package/dist/commands/analytics/live/totals.cjs +85 -0
- package/dist/commands/analytics/live/weekday/timeseries.cjs +85 -0
- package/dist/commands/analytics/live/weekday/totals.cjs +85 -0
- package/dist/commands/analytics/live/weekday.cjs +88 -0
- package/dist/commands/analytics/usage/devices/timeseries.cjs +83 -0
- package/dist/commands/analytics/usage/devices/totals.cjs +86 -0
- package/dist/commands/analytics/usage/devices.cjs +89 -0
- package/dist/commands/analytics/usage/domains/totals.cjs +83 -0
- package/dist/commands/analytics/usage/domains.cjs +89 -0
- package/dist/commands/analytics/usage/locations/totals.cjs +83 -0
- package/dist/commands/analytics/usage/locations.cjs +89 -0
- package/dist/commands/analytics/usage/sourceids/totals.cjs +83 -0
- package/dist/commands/analytics/usage/sourceids.cjs +89 -0
- package/dist/commands/analytics/usage/sources/totals.cjs +83 -0
- package/dist/commands/analytics/usage/sources.cjs +89 -0
- package/dist/commands/analytics/usage/spots/timeseries.cjs +83 -0
- package/dist/commands/analytics/usage/spots/totals.cjs +83 -0
- package/dist/commands/analytics/usage/spots.cjs +89 -0
- package/dist/commands/analytics/usage/storage.cjs +52 -0
- package/dist/commands/analytics/usage/traffic/timeseries.cjs +83 -0
- package/dist/commands/analytics/usage/traffic/totals.cjs +86 -0
- package/dist/commands/analytics/usage/traffic.cjs +89 -0
- package/dist/commands/analytics/video/index.cjs +89 -0
- package/dist/commands/analytics/video/performance/timeseries.cjs +83 -0
- package/dist/commands/analytics/video/performance/totals.cjs +80 -0
- package/dist/commands/analytics/video/performance.cjs +89 -0
- package/dist/commands/analytics/video/published/timeseries.cjs +83 -0
- package/dist/commands/analytics/video/published/totals.cjs +80 -0
- package/dist/commands/analytics/video/published.cjs +89 -0
- package/dist/commands/analytics/video/timeseries.cjs +86 -0
- package/dist/commands/analytics/video/totals.cjs +86 -0
- package/dist/commands/analytics/video/weekday/timeseries.cjs +86 -0
- package/dist/commands/analytics/video/weekday/totals.cjs +83 -0
- package/dist/commands/analytics/video/weekday.cjs +89 -0
- package/dist/commands/app/add.cjs +76 -0
- package/dist/commands/app/delete.cjs +57 -0
- package/dist/commands/app/update.cjs +77 -0
- package/dist/commands/audience/companies.cjs +116 -0
- package/dist/commands/audience/field/list.cjs +83 -0
- package/dist/commands/audience/field/remove.cjs +63 -0
- package/dist/commands/audience/field/set.cjs +78 -0
- package/dist/commands/audience/field/types.cjs +57 -0
- package/dist/commands/audience/funnel.cjs +77 -0
- package/dist/commands/audience/identity-sources.cjs +64 -0
- package/dist/commands/audience/list-collectors.cjs +88 -0
- package/dist/commands/audience/list.cjs +122 -0
- package/dist/commands/audience/metrics.cjs +89 -0
- package/dist/commands/audience/register.cjs +106 -0
- package/dist/commands/audience/remove.cjs +72 -0
- package/dist/commands/audience/search.cjs +106 -0
- package/dist/commands/audience/timelines.cjs +115 -0
- package/dist/commands/audience/unregister.cjs +65 -0
- package/dist/commands/auth/credentials.cjs +89 -0
- package/dist/commands/auth/status.cjs +34 -0
- package/dist/commands/category/create.cjs +80 -0
- package/dist/commands/category/delete.cjs +70 -0
- package/dist/commands/category/index.cjs +11 -0
- package/dist/commands/category/list.cjs +98 -0
- package/dist/commands/category/update.cjs +134 -0
- package/dist/commands/collector/exclude.cjs +56 -0
- package/dist/commands/collector/include.cjs +56 -0
- package/dist/commands/collector/list.cjs +81 -0
- package/dist/commands/comment/add.cjs +102 -0
- package/dist/commands/comment/clone.cjs +59 -0
- package/dist/commands/comment/delete.cjs +55 -0
- package/dist/commands/comment/list.cjs +126 -0
- package/dist/commands/comment/promote.cjs +65 -0
- package/dist/commands/comment/reaction/add.cjs +81 -0
- package/dist/commands/comment/reaction/list.cjs +92 -0
- package/dist/commands/comment/reaction/remove.cjs +81 -0
- package/dist/commands/comment/set-order.cjs +63 -0
- package/dist/commands/comment/update.cjs +63 -0
- package/dist/commands/doctor.cjs +129 -0
- package/dist/commands/openupload/list.cjs +95 -0
- package/dist/commands/openupload/update-file.cjs +85 -0
- package/dist/commands/openupload/upload-file.cjs +130 -0
- package/dist/commands/player/delete.cjs +66 -0
- package/dist/commands/player/embed-versions.cjs +83 -0
- package/dist/commands/player/embed.cjs +134 -0
- package/dist/commands/player/list.cjs +86 -0
- package/dist/commands/player/styles.cjs +70 -0
- package/dist/commands/player/update.cjs +80 -0
- package/dist/commands/poll/add.cjs +84 -0
- package/dist/commands/poll/answer.cjs +89 -0
- package/dist/commands/poll/list.cjs +92 -0
- package/dist/commands/poll/remove.cjs +57 -0
- package/dist/commands/poll/set-options.cjs +84 -0
- package/dist/commands/poll/update.cjs +79 -0
- package/dist/commands/presentation/page/link-locations.cjs +57 -0
- package/dist/commands/presentation/setting/list.cjs +44 -0
- package/dist/commands/presentation/setting/update.cjs +67 -0
- package/dist/commands/protection/protect.cjs +68 -0
- package/dist/commands/protection/unprotect.cjs +65 -0
- package/dist/commands/protection/verify.cjs +80 -0
- package/dist/commands/session/get-token.cjs +75 -0
- package/dist/commands/session/redeem-token.cjs +56 -0
- package/dist/commands/setting/update.cjs +79 -0
- package/dist/commands/site/get.cjs +73 -0
- package/dist/commands/site/search.cjs +93 -0
- package/dist/commands/spot/check.cjs +52 -0
- package/dist/commands/spot/create.cjs +79 -0
- package/dist/commands/spot/delete.cjs +68 -0
- package/dist/commands/spot/list.cjs +120 -0
- package/dist/commands/spot/reset-version.cjs +53 -0
- package/dist/commands/spot/set-videos.cjs +64 -0
- package/dist/commands/spot/update.cjs +78 -0
- package/dist/commands/tag/list.cjs +98 -0
- package/dist/commands/tag/related.cjs +57 -0
- package/dist/commands/thumbnail/add.cjs +66 -0
- package/dist/commands/thumbnail/data.cjs +60 -0
- package/dist/commands/thumbnail/delete.cjs +61 -0
- package/dist/commands/thumbnail/duplicate.cjs +67 -0
- package/dist/commands/thumbnail/file/delete.cjs +71 -0
- package/dist/commands/thumbnail/file/list.cjs +74 -0
- package/dist/commands/thumbnail/file/upload.cjs +79 -0
- package/dist/commands/thumbnail/index.cjs +11 -0
- package/dist/commands/thumbnail/list.cjs +89 -0
- package/dist/commands/thumbnail/update.cjs +87 -0
- package/dist/commands/user/create.cjs +87 -0
- package/dist/commands/user/get-login-token.cjs +72 -0
- package/dist/commands/user/get.cjs +67 -0
- package/dist/commands/user/list.cjs +95 -0
- package/dist/commands/user/redeem-login-token.cjs +55 -0
- package/dist/commands/user/send-invitation.cjs +63 -0
- package/dist/commands/user/tokens.cjs +80 -0
- package/dist/commands/user/update.cjs +121 -0
- package/dist/commands/video/delete.cjs +67 -0
- package/dist/commands/video/frame.cjs +69 -0
- package/dist/commands/video/get.cjs +68 -0
- package/dist/commands/video/index.cjs +11 -0
- package/dist/commands/video/list.cjs +98 -0
- package/dist/commands/video/replace.cjs +126 -0
- package/dist/commands/video/section/create.cjs +73 -0
- package/dist/commands/video/section/delete.cjs +78 -0
- package/dist/commands/video/section/index.cjs +11 -0
- package/dist/commands/video/section/list.cjs +75 -0
- package/dist/commands/video/section/set-thumbnail.cjs +73 -0
- package/dist/commands/video/section/update.cjs +84 -0
- package/dist/commands/video/subtitle/archive.cjs +76 -0
- package/dist/commands/video/subtitle/create.cjs +80 -0
- package/dist/commands/video/subtitle/data.cjs +75 -0
- package/dist/commands/video/subtitle/delete.cjs +84 -0
- package/dist/commands/video/subtitle/duplicate.cjs +89 -0
- package/dist/commands/video/subtitle/index.cjs +11 -0
- package/dist/commands/video/subtitle/list.cjs +94 -0
- package/dist/commands/video/subtitle/locales.cjs +60 -0
- package/dist/commands/video/subtitle/set-primary.cjs +64 -0
- package/dist/commands/video/subtitle/types.cjs +42 -0
- package/dist/commands/video/subtitle/update.cjs +93 -0
- package/dist/commands/video/subtitle/upload.cjs +104 -0
- package/dist/commands/video/transcoding-progress.cjs +71 -0
- package/dist/commands/video/update.cjs +184 -0
- package/dist/commands/video/upload.cjs +151 -0
- package/dist/commands/webhook/events.cjs +68 -0
- package/dist/commands/webhook/list.cjs +64 -0
- package/dist/commands/webhook/sample.cjs +47 -0
- package/dist/commands/webhook/subscribe.cjs +66 -0
- package/dist/commands/webhook/unsubscribe.cjs +71 -0
- package/dist/commands/webinar/attachment/delete.cjs +79 -0
- package/dist/commands/webinar/attachment/list.cjs +94 -0
- package/dist/commands/webinar/attachment/set-hidden.cjs +85 -0
- package/dist/commands/webinar/attachment/upload.cjs +128 -0
- package/dist/commands/webinar/clips.cjs +77 -0
- package/dist/commands/webinar/create.cjs +107 -0
- package/dist/commands/webinar/delete.cjs +62 -0
- package/dist/commands/webinar/highlights.cjs +84 -0
- package/dist/commands/webinar/index.cjs +11 -0
- package/dist/commands/webinar/list-formats.cjs +50 -0
- package/dist/commands/webinar/list.cjs +134 -0
- package/dist/commands/webinar/log.cjs +69 -0
- package/dist/commands/webinar/mail/add.cjs +101 -0
- package/dist/commands/webinar/mail/list.cjs +83 -0
- package/dist/commands/webinar/mail/preview.cjs +75 -0
- package/dist/commands/webinar/mail/remove.cjs +75 -0
- package/dist/commands/webinar/mail/send.cjs +68 -0
- package/dist/commands/webinar/mail/test.cjs +86 -0
- package/dist/commands/webinar/mail/update.cjs +84 -0
- package/dist/commands/webinar/metrics.cjs +59 -0
- package/dist/commands/webinar/queued-video/add.cjs +81 -0
- package/dist/commands/webinar/queued-video/remove.cjs +81 -0
- package/dist/commands/webinar/recording/split.cjs +53 -0
- package/dist/commands/webinar/recording/start.cjs +53 -0
- package/dist/commands/webinar/recording/status.cjs +52 -0
- package/dist/commands/webinar/recording/stop.cjs +53 -0
- package/dist/commands/webinar/repeat.cjs +65 -0
- package/dist/commands/webinar/room/connect.cjs +60 -0
- package/dist/commands/webinar/room/info.cjs +60 -0
- package/dist/commands/webinar/room/send-recording.cjs +59 -0
- package/dist/commands/webinar/room/themes.cjs +63 -0
- package/dist/commands/webinar/section/add.cjs +98 -0
- package/dist/commands/webinar/section/list.cjs +86 -0
- package/dist/commands/webinar/section/remove.cjs +75 -0
- package/dist/commands/webinar/section/update.cjs +85 -0
- package/dist/commands/webinar/series/apply-recurrence.cjs +68 -0
- package/dist/commands/webinar/series/cancel.cjs +73 -0
- package/dist/commands/webinar/series/create.cjs +80 -0
- package/dist/commands/webinar/series/delete.cjs +73 -0
- package/dist/commands/webinar/series/list.cjs +79 -0
- package/dist/commands/webinar/series/mapped-objects.cjs +69 -0
- package/dist/commands/webinar/series/metrics.cjs +57 -0
- package/dist/commands/webinar/series/recurrences.cjs +72 -0
- package/dist/commands/webinar/series/set-ondemand.cjs +67 -0
- package/dist/commands/webinar/series/skip-recurrence.cjs +79 -0
- package/dist/commands/webinar/series/update.cjs +71 -0
- package/dist/commands/webinar/series/upload-thumbnail.cjs +117 -0
- package/dist/commands/webinar/speaker/add-from-speaker.cjs +78 -0
- package/dist/commands/webinar/speaker/add-from-user.cjs +78 -0
- package/dist/commands/webinar/speaker/add.cjs +112 -0
- package/dist/commands/webinar/speaker/cancel-guest-request.cjs +62 -0
- package/dist/commands/webinar/speaker/connection-types.cjs +66 -0
- package/dist/commands/webinar/speaker/library.cjs +59 -0
- package/dist/commands/webinar/speaker/list.cjs +90 -0
- package/dist/commands/webinar/speaker/remove-avatar.cjs +62 -0
- package/dist/commands/webinar/speaker/remove.cjs +69 -0
- package/dist/commands/webinar/speaker/request-guest.cjs +62 -0
- package/dist/commands/webinar/speaker/send-invitation.cjs +62 -0
- package/dist/commands/webinar/speaker/set-avatar.cjs +130 -0
- package/dist/commands/webinar/speaker/set-order.cjs +95 -0
- package/dist/commands/webinar/speaker/update.cjs +90 -0
- package/dist/commands/webinar/transcription/connect.cjs +69 -0
- package/dist/commands/webinar/transcription/list.cjs +88 -0
- package/dist/commands/webinar/transcription/locales.cjs +76 -0
- package/dist/commands/webinar/transcription/transcriptionlist.cjs +67 -0
- package/dist/commands/webinar/update.cjs +192 -0
- package/dist/commands/webinar/upload-image.cjs +133 -0
- package/dist/commands/workspace/list.cjs +47 -0
- package/dist/commands/workspace/use.cjs +52 -0
- package/dist/index.cjs +6 -0
- package/dist/lib/analytics-flags.cjs +60 -0
- package/dist/lib/audit.cjs +44 -0
- package/dist/lib/base-command.cjs +156 -0
- package/dist/lib/output.cjs +82 -0
- package/dist/lib/pagination.cjs +36 -0
- package/dist/lib/term-map.cjs +48 -0
- package/dist/upload/chunk-pool.cjs +47 -0
- package/dist/upload/chunked-upload.cjs +131 -0
- package/dist/upload/types.cjs +9 -0
- package/docs/commands/README.md +31 -0
- package/docs/commands/action/add.md +36 -0
- package/docs/commands/action/delete.md +32 -0
- package/docs/commands/action/exclude.md +38 -0
- package/docs/commands/action/get.md +47 -0
- package/docs/commands/action/include.md +38 -0
- package/docs/commands/action/list.md +43 -0
- package/docs/commands/action/types.md +34 -0
- package/docs/commands/action/update.md +42 -0
- package/docs/commands/action/upload.md +36 -0
- package/docs/commands/action.md +306 -0
- package/docs/commands/analytics/conversions.md +113 -0
- package/docs/commands/analytics/live.md +338 -0
- package/docs/commands/analytics/usage.md +674 -0
- package/docs/commands/analytics/video.md +449 -0
- package/docs/commands/analytics.md +1559 -0
- package/docs/commands/app/add.md +38 -0
- package/docs/commands/app/delete.md +32 -0
- package/docs/commands/app/update.md +41 -0
- package/docs/commands/app.md +101 -0
- package/docs/commands/audience/companies.md +41 -0
- package/docs/commands/audience/field.md +119 -0
- package/docs/commands/audience/funnel.md +38 -0
- package/docs/commands/audience/identity-sources.md +29 -0
- package/docs/commands/audience/list-collectors.md +35 -0
- package/docs/commands/audience/list.md +42 -0
- package/docs/commands/audience/metrics.md +40 -0
- package/docs/commands/audience/register.md +45 -0
- package/docs/commands/audience/remove.md +35 -0
- package/docs/commands/audience/search.md +39 -0
- package/docs/commands/audience/timelines.md +41 -0
- package/docs/commands/audience/unregister.md +36 -0
- package/docs/commands/audience.md +485 -0
- package/docs/commands/auth/credentials.md +23 -0
- package/docs/commands/auth/status.md +27 -0
- package/docs/commands/auth.md +45 -0
- package/docs/commands/category/create.md +36 -0
- package/docs/commands/category/delete.md +32 -0
- package/docs/commands/category/list.md +34 -0
- package/docs/commands/category/update.md +39 -0
- package/docs/commands/category.md +141 -0
- package/docs/commands/collector/exclude.md +33 -0
- package/docs/commands/collector/include.md +33 -0
- package/docs/commands/collector/list.md +37 -0
- package/docs/commands/collector.md +93 -0
- package/docs/commands/comment/add.md +43 -0
- package/docs/commands/comment/clone.md +35 -0
- package/docs/commands/comment/delete.md +32 -0
- package/docs/commands/comment/list.md +42 -0
- package/docs/commands/comment/promote.md +37 -0
- package/docs/commands/comment/reaction.md +106 -0
- package/docs/commands/comment/set-order.md +34 -0
- package/docs/commands/comment/update.md +36 -0
- package/docs/commands/comment.md +330 -0
- package/docs/commands/doctor.md +28 -0
- package/docs/commands/openupload/list.md +36 -0
- package/docs/commands/openupload/update-file.md +40 -0
- package/docs/commands/openupload/upload-file.md +39 -0
- package/docs/commands/openupload.md +105 -0
- package/docs/commands/player/delete.md +32 -0
- package/docs/commands/player/embed-versions.md +34 -0
- package/docs/commands/player/embed.md +51 -0
- package/docs/commands/player/list.md +32 -0
- package/docs/commands/player/styles.md +32 -0
- package/docs/commands/player/update.md +37 -0
- package/docs/commands/player.md +193 -0
- package/docs/commands/poll/add.md +33 -0
- package/docs/commands/poll/answer.md +38 -0
- package/docs/commands/poll/list.md +33 -0
- package/docs/commands/poll/remove.md +32 -0
- package/docs/commands/poll/set-options.md +35 -0
- package/docs/commands/poll/update.md +41 -0
- package/docs/commands/poll.md +187 -0
- package/docs/commands/presentation/page.md +29 -0
- package/docs/commands/presentation/setting.md +58 -0
- package/docs/commands/presentation.md +82 -0
- package/docs/commands/protection/protect.md +37 -0
- package/docs/commands/protection/unprotect.md +34 -0
- package/docs/commands/protection/verify.md +39 -0
- package/docs/commands/protection.md +100 -0
- package/docs/commands/session/get-token.md +38 -0
- package/docs/commands/session/redeem-token.md +32 -0
- package/docs/commands/session.md +65 -0
- package/docs/commands/setting/update.md +37 -0
- package/docs/commands/setting.md +37 -0
- package/docs/commands/site/get.md +35 -0
- package/docs/commands/site/search.md +38 -0
- package/docs/commands/site.md +68 -0
- package/docs/commands/spot/check.md +32 -0
- package/docs/commands/spot/create.md +38 -0
- package/docs/commands/spot/delete.md +32 -0
- package/docs/commands/spot/list.md +43 -0
- package/docs/commands/spot/reset-version.md +32 -0
- package/docs/commands/spot/set-videos.md +35 -0
- package/docs/commands/spot/update.md +40 -0
- package/docs/commands/spot.md +222 -0
- package/docs/commands/tag/list.md +44 -0
- package/docs/commands/tag/related.md +32 -0
- package/docs/commands/tag.md +71 -0
- package/docs/commands/thumbnail/add.md +33 -0
- package/docs/commands/thumbnail/data.md +35 -0
- package/docs/commands/thumbnail/delete.md +32 -0
- package/docs/commands/thumbnail/duplicate.md +37 -0
- package/docs/commands/thumbnail/file.md +90 -0
- package/docs/commands/thumbnail/list.md +37 -0
- package/docs/commands/thumbnail/update.md +44 -0
- package/docs/commands/thumbnail.md +293 -0
- package/docs/commands/user/create.md +41 -0
- package/docs/commands/user/get-login-token.md +37 -0
- package/docs/commands/user/get.md +37 -0
- package/docs/commands/user/list.md +40 -0
- package/docs/commands/user/redeem-login-token.md +32 -0
- package/docs/commands/user/send-invitation.md +37 -0
- package/docs/commands/user/tokens.md +34 -0
- package/docs/commands/user/update.md +44 -0
- package/docs/commands/user.md +267 -0
- package/docs/commands/video/delete.md +32 -0
- package/docs/commands/video/frame.md +37 -0
- package/docs/commands/video/get.md +32 -0
- package/docs/commands/video/list.md +33 -0
- package/docs/commands/video/replace.md +37 -0
- package/docs/commands/video/section.md +177 -0
- package/docs/commands/video/subtitle.md +362 -0
- package/docs/commands/video/transcoding-progress.md +32 -0
- package/docs/commands/video/update.md +45 -0
- package/docs/commands/video/upload.md +44 -0
- package/docs/commands/video.md +801 -0
- package/docs/commands/webhook/events.md +34 -0
- package/docs/commands/webhook/list.md +29 -0
- package/docs/commands/webhook/sample.md +32 -0
- package/docs/commands/webhook/subscribe.md +33 -0
- package/docs/commands/webhook/unsubscribe.md +35 -0
- package/docs/commands/webhook.md +143 -0
- package/docs/commands/webinar/attachment.md +135 -0
- package/docs/commands/webinar/clips.md +32 -0
- package/docs/commands/webinar/create.md +40 -0
- package/docs/commands/webinar/delete.md +32 -0
- package/docs/commands/webinar/highlights.md +37 -0
- package/docs/commands/webinar/list-formats.md +29 -0
- package/docs/commands/webinar/list.md +41 -0
- package/docs/commands/webinar/log.md +32 -0
- package/docs/commands/webinar/mail.md +238 -0
- package/docs/commands/webinar/metrics.md +32 -0
- package/docs/commands/webinar/queued-video.md +65 -0
- package/docs/commands/webinar/recording.md +113 -0
- package/docs/commands/webinar/repeat.md +35 -0
- package/docs/commands/webinar/room.md +110 -0
- package/docs/commands/webinar/section.md +134 -0
- package/docs/commands/webinar/series.md +365 -0
- package/docs/commands/webinar/speaker.md +430 -0
- package/docs/commands/webinar/transcription.md +125 -0
- package/docs/commands/webinar/update.md +43 -0
- package/docs/commands/webinar/upload-image.md +42 -0
- package/docs/commands/webinar.md +2030 -0
- package/docs/commands/workspace/list.md +27 -0
- package/docs/commands/workspace/use.md +32 -0
- package/docs/commands/workspace.md +54 -0
- package/docs/guides/api-spec-upgrade.md +92 -0
- package/docs/guides/getting-started.md +66 -0
- package/oclif.manifest.json +21609 -0
- package/package.json +71 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# TwentyThree CLI
|
|
2
|
+
|
|
3
|
+
Terminal access to every TwentyThree API endpoint.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install -g twentythree-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quickstart
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install -g twentythree-cli
|
|
15
|
+
twentythree auth credentials
|
|
16
|
+
twentythree video list
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Documentation
|
|
20
|
+
|
|
21
|
+
Full documentation, command reference, and guides are available on [GitHub](https://github.com/23/twentythree-cli).
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
MIT
|
package/bin/dev.cmd
ADDED
package/bin/dev.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// bin/dev.js — development mode; auto-transpiles TypeScript via tsx
|
|
3
|
+
|
|
4
|
+
const nodeVersion = process.versions.node
|
|
5
|
+
const [major] = nodeVersion.split('.').map(Number)
|
|
6
|
+
if (major < 22) {
|
|
7
|
+
process.stderr.write(
|
|
8
|
+
`\nError: twentythree requires Node.js 22 or later.\n` +
|
|
9
|
+
`You are running Node.js ${nodeVersion}.\n` +
|
|
10
|
+
`Please upgrade: https://nodejs.org\n\n`
|
|
11
|
+
)
|
|
12
|
+
process.exit(1)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
process.env.NODE_ENV = 'development'
|
|
16
|
+
|
|
17
|
+
// In dev mode, attempt tsx for TypeScript transpilation of src/commands
|
|
18
|
+
// Fallback to compiled dist if tsx is unavailable
|
|
19
|
+
void (async () => {
|
|
20
|
+
try {
|
|
21
|
+
require('tsx/cjs')
|
|
22
|
+
} catch (err) {
|
|
23
|
+
if (err?.code !== 'MODULE_NOT_FOUND') throw err
|
|
24
|
+
// tsx not installed — fall through to compiled dist
|
|
25
|
+
}
|
|
26
|
+
const oclif = await import('@oclif/core')
|
|
27
|
+
await oclif.execute({ development: true, dir: __dirname })
|
|
28
|
+
})()
|
package/bin/run.cmd
ADDED
package/bin/run.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// bin/run.js — MUST be plain JavaScript
|
|
3
|
+
|
|
4
|
+
// Node version guard: runs BEFORE oclif loads
|
|
5
|
+
// This is the only location that catches old Node reliably.
|
|
6
|
+
// The oclif init hook fires too late (after oclif itself is loaded).
|
|
7
|
+
const nodeVersion = process.versions.node
|
|
8
|
+
const [major] = nodeVersion.split('.').map(Number)
|
|
9
|
+
if (major < 22) {
|
|
10
|
+
process.stderr.write(
|
|
11
|
+
`\nError: twentythree requires Node.js 22 or later.\n` +
|
|
12
|
+
`You are running Node.js ${nodeVersion}.\n` +
|
|
13
|
+
`Please upgrade: https://nodejs.org\n\n`
|
|
14
|
+
)
|
|
15
|
+
process.exit(1)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Load oclif only after version check passes
|
|
19
|
+
// execute() is the documented CJS entry pattern; it calls run() + handle() internally
|
|
20
|
+
void (async () => {
|
|
21
|
+
const oclif = await import('@oclif/core')
|
|
22
|
+
await oclif.execute({ dir: __dirname })
|
|
23
|
+
})()
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.__toESM = __toESM;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
let openapi_fetch = require("openapi-fetch");
|
|
4
|
+
openapi_fetch = require_runtime.__toESM(openapi_fetch);
|
|
5
|
+
//#region src/api/client.ts
|
|
6
|
+
/**
|
|
7
|
+
* Create a typed openapi-fetch client for a TwentyThree workspace.
|
|
8
|
+
*
|
|
9
|
+
* When token is provided, an auth middleware injects the Authorization header.
|
|
10
|
+
* When token is undefined or empty string (domain-only mode per AUTH-11), no
|
|
11
|
+
* auth header is sent.
|
|
12
|
+
*
|
|
13
|
+
* Pass api_base_url from WorkspaceEntry directly — it already has a trailing slash.
|
|
14
|
+
*/
|
|
15
|
+
function createApiClient(config) {
|
|
16
|
+
const client = (0, openapi_fetch.default)({ baseUrl: config.baseUrl });
|
|
17
|
+
if (config.token) client.use({ async onRequest({ request }) {
|
|
18
|
+
request.headers.set("Authorization", `Bearer ${config.token}`);
|
|
19
|
+
return request;
|
|
20
|
+
} });
|
|
21
|
+
return client;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.createApiClient = createApiClient;
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
let _napi_rs_keyring = require("@napi-rs/keyring");
|
|
4
|
+
//#region src/auth/credential-store.ts
|
|
5
|
+
const SERVICE_NAME = "twentythree-cli";
|
|
6
|
+
function setCredential(domain, token) {
|
|
7
|
+
new _napi_rs_keyring.Entry(SERVICE_NAME, domain).setPassword(token);
|
|
8
|
+
}
|
|
9
|
+
function getCredential(domain) {
|
|
10
|
+
return new _napi_rs_keyring.Entry(SERVICE_NAME, domain).getPassword();
|
|
11
|
+
}
|
|
12
|
+
function deleteCredential(domain) {
|
|
13
|
+
return new _napi_rs_keyring.Entry(SERVICE_NAME, domain).deleteCredential();
|
|
14
|
+
}
|
|
15
|
+
function hasCredential(domain) {
|
|
16
|
+
return getCredential(domain) !== null;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.deleteCredential = deleteCredential;
|
|
20
|
+
exports.getCredential = getCredential;
|
|
21
|
+
exports.hasCredential = hasCredential;
|
|
22
|
+
exports.setCredential = setCredential;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_auth_credential_store = require("./credential-store.cjs");
|
|
4
|
+
const require_auth_workspace_config = require("./workspace-config.cjs");
|
|
5
|
+
let proper_lockfile = require("proper-lockfile");
|
|
6
|
+
proper_lockfile = require_runtime.__toESM(proper_lockfile);
|
|
7
|
+
//#region src/auth/token-refresh.ts
|
|
8
|
+
const REFRESH_THRESHOLD_MS = 300 * 1e3;
|
|
9
|
+
/**
|
|
10
|
+
* Fetch workspace tokens from /api/2/user/tokens?cross_sites_p=1.
|
|
11
|
+
* Uses the login token (from keychain) as the Authorization header.
|
|
12
|
+
* Returns an array of WorkspaceEntry objects parsed from the API response.
|
|
13
|
+
*
|
|
14
|
+
* Response shape (confirmed from live API — see 02-RESEARCH.md Pattern 6):
|
|
15
|
+
* { status: 'ok', sites: WorkspaceEntry[] }
|
|
16
|
+
* Field names in response match WorkspaceEntry exactly — no mapping needed.
|
|
17
|
+
*/
|
|
18
|
+
async function fetchWorkspaceTokens(domain, loginToken) {
|
|
19
|
+
const url = `https://${domain}/api/2/user/tokens?cross_sites_p=1`;
|
|
20
|
+
const response = await fetch(url, { headers: { Authorization: `Bearer ${loginToken}` } });
|
|
21
|
+
if (!response.ok) throw new Error(`Failed to fetch workspace tokens: ${response.status} ${response.statusText}`);
|
|
22
|
+
const json = await response.json();
|
|
23
|
+
return Array.isArray(json) ? json : json.tokens ?? json.sites ?? json.data ?? json.workspaces ?? [];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Ensure a fresh workspace token for the given domain.
|
|
27
|
+
* Returns the bearer_token string, or null if:
|
|
28
|
+
* - No workspace is configured for the domain
|
|
29
|
+
* - The workspace has no bearer_token (domain-only / anonymous mode)
|
|
30
|
+
* - No login token exists in the OS keychain
|
|
31
|
+
*
|
|
32
|
+
* If the token is near expiry (within REFRESH_THRESHOLD_MS), acquires a
|
|
33
|
+
* file lock on the conf config file and refreshes by re-calling
|
|
34
|
+
* /api/2/user/tokens. Re-checks token freshness after lock acquisition
|
|
35
|
+
* to prevent redundant refreshes from concurrent processes.
|
|
36
|
+
*
|
|
37
|
+
* Security: Login token transmitted only over HTTPS (hardcoded https:// in
|
|
38
|
+
* fetchWorkspaceTokens). Token values never appear in error messages — only
|
|
39
|
+
* HTTP status codes. Lock released in finally block to prevent stale locks.
|
|
40
|
+
*/
|
|
41
|
+
async function ensureFreshToken(domain) {
|
|
42
|
+
const workspace = require_auth_workspace_config.getWorkspaceForDomain(domain);
|
|
43
|
+
if (!workspace?.bearer_token) return null;
|
|
44
|
+
const now = Date.now();
|
|
45
|
+
if (new Date(workspace.expiration_time).getTime() - now > 3e5) return workspace.bearer_token;
|
|
46
|
+
const configPath = require_auth_workspace_config.getConfigPath();
|
|
47
|
+
let release;
|
|
48
|
+
try {
|
|
49
|
+
release = await proper_lockfile.lock(configPath, {
|
|
50
|
+
realpath: false,
|
|
51
|
+
retries: 3
|
|
52
|
+
});
|
|
53
|
+
const rechecked = require_auth_workspace_config.getWorkspaceForDomain(domain);
|
|
54
|
+
if (rechecked && new Date(rechecked.expiration_time).getTime() - Date.now() > 3e5) return rechecked.bearer_token;
|
|
55
|
+
const credDomain = require_auth_workspace_config.getCredentialDomain() ?? domain;
|
|
56
|
+
const loginToken = require_auth_credential_store.getCredential(credDomain);
|
|
57
|
+
if (!loginToken) return null;
|
|
58
|
+
const freshTokens = await fetchWorkspaceTokens(credDomain, loginToken);
|
|
59
|
+
require_auth_workspace_config.setWorkspaces(require_auth_workspace_config.getWorkspaces().map((w) => {
|
|
60
|
+
return freshTokens.find((f) => f.domain === w.domain) ?? w;
|
|
61
|
+
}));
|
|
62
|
+
return freshTokens.find((t) => t.domain === domain)?.bearer_token ?? null;
|
|
63
|
+
} finally {
|
|
64
|
+
await release?.();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
exports.REFRESH_THRESHOLD_MS = REFRESH_THRESHOLD_MS;
|
|
69
|
+
exports.ensureFreshToken = ensureFreshToken;
|
|
70
|
+
exports.fetchWorkspaceTokens = fetchWorkspaceTokens;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
let conf = require("conf");
|
|
4
|
+
conf = require_runtime.__toESM(conf);
|
|
5
|
+
//#region src/auth/workspace-config.ts
|
|
6
|
+
const config = new conf.default({
|
|
7
|
+
projectName: "twentythree-cli",
|
|
8
|
+
defaults: {
|
|
9
|
+
activeDomain: void 0,
|
|
10
|
+
credentialDomain: void 0,
|
|
11
|
+
workspaces: []
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
function getWorkspaces() {
|
|
15
|
+
return config.get("workspaces");
|
|
16
|
+
}
|
|
17
|
+
function setWorkspaces(workspaces) {
|
|
18
|
+
config.set("workspaces", workspaces);
|
|
19
|
+
}
|
|
20
|
+
function getActiveWorkspace() {
|
|
21
|
+
return config.get("activeDomain");
|
|
22
|
+
}
|
|
23
|
+
function setActiveWorkspace(domain) {
|
|
24
|
+
config.set("activeDomain", domain);
|
|
25
|
+
}
|
|
26
|
+
function getWorkspaceForDomain(domain) {
|
|
27
|
+
return getWorkspaces().find((w) => w.domain === domain) ?? null;
|
|
28
|
+
}
|
|
29
|
+
function findWorkspace(query, workspaces) {
|
|
30
|
+
const exactDomain = workspaces.find((w) => w.domain.toLowerCase() === query.toLowerCase());
|
|
31
|
+
if (exactDomain) return exactDomain;
|
|
32
|
+
const matches = workspaces.filter((w) => w.display_name.toLowerCase().includes(query.toLowerCase()) || w.domain.toLowerCase().includes(query.toLowerCase()));
|
|
33
|
+
if (matches.length === 1) return matches[0];
|
|
34
|
+
if (matches.length > 1) return matches;
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
function getCredentialDomain() {
|
|
38
|
+
return config.get("credentialDomain");
|
|
39
|
+
}
|
|
40
|
+
function setCredentialDomain(domain) {
|
|
41
|
+
config.set("credentialDomain", domain);
|
|
42
|
+
}
|
|
43
|
+
/** Get the conf file path (needed for file locking in token refresh) */
|
|
44
|
+
function getConfigPath() {
|
|
45
|
+
return config.path;
|
|
46
|
+
}
|
|
47
|
+
/** Clear all config (for testing) */
|
|
48
|
+
function clearConfig() {
|
|
49
|
+
config.clear();
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
exports.clearConfig = clearConfig;
|
|
53
|
+
exports.findWorkspace = findWorkspace;
|
|
54
|
+
exports.getActiveWorkspace = getActiveWorkspace;
|
|
55
|
+
exports.getConfigPath = getConfigPath;
|
|
56
|
+
exports.getCredentialDomain = getCredentialDomain;
|
|
57
|
+
exports.getWorkspaceForDomain = getWorkspaceForDomain;
|
|
58
|
+
exports.getWorkspaces = getWorkspaces;
|
|
59
|
+
exports.setActiveWorkspace = setActiveWorkspace;
|
|
60
|
+
exports.setCredentialDomain = setCredentialDomain;
|
|
61
|
+
exports.setWorkspaces = setWorkspaces;
|
|
@@ -0,0 +1,75 @@
|
|
|
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/action/add.ts
|
|
9
|
+
/**
|
|
10
|
+
* Action add command — creates a new CTA (Call-To-Action) on a video or webinar.
|
|
11
|
+
*
|
|
12
|
+
* POSTs to /action/add with type + object_id required.
|
|
13
|
+
*
|
|
14
|
+
* Threat mitigations:
|
|
15
|
+
* T-06-03: No destructive action — creation only
|
|
16
|
+
*/
|
|
17
|
+
var ActionAdd = class ActionAdd extends require_lib_base_command.AuthenticatedCommand {
|
|
18
|
+
static description = "Create a new CTA action on a video or webinar";
|
|
19
|
+
static examples = [
|
|
20
|
+
"<%= config.bin %> action add --type overlay --object-id 12345",
|
|
21
|
+
"<%= config.bin %> action add --type overlay --object-id 12345 --fields \"title=Buy Now\"",
|
|
22
|
+
"<%= config.bin %> action add --type overlay --object-id 12345 --json"
|
|
23
|
+
];
|
|
24
|
+
static enableJsonFlag = true;
|
|
25
|
+
static agentMetadata = {
|
|
26
|
+
api_endpoint: "POST /action/add",
|
|
27
|
+
auth_scope: "write",
|
|
28
|
+
output_shape: { type: "key-value" },
|
|
29
|
+
side_effects: "creates"
|
|
30
|
+
};
|
|
31
|
+
static flags = {
|
|
32
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
33
|
+
type: _oclif_core.Flags.string({
|
|
34
|
+
description: "Action type (use `action types` to list available types)",
|
|
35
|
+
required: true
|
|
36
|
+
}),
|
|
37
|
+
"object-id": _oclif_core.Flags.string({
|
|
38
|
+
description: "Object ID (video or webinar) to attach the action to",
|
|
39
|
+
required: true
|
|
40
|
+
}),
|
|
41
|
+
fields: _oclif_core.Flags.string({
|
|
42
|
+
description: "Additional fields for the action (key=value pairs)",
|
|
43
|
+
required: false
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
static args = {};
|
|
47
|
+
async run() {
|
|
48
|
+
const { flags } = await this.parse(ActionAdd);
|
|
49
|
+
this.printWorkspaceHeader();
|
|
50
|
+
const body = {
|
|
51
|
+
type: flags.type,
|
|
52
|
+
object_id: Number(flags["object-id"])
|
|
53
|
+
};
|
|
54
|
+
if (flags.fields !== void 0) body.fields = flags.fields;
|
|
55
|
+
const { data, error } = await this.apiClient.POST("/action/add", {
|
|
56
|
+
body,
|
|
57
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
58
|
+
});
|
|
59
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
60
|
+
const actionId = data?.data?.action_id ?? data?.action_id;
|
|
61
|
+
this.log(chalk.default.green("Action created"));
|
|
62
|
+
if (actionId) this.log(`ID: ${actionId}`);
|
|
63
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
64
|
+
ok: true,
|
|
65
|
+
data,
|
|
66
|
+
summary: "Action created",
|
|
67
|
+
breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
|
|
68
|
+
resource: "action",
|
|
69
|
+
id: actionId ? String(actionId) : void 0
|
|
70
|
+
}]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
module.exports = ActionAdd;
|
|
@@ -0,0 +1,64 @@
|
|
|
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 _clack_prompts = require("@clack/prompts");
|
|
9
|
+
//#region src/commands/action/delete.ts
|
|
10
|
+
/**
|
|
11
|
+
* Action delete command — deletes a CTA action after confirmation.
|
|
12
|
+
*
|
|
13
|
+
* Prompts user to confirm deletion showing the workspace domain (T-06-03 mitigation).
|
|
14
|
+
* --json flag skips the confirmation prompt (scripting mode — assume confirmed).
|
|
15
|
+
*
|
|
16
|
+
* Exit codes:
|
|
17
|
+
* 0 — success
|
|
18
|
+
* 1 — error
|
|
19
|
+
* 2 — cancelled (user declined confirmation)
|
|
20
|
+
*
|
|
21
|
+
* Threat mitigations:
|
|
22
|
+
* T-06-03: Confirmation prompt includes workspace domain
|
|
23
|
+
*/
|
|
24
|
+
var ActionDelete = class ActionDelete extends require_lib_base_command.AuthenticatedCommand {
|
|
25
|
+
static description = "Delete a CTA action";
|
|
26
|
+
static examples = ["<%= config.bin %> action delete 12345", "<%= config.bin %> action delete 12345 --json"];
|
|
27
|
+
static enableJsonFlag = true;
|
|
28
|
+
static agentMetadata = {
|
|
29
|
+
api_endpoint: "POST /action/delete",
|
|
30
|
+
auth_scope: "write",
|
|
31
|
+
output_shape: { type: "key-value" },
|
|
32
|
+
side_effects: "destructive"
|
|
33
|
+
};
|
|
34
|
+
static flags = { ...require_lib_base_command.AuthenticatedCommand.baseFlags };
|
|
35
|
+
static args = { id: _oclif_core.Args.string({
|
|
36
|
+
description: "Action ID",
|
|
37
|
+
required: true
|
|
38
|
+
}) };
|
|
39
|
+
async run() {
|
|
40
|
+
const { args } = await this.parse(ActionDelete);
|
|
41
|
+
this.printWorkspaceHeader();
|
|
42
|
+
if (!this.jsonEnabled()) {
|
|
43
|
+
const confirmed = await (0, _clack_prompts.confirm)({ message: `Delete action ${args.id} from ${this.activeWorkspace.domain}? This cannot be undone.` });
|
|
44
|
+
if ((0, _clack_prompts.isCancel)(confirmed) || !confirmed) process.exit(2);
|
|
45
|
+
}
|
|
46
|
+
const { data: deleteData, error: deleteError } = await this.apiClient.POST("/action/delete", {
|
|
47
|
+
body: { action_id: Number(args.id) },
|
|
48
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
49
|
+
});
|
|
50
|
+
if (deleteError) this.error(require_lib_term_map.applyCliTerms(formatApiError(deleteError)), { exit: 1 });
|
|
51
|
+
this.log(chalk.default.green("Action deleted"));
|
|
52
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
53
|
+
ok: true,
|
|
54
|
+
data: deleteData,
|
|
55
|
+
summary: `Action ${args.id} deleted`,
|
|
56
|
+
breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
|
|
57
|
+
resource: "action",
|
|
58
|
+
id: args.id
|
|
59
|
+
}]
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
64
|
+
module.exports = ActionDelete;
|
|
@@ -0,0 +1,70 @@
|
|
|
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/action/exclude.ts
|
|
9
|
+
/**
|
|
10
|
+
* Action exclude command — blocks a CTA action from appearing on a specific object.
|
|
11
|
+
*
|
|
12
|
+
* POSTs to /action/exclude with action_id + object_id.
|
|
13
|
+
* Use --undo to reverse the exclusion (maps to remove_exclusion_p).
|
|
14
|
+
*/
|
|
15
|
+
var ActionExclude = class ActionExclude extends require_lib_base_command.AuthenticatedCommand {
|
|
16
|
+
static description = "Exclude a CTA action from an object (or undo an exclusion)";
|
|
17
|
+
static examples = [
|
|
18
|
+
"<%= config.bin %> action exclude 12345 --object-id 6789",
|
|
19
|
+
"<%= config.bin %> action exclude 12345 --object-id 6789 --undo",
|
|
20
|
+
"<%= config.bin %> action exclude 12345 --object-id 6789 --json"
|
|
21
|
+
];
|
|
22
|
+
static enableJsonFlag = true;
|
|
23
|
+
static agentMetadata = {
|
|
24
|
+
api_endpoint: "POST /action/exclude",
|
|
25
|
+
auth_scope: "write",
|
|
26
|
+
output_shape: { type: "key-value" },
|
|
27
|
+
side_effects: "updates"
|
|
28
|
+
};
|
|
29
|
+
static flags = {
|
|
30
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
31
|
+
"object-id": _oclif_core.Flags.string({
|
|
32
|
+
description: "Object ID to exclude the action from",
|
|
33
|
+
required: true
|
|
34
|
+
}),
|
|
35
|
+
undo: _oclif_core.Flags.boolean({
|
|
36
|
+
description: "Remove the exclusion (reverse this operation)",
|
|
37
|
+
required: false
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
static args = { id: _oclif_core.Args.string({
|
|
41
|
+
description: "Action ID",
|
|
42
|
+
required: true
|
|
43
|
+
}) };
|
|
44
|
+
async run() {
|
|
45
|
+
const { args, flags } = await this.parse(ActionExclude);
|
|
46
|
+
this.printWorkspaceHeader();
|
|
47
|
+
const body = {
|
|
48
|
+
action_id: Number(args.id),
|
|
49
|
+
object_id: Number(flags["object-id"])
|
|
50
|
+
};
|
|
51
|
+
if (flags.undo) body.remove_exclusion_p = 1;
|
|
52
|
+
const { data, error } = await this.apiClient.POST("/action/exclude", {
|
|
53
|
+
body,
|
|
54
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
55
|
+
});
|
|
56
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
57
|
+
this.log(chalk.default.green(flags.undo ? "Exclusion removed" : "Action excluded"));
|
|
58
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
59
|
+
ok: true,
|
|
60
|
+
data,
|
|
61
|
+
summary: flags.undo ? "Exclusion removed" : "Action excluded",
|
|
62
|
+
breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
|
|
63
|
+
resource: "action",
|
|
64
|
+
id: args.id
|
|
65
|
+
}]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
//#endregion
|
|
70
|
+
module.exports = ActionExclude;
|
|
@@ -0,0 +1,112 @@
|
|
|
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/action/get.ts
|
|
7
|
+
/**
|
|
8
|
+
* Action get command — flexible retrieval of action CTAs.
|
|
9
|
+
*
|
|
10
|
+
* D-5: Single flexible command; all context fields are optional flags.
|
|
11
|
+
* The most common case is passing an action_id as a positional arg.
|
|
12
|
+
*
|
|
13
|
+
* Calls GET /action/get — same endpoint as action list, but oriented around
|
|
14
|
+
* detail/single-object retrieval.
|
|
15
|
+
*/
|
|
16
|
+
var ActionGet = class ActionGet extends require_lib_base_command.AuthenticatedCommand {
|
|
17
|
+
static description = "Get details of a CTA action";
|
|
18
|
+
static examples = [
|
|
19
|
+
"<%= config.bin %> action get 12345",
|
|
20
|
+
"<%= config.bin %> action get --video-id 6789",
|
|
21
|
+
"<%= config.bin %> action get --webinar-id 1234 --json",
|
|
22
|
+
"<%= config.bin %> action get 12345 --json"
|
|
23
|
+
];
|
|
24
|
+
static enableJsonFlag = true;
|
|
25
|
+
static agentMetadata = {
|
|
26
|
+
api_endpoint: "GET /action/get",
|
|
27
|
+
auth_scope: "read",
|
|
28
|
+
output_shape: { type: "key-value" },
|
|
29
|
+
side_effects: "none"
|
|
30
|
+
};
|
|
31
|
+
static flags = {
|
|
32
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
33
|
+
"object-id": _oclif_core.Flags.string({
|
|
34
|
+
description: "Object ID context",
|
|
35
|
+
required: false
|
|
36
|
+
}),
|
|
37
|
+
"video-id": _oclif_core.Flags.string({
|
|
38
|
+
description: "Video ID context (maps to photo_id)",
|
|
39
|
+
required: false
|
|
40
|
+
}),
|
|
41
|
+
"webinar-id": _oclif_core.Flags.string({
|
|
42
|
+
description: "Webinar ID context (maps to live_id)",
|
|
43
|
+
required: false
|
|
44
|
+
}),
|
|
45
|
+
token: _oclif_core.Flags.string({
|
|
46
|
+
description: "Object token for authentication",
|
|
47
|
+
required: false
|
|
48
|
+
}),
|
|
49
|
+
"player-id": _oclif_core.Flags.string({
|
|
50
|
+
description: "Player ID context",
|
|
51
|
+
required: false
|
|
52
|
+
}),
|
|
53
|
+
"exclude-internal": _oclif_core.Flags.boolean({
|
|
54
|
+
description: "Exclude internal actions",
|
|
55
|
+
required: false
|
|
56
|
+
}),
|
|
57
|
+
"exclude-pending": _oclif_core.Flags.boolean({
|
|
58
|
+
description: "Exclude pending actions",
|
|
59
|
+
required: false
|
|
60
|
+
}),
|
|
61
|
+
"exclude-items": _oclif_core.Flags.boolean({
|
|
62
|
+
description: "Exclude action items",
|
|
63
|
+
required: false
|
|
64
|
+
})
|
|
65
|
+
};
|
|
66
|
+
static args = { id: _oclif_core.Args.string({
|
|
67
|
+
description: "Action ID (optional)",
|
|
68
|
+
required: false
|
|
69
|
+
}) };
|
|
70
|
+
async run() {
|
|
71
|
+
const { args, flags } = await this.parse(ActionGet);
|
|
72
|
+
this.printWorkspaceHeader();
|
|
73
|
+
const { data, error } = await this.apiClient.GET("/action/get", { params: { query: {
|
|
74
|
+
action_id: args.id ? Number(args.id) : void 0,
|
|
75
|
+
object_id: flags["object-id"] ? Number(flags["object-id"]) : void 0,
|
|
76
|
+
photo_id: flags["video-id"] ? Number(flags["video-id"]) : void 0,
|
|
77
|
+
live_id: flags["webinar-id"] ? Number(flags["webinar-id"]) : void 0,
|
|
78
|
+
token: flags.token,
|
|
79
|
+
player_id: flags["player-id"] ? Number(flags["player-id"]) : void 0,
|
|
80
|
+
exclude_internal_p: flags["exclude-internal"] ? true : void 0,
|
|
81
|
+
exclude_pending_p: flags["exclude-pending"] ? true : void 0,
|
|
82
|
+
exclude_items_p: flags["exclude-items"] ? true : void 0
|
|
83
|
+
} } });
|
|
84
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
85
|
+
const resp = data;
|
|
86
|
+
const items = Array.isArray(resp?.data) ? resp.data : resp?.data ? [resp.data] : [];
|
|
87
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
88
|
+
ok: true,
|
|
89
|
+
data: items.length === 1 ? items[0] : items,
|
|
90
|
+
summary: items.length === 1 ? `Action ${items[0].action_id ?? args.id}` : `${items.length} actions`,
|
|
91
|
+
breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
|
|
92
|
+
resource: "action",
|
|
93
|
+
id: args.id
|
|
94
|
+
}]
|
|
95
|
+
});
|
|
96
|
+
if (items.length === 0) {
|
|
97
|
+
this.log("No actions found.");
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
for (const action of items) {
|
|
101
|
+
this.log(`ID: ${action.action_id ?? ""}`);
|
|
102
|
+
this.log(`Name: ${require_lib_term_map.applyCliTerms(String(action.name ?? action.action_name ?? ""))}`);
|
|
103
|
+
this.log(`Type: ${String(action.type ?? action.action_type ?? "")}`);
|
|
104
|
+
this.log(`Start: ${String(action.start_time ?? "")}`);
|
|
105
|
+
this.log(`End: ${String(action.end_time ?? "")}`);
|
|
106
|
+
if (action.object_id) this.log(`Object ID: ${action.object_id}`);
|
|
107
|
+
if (items.length > 1) this.log("---");
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
//#endregion
|
|
112
|
+
module.exports = ActionGet;
|