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
|
@@ -0,0 +1,87 @@
|
|
|
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/user/create.ts
|
|
9
|
+
/**
|
|
10
|
+
* User create command — creates a new user in the workspace (USR-03).
|
|
11
|
+
*
|
|
12
|
+
* Maps to the POST /user/create API endpoint.
|
|
13
|
+
*/
|
|
14
|
+
var UserCreate = class UserCreate extends require_lib_base_command.AuthenticatedCommand {
|
|
15
|
+
static description = "Create a new user";
|
|
16
|
+
static examples = [
|
|
17
|
+
"<%= config.bin %> user create --email alice@example.com",
|
|
18
|
+
"<%= config.bin %> user create --email alice@example.com --full-name \"Alice Smith\"",
|
|
19
|
+
"<%= config.bin %> user create --email alice@example.com --site-admin",
|
|
20
|
+
"<%= config.bin %> user create --email alice@example.com --json"
|
|
21
|
+
];
|
|
22
|
+
static enableJsonFlag = true;
|
|
23
|
+
static flags = {
|
|
24
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
25
|
+
email: _oclif_core.Flags.string({
|
|
26
|
+
description: "Email address for the new user",
|
|
27
|
+
required: true
|
|
28
|
+
}),
|
|
29
|
+
username: _oclif_core.Flags.string({
|
|
30
|
+
description: "Username for the new user",
|
|
31
|
+
required: false
|
|
32
|
+
}),
|
|
33
|
+
"full-name": _oclif_core.Flags.string({
|
|
34
|
+
description: "Full display name for the new user",
|
|
35
|
+
required: false
|
|
36
|
+
}),
|
|
37
|
+
"site-admin": _oclif_core.Flags.boolean({
|
|
38
|
+
description: "Grant site admin privileges",
|
|
39
|
+
allowNo: true,
|
|
40
|
+
required: false
|
|
41
|
+
}),
|
|
42
|
+
"site-admin-p": _oclif_core.Flags.string({
|
|
43
|
+
hidden: true,
|
|
44
|
+
required: false
|
|
45
|
+
}),
|
|
46
|
+
"user-type": _oclif_core.Flags.string({
|
|
47
|
+
description: "User type (e.g. standard, administrator)",
|
|
48
|
+
required: false
|
|
49
|
+
})
|
|
50
|
+
};
|
|
51
|
+
static args = {};
|
|
52
|
+
static agentMetadata = {
|
|
53
|
+
api_endpoint: "POST /user/create",
|
|
54
|
+
auth_scope: "admin",
|
|
55
|
+
output_shape: { type: "key-value" },
|
|
56
|
+
side_effects: "creates"
|
|
57
|
+
};
|
|
58
|
+
async run() {
|
|
59
|
+
const { flags } = await this.parse(UserCreate);
|
|
60
|
+
this.printWorkspaceHeader();
|
|
61
|
+
const body = { email: flags.email };
|
|
62
|
+
if (flags.username !== void 0) body.username = flags.username;
|
|
63
|
+
if (flags["full-name"] !== void 0) body.full_name = flags["full-name"];
|
|
64
|
+
if (flags["user-type"] !== void 0) body.user_type = flags["user-type"];
|
|
65
|
+
const siteAdminVal = parseBoolParam(flags["site-admin"], flags["site-admin-p"]);
|
|
66
|
+
if (siteAdminVal !== void 0) body.site_admin_p = siteAdminVal ? 1 : 0;
|
|
67
|
+
const { data, error } = await this.apiClient.POST("/user/create", {
|
|
68
|
+
body,
|
|
69
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
70
|
+
});
|
|
71
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
72
|
+
const userId = data?.data?.user_id;
|
|
73
|
+
this.log(chalk.default.green("User created"));
|
|
74
|
+
this.log(`ID: ${userId}`);
|
|
75
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
76
|
+
ok: true,
|
|
77
|
+
data,
|
|
78
|
+
summary: "User created",
|
|
79
|
+
breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
|
|
80
|
+
resource: "user",
|
|
81
|
+
id: String(userId)
|
|
82
|
+
}]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
module.exports = UserCreate;
|
|
@@ -0,0 +1,72 @@
|
|
|
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/user/get-login-token.ts
|
|
7
|
+
/**
|
|
8
|
+
* User get-login-token command — generates a login token for a user (USR-06).
|
|
9
|
+
*
|
|
10
|
+
* Maps to the GET /user/get-login-token API endpoint.
|
|
11
|
+
*
|
|
12
|
+
* SECURITY (T-08-10): The actual token value is NOT included in the --json summary string.
|
|
13
|
+
* The token is present in the data field for programmatic access only.
|
|
14
|
+
* The summary string is safe for logs and CI output.
|
|
15
|
+
*/
|
|
16
|
+
var UserGetLoginToken = class UserGetLoginToken extends require_lib_base_command.AuthenticatedCommand {
|
|
17
|
+
static description = "Generate a login token for a user";
|
|
18
|
+
static examples = [
|
|
19
|
+
"<%= config.bin %> user get-login-token 12345",
|
|
20
|
+
"<%= config.bin %> user get-login-token 12345 --return-url https://example.com/dashboard",
|
|
21
|
+
"<%= config.bin %> user get-login-token 12345 --json"
|
|
22
|
+
];
|
|
23
|
+
static enableJsonFlag = true;
|
|
24
|
+
static flags = {
|
|
25
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
26
|
+
"return-url": _oclif_core.Flags.string({
|
|
27
|
+
description: "URL to redirect to after login",
|
|
28
|
+
required: false
|
|
29
|
+
})
|
|
30
|
+
};
|
|
31
|
+
static args = { id: _oclif_core.Args.string({
|
|
32
|
+
description: "User ID",
|
|
33
|
+
required: true
|
|
34
|
+
}) };
|
|
35
|
+
static agentMetadata = {
|
|
36
|
+
api_endpoint: "GET /user/get-login-token",
|
|
37
|
+
auth_scope: "admin",
|
|
38
|
+
output_shape: { type: "key-value" },
|
|
39
|
+
side_effects: "none"
|
|
40
|
+
};
|
|
41
|
+
async run() {
|
|
42
|
+
const { args, flags } = await this.parse(UserGetLoginToken);
|
|
43
|
+
this.printWorkspaceHeader();
|
|
44
|
+
const { data, error } = await this.apiClient.GET("/user/get-login-token", { params: { query: {
|
|
45
|
+
user_id: Number(args.id),
|
|
46
|
+
return_url: flags["return-url"]
|
|
47
|
+
} } });
|
|
48
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
49
|
+
const resp = data;
|
|
50
|
+
const obj = resp?.data ?? resp;
|
|
51
|
+
const token = obj?.login_token ?? obj?.token ?? "";
|
|
52
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
53
|
+
ok: true,
|
|
54
|
+
data: obj,
|
|
55
|
+
summary: `Login token generated for user ${args.id}`,
|
|
56
|
+
breadcrumbs: [
|
|
57
|
+
{ domain: this.activeWorkspace.domain },
|
|
58
|
+
{
|
|
59
|
+
resource: "user",
|
|
60
|
+
id: args.id
|
|
61
|
+
},
|
|
62
|
+
{ resource: "login-token" }
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
this.log(`Login token: ${token}`);
|
|
66
|
+
if (obj && typeof obj === "object") {
|
|
67
|
+
for (const [k, v] of Object.entries(obj)) if (k !== "login_token" && k !== "token") this.log(`${k}: ${String(v)}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
//#endregion
|
|
72
|
+
module.exports = UserGetLoginToken;
|
|
@@ -0,0 +1,67 @@
|
|
|
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/user/get.ts
|
|
7
|
+
/**
|
|
8
|
+
* User get command — retrieves details of a single user by ID (USR-02).
|
|
9
|
+
*
|
|
10
|
+
* Maps to the GET /user/get API endpoint.
|
|
11
|
+
*/
|
|
12
|
+
var UserGet = class UserGet extends require_lib_base_command.AuthenticatedCommand {
|
|
13
|
+
static description = "Get details of a specific user";
|
|
14
|
+
static examples = [
|
|
15
|
+
"<%= config.bin %> user get 12345",
|
|
16
|
+
"<%= config.bin %> user get 12345 --include-invitation",
|
|
17
|
+
"<%= config.bin %> user get 12345 --json"
|
|
18
|
+
];
|
|
19
|
+
static enableJsonFlag = true;
|
|
20
|
+
static flags = {
|
|
21
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
22
|
+
"include-invitation": _oclif_core.Flags.boolean({
|
|
23
|
+
description: "Include invitation details in the response",
|
|
24
|
+
allowNo: true,
|
|
25
|
+
required: false
|
|
26
|
+
}),
|
|
27
|
+
"include-invitation-p": _oclif_core.Flags.string({
|
|
28
|
+
hidden: true,
|
|
29
|
+
required: false
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
static args = { id: _oclif_core.Args.string({
|
|
33
|
+
description: "User ID",
|
|
34
|
+
required: true
|
|
35
|
+
}) };
|
|
36
|
+
static agentMetadata = {
|
|
37
|
+
api_endpoint: "GET /user/get",
|
|
38
|
+
auth_scope: "admin",
|
|
39
|
+
output_shape: { type: "key-value" },
|
|
40
|
+
side_effects: "none"
|
|
41
|
+
};
|
|
42
|
+
async run() {
|
|
43
|
+
const { args, flags } = await this.parse(UserGet);
|
|
44
|
+
this.printWorkspaceHeader();
|
|
45
|
+
const inclVal = parseBoolParam(flags["include-invitation"], flags["include-invitation-p"]);
|
|
46
|
+
const { data, error } = await this.apiClient.GET("/user/get", { params: { query: {
|
|
47
|
+
user_id: Number(args.id),
|
|
48
|
+
include_invitation_p: inclVal
|
|
49
|
+
} } });
|
|
50
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
51
|
+
const resp = data;
|
|
52
|
+
const obj = resp?.data ?? resp;
|
|
53
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
54
|
+
ok: true,
|
|
55
|
+
data: obj,
|
|
56
|
+
summary: obj?.username ?? obj?.display_name ?? `User ${args.id}`,
|
|
57
|
+
breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
|
|
58
|
+
resource: "user",
|
|
59
|
+
id: args.id
|
|
60
|
+
}]
|
|
61
|
+
});
|
|
62
|
+
if (!obj || Object.keys(obj).length === 0) this.error(`User ${args.id} not found`, { exit: 1 });
|
|
63
|
+
for (const [k, v] of Object.entries(obj)) this.log(`${k}: ${String(v)}`);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
module.exports = UserGet;
|
|
@@ -0,0 +1,95 @@
|
|
|
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/user/list.ts
|
|
9
|
+
/**
|
|
10
|
+
* User list command — lists users in the active workspace (USR-01).
|
|
11
|
+
*
|
|
12
|
+
* Maps to the GET /user/list API endpoint.
|
|
13
|
+
*/
|
|
14
|
+
var UserList = class UserList extends require_lib_base_command.AuthenticatedCommand {
|
|
15
|
+
static description = "List users in the workspace";
|
|
16
|
+
static examples = [
|
|
17
|
+
"<%= config.bin %> user list",
|
|
18
|
+
"<%= config.bin %> user list --search \"alice\"",
|
|
19
|
+
"<%= config.bin %> user list --page 2 --size 20",
|
|
20
|
+
"<%= config.bin %> user list --json"
|
|
21
|
+
];
|
|
22
|
+
static enableJsonFlag = true;
|
|
23
|
+
static flags = {
|
|
24
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
25
|
+
page: _oclif_core.Flags.integer({
|
|
26
|
+
description: "Page number",
|
|
27
|
+
required: false
|
|
28
|
+
}),
|
|
29
|
+
size: _oclif_core.Flags.integer({
|
|
30
|
+
description: "Number of results per page",
|
|
31
|
+
required: false
|
|
32
|
+
}),
|
|
33
|
+
search: _oclif_core.Flags.string({
|
|
34
|
+
description: "Search query (username, display name, or email)",
|
|
35
|
+
required: false
|
|
36
|
+
}),
|
|
37
|
+
"user-id": _oclif_core.Flags.string({
|
|
38
|
+
description: "Filter by user ID",
|
|
39
|
+
required: false
|
|
40
|
+
})
|
|
41
|
+
};
|
|
42
|
+
static args = {};
|
|
43
|
+
static agentMetadata = {
|
|
44
|
+
api_endpoint: "GET /user/list",
|
|
45
|
+
auth_scope: "admin",
|
|
46
|
+
output_shape: {
|
|
47
|
+
type: "table",
|
|
48
|
+
columns: [
|
|
49
|
+
"ID",
|
|
50
|
+
"Username",
|
|
51
|
+
"Display Name",
|
|
52
|
+
"URL"
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
side_effects: "none"
|
|
56
|
+
};
|
|
57
|
+
async run() {
|
|
58
|
+
const { flags } = await this.parse(UserList);
|
|
59
|
+
this.printWorkspaceHeader();
|
|
60
|
+
const { data, error } = await this.apiClient.GET("/user/list", { params: { query: {
|
|
61
|
+
search: flags.search,
|
|
62
|
+
user_id: flags["user-id"] ? Number(flags["user-id"]) : void 0,
|
|
63
|
+
p: flags.page,
|
|
64
|
+
size: flags.size
|
|
65
|
+
} } });
|
|
66
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
67
|
+
const resp = data;
|
|
68
|
+
const rows = Array.isArray(resp?.data) ? resp.data : resp?.data ? [resp.data] : [];
|
|
69
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
70
|
+
ok: true,
|
|
71
|
+
data: rows,
|
|
72
|
+
summary: `${rows.length} user(s)`,
|
|
73
|
+
breadcrumbs: [{ domain: this.activeWorkspace.domain }, { resource: "user" }]
|
|
74
|
+
});
|
|
75
|
+
if (rows.length === 0) {
|
|
76
|
+
this.log("No users found.");
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const table = require_lib_output.renderTable([
|
|
80
|
+
"ID",
|
|
81
|
+
"Username",
|
|
82
|
+
"Display Name",
|
|
83
|
+
"URL"
|
|
84
|
+
], rows.map((r) => [
|
|
85
|
+
String(r.user_id ?? ""),
|
|
86
|
+
String(r.username ?? ""),
|
|
87
|
+
String(r.display_name ?? ""),
|
|
88
|
+
String(require_lib_output.resolveUrl(r.url, this.activeWorkspace.api_base_url) ?? "")
|
|
89
|
+
]));
|
|
90
|
+
this.log(table.toString());
|
|
91
|
+
this.log(chalk.default.dim(`${rows.length} user(s)`));
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
//#endregion
|
|
95
|
+
module.exports = UserList;
|
|
@@ -0,0 +1,55 @@
|
|
|
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/user/redeem-login-token.ts
|
|
7
|
+
/**
|
|
8
|
+
* User redeem-login-token command — redeems a login token (USR-07).
|
|
9
|
+
*
|
|
10
|
+
* Maps to the GET /user/redeem-login-token API endpoint.
|
|
11
|
+
*/
|
|
12
|
+
var UserRedeemLoginToken = class UserRedeemLoginToken extends require_lib_base_command.AuthenticatedCommand {
|
|
13
|
+
static description = "Redeem a login token to authenticate a user";
|
|
14
|
+
static examples = ["<%= config.bin %> user redeem-login-token --login-token abc123", "<%= config.bin %> user redeem-login-token --login-token abc123 --json"];
|
|
15
|
+
static enableJsonFlag = true;
|
|
16
|
+
static flags = {
|
|
17
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
18
|
+
"login-token": _oclif_core.Flags.string({
|
|
19
|
+
description: "Login token to redeem",
|
|
20
|
+
required: true
|
|
21
|
+
})
|
|
22
|
+
};
|
|
23
|
+
static args = {};
|
|
24
|
+
static agentMetadata = {
|
|
25
|
+
api_endpoint: "GET /user/redeem-login-token",
|
|
26
|
+
auth_scope: "read",
|
|
27
|
+
output_shape: { type: "key-value" },
|
|
28
|
+
side_effects: "none"
|
|
29
|
+
};
|
|
30
|
+
async run() {
|
|
31
|
+
const { flags } = await this.parse(UserRedeemLoginToken);
|
|
32
|
+
this.printWorkspaceHeader();
|
|
33
|
+
const { data, error } = await this.apiClient.GET("/user/redeem-login-token", { params: { query: { login_token: flags["login-token"] } } });
|
|
34
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
35
|
+
const resp = data;
|
|
36
|
+
const obj = resp?.data ?? resp;
|
|
37
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
38
|
+
ok: true,
|
|
39
|
+
data: obj,
|
|
40
|
+
summary: "Login token redeemed",
|
|
41
|
+
breadcrumbs: [
|
|
42
|
+
{ domain: this.activeWorkspace.domain },
|
|
43
|
+
{ resource: "user" },
|
|
44
|
+
{ resource: "redeem-login-token" }
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
if (!obj || Object.keys(obj).length === 0) {
|
|
48
|
+
this.log("No data returned.");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
for (const [k, v] of Object.entries(obj)) this.log(`${k}: ${String(v)}`);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
module.exports = UserRedeemLoginToken;
|
|
@@ -0,0 +1,63 @@
|
|
|
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/user/send-invitation.ts
|
|
9
|
+
/**
|
|
10
|
+
* User send-invitation command — sends an invitation email to a user (USR-05).
|
|
11
|
+
*
|
|
12
|
+
* Maps to the POST /user/send-invitation API endpoint.
|
|
13
|
+
*/
|
|
14
|
+
var UserSendInvitation = class UserSendInvitation extends require_lib_base_command.AuthenticatedCommand {
|
|
15
|
+
static description = "Send an invitation email to a user";
|
|
16
|
+
static examples = [
|
|
17
|
+
"<%= config.bin %> user send-invitation 12345",
|
|
18
|
+
"<%= config.bin %> user send-invitation 12345 --invitation-message \"Welcome to the platform!\"",
|
|
19
|
+
"<%= config.bin %> user send-invitation 12345 --json"
|
|
20
|
+
];
|
|
21
|
+
static enableJsonFlag = true;
|
|
22
|
+
static flags = {
|
|
23
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
24
|
+
"invitation-message": _oclif_core.Flags.string({
|
|
25
|
+
description: "Custom invitation message",
|
|
26
|
+
required: false
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
static args = { id: _oclif_core.Args.string({
|
|
30
|
+
description: "User ID",
|
|
31
|
+
required: true
|
|
32
|
+
}) };
|
|
33
|
+
static agentMetadata = {
|
|
34
|
+
api_endpoint: "POST /user/send-invitation",
|
|
35
|
+
auth_scope: "admin",
|
|
36
|
+
output_shape: { type: "key-value" },
|
|
37
|
+
side_effects: "updates"
|
|
38
|
+
};
|
|
39
|
+
async run() {
|
|
40
|
+
const { args, flags } = await this.parse(UserSendInvitation);
|
|
41
|
+
this.printWorkspaceHeader();
|
|
42
|
+
const { data, error } = await this.apiClient.POST("/user/send-invitation", {
|
|
43
|
+
body: {
|
|
44
|
+
user_id: Number(args.id),
|
|
45
|
+
invitation_message: flags["invitation-message"]
|
|
46
|
+
},
|
|
47
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
48
|
+
});
|
|
49
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
50
|
+
this.log(chalk.default.green(`Invitation sent to user ${args.id}`));
|
|
51
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
52
|
+
ok: true,
|
|
53
|
+
data,
|
|
54
|
+
summary: `Invitation sent to user ${args.id}`,
|
|
55
|
+
breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
|
|
56
|
+
resource: "user",
|
|
57
|
+
id: args.id
|
|
58
|
+
}]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
//#endregion
|
|
63
|
+
module.exports = UserSendInvitation;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
require("../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_lib_base_command = require("../../lib/base-command.cjs");
|
|
3
|
+
const require_lib_output = require("../../lib/output.cjs");
|
|
4
|
+
let _oclif_core = require("@oclif/core");
|
|
5
|
+
//#region src/commands/user/tokens.ts
|
|
6
|
+
/**
|
|
7
|
+
* User tokens command — retrieves cross-site tokens for the authenticated user (USR-08).
|
|
8
|
+
*
|
|
9
|
+
* USR-08: /user/tokens is not in the OpenAPI swagger spec but is referenced in AUTH-02.
|
|
10
|
+
* Implemented as best-effort GET with any-typed response.
|
|
11
|
+
*
|
|
12
|
+
* Uses raw fetch instead of apiClient since the endpoint is not in the type system.
|
|
13
|
+
*
|
|
14
|
+
* SECURITY (T-08-13): Tokens printed to stdout intentionally — this is the command's
|
|
15
|
+
* purpose; user controls their terminal.
|
|
16
|
+
*/
|
|
17
|
+
var UserTokens = class UserTokens extends require_lib_base_command.AuthenticatedCommand {
|
|
18
|
+
static description = "Retrieve cross-site tokens for the authenticated user";
|
|
19
|
+
static examples = [
|
|
20
|
+
"<%= config.bin %> user tokens",
|
|
21
|
+
"<%= config.bin %> user tokens --no-cross-sites",
|
|
22
|
+
"<%= config.bin %> user tokens --json"
|
|
23
|
+
];
|
|
24
|
+
static enableJsonFlag = true;
|
|
25
|
+
static flags = {
|
|
26
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
27
|
+
"cross-sites": _oclif_core.Flags.boolean({
|
|
28
|
+
description: "Include cross-site tokens",
|
|
29
|
+
default: true,
|
|
30
|
+
allowNo: true,
|
|
31
|
+
required: false
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
static args = {};
|
|
35
|
+
static agentMetadata = {
|
|
36
|
+
api_endpoint: "GET /user/tokens",
|
|
37
|
+
auth_scope: "read",
|
|
38
|
+
output_shape: {
|
|
39
|
+
type: "table",
|
|
40
|
+
columns: ["Domain", "Token"]
|
|
41
|
+
},
|
|
42
|
+
side_effects: "none"
|
|
43
|
+
};
|
|
44
|
+
async run() {
|
|
45
|
+
const { flags } = await this.parse(UserTokens);
|
|
46
|
+
this.printWorkspaceHeader();
|
|
47
|
+
const url = new URL("user/tokens", this.apiBaseUrl);
|
|
48
|
+
if (flags["cross-sites"]) url.searchParams.set("cross_sites_p", "1");
|
|
49
|
+
const response = await fetch(url.toString(), { headers: { Authorization: `Bearer ${this.activeWorkspace.bearer_token}` } });
|
|
50
|
+
if (!response.ok) this.error(`API returned ${response.status}: ${response.statusText}`, { exit: 1 });
|
|
51
|
+
let json;
|
|
52
|
+
try {
|
|
53
|
+
json = await response.json();
|
|
54
|
+
} catch {
|
|
55
|
+
this.error(`API returned non-JSON response (status ${response.status})`, { exit: 1 });
|
|
56
|
+
}
|
|
57
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
58
|
+
ok: true,
|
|
59
|
+
data: json,
|
|
60
|
+
summary: "User tokens retrieved",
|
|
61
|
+
breadcrumbs: [
|
|
62
|
+
{ domain: this.activeWorkspace.domain },
|
|
63
|
+
{ resource: "user" },
|
|
64
|
+
{ resource: "tokens" }
|
|
65
|
+
]
|
|
66
|
+
});
|
|
67
|
+
const rows = Array.isArray(json?.data) ? json.data : json?.data ? [json.data] : [];
|
|
68
|
+
if (rows.length > 0 && (rows[0].domain !== void 0 || rows[0].token !== void 0)) {
|
|
69
|
+
const table = require_lib_output.renderTable(["Domain", "Token"], rows.map((r) => [String(r.domain ?? r.site ?? ""), String(r.token ?? "")]));
|
|
70
|
+
this.log(table.toString());
|
|
71
|
+
} else if (rows.length > 0) for (const item of rows) {
|
|
72
|
+
for (const [k, v] of Object.entries(item)) this.log(`${k}: ${String(v)}`);
|
|
73
|
+
this.log("---");
|
|
74
|
+
}
|
|
75
|
+
else if (json && typeof json === "object") for (const [k, v] of Object.entries(json)) this.log(`${k}: ${String(v)}`);
|
|
76
|
+
else this.log("No tokens found.");
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
//#endregion
|
|
80
|
+
module.exports = UserTokens;
|
|
@@ -0,0 +1,121 @@
|
|
|
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/user/update.ts
|
|
13
|
+
/**
|
|
14
|
+
* User update command — updates an existing user's profile (USR-04).
|
|
15
|
+
*
|
|
16
|
+
* CRITICAL (Pitfall 7): user/update uses multipart/form-data (NOT form-urlencoded)
|
|
17
|
+
* because profile_image is a file field. When profile_image is provided, the
|
|
18
|
+
* bodySerializer FormData pattern is used. When no image is provided, standard
|
|
19
|
+
* form-urlencoded is used.
|
|
20
|
+
*
|
|
21
|
+
* Threat mitigations:
|
|
22
|
+
* T-08-12: fs.existsSync validates file path before reading; API validates file type server-side
|
|
23
|
+
* T-08-11: extends AuthenticatedCommand — token presence enforced
|
|
24
|
+
*/
|
|
25
|
+
var UserUpdate = class UserUpdate extends require_lib_base_command.AuthenticatedCommand {
|
|
26
|
+
static description = "Update a user profile";
|
|
27
|
+
static examples = [
|
|
28
|
+
"<%= config.bin %> user update 12345 --full-name \"Alice Smith\"",
|
|
29
|
+
"<%= config.bin %> user update 12345 --email alice@example.com",
|
|
30
|
+
"<%= config.bin %> user update 12345 --profile-image ./avatar.jpg",
|
|
31
|
+
"<%= config.bin %> user update 12345 --json"
|
|
32
|
+
];
|
|
33
|
+
static enableJsonFlag = true;
|
|
34
|
+
static flags = {
|
|
35
|
+
...require_lib_base_command.AuthenticatedCommand.baseFlags,
|
|
36
|
+
email: _oclif_core.Flags.string({
|
|
37
|
+
description: "New email address",
|
|
38
|
+
required: false
|
|
39
|
+
}),
|
|
40
|
+
"full-name": _oclif_core.Flags.string({
|
|
41
|
+
description: "New full display name",
|
|
42
|
+
required: false
|
|
43
|
+
}),
|
|
44
|
+
password: _oclif_core.Flags.string({
|
|
45
|
+
description: "New password (WARNING: visible in process list and shell history — prefer interactive prompt for sensitive environments)",
|
|
46
|
+
required: false
|
|
47
|
+
}),
|
|
48
|
+
"profile-image": _oclif_core.Flags.string({
|
|
49
|
+
description: "Path to profile image file",
|
|
50
|
+
required: false
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
static args = { id: _oclif_core.Args.string({
|
|
54
|
+
description: "User ID",
|
|
55
|
+
required: true
|
|
56
|
+
}) };
|
|
57
|
+
static agentMetadata = {
|
|
58
|
+
api_endpoint: "POST /user/update",
|
|
59
|
+
auth_scope: "admin",
|
|
60
|
+
output_shape: { type: "key-value" },
|
|
61
|
+
side_effects: "updates"
|
|
62
|
+
};
|
|
63
|
+
async run() {
|
|
64
|
+
const { args, flags } = await this.parse(UserUpdate);
|
|
65
|
+
this.printWorkspaceHeader();
|
|
66
|
+
const body = { user_id: Number(args.id) };
|
|
67
|
+
if (flags.email !== void 0) body.email = flags.email;
|
|
68
|
+
if (flags["full-name"] !== void 0) body.full_name = flags["full-name"];
|
|
69
|
+
if (flags.password !== void 0) body.password = flags.password;
|
|
70
|
+
let useMultipart = false;
|
|
71
|
+
if (flags["profile-image"] !== void 0) {
|
|
72
|
+
const imgPath = node_path.resolve(flags["profile-image"]);
|
|
73
|
+
if (!node_fs.existsSync(imgPath)) this.error(`File not found: ${imgPath}`, { exit: 1 });
|
|
74
|
+
const fileName = node_path.basename(imgPath);
|
|
75
|
+
const fileBuffer = node_fs.readFileSync(imgPath);
|
|
76
|
+
body.profile_image = {
|
|
77
|
+
blob: new Blob([fileBuffer]),
|
|
78
|
+
fileName
|
|
79
|
+
};
|
|
80
|
+
useMultipart = true;
|
|
81
|
+
}
|
|
82
|
+
let data;
|
|
83
|
+
let error;
|
|
84
|
+
if (useMultipart) {
|
|
85
|
+
const result = await this.apiClient.POST("/user/update", {
|
|
86
|
+
body,
|
|
87
|
+
bodySerializer(b) {
|
|
88
|
+
const fd = new FormData();
|
|
89
|
+
for (const [k, v] of Object.entries(b)) if (v !== void 0) if (k === "profile_image" && typeof v === "object" && v !== null && "blob" in v) {
|
|
90
|
+
const { blob, fileName: fn } = v;
|
|
91
|
+
fd.append(k, blob, fn);
|
|
92
|
+
} else if (v instanceof Blob) fd.append(k, v);
|
|
93
|
+
else fd.append(k, String(v));
|
|
94
|
+
return fd;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
data = result.data;
|
|
98
|
+
error = result.error;
|
|
99
|
+
} else {
|
|
100
|
+
const result = await this.apiClient.POST("/user/update", {
|
|
101
|
+
body,
|
|
102
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" }
|
|
103
|
+
});
|
|
104
|
+
data = result.data;
|
|
105
|
+
error = result.error;
|
|
106
|
+
}
|
|
107
|
+
if (error) this.error(require_lib_term_map.applyCliTerms(formatApiError(error)), { exit: 1 });
|
|
108
|
+
this.log(chalk.default.green(`User ${args.id} updated`));
|
|
109
|
+
if (this.jsonEnabled()) return require_lib_output.formatJsonOutput({
|
|
110
|
+
ok: true,
|
|
111
|
+
data,
|
|
112
|
+
summary: `User ${args.id} updated`,
|
|
113
|
+
breadcrumbs: [{ domain: this.activeWorkspace.domain }, {
|
|
114
|
+
resource: "user",
|
|
115
|
+
id: args.id
|
|
116
|
+
}]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
module.exports = UserUpdate;
|