@mittwald/cli 1.0.0-alpha.46 → 1.0.0-alpha.47
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 +214 -154
- package/bin/run.js +1 -1
- package/dist/commands/app/copy.d.ts +1 -1
- package/dist/commands/app/copy.js +2 -2
- package/dist/commands/app/create/node.d.ts +4 -4
- package/dist/commands/app/create/node.js +2 -2
- package/dist/commands/app/create/php.d.ts +4 -4
- package/dist/commands/app/create/php.js +2 -2
- package/dist/commands/app/create/python.d.ts +4 -4
- package/dist/commands/app/create/python.js +2 -2
- package/dist/commands/app/create/static.d.ts +4 -4
- package/dist/commands/app/create/static.js +2 -2
- package/dist/commands/app/dependency/list.d.ts +3 -4
- package/dist/commands/app/dependency/list.js +2 -5
- package/dist/commands/app/dependency/update.d.ts +1 -1
- package/dist/commands/app/dependency/update.js +2 -2
- package/dist/commands/app/dependency/versions.d.ts +3 -4
- package/dist/commands/app/dependency/versions.js +2 -5
- package/dist/commands/app/download.d.ts +3 -2
- package/dist/commands/app/download.js +15 -31
- package/dist/commands/app/get.d.ts +1 -1
- package/dist/commands/app/get.js +4 -4
- package/dist/commands/app/install/contao.d.ts +3 -3
- package/dist/commands/app/install/contao.js +2 -3
- package/dist/commands/app/install/drupal.d.ts +4 -4
- package/dist/commands/app/install/drupal.js +2 -3
- package/dist/commands/app/install/grav.d.ts +3 -3
- package/dist/commands/app/install/grav.js +2 -3
- package/dist/commands/app/install/joomla.d.ts +3 -3
- package/dist/commands/app/install/joomla.js +2 -3
- package/dist/commands/app/install/matomo.d.ts +3 -3
- package/dist/commands/app/install/matomo.js +2 -3
- package/dist/commands/app/install/moodle.d.ts +4 -4
- package/dist/commands/app/install/moodle.js +2 -3
- package/dist/commands/app/install/neos.d.ts +4 -4
- package/dist/commands/app/install/neos.js +2 -3
- package/dist/commands/app/install/nextcloud.d.ts +3 -3
- package/dist/commands/app/install/nextcloud.js +2 -3
- package/dist/commands/app/install/prestashop.d.ts +4 -4
- package/dist/commands/app/install/prestashop.js +2 -3
- package/dist/commands/app/install/shopware5.d.ts +3 -3
- package/dist/commands/app/install/shopware5.js +2 -3
- package/dist/commands/app/install/shopware6.d.ts +4 -4
- package/dist/commands/app/install/shopware6.js +2 -3
- package/dist/commands/app/install/typo3.d.ts +4 -4
- package/dist/commands/app/install/typo3.js +2 -3
- package/dist/commands/app/install/wordpress.d.ts +4 -4
- package/dist/commands/app/install/wordpress.js +2 -3
- package/dist/commands/app/list-upgrade-candidates.d.ts +2 -2
- package/dist/commands/app/list-upgrade-candidates.js +4 -4
- package/dist/commands/app/list.d.ts +3 -3
- package/dist/commands/app/list.js +4 -4
- package/dist/commands/app/ssh.d.ts +1 -1
- package/dist/commands/app/ssh.js +6 -6
- package/dist/commands/app/uninstall.d.ts +1 -1
- package/dist/commands/app/uninstall.js +2 -2
- package/dist/commands/app/upgrade.d.ts +3 -2
- package/dist/commands/app/upgrade.js +9 -11
- package/dist/commands/app/upload.d.ts +3 -2
- package/dist/commands/app/upload.js +15 -28
- package/dist/commands/app/versions.d.ts +2 -2
- package/dist/commands/app/versions.js +10 -19
- package/dist/commands/backup/create.d.ts +3 -3
- package/dist/commands/backup/create.js +6 -7
- package/dist/commands/backup/delete.d.ts +2 -2
- package/dist/commands/backup/delete.js +4 -9
- package/dist/commands/backup/download.d.ts +3 -3
- package/dist/commands/backup/download.js +20 -25
- package/dist/commands/backup/get.d.ts +2 -2
- package/dist/commands/backup/get.js +9 -12
- package/dist/commands/backup/list.d.ts +2 -4
- package/dist/commands/backup/list.js +8 -11
- package/dist/commands/backup/schedule/list.d.ts +2 -4
- package/dist/commands/backup/schedule/list.js +2 -5
- package/dist/commands/context/get.d.ts +1 -1
- package/dist/commands/context/get.js +2 -2
- package/dist/commands/context/reset.d.ts +1 -1
- package/dist/commands/context/reset.js +2 -2
- package/dist/commands/context/set.d.ts +1 -1
- package/dist/commands/context/set.js +6 -11
- package/dist/commands/conversation/categories.d.ts +2 -4
- package/dist/commands/conversation/categories.js +3 -6
- package/dist/commands/conversation/close.d.ts +3 -3
- package/dist/commands/conversation/close.js +6 -10
- package/dist/commands/conversation/create.d.ts +1 -1
- package/dist/commands/conversation/create.js +2 -2
- package/dist/commands/conversation/list.d.ts +2 -4
- package/dist/commands/conversation/list.js +2 -5
- package/dist/commands/conversation/reply.d.ts +3 -3
- package/dist/commands/conversation/reply.js +9 -14
- package/dist/commands/conversation/show.d.ts +3 -3
- package/dist/commands/conversation/show.js +8 -14
- package/dist/commands/conversation/show2.d.ts +1 -1
- package/dist/commands/conversation/show2.js +1 -1
- package/dist/commands/cronjob/create.d.ts +3 -1
- package/dist/commands/cronjob/create.js +10 -4
- package/dist/commands/cronjob/delete.d.ts +1 -1
- package/dist/commands/cronjob/delete.js +2 -2
- package/dist/commands/cronjob/execute.d.ts +1 -1
- package/dist/commands/cronjob/execute.js +1 -1
- package/dist/commands/cronjob/execution/abort.d.ts +1 -1
- package/dist/commands/cronjob/execution/abort.js +2 -2
- package/dist/commands/cronjob/execution/get.d.ts +1 -1
- package/dist/commands/cronjob/execution/get.js +1 -1
- package/dist/commands/cronjob/execution/list.d.ts +2 -4
- package/dist/commands/cronjob/execution/list.js +5 -7
- package/dist/commands/cronjob/execution/logs.d.ts +1 -1
- package/dist/commands/cronjob/execution/logs.js +2 -2
- package/dist/commands/cronjob/get.d.ts +2 -2
- package/dist/commands/cronjob/get.js +3 -3
- package/dist/commands/cronjob/list.d.ts +2 -4
- package/dist/commands/cronjob/list.js +3 -6
- package/dist/commands/database/mysql/charsets.d.ts +3 -4
- package/dist/commands/database/mysql/charsets.js +2 -5
- package/dist/commands/database/mysql/create.d.ts +2 -2
- package/dist/commands/database/mysql/create.js +5 -5
- package/dist/commands/database/mysql/delete.d.ts +1 -2
- package/dist/commands/database/mysql/delete.js +3 -7
- package/dist/commands/database/mysql/dump.d.ts +1 -1
- package/dist/commands/database/mysql/dump.js +6 -6
- package/dist/commands/database/mysql/get.d.ts +1 -1
- package/dist/commands/database/mysql/get.js +2 -2
- package/dist/commands/database/mysql/import.d.ts +1 -1
- package/dist/commands/database/mysql/import.js +6 -6
- package/dist/commands/database/mysql/list.d.ts +2 -4
- package/dist/commands/database/mysql/list.js +2 -5
- package/dist/commands/database/mysql/phpmyadmin.d.ts +1 -1
- package/dist/commands/database/mysql/phpmyadmin.js +2 -2
- package/dist/commands/database/mysql/port-forward.d.ts +1 -1
- package/dist/commands/database/mysql/port-forward.js +6 -6
- package/dist/commands/database/mysql/shell.d.ts +1 -1
- package/dist/commands/database/mysql/shell.js +6 -6
- package/dist/commands/database/mysql/user/delete.d.ts +1 -1
- package/dist/commands/database/mysql/user/delete.js +2 -2
- package/dist/commands/database/mysql/user/get.d.ts +1 -1
- package/dist/commands/database/mysql/user/get.js +1 -1
- package/dist/commands/database/mysql/user/list.d.ts +2 -4
- package/dist/commands/database/mysql/user/list.js +1 -4
- package/dist/commands/database/mysql/versions.d.ts +2 -4
- package/dist/commands/database/mysql/versions.js +1 -4
- package/dist/commands/database/redis/create.d.ts +1 -1
- package/dist/commands/database/redis/create.js +2 -2
- package/dist/commands/database/redis/get.d.ts +1 -1
- package/dist/commands/database/redis/get.js +1 -1
- package/dist/commands/database/redis/list.d.ts +2 -4
- package/dist/commands/database/redis/list.js +2 -5
- package/dist/commands/database/redis/shell.d.ts +1 -1
- package/dist/commands/database/redis/shell.js +6 -6
- package/dist/commands/database/redis/versions.d.ts +2 -4
- package/dist/commands/database/redis/versions.js +2 -5
- package/dist/commands/ddev/init.d.ts +1 -1
- package/dist/commands/ddev/init.js +3 -3
- package/dist/commands/ddev/render-config.d.ts +1 -1
- package/dist/commands/ddev/render-config.js +2 -2
- package/dist/commands/domain/dnszone/get.d.ts +1 -1
- package/dist/commands/domain/dnszone/get.js +3 -3
- package/dist/commands/domain/dnszone/list.d.ts +2 -4
- package/dist/commands/domain/dnszone/list.js +3 -6
- package/dist/commands/domain/dnszone/update.d.ts +1 -1
- package/dist/commands/domain/dnszone/update.js +3 -3
- package/dist/commands/domain/get.d.ts +1 -1
- package/dist/commands/domain/get.js +3 -3
- package/dist/commands/domain/list.d.ts +2 -4
- package/dist/commands/domain/list.js +2 -5
- package/dist/commands/domain/virtualhost/create.d.ts +1 -1
- package/dist/commands/domain/virtualhost/create.js +2 -2
- package/dist/commands/domain/virtualhost/delete.d.ts +1 -1
- package/dist/commands/domain/virtualhost/delete.js +1 -1
- package/dist/commands/domain/virtualhost/get.d.ts +1 -1
- package/dist/commands/domain/virtualhost/get.js +2 -2
- package/dist/commands/domain/virtualhost/list.d.ts +2 -4
- package/dist/commands/domain/virtualhost/list.js +2 -5
- package/dist/commands/login/reset.d.ts +1 -1
- package/dist/commands/login/reset.js +2 -2
- package/dist/commands/login/status.d.ts +1 -1
- package/dist/commands/login/status.js +1 -1
- package/dist/commands/login/token.d.ts +1 -1
- package/dist/commands/login/token.js +2 -2
- package/dist/commands/mail/address/create.d.ts +3 -2
- package/dist/commands/mail/address/create.js +6 -5
- package/dist/commands/mail/address/delete.d.ts +1 -1
- package/dist/commands/mail/address/delete.js +1 -1
- package/dist/commands/mail/address/get.d.ts +1 -1
- package/dist/commands/mail/address/get.js +1 -1
- package/dist/commands/mail/address/list.d.ts +2 -4
- package/dist/commands/mail/address/list.js +6 -9
- package/dist/commands/mail/address/update.d.ts +1 -1
- package/dist/commands/mail/address/update.js +2 -2
- package/dist/commands/mail/deliverybox/get.d.ts +1 -1
- package/dist/commands/mail/deliverybox/get.js +1 -1
- package/dist/commands/mail/deliverybox/list.d.ts +2 -4
- package/dist/commands/mail/deliverybox/list.js +3 -6
- package/dist/commands/org/delete.d.ts +1 -1
- package/dist/commands/org/delete.js +2 -2
- package/dist/commands/org/get.d.ts +1 -1
- package/dist/commands/org/get.js +3 -3
- package/dist/commands/org/invite/list-own.d.ts +3 -3
- package/dist/commands/org/invite/list-own.js +2 -2
- package/dist/commands/org/invite/list.d.ts +3 -6
- package/dist/commands/org/invite/list.js +10 -12
- package/dist/commands/org/invite/revoke.d.ts +1 -1
- package/dist/commands/org/invite/revoke.js +1 -1
- package/dist/commands/org/invite.d.ts +2 -2
- package/dist/commands/org/invite.js +5 -5
- package/dist/commands/org/list.d.ts +2 -4
- package/dist/commands/org/list.js +1 -4
- package/dist/commands/org/membership/list-own.d.ts +3 -3
- package/dist/commands/org/membership/list-own.js +6 -7
- package/dist/commands/org/membership/list.d.ts +3 -3
- package/dist/commands/org/membership/list.js +7 -8
- package/dist/commands/org/membership/revoke.d.ts +1 -1
- package/dist/commands/org/membership/revoke.js +1 -1
- package/dist/commands/project/create.d.ts +2 -2
- package/dist/commands/project/create.js +3 -3
- package/dist/commands/project/delete.d.ts +1 -1
- package/dist/commands/project/delete.js +3 -3
- package/dist/commands/project/filesystem/usage.d.ts +1 -1
- package/dist/commands/project/filesystem/usage.js +16 -11
- package/dist/commands/project/get.d.ts +2 -2
- package/dist/commands/project/get.js +6 -6
- package/dist/commands/project/invite/get.d.ts +1 -1
- package/dist/commands/project/invite/get.js +1 -1
- package/dist/commands/project/invite/list-own.d.ts +2 -4
- package/dist/commands/project/invite/list-own.js +2 -5
- package/dist/commands/project/invite/list.d.ts +2 -4
- package/dist/commands/project/invite/list.js +13 -16
- package/dist/commands/project/list.d.ts +3 -6
- package/dist/commands/project/list.js +1 -4
- package/dist/commands/project/membership/get-own.d.ts +1 -1
- package/dist/commands/project/membership/get-own.js +2 -2
- package/dist/commands/project/membership/get.d.ts +1 -1
- package/dist/commands/project/membership/get.js +1 -1
- package/dist/commands/project/membership/list-own.d.ts +2 -4
- package/dist/commands/project/membership/list-own.js +10 -15
- package/dist/commands/project/membership/list.d.ts +3 -3
- package/dist/commands/project/membership/list.js +3 -3
- package/dist/commands/project/ssh.d.ts +1 -1
- package/dist/commands/project/ssh.js +5 -5
- package/dist/commands/project/update.d.ts +1 -1
- package/dist/commands/project/update.js +2 -2
- package/dist/commands/server/get.d.ts +1 -1
- package/dist/commands/server/get.js +2 -2
- package/dist/commands/server/list.d.ts +2 -4
- package/dist/commands/server/list.js +1 -4
- package/dist/commands/sftp-user/delete.d.ts +1 -1
- package/dist/commands/sftp-user/delete.js +2 -2
- package/dist/commands/sftp-user/list.d.ts +2 -5
- package/dist/commands/sftp-user/list.js +2 -5
- package/dist/commands/ssh-user/delete.d.ts +1 -1
- package/dist/commands/ssh-user/delete.js +2 -2
- package/dist/commands/ssh-user/list.d.ts +2 -5
- package/dist/commands/ssh-user/list.js +2 -5
- package/dist/commands/user/api-token/create.d.ts +3 -4
- package/dist/commands/user/api-token/create.js +14 -25
- package/dist/commands/user/api-token/get.d.ts +1 -1
- package/dist/commands/user/api-token/get.js +1 -1
- package/dist/commands/user/api-token/list.d.ts +2 -4
- package/dist/commands/user/api-token/list.js +10 -13
- package/dist/commands/user/api-token/revoke.d.ts +1 -1
- package/dist/commands/user/api-token/revoke.js +1 -1
- package/dist/commands/user/get.d.ts +1 -1
- package/dist/commands/user/get.js +1 -1
- package/dist/commands/user/session/get.d.ts +1 -1
- package/dist/commands/user/session/get.js +1 -1
- package/dist/commands/user/session/list.d.ts +2 -4
- package/dist/commands/user/session/list.js +10 -12
- package/dist/commands/user/ssh-key/create.d.ts +2 -2
- package/dist/commands/user/ssh-key/create.js +5 -5
- package/dist/commands/user/ssh-key/delete.d.ts +1 -1
- package/dist/commands/user/ssh-key/delete.js +1 -1
- package/dist/commands/user/ssh-key/get.d.ts +1 -1
- package/dist/commands/user/ssh-key/get.js +1 -1
- package/dist/commands/user/ssh-key/import.d.ts +2 -2
- package/dist/commands/user/ssh-key/import.js +5 -5
- package/dist/commands/user/ssh-key/list.d.ts +3 -3
- package/dist/commands/user/ssh-key/list.js +3 -3
- package/dist/lib/apiutil/SuccessfulResponse.d.ts +19 -0
- package/dist/lib/auth/token.js +1 -1
- package/dist/{BaseCommand.js → lib/basecommands/BaseCommand.js} +4 -4
- package/dist/{types.d.ts → lib/basecommands/CommandFlags.d.ts} +2 -4
- package/dist/{DeleteBaseCommand.d.ts → lib/basecommands/DeleteBaseCommand.d.ts} +1 -1
- package/dist/{DeleteBaseCommand.js → lib/basecommands/DeleteBaseCommand.js} +3 -3
- package/dist/{rendering/react → lib/basecommands}/ExecRenderBaseCommand.d.ts +2 -2
- package/dist/{rendering/react → lib/basecommands}/ExecRenderBaseCommand.js +2 -2
- package/dist/{ExtendedBaseCommand.d.ts → lib/basecommands/ExtendedBaseCommand.d.ts} +2 -2
- package/dist/{ExtendedBaseCommand.js → lib/basecommands/ExtendedBaseCommand.js} +3 -3
- package/dist/{GetBaseCommand.d.ts → lib/basecommands/GetBaseCommand.d.ts} +1 -1
- package/dist/{GetBaseCommand.js → lib/basecommands/GetBaseCommand.js} +1 -1
- package/dist/{ListBaseCommand.d.ts → lib/basecommands/ListBaseCommand.d.ts} +5 -3
- package/dist/{ListBaseCommand.js → lib/basecommands/ListBaseCommand.js} +10 -3
- package/dist/{rendering/react → lib/basecommands}/RenderBaseCommand.d.ts +3 -3
- package/dist/{rendering/react → lib/basecommands}/RenderBaseCommand.js +6 -6
- package/dist/lib/{context.d.ts → context/Context.d.ts} +11 -14
- package/dist/lib/{context.js → context/Context.js} +12 -5
- package/dist/lib/context/ContextProvider.d.ts +6 -0
- package/dist/lib/{context_ddev.d.ts → context/DDEVContextProvider.d.ts} +3 -2
- package/dist/lib/{context_ddev.js → context/DDEVContextProvider.js} +2 -2
- package/dist/lib/context/FlagSet.d.ts +20 -0
- package/dist/lib/{context_flags.d.ts → context/FlagSetBuilder.d.ts} +23 -9
- package/dist/lib/context/FlagSetBuilder.js +148 -0
- package/dist/lib/context/TerraformContextProvider.d.ts +7 -0
- package/dist/lib/{context_terraform.js → context/TerraformContextProvider.js} +2 -2
- package/dist/lib/{context_user.d.ts → context/UserContextProvider.d.ts} +4 -2
- package/dist/lib/{context_user.js → context/UserContextProvider.js} +4 -6
- package/dist/lib/context/WritableContextProvider.d.ts +14 -0
- package/dist/lib/context/WritableContextProvider.js +1 -0
- package/dist/lib/ddev/config_loader.js +1 -1
- package/dist/lib/ddev/init_assert.js +2 -2
- package/dist/lib/error/UnexpectedShortIDPassedError.js +1 -1
- package/dist/lib/{handleError.d.ts → error/handleError.d.ts} +2 -3
- package/dist/lib/{handleError.js → error/handleError.js} +4 -6
- package/dist/lib/flags/expireFlags.d.ts +7 -0
- package/dist/lib/flags/expireFlags.js +18 -0
- package/dist/lib/{app → resources/app}/Installer.d.ts +5 -3
- package/dist/lib/{app → resources/app}/Installer.js +4 -4
- package/dist/lib/{app → resources/app}/custom_installation.js +3 -3
- package/dist/lib/{app → resources/app}/flags.d.ts +7 -7
- package/dist/lib/{app → resources/app}/flags.js +18 -12
- package/dist/lib/{app → resources/app}/hooks.js +1 -1
- package/dist/lib/{app → resources/app}/install.d.ts +1 -1
- package/dist/lib/resources/app/sync.d.ts +15 -0
- package/dist/lib/resources/app/sync.js +55 -0
- package/dist/lib/resources/app/upgrade.d.ts +1 -0
- package/dist/lib/resources/app/upgrade.js +1 -0
- package/dist/lib/{app → resources/app}/versions.d.ts +1 -1
- package/dist/lib/{app → resources/app}/versions.js +1 -1
- package/dist/lib/{app → resources/app}/wait.d.ts +3 -2
- package/dist/lib/{app → resources/app}/wait.js +3 -3
- package/dist/lib/resources/backup/flags.d.ts +1 -0
- package/dist/lib/resources/backup/flags.js +4 -0
- package/dist/lib/resources/conversation/flags.d.ts +2 -0
- package/dist/lib/resources/conversation/flags.js +12 -0
- package/dist/lib/{database → resources/database}/common.d.ts +1 -1
- package/dist/lib/{database → resources/database}/mysql/connect.d.ts +1 -1
- package/dist/lib/{database → resources/database}/mysql/temp_user.d.ts +1 -1
- package/dist/lib/{database → resources/database}/mysql/temp_user.js +1 -1
- package/dist/lib/{database → resources/database}/redis/connect.d.ts +1 -1
- package/dist/lib/{database → resources/database}/redis/flags.js +2 -2
- package/dist/lib/resources/domain/dnszone/flags.d.ts +1 -0
- package/dist/lib/{domain → resources/domain}/dnszone/flags.js +2 -2
- package/dist/lib/resources/domain/flags.d.ts +1 -0
- package/dist/lib/{domain → resources/domain}/flags.js +2 -2
- package/dist/lib/resources/mail/flags.d.ts +1 -0
- package/dist/lib/{mail → resources/mail}/flags.js +2 -2
- package/dist/lib/resources/org/flags.d.ts +2 -0
- package/dist/lib/resources/org/flags.js +10 -0
- package/dist/lib/{project → resources/project}/flags.d.ts +4 -3
- package/dist/lib/{project → resources/project}/flags.js +15 -8
- package/dist/lib/{project → resources/project}/hooks.js +1 -1
- package/dist/lib/{project → resources/project}/ingress.js +2 -4
- package/dist/lib/{projectbackup → resources/projectbackup}/hooks.js +1 -1
- package/dist/lib/resources/server/flags.d.ts +2 -0
- package/dist/lib/resources/server/flags.js +10 -0
- package/dist/lib/resources/ssh/types.js +1 -0
- package/dist/lib/units/ByteQuantity.d.ts +23 -0
- package/dist/lib/units/ByteQuantity.js +49 -0
- package/dist/lib/units/Duration.d.ts +23 -0
- package/dist/lib/units/Duration.js +57 -0
- package/dist/lib/util/fs/hasBinaryInPath.d.ts +9 -0
- package/dist/lib/{hasbin.js → util/fs/hasBinaryInPath.js} +9 -1
- package/dist/lib/util/fs/isNotFound.d.ts +8 -0
- package/dist/lib/util/fs/isNotFound.js +10 -0
- package/dist/lib/util/fs/pathExists.d.ts +7 -0
- package/dist/lib/{fsutil.js → util/fs/pathExists.js} +7 -3
- package/dist/lib/util/maybe.d.ts +12 -0
- package/dist/lib/util/maybe.js +17 -0
- package/dist/lib/util/mergeObjects.d.ts +7 -0
- package/dist/lib/{mergeObjects.js → util/mergeObjects.js} +8 -2
- package/dist/lib/util/password/generatePassword.d.ts +9 -0
- package/dist/lib/util/password/generatePassword.js +12 -0
- package/dist/lib/util/password/generatePasswordWithSpecialChars.d.ts +9 -0
- package/dist/lib/{password.js → util/password/generatePasswordWithSpecialChars.js} +9 -5
- package/dist/lib/wait.d.ts +5 -2
- package/dist/lib/wait.js +10 -9
- package/dist/rendering/formatter/GetFormatter.d.ts +11 -0
- package/dist/rendering/formatter/GetFormatter.js +20 -0
- package/dist/rendering/formatter/ListDateColumnFormatter.d.ts +24 -0
- package/dist/rendering/formatter/ListDateColumnFormatter.js +28 -0
- package/dist/{Formatter.d.ts → rendering/formatter/ListFormatter.d.ts} +2 -12
- package/dist/{Formatter.js → rendering/formatter/ListFormatter.js} +1 -19
- package/dist/rendering/formatter/printHeader.d.ts +7 -0
- package/dist/rendering/formatter/printHeader.js +12 -0
- package/dist/rendering/formatter/printKeyValues.d.ts +7 -0
- package/dist/{lib/viewhelpers/tui.js → rendering/formatter/printKeyValues.js} +6 -5
- package/dist/rendering/lib/getTerminalWidth.d.ts +7 -1
- package/dist/rendering/lib/getTerminalWidth.js +9 -2
- package/dist/rendering/process/components/ProcessError.js +1 -1
- package/dist/rendering/process/process_exec.js +3 -0
- package/dist/rendering/react/ComponentPrinter.d.ts +1 -1
- package/dist/rendering/react/components/AppInstallation/AppInstallationDetails.js +8 -10
- package/dist/rendering/react/components/AppInstallation/AppSystemSoftware.js +1 -1
- package/dist/rendering/react/components/ByteFormat.d.ts +9 -1
- package/dist/rendering/react/components/ByteFormat.js +9 -10
- package/dist/rendering/react/components/CronJob/CronJobDetails.js +2 -2
- package/dist/rendering/react/components/DnsZone/DnsZoneRecordsA.js +1 -1
- package/dist/rendering/react/components/DnsZone/DnsZoneRecordsAAAA.js +1 -1
- package/dist/rendering/react/components/DnsZone/DnsZoneRecordsMX.js +1 -1
- package/dist/rendering/react/components/DnsZone/DnsZoneRecordsSRV.js +1 -1
- package/dist/rendering/react/components/DnsZone/DnsZoneRecordsTXT.js +1 -1
- package/dist/rendering/react/components/FormattedDate.js +1 -1
- package/dist/rendering/react/components/OptionalValue.d.ts +13 -0
- package/dist/rendering/react/components/OptionalValue.js +16 -0
- package/dist/rendering/react/components/ProjectBackup/ProjectBackupDetails.js +2 -2
- package/dist/rendering/react/components/Table/CellData.js +1 -1
- package/dist/rendering/react/components/WithoutLineBreaks.js +1 -1
- package/dist/rendering/setup/FlagSupportedSetup.js +1 -1
- package/dist/{lib/viewhelpers/date.d.ts → rendering/textformat/formatDate.d.ts} +0 -1
- package/dist/{lib/viewhelpers/date.js → rendering/textformat/formatDate.js} +8 -15
- package/dist/rendering/textformat/removeLineBreaks.d.ts +6 -0
- package/dist/rendering/textformat/removeLineBreaks.js +8 -0
- package/package.json +5 -5
- package/dist/Flags.d.ts +0 -1
- package/dist/Flags.js +0 -1
- package/dist/lib/bytes.d.ts +0 -1
- package/dist/lib/bytes.js +0 -16
- package/dist/lib/context_flags.js +0 -88
- package/dist/lib/context_terraform.d.ts +0 -6
- package/dist/lib/domain/dnszone/flags.d.ts +0 -1
- package/dist/lib/domain/flags.d.ts +0 -1
- package/dist/lib/expires.d.ts +0 -11
- package/dist/lib/expires.js +0 -31
- package/dist/lib/fsutil.d.ts +0 -2
- package/dist/lib/hasbin.d.ts +0 -1
- package/dist/lib/mail/flags.d.ts +0 -1
- package/dist/lib/mergeObjects.d.ts +0 -1
- package/dist/lib/notify.d.ts +0 -2
- package/dist/lib/notify.js +0 -5
- package/dist/lib/org/flags.d.ts +0 -1
- package/dist/lib/org/flags.js +0 -3
- package/dist/lib/password.d.ts +0 -2
- package/dist/lib/server/flags.d.ts +0 -1
- package/dist/lib/server/flags.js +0 -3
- package/dist/lib/viewhelpers/list_column_date.d.ts +0 -14
- package/dist/lib/viewhelpers/list_column_date.js +0 -21
- package/dist/lib/viewhelpers/removeLineBreaks.d.ts +0 -1
- package/dist/lib/viewhelpers/removeLineBreaks.js +0 -1
- package/dist/lib/viewhelpers/size.d.ts +0 -2
- package/dist/lib/viewhelpers/size.js +0 -4
- package/dist/lib/viewhelpers/tui.d.ts +0 -2
- package/dist/normalize_id.d.ts +0 -7
- package/dist/normalize_id.js +0 -34
- /package/dist/lib/{app/upgrade.d.ts → apiutil/SuccessfulResponse.js} +0 -0
- /package/dist/lib/{api_consistency.d.ts → apiutil/api_consistency.d.ts} +0 -0
- /package/dist/lib/{api_consistency.js → apiutil/api_consistency.js} +0 -0
- /package/dist/lib/{api_logging.d.ts → apiutil/api_logging.d.ts} +0 -0
- /package/dist/lib/{api_logging.js → apiutil/api_logging.js} +0 -0
- /package/dist/lib/{api_retry.d.ts → apiutil/api_retry.d.ts} +0 -0
- /package/dist/lib/{api_retry.js → apiutil/api_retry.js} +0 -0
- /package/dist/lib/{assert_success.d.ts → apiutil/assert_success.d.ts} +0 -0
- /package/dist/lib/{assert_success.js → apiutil/assert_success.js} +0 -0
- /package/dist/{BaseCommand.d.ts → lib/basecommands/BaseCommand.d.ts} +0 -0
- /package/dist/lib/{app/upgrade.js → basecommands/CommandFlags.js} +0 -0
- /package/dist/lib/{ssh/types.js → context/ContextProvider.js} +0 -0
- /package/dist/{types.js → lib/context/FlagSet.js} +0 -0
- /package/dist/lib/{app → resources/app}/custom_installation.d.ts +0 -0
- /package/dist/lib/{app → resources/app}/hooks.d.ts +0 -0
- /package/dist/lib/{app → resources/app}/install.js +0 -0
- /package/dist/lib/{app → resources/app}/uuid.d.ts +0 -0
- /package/dist/lib/{app → resources/app}/uuid.js +0 -0
- /package/dist/lib/{conversation → resources/conversation}/message_input.d.ts +0 -0
- /package/dist/lib/{conversation → resources/conversation}/message_input.js +0 -0
- /package/dist/lib/{database → resources/database}/common.js +0 -0
- /package/dist/lib/{database → resources/database}/mysql/connect.js +0 -0
- /package/dist/lib/{database → resources/database}/mysql/flags.d.ts +0 -0
- /package/dist/lib/{database → resources/database}/mysql/flags.js +0 -0
- /package/dist/lib/{database → resources/database}/redis/connect.js +0 -0
- /package/dist/lib/{database → resources/database}/redis/flags.d.ts +0 -0
- /package/dist/lib/{domain → resources/domain}/dnszone/records.d.ts +0 -0
- /package/dist/lib/{domain → resources/domain}/dnszone/records.js +0 -0
- /package/dist/lib/{project → resources/project}/hooks.d.ts +0 -0
- /package/dist/lib/{project → resources/project}/ingress.d.ts +0 -0
- /package/dist/lib/{project → resources/project}/shortId.d.ts +0 -0
- /package/dist/lib/{project → resources/project}/shortId.js +0 -0
- /package/dist/lib/{projectbackup → resources/projectbackup}/hooks.d.ts +0 -0
- /package/dist/lib/{ssh → resources/ssh}/appinstall.d.ts +0 -0
- /package/dist/lib/{ssh → resources/ssh}/appinstall.js +0 -0
- /package/dist/lib/{ssh → resources/ssh}/connection.d.ts +0 -0
- /package/dist/lib/{ssh → resources/ssh}/connection.js +0 -0
- /package/dist/lib/{ssh → resources/ssh}/doc.d.ts +0 -0
- /package/dist/lib/{ssh → resources/ssh}/doc.js +0 -0
- /package/dist/lib/{ssh → resources/ssh}/exec.d.ts +0 -0
- /package/dist/lib/{ssh → resources/ssh}/exec.js +0 -0
- /package/dist/lib/{ssh → resources/ssh}/flags.d.ts +0 -0
- /package/dist/lib/{ssh → resources/ssh}/flags.js +0 -0
- /package/dist/lib/{ssh → resources/ssh}/project.d.ts +0 -0
- /package/dist/lib/{ssh → resources/ssh}/project.js +0 -0
- /package/dist/lib/{ssh → resources/ssh}/types.d.ts +0 -0
- /package/dist/lib/{language.d.ts → util/language/articleForWord.d.ts} +0 -0
- /package/dist/lib/{language.js → util/language/articleForWord.js} +0 -0
- /package/dist/{Printer.d.ts → rendering/Printer.d.ts} +0 -0
- /package/dist/{Printer.js → rendering/Printer.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DeleteBaseCommand } from "../../DeleteBaseCommand.js";
|
|
2
|
-
import assertSuccess from "../../lib/assert_success.js";
|
|
1
|
+
import { DeleteBaseCommand } from "../../lib/basecommands/DeleteBaseCommand.js";
|
|
2
|
+
import assertSuccess from "../../lib/apiutil/assert_success.js";
|
|
3
3
|
import { Args } from "@oclif/core";
|
|
4
4
|
export default class Delete extends DeleteBaseCommand {
|
|
5
5
|
static description = "Delete an SSH user";
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
2
|
import { Simplify } from "@mittwald/api-client-commons";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ListBaseCommand } from "../../ListBaseCommand.js";
|
|
6
|
-
type SshUserResponse = Awaited<ReturnType<MittwaldAPIV2Client["sshsftpUser"]["sftpUserListSftpUsers"]>>;
|
|
3
|
+
import { ListColumns } from "../../rendering/formatter/ListFormatter.js";
|
|
4
|
+
import { ListBaseCommand } from "../../lib/basecommands/ListBaseCommand.js";
|
|
7
5
|
type SshUserResponseItem = Simplify<MittwaldAPIV2.Paths.V2ProjectsProjectIdSftpUsers.Get.Responses.$200.Content.ApplicationJson[number]>;
|
|
8
6
|
type Response = Awaited<ReturnType<MittwaldAPIV2Client["sshsftpUser"]["sshUserListSshUsers"]>>;
|
|
9
7
|
export declare class List extends ListBaseCommand<typeof List, SshUserResponseItem, Response> {
|
|
@@ -37,7 +35,6 @@ export declare class List extends ListBaseCommand<typeof List, SshUserResponseIt
|
|
|
37
35
|
static aliases: string[];
|
|
38
36
|
static deprecateAliases: boolean;
|
|
39
37
|
getData(): Promise<Response>;
|
|
40
|
-
protected mapData(data: SuccessfulResponse<SshUserResponse, 200>["data"]): SshUserResponseItem[];
|
|
41
38
|
protected getColumns(data: SshUserResponseItem[]): ListColumns<SshUserResponseItem>;
|
|
42
39
|
}
|
|
43
40
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ListBaseCommand } from "../../ListBaseCommand.js";
|
|
2
|
-
import { projectFlags } from "../../lib/project/flags.js";
|
|
1
|
+
import { ListBaseCommand } from "../../lib/basecommands/ListBaseCommand.js";
|
|
2
|
+
import { projectFlags } from "../../lib/resources/project/flags.js";
|
|
3
3
|
export class List extends ListBaseCommand {
|
|
4
4
|
static description = "List all SSH users for a project.";
|
|
5
5
|
static args = {};
|
|
@@ -13,9 +13,6 @@ export class List extends ListBaseCommand {
|
|
|
13
13
|
const projectId = await this.withProjectId(List);
|
|
14
14
|
return await this.apiClient.sshsftpUser.sshUserListSshUsers({ projectId });
|
|
15
15
|
}
|
|
16
|
-
mapData(data) {
|
|
17
|
-
return data;
|
|
18
|
-
}
|
|
19
16
|
getColumns(data) {
|
|
20
17
|
const { id, userName, createdAt } = super.getColumns(data, {
|
|
21
18
|
shortIdKey: "userName",
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { ExecRenderBaseCommand } from "../../../
|
|
1
|
+
import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
2
2
|
export default class Create extends ExecRenderBaseCommand<typeof Create, {
|
|
3
3
|
token: string;
|
|
4
4
|
}> {
|
|
5
5
|
static description: string;
|
|
6
6
|
static flags: {
|
|
7
7
|
description: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
roles: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<["api_read" | "api_write", ...("api_read" | "api_write")[]], import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
9
|
+
expires: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<Date | undefined>;
|
|
10
10
|
quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
|
-
private determineExpiration;
|
|
13
12
|
protected exec(): Promise<{
|
|
14
13
|
token: string;
|
|
15
14
|
}>;
|
|
@@ -1,51 +1,40 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Flags } from "@oclif/core";
|
|
3
3
|
import { assertStatus } from "@mittwald/api-client-commons";
|
|
4
|
-
import
|
|
5
|
-
import { ExecRenderBaseCommand } from "../../../rendering/react/ExecRenderBaseCommand.js";
|
|
4
|
+
import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
6
5
|
import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
|
|
7
6
|
import { Success } from "../../../rendering/react/components/Success.js";
|
|
8
7
|
import { Newline, Text } from "ink";
|
|
9
8
|
import { Value } from "../../../rendering/react/components/Value.js";
|
|
9
|
+
import { expireFlags } from "../../../lib/flags/expireFlags.js";
|
|
10
|
+
const roleFlags = Flags.custom({
|
|
11
|
+
options: ["api_read", "api_write"],
|
|
12
|
+
});
|
|
10
13
|
export default class Create extends ExecRenderBaseCommand {
|
|
11
14
|
static description = "Create a new API token";
|
|
12
15
|
static flags = {
|
|
13
16
|
...processFlags,
|
|
17
|
+
...expireFlags("API token", false),
|
|
14
18
|
description: Flags.string({
|
|
15
|
-
description: "
|
|
19
|
+
description: "description of the API token",
|
|
16
20
|
required: true,
|
|
17
21
|
}),
|
|
18
|
-
|
|
19
|
-
description: "
|
|
20
|
-
}),
|
|
21
|
-
roles: Flags.string({
|
|
22
|
-
description: "Roles of the API token",
|
|
22
|
+
roles: roleFlags({
|
|
23
|
+
description: "roles of the API token",
|
|
23
24
|
required: true,
|
|
24
25
|
multiple: true,
|
|
25
|
-
options: ["api_read", "api_write"],
|
|
26
26
|
}),
|
|
27
27
|
};
|
|
28
|
-
determineExpiration(input) {
|
|
29
|
-
if (input === undefined) {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
const duration = parseDuration(input);
|
|
33
|
-
if (duration === undefined) {
|
|
34
|
-
throw new Error(`Could not parse duration ${input}`);
|
|
35
|
-
}
|
|
36
|
-
return new Date(Date.now() + duration);
|
|
37
|
-
}
|
|
38
28
|
async exec() {
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const expiresAt = this.determineExpiration(flags["expires-in"]);
|
|
29
|
+
const process = makeProcessRenderer(this.flags, "Creating an API token");
|
|
30
|
+
const { description, roles, expires } = this.flags;
|
|
42
31
|
const step = process.addStep("creating API token");
|
|
43
32
|
try {
|
|
44
33
|
const response = await this.apiClient.user.createApiToken({
|
|
45
34
|
data: {
|
|
46
|
-
description
|
|
47
|
-
expiresAt:
|
|
48
|
-
roles
|
|
35
|
+
description,
|
|
36
|
+
expiresAt: expires?.toJSON(),
|
|
37
|
+
roles,
|
|
49
38
|
},
|
|
50
39
|
});
|
|
51
40
|
step.complete();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
|
-
import { GetBaseCommand } from "../../../GetBaseCommand.js";
|
|
2
|
+
import { GetBaseCommand } from "../../../lib/basecommands/GetBaseCommand.js";
|
|
3
3
|
type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["user"]["getApiToken"]>>;
|
|
4
4
|
export default class Get extends GetBaseCommand<typeof Get, APIResponse> {
|
|
5
5
|
static description: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Args } from "@oclif/core";
|
|
2
|
-
import { GetBaseCommand } from "../../../GetBaseCommand.js";
|
|
2
|
+
import { GetBaseCommand } from "../../../lib/basecommands/GetBaseCommand.js";
|
|
3
3
|
export default class Get extends GetBaseCommand {
|
|
4
4
|
static description = "Get a specific API token";
|
|
5
5
|
static flags = {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Simplify } from "@mittwald/api-client-commons";
|
|
2
2
|
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ListBaseCommand } from "../../../ListBaseCommand.js";
|
|
3
|
+
import { ListColumns } from "../../../rendering/formatter/ListFormatter.js";
|
|
4
|
+
import { ListBaseCommand } from "../../../lib/basecommands/ListBaseCommand.js";
|
|
6
5
|
type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2UsersSelfApiTokens.Get.Responses.$200.Content.ApplicationJson[number]>;
|
|
7
6
|
type Response = Awaited<ReturnType<MittwaldAPIV2Client["user"]["listApiTokens"]>>;
|
|
8
7
|
export default class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
|
|
@@ -33,7 +32,6 @@ export default class List extends ListBaseCommand<typeof List, ResponseItem, Res
|
|
|
33
32
|
"no-relative-dates": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
34
33
|
};
|
|
35
34
|
getData(): Promise<Response>;
|
|
36
|
-
protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.SignupApiToken[];
|
|
37
35
|
protected getColumns(): ListColumns<ResponseItem>;
|
|
38
36
|
}
|
|
39
37
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { buildCreatedAtColumn } from "../../../lib/viewhelpers/list_column_date.js";
|
|
1
|
+
import { ListBaseCommand } from "../../../lib/basecommands/ListBaseCommand.js";
|
|
2
|
+
import ListDateColumnFormatter from "../../../rendering/formatter/ListDateColumnFormatter.js";
|
|
4
3
|
export default class List extends ListBaseCommand {
|
|
5
4
|
static description = "List all API tokens of the user";
|
|
6
5
|
static args = {};
|
|
@@ -10,21 +9,19 @@ export default class List extends ListBaseCommand {
|
|
|
10
9
|
async getData() {
|
|
11
10
|
return await this.apiClient.user.listApiTokens();
|
|
12
11
|
}
|
|
13
|
-
mapData(data) {
|
|
14
|
-
return data;
|
|
15
|
-
}
|
|
16
12
|
getColumns() {
|
|
17
|
-
const
|
|
13
|
+
const dateColumnBuilder = new ListDateColumnFormatter(this.flags);
|
|
14
|
+
const createdAt = dateColumnBuilder.buildColumn();
|
|
15
|
+
const expiresAt = dateColumnBuilder.buildColumn({
|
|
16
|
+
header: "Expires at",
|
|
17
|
+
column: "expiresAt",
|
|
18
|
+
fallback: "never",
|
|
19
|
+
});
|
|
18
20
|
return {
|
|
19
21
|
apiTokenId: { header: "ID", minWidth: 36 },
|
|
20
22
|
description: {},
|
|
21
23
|
createdAt,
|
|
22
|
-
expiresAt
|
|
23
|
-
header: "Expires at",
|
|
24
|
-
get: (r) => r.expiresAt
|
|
25
|
-
? formatRelativeDate(new Date(`${r.expiresAt}`))
|
|
26
|
-
: "never",
|
|
27
|
-
},
|
|
24
|
+
expiresAt,
|
|
28
25
|
};
|
|
29
26
|
}
|
|
30
27
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeleteBaseCommand } from "../../../DeleteBaseCommand.js";
|
|
1
|
+
import { DeleteBaseCommand } from "../../../lib/basecommands/DeleteBaseCommand.js";
|
|
2
2
|
export default class Revoke extends DeleteBaseCommand<typeof Revoke> {
|
|
3
3
|
static description: string;
|
|
4
4
|
static resource: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args } from "@oclif/core";
|
|
2
2
|
import { assertStatus } from "@mittwald/api-client-commons";
|
|
3
|
-
import { DeleteBaseCommand } from "../../../DeleteBaseCommand.js";
|
|
3
|
+
import { DeleteBaseCommand } from "../../../lib/basecommands/DeleteBaseCommand.js";
|
|
4
4
|
export default class Revoke extends DeleteBaseCommand {
|
|
5
5
|
static description = "Revoke an API token";
|
|
6
6
|
static resource = "API token";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
|
-
import { GetBaseCommand } from "../../GetBaseCommand.js";
|
|
2
|
+
import { GetBaseCommand } from "../../lib/basecommands/GetBaseCommand.js";
|
|
3
3
|
export type PathParams = MittwaldAPIV2.Paths.V2UsersUserId.Get.Parameters.Path;
|
|
4
4
|
type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["user"]["getUser"]>>;
|
|
5
5
|
export default class Get extends GetBaseCommand<typeof Get, APIResponse> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GetBaseCommand } from "../../GetBaseCommand.js";
|
|
1
|
+
import { GetBaseCommand } from "../../lib/basecommands/GetBaseCommand.js";
|
|
2
2
|
import { Args } from "@oclif/core";
|
|
3
3
|
export default class Get extends GetBaseCommand {
|
|
4
4
|
static description = "Get profile information for a user.";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
|
-
import { GetBaseCommand } from "../../../GetBaseCommand.js";
|
|
2
|
+
import { GetBaseCommand } from "../../../lib/basecommands/GetBaseCommand.js";
|
|
3
3
|
type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["user"]["getSession"]>>;
|
|
4
4
|
export default class Get extends GetBaseCommand<typeof Get, APIResponse> {
|
|
5
5
|
static description: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Args } from "@oclif/core";
|
|
2
|
-
import { GetBaseCommand } from "../../../GetBaseCommand.js";
|
|
2
|
+
import { GetBaseCommand } from "../../../lib/basecommands/GetBaseCommand.js";
|
|
3
3
|
export default class Get extends GetBaseCommand {
|
|
4
4
|
static description = "Get a specific session";
|
|
5
5
|
static flags = {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Simplify } from "@mittwald/api-client-commons";
|
|
2
2
|
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { ListBaseCommand } from "../../../ListBaseCommand.js";
|
|
3
|
+
import { ListColumns } from "../../../rendering/formatter/ListFormatter.js";
|
|
4
|
+
import { ListBaseCommand } from "../../../lib/basecommands/ListBaseCommand.js";
|
|
6
5
|
type ResponseItem = Simplify<MittwaldAPIV2.Paths.V2UsersSelfSessions.Get.Responses.$200.Content.ApplicationJson[number]>;
|
|
7
6
|
type Response = Awaited<ReturnType<MittwaldAPIV2Client["user"]["listSessions"]>>;
|
|
8
7
|
export default class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
|
|
@@ -33,7 +32,6 @@ export default class List extends ListBaseCommand<typeof List, ResponseItem, Res
|
|
|
33
32
|
"no-relative-dates": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
34
33
|
};
|
|
35
34
|
getData(): Promise<Response>;
|
|
36
|
-
protected mapData(data: SuccessfulResponse<Response, 200>["data"]): MittwaldAPIV2.Components.Schemas.SignupUserSession[];
|
|
37
35
|
protected getColumns(): ListColumns<ResponseItem>;
|
|
38
36
|
}
|
|
39
37
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { ListBaseCommand } from "../../../lib/basecommands/ListBaseCommand.js";
|
|
2
|
+
import ListDateColumnFormatter from "../../../rendering/formatter/ListDateColumnFormatter.js";
|
|
3
3
|
export default class List extends ListBaseCommand {
|
|
4
4
|
static description = "List all active sessions";
|
|
5
5
|
static args = {};
|
|
@@ -9,26 +9,24 @@ export default class List extends ListBaseCommand {
|
|
|
9
9
|
async getData() {
|
|
10
10
|
return await this.apiClient.user.listSessions();
|
|
11
11
|
}
|
|
12
|
-
mapData(data) {
|
|
13
|
-
return data;
|
|
14
|
-
}
|
|
15
12
|
getColumns() {
|
|
13
|
+
const dateColumnBuilder = new ListDateColumnFormatter(this.flags);
|
|
14
|
+
const lastAccess = dateColumnBuilder.buildColumn({
|
|
15
|
+
header: "Last access",
|
|
16
|
+
column: "lastAccess",
|
|
17
|
+
fallback: "(never)",
|
|
18
|
+
});
|
|
16
19
|
return {
|
|
17
20
|
tokenId: { header: "ID", minWidth: 36 },
|
|
18
21
|
device: {
|
|
19
22
|
header: "Device",
|
|
20
|
-
get: (row) => `${row.device.browser} on ${row.device.os}`,
|
|
23
|
+
get: (row) => `${row.device.browser ?? "unknown browser"} on ${row.device.os ?? "unknown OS"}`,
|
|
21
24
|
},
|
|
22
25
|
location: {
|
|
23
26
|
header: "Location",
|
|
24
27
|
get: (row) => row.location?.country,
|
|
25
28
|
},
|
|
26
|
-
lastAccess
|
|
27
|
-
header: "Last Access",
|
|
28
|
-
get: (row) => row.lastAccess
|
|
29
|
-
? formatRelativeDate(new Date(`${row.lastAccess}`))
|
|
30
|
-
: "never",
|
|
31
|
-
},
|
|
29
|
+
lastAccess,
|
|
32
30
|
};
|
|
33
31
|
}
|
|
34
32
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ExecRenderBaseCommand } from "../../../
|
|
1
|
+
import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
2
2
|
export default class Create extends ExecRenderBaseCommand<typeof Create, undefined> {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
6
6
|
"no-passphrase": import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
7
7
|
comment: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
8
|
-
expires: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<
|
|
8
|
+
expires: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<Date | undefined>;
|
|
9
9
|
quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
10
10
|
};
|
|
11
11
|
protected exec(): Promise<undefined>;
|
|
@@ -4,18 +4,18 @@ import { assertStatus } from "@mittwald/api-client-commons";
|
|
|
4
4
|
import * as path from "path";
|
|
5
5
|
import * as os from "os";
|
|
6
6
|
import * as fs from "fs/promises";
|
|
7
|
-
import { ExecRenderBaseCommand } from "../../../
|
|
7
|
+
import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
8
8
|
import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
|
|
9
9
|
import { Success } from "../../../rendering/react/components/Success.js";
|
|
10
10
|
import { Filename } from "../../../rendering/react/components/Filename.js";
|
|
11
11
|
import { Text } from "ink";
|
|
12
|
-
import { expirationDateFromFlagsOptional, expireFlags, } from "../../../lib/expires.js";
|
|
13
12
|
import { spawnInProcess } from "../../../rendering/process/process_exec.js";
|
|
13
|
+
import { expireFlags } from "../../../lib/flags/expireFlags.js";
|
|
14
14
|
export default class Create extends ExecRenderBaseCommand {
|
|
15
15
|
static description = "Create and import a new SSH key";
|
|
16
16
|
static flags = {
|
|
17
17
|
...processFlags,
|
|
18
|
-
...expireFlags("SSH key"),
|
|
18
|
+
...expireFlags("SSH key", false),
|
|
19
19
|
output: Flags.string({
|
|
20
20
|
description: "A filename in your ~/.ssh directory to write the SSH key to.",
|
|
21
21
|
default: "mstudio-cli",
|
|
@@ -31,7 +31,7 @@ export default class Create extends ExecRenderBaseCommand {
|
|
|
31
31
|
const cmd = "ssh-keygen";
|
|
32
32
|
const outputFile = path.join(os.homedir(), ".ssh", this.flags.output);
|
|
33
33
|
const r = makeProcessRenderer(this.flags, "Creating a new SSH key");
|
|
34
|
-
const
|
|
34
|
+
const { expires } = this.flags;
|
|
35
35
|
const passphrase = await this.getPassphrase(r);
|
|
36
36
|
const args = ["-t", "rsa", "-f", outputFile, "-N", passphrase];
|
|
37
37
|
if (this.flags.comment) {
|
|
@@ -44,7 +44,7 @@ export default class Create extends ExecRenderBaseCommand {
|
|
|
44
44
|
const response = await this.apiClient.user.createSshKey({
|
|
45
45
|
data: {
|
|
46
46
|
publicKey,
|
|
47
|
-
expiresAt:
|
|
47
|
+
expiresAt: expires?.toJSON(),
|
|
48
48
|
},
|
|
49
49
|
});
|
|
50
50
|
assertStatus(response, 201);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DeleteBaseCommand } from "../../../DeleteBaseCommand.js";
|
|
1
|
+
import { DeleteBaseCommand } from "../../../lib/basecommands/DeleteBaseCommand.js";
|
|
2
2
|
export default class Delete extends DeleteBaseCommand<typeof Delete> {
|
|
3
3
|
static description: string;
|
|
4
4
|
static resourceName: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args } from "@oclif/core";
|
|
2
2
|
import { assertStatus } from "@mittwald/api-client-commons";
|
|
3
|
-
import { DeleteBaseCommand } from "../../../DeleteBaseCommand.js";
|
|
3
|
+
import { DeleteBaseCommand } from "../../../lib/basecommands/DeleteBaseCommand.js";
|
|
4
4
|
export default class Delete extends DeleteBaseCommand {
|
|
5
5
|
static description = "Delete an SSH key";
|
|
6
6
|
static resourceName = "SSH key";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
2
|
-
import { GetBaseCommand } from "../../../GetBaseCommand.js";
|
|
2
|
+
import { GetBaseCommand } from "../../../lib/basecommands/GetBaseCommand.js";
|
|
3
3
|
type APIResponse = Awaited<ReturnType<MittwaldAPIV2Client["user"]["getSshKey"]>>;
|
|
4
4
|
export default class Get extends GetBaseCommand<typeof Get, APIResponse> {
|
|
5
5
|
static description: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Args } from "@oclif/core";
|
|
2
|
-
import { GetBaseCommand } from "../../../GetBaseCommand.js";
|
|
2
|
+
import { GetBaseCommand } from "../../../lib/basecommands/GetBaseCommand.js";
|
|
3
3
|
export default class Get extends GetBaseCommand {
|
|
4
4
|
static description = "Get a specific SSH key";
|
|
5
5
|
static flags = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ExecRenderBaseCommand } from "../../../
|
|
1
|
+
import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
2
2
|
export default class Import extends ExecRenderBaseCommand<typeof Import, undefined> {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
input: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
6
|
-
expires: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<
|
|
6
|
+
expires: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<Date | undefined>;
|
|
7
7
|
quiet: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
8
8
|
};
|
|
9
9
|
protected exec(): Promise<undefined>;
|
|
@@ -4,16 +4,16 @@ import { assertStatus } from "@mittwald/api-client-commons";
|
|
|
4
4
|
import * as path from "path";
|
|
5
5
|
import * as os from "os";
|
|
6
6
|
import * as fs from "fs/promises";
|
|
7
|
-
import { ExecRenderBaseCommand } from "../../../
|
|
7
|
+
import { ExecRenderBaseCommand } from "../../../lib/basecommands/ExecRenderBaseCommand.js";
|
|
8
8
|
import { makeProcessRenderer, processFlags, } from "../../../rendering/process/process_flags.js";
|
|
9
9
|
import { Success } from "../../../rendering/react/components/Success.js";
|
|
10
10
|
import { Filename } from "../../../rendering/react/components/Filename.js";
|
|
11
|
-
import {
|
|
11
|
+
import { expireFlags } from "../../../lib/flags/expireFlags.js";
|
|
12
12
|
export default class Import extends ExecRenderBaseCommand {
|
|
13
13
|
static description = "Import an existing (local) SSH key";
|
|
14
14
|
static flags = {
|
|
15
15
|
...processFlags,
|
|
16
|
-
...expireFlags("SSH key"),
|
|
16
|
+
...expireFlags("SSH key", false),
|
|
17
17
|
input: Flags.string({
|
|
18
18
|
description: "A filename in your ~/.ssh directory containing the key to import.",
|
|
19
19
|
default: "id_rsa.pub",
|
|
@@ -22,7 +22,7 @@ export default class Import extends ExecRenderBaseCommand {
|
|
|
22
22
|
async exec() {
|
|
23
23
|
const inputFile = path.join(os.homedir(), ".ssh", this.flags.input);
|
|
24
24
|
const r = makeProcessRenderer(this.flags, "Importing an SSH key");
|
|
25
|
-
const
|
|
25
|
+
const { expires } = this.flags;
|
|
26
26
|
const publicKey = await fs.readFile(inputFile, "utf-8");
|
|
27
27
|
const publicKeyParts = publicKey.split(" ");
|
|
28
28
|
const keys = await r.runStep("retrieving existing SSH keys", async () => {
|
|
@@ -40,7 +40,7 @@ export default class Import extends ExecRenderBaseCommand {
|
|
|
40
40
|
const response = await this.apiClient.user.createSshKey({
|
|
41
41
|
data: {
|
|
42
42
|
publicKey,
|
|
43
|
-
expiresAt:
|
|
43
|
+
expiresAt: expires?.toJSON(),
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
46
|
assertStatus(response, 201);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Simplify } from "@mittwald/api-client-commons";
|
|
2
2
|
import { MittwaldAPIV2, MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
3
|
-
import { SuccessfulResponse } from "../../../
|
|
4
|
-
import { ListColumns } from "../../../
|
|
5
|
-
import { ListBaseCommand } from "../../../ListBaseCommand.js";
|
|
3
|
+
import { SuccessfulResponse } from "../../../lib/apiutil/SuccessfulResponse.js";
|
|
4
|
+
import { ListColumns } from "../../../rendering/formatter/ListFormatter.js";
|
|
5
|
+
import { ListBaseCommand } from "../../../lib/basecommands/ListBaseCommand.js";
|
|
6
6
|
type ResponseItem = Simplify<Required<MittwaldAPIV2.Paths.V2UsersSelfSshKeys.Get.Responses.$200.Content.ApplicationJson>["sshKeys"][number]>;
|
|
7
7
|
type Response = Awaited<ReturnType<MittwaldAPIV2Client["user"]["listSshKeys"]>>;
|
|
8
8
|
export default class List extends ListBaseCommand<typeof List, ResponseItem, Response> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ListBaseCommand } from "../../../ListBaseCommand.js";
|
|
2
|
-
import
|
|
1
|
+
import { ListBaseCommand } from "../../../lib/basecommands/ListBaseCommand.js";
|
|
2
|
+
import ListDateColumnFormatter from "../../../rendering/formatter/ListDateColumnFormatter.js";
|
|
3
3
|
export default class List extends ListBaseCommand {
|
|
4
4
|
static description = "Get your stored ssh keys";
|
|
5
5
|
static args = {};
|
|
@@ -20,7 +20,7 @@ export default class List extends ListBaseCommand {
|
|
|
20
20
|
},
|
|
21
21
|
comment: {},
|
|
22
22
|
fingerprint: {},
|
|
23
|
-
createdAt:
|
|
23
|
+
createdAt: new ListDateColumnFormatter(this.flags).buildColumn(),
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Response } from "@mittwald/api-client-commons";
|
|
2
|
+
/**
|
|
3
|
+
* Helper type to assert that a response has a specific status code.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
*
|
|
7
|
+
* // ResponseType is a union of all possible responses
|
|
8
|
+
* type AppListResponseType = Awaited<
|
|
9
|
+
* ReturnType<MittwaldAPIV2Client["app"]["listAppinstallations"]>
|
|
10
|
+
* >;
|
|
11
|
+
*
|
|
12
|
+
* type AppListSuccessfulResponse = SuccessfulResponse<
|
|
13
|
+
* AppListResponseType,
|
|
14
|
+
* 200
|
|
15
|
+
* >;
|
|
16
|
+
*/
|
|
17
|
+
export type SuccessfulResponse<T extends Response, S extends T["status"]> = T & {
|
|
18
|
+
status: S;
|
|
19
|
+
};
|
package/dist/lib/auth/token.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command } from "@oclif/core";
|
|
2
2
|
import { MittwaldAPIV2Client } from "@mittwald/api-client";
|
|
3
|
-
import { configureAxiosRetry } from "
|
|
4
|
-
import { configureConsistencyHandling } from "
|
|
5
|
-
import { getTokenFilename, readApiToken } from "
|
|
6
|
-
import { configureAxiosLogging } from "
|
|
3
|
+
import { configureAxiosRetry } from "../apiutil/api_retry.js";
|
|
4
|
+
import { configureConsistencyHandling } from "../apiutil/api_consistency.js";
|
|
5
|
+
import { getTokenFilename, readApiToken } from "../auth/token.js";
|
|
6
|
+
import { configureAxiosLogging } from "../apiutil/api_logging.js";
|
|
7
7
|
export class BaseCommand extends Command {
|
|
8
8
|
authenticationRequired = true;
|
|
9
9
|
apiClient = MittwaldAPIV2Client.newUnauthenticated();
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Response } from "@mittwald/api-client-commons";
|
|
2
1
|
import { BaseCommand } from "./BaseCommand.js";
|
|
3
2
|
import { Interfaces } from "@oclif/core";
|
|
4
|
-
|
|
5
|
-
status: S;
|
|
6
|
-
};
|
|
3
|
+
/** CommandFlags is a helper type that extracts the flags from a command class. */
|
|
7
4
|
export type CommandFlags<T extends typeof BaseCommand> = Interfaces.InferredFlags<T["flags"]>;
|
|
5
|
+
/** CommandArgs is a helper type that extracts the args from a command class. */
|
|
8
6
|
export type CommandArgs<T extends typeof BaseCommand> = Interfaces.InferredArgs<T["args"]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseCommand } from "./BaseCommand.js";
|
|
2
|
-
import { ExecRenderBaseCommand } from "./
|
|
2
|
+
import { ExecRenderBaseCommand } from "./ExecRenderBaseCommand.js";
|
|
3
3
|
export declare abstract class DeleteBaseCommand<T extends typeof BaseCommand> extends ExecRenderBaseCommand<T, void> {
|
|
4
4
|
static resourceName: string;
|
|
5
5
|
static baseFlags: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Flags, ux } from "@oclif/core";
|
|
3
|
-
import { ExecRenderBaseCommand } from "./
|
|
4
|
-
import { makeProcessRenderer, processFlags, } from "
|
|
5
|
-
import { Success } from "
|
|
3
|
+
import { ExecRenderBaseCommand } from "./ExecRenderBaseCommand.js";
|
|
4
|
+
import { makeProcessRenderer, processFlags, } from "../../rendering/process/process_flags.js";
|
|
5
|
+
import { Success } from "../../rendering/react/components/Success.js";
|
|
6
6
|
import { Text } from "ink";
|
|
7
7
|
export class DeleteBaseCommand extends ExecRenderBaseCommand {
|
|
8
8
|
static resourceName = "object";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseCommand } from "
|
|
1
|
+
import { BaseCommand } from "./BaseCommand.js";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import { ExtendedBaseCommand } from "
|
|
3
|
+
import { ExtendedBaseCommand } from "./ExtendedBaseCommand.js";
|
|
4
4
|
export declare abstract class ExecRenderBaseCommand<T extends typeof BaseCommand, TRes> extends ExtendedBaseCommand<T> {
|
|
5
5
|
protected abstract exec(): Promise<TRes>;
|
|
6
6
|
run(): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Suspense } from "react";
|
|
3
3
|
import { render, Text } from "ink";
|
|
4
|
-
import { RenderContextProvider } from "
|
|
5
|
-
import { ExtendedBaseCommand } from "
|
|
4
|
+
import { RenderContextProvider } from "../../rendering/react/context.js";
|
|
5
|
+
import { ExtendedBaseCommand } from "./ExtendedBaseCommand.js";
|
|
6
6
|
const RenderComponent = (p) => (_jsx(_Fragment, { children: p.render() }));
|
|
7
7
|
function wrapRender(fn) {
|
|
8
8
|
return (result) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from "./BaseCommand.js";
|
|
2
|
-
import { CommandArgs, CommandFlags } from "./
|
|
3
|
-
import { CommandType } from "
|
|
2
|
+
import { CommandArgs, CommandFlags } from "./CommandFlags.js";
|
|
3
|
+
import { CommandType } from "../context/FlagSetBuilder.js";
|
|
4
4
|
export declare abstract class ExtendedBaseCommand<T extends typeof BaseCommand> extends BaseCommand {
|
|
5
5
|
protected flags: CommandFlags<T>;
|
|
6
6
|
protected args: CommandArgs<T>;
|