@seliseblocks/cli-os 0.1.3 → 0.1.5
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/AI_USAGE_GUIDE.md +328 -58
- package/README.md +83 -46
- package/dist/commands/auth/client-credentials/delete.d.ts +1 -0
- package/dist/commands/auth/client-credentials/delete.js +23 -0
- package/dist/commands/auth/client-credentials/list.d.ts +1 -0
- package/dist/commands/auth/client-credentials/list.js +14 -0
- package/dist/commands/auth/client-credentials/save.d.ts +1 -0
- package/dist/commands/auth/client-credentials/save.js +41 -0
- package/dist/commands/auth/config/get.d.ts +1 -0
- package/dist/commands/auth/config/get.js +14 -0
- package/dist/commands/auth/config/save.d.ts +1 -0
- package/dist/commands/auth/config/save.js +37 -0
- package/dist/commands/auth/idp/create.d.ts +1 -0
- package/dist/commands/auth/idp/create.js +46 -0
- package/dist/commands/auth/idp/delete.d.ts +1 -0
- package/dist/commands/auth/idp/delete.js +23 -0
- package/dist/commands/auth/idp/get.d.ts +1 -0
- package/dist/commands/auth/idp/get.js +16 -0
- package/dist/commands/auth/idp/list.d.ts +1 -0
- package/dist/commands/auth/idp/list.js +14 -0
- package/dist/commands/auth/idp/status.d.ts +1 -0
- package/dist/commands/auth/idp/status.js +27 -0
- package/dist/commands/auth/idp/update.d.ts +7 -0
- package/dist/commands/auth/idp/update.js +45 -0
- package/dist/commands/auth/oidc-clients/delete.d.ts +1 -0
- package/dist/commands/auth/oidc-clients/delete.js +23 -0
- package/dist/commands/auth/oidc-clients/get.d.ts +1 -0
- package/dist/commands/auth/oidc-clients/get.js +16 -0
- package/dist/commands/auth/oidc-clients/list.d.ts +1 -0
- package/dist/commands/auth/oidc-clients/list.js +14 -0
- package/dist/commands/auth/oidc-clients/rotate-secret.d.ts +1 -0
- package/dist/commands/auth/oidc-clients/rotate-secret.js +23 -0
- package/dist/commands/auth/oidc-clients/save.d.ts +2 -0
- package/dist/commands/auth/oidc-clients/save.js +57 -0
- package/dist/commands/auth/refresh.js +1 -1
- package/dist/commands/data/config/create.d.ts +1 -0
- package/dist/commands/data/config/create.js +38 -0
- package/dist/commands/data/config/get.d.ts +1 -0
- package/dist/commands/data/config/get.js +14 -0
- package/dist/commands/data/config/update.d.ts +1 -0
- package/dist/commands/data/config/update.js +41 -0
- package/dist/commands/data/files/create-folder.d.ts +1 -0
- package/dist/commands/data/files/create-folder.js +34 -0
- package/dist/commands/data/files/delete-folder.d.ts +1 -0
- package/dist/commands/data/files/delete-folder.js +25 -0
- package/dist/commands/data/files/delete.d.ts +1 -0
- package/dist/commands/data/files/delete.js +28 -0
- package/dist/commands/data/files/dms-list.d.ts +1 -0
- package/dist/commands/data/files/dms-list.js +27 -0
- package/dist/commands/data/files/dms-upload.d.ts +6 -0
- package/dist/commands/data/files/dms-upload.js +41 -0
- package/dist/commands/data/files/get-many.d.ts +1 -0
- package/dist/commands/data/files/get-many.js +24 -0
- package/dist/commands/data/files/get.d.ts +1 -0
- package/dist/commands/data/files/get.js +21 -0
- package/dist/commands/data/files/info.d.ts +1 -0
- package/dist/commands/data/files/info.js +30 -0
- package/dist/commands/data/files/presigned-upload-url.d.ts +6 -0
- package/dist/commands/data/files/presigned-upload-url.js +34 -0
- package/dist/commands/data/files/update-additional-info.d.ts +1 -0
- package/dist/commands/data/files/update-additional-info.js +26 -0
- package/dist/commands/data/files/upload-to-local-storage.d.ts +5 -0
- package/dist/commands/data/files/upload-to-local-storage.js +55 -0
- package/dist/commands/data/files/upload-to-url.d.ts +8 -0
- package/dist/commands/data/files/upload-to-url.js +36 -0
- package/dist/commands/data/files/upload.d.ts +7 -0
- package/dist/commands/data/files/upload.js +145 -0
- package/dist/commands/data/rules/policy/delete.d.ts +1 -0
- package/dist/commands/data/rules/policy/delete.js +24 -0
- package/dist/commands/data/rules/policy/get.d.ts +1 -0
- package/dist/commands/data/rules/policy/get.js +17 -0
- package/dist/commands/data/schema/aggregation.d.ts +1 -0
- package/dist/commands/data/schema/aggregation.js +26 -0
- package/dist/commands/data/schema/change-logs.d.ts +1 -0
- package/dist/commands/data/schema/change-logs.js +14 -0
- package/dist/commands/data/schema/delete.d.ts +1 -0
- package/dist/commands/data/schema/delete.js +24 -0
- package/dist/commands/data/schema/fields.d.ts +5 -0
- package/dist/commands/data/schema/fields.js +39 -0
- package/dist/commands/data/schema/get-by-name.d.ts +1 -0
- package/dist/commands/data/schema/get-by-name.js +17 -0
- package/dist/commands/data/schema/get.d.ts +1 -0
- package/dist/commands/data/schema/get.js +17 -0
- package/dist/commands/data/schema/info/list.d.ts +1 -0
- package/dist/commands/data/schema/info/list.js +15 -0
- package/dist/commands/data/schema/info/save.d.ts +1 -0
- package/dist/commands/data/schema/info/save.js +34 -0
- package/dist/commands/data/schema/info/update.d.ts +1 -0
- package/dist/commands/data/schema/info/update.js +35 -0
- package/dist/commands/data/sync.d.ts +7 -0
- package/dist/commands/data/sync.js +46 -0
- package/dist/commands/data/validation/by-schema-field.d.ts +1 -0
- package/dist/commands/data/validation/by-schema-field.js +18 -0
- package/dist/commands/data/validation/by-schema.d.ts +1 -0
- package/dist/commands/data/validation/by-schema.js +17 -0
- package/dist/commands/data/validation/delete.d.ts +1 -0
- package/dist/commands/data/validation/delete.js +24 -0
- package/dist/commands/data/validation/get.d.ts +1 -0
- package/dist/commands/data/validation/get.js +17 -0
- package/dist/commands/data/validation/list.d.ts +1 -0
- package/dist/commands/data/validation/list.js +25 -0
- package/dist/commands/data/validation/save.d.ts +6 -0
- package/dist/commands/data/validation/save.js +44 -0
- package/dist/commands/deselect.d.ts +1 -0
- package/dist/commands/deselect.js +31 -0
- package/dist/commands/iam/email/available.d.ts +1 -0
- package/dist/commands/iam/email/available.js +17 -0
- package/dist/commands/iam/organizations/config-get.d.ts +1 -0
- package/dist/commands/iam/organizations/config-get.js +14 -0
- package/dist/commands/iam/organizations/config-save.d.ts +1 -0
- package/dist/commands/iam/organizations/config-save.js +34 -0
- package/dist/commands/iam/organizations/create.d.ts +1 -0
- package/dist/commands/iam/organizations/create.js +37 -0
- package/dist/commands/iam/organizations/get.d.ts +1 -0
- package/dist/commands/iam/organizations/get.js +16 -0
- package/dist/commands/iam/organizations/list.d.ts +1 -0
- package/dist/commands/iam/organizations/list.js +26 -0
- package/dist/commands/iam/organizations/my.d.ts +1 -0
- package/dist/commands/iam/organizations/my.js +14 -0
- package/dist/commands/iam/organizations/update.d.ts +1 -0
- package/dist/commands/iam/organizations/update.js +39 -0
- package/dist/commands/iam/permissions/by-severity.d.ts +1 -0
- package/dist/commands/iam/permissions/by-severity.js +14 -0
- package/dist/commands/iam/permissions/create.d.ts +1 -0
- package/dist/commands/iam/permissions/create.js +39 -0
- package/dist/commands/iam/permissions/get.d.ts +1 -0
- package/dist/commands/iam/permissions/get.js +16 -0
- package/dist/commands/iam/permissions/list.d.ts +1 -0
- package/dist/commands/iam/permissions/list.js +41 -0
- package/dist/commands/iam/permissions/update.d.ts +1 -0
- package/dist/commands/iam/permissions/update.js +40 -0
- package/dist/commands/iam/resources/features.d.ts +1 -0
- package/dist/commands/iam/resources/features.js +19 -0
- package/dist/commands/iam/resources/groups.d.ts +1 -0
- package/dist/commands/iam/resources/groups.js +14 -0
- package/dist/commands/iam/roles/assign-permissions.d.ts +1 -0
- package/dist/commands/iam/roles/assign-permissions.js +33 -0
- package/dist/commands/iam/roles/assignable.d.ts +1 -0
- package/dist/commands/iam/roles/assignable.js +14 -0
- package/dist/commands/iam/roles/create.d.ts +1 -0
- package/dist/commands/iam/roles/create.js +35 -0
- package/dist/commands/iam/roles/get.d.ts +1 -0
- package/dist/commands/iam/roles/get.js +16 -0
- package/dist/commands/iam/roles/list.d.ts +1 -0
- package/dist/commands/iam/roles/list.js +34 -0
- package/dist/commands/iam/roles/update.d.ts +1 -0
- package/dist/commands/iam/roles/update.js +35 -0
- package/dist/commands/iam/signup-settings/get.d.ts +1 -0
- package/dist/commands/iam/signup-settings/get.js +14 -0
- package/dist/commands/iam/signup-settings/save.d.ts +1 -0
- package/dist/commands/iam/signup-settings/save.js +32 -0
- package/dist/commands/iam/users/access-grant.d.ts +1 -0
- package/dist/commands/iam/users/access-grant.js +32 -0
- package/dist/commands/iam/users/access-revoke.d.ts +1 -0
- package/dist/commands/iam/users/access-revoke.js +24 -0
- package/dist/commands/iam/users/activate.d.ts +1 -0
- package/dist/commands/iam/users/activate.js +24 -0
- package/dist/commands/iam/users/create.d.ts +1 -0
- package/dist/commands/iam/users/create.js +39 -0
- package/dist/commands/iam/users/deactivate.d.ts +1 -0
- package/dist/commands/iam/users/deactivate.js +24 -0
- package/dist/commands/iam/users/exists.d.ts +1 -0
- package/dist/commands/iam/users/exists.js +17 -0
- package/dist/commands/iam/users/get.d.ts +1 -0
- package/dist/commands/iam/users/get.js +17 -0
- package/dist/commands/iam/users/list.d.ts +1 -0
- package/dist/commands/iam/users/list.js +34 -0
- package/dist/commands/iam/users/update.d.ts +1 -0
- package/dist/commands/iam/users/update.js +35 -0
- package/dist/commands/init.js +0 -12
- package/dist/commands/localization/assistant/translation-suggestion.d.ts +1 -0
- package/dist/commands/localization/assistant/translation-suggestion.js +35 -0
- package/dist/commands/localization/config/get-webhook.d.ts +1 -0
- package/dist/commands/localization/config/get-webhook.js +14 -0
- package/dist/commands/localization/config/save-webhook.d.ts +1 -0
- package/dist/commands/localization/config/save-webhook.js +47 -0
- package/dist/commands/localization/glossary/delete.d.ts +1 -0
- package/dist/commands/localization/glossary/delete.js +24 -0
- package/dist/commands/localization/glossary/get.d.ts +1 -0
- package/dist/commands/localization/glossary/get.js +17 -0
- package/dist/commands/localization/glossary/list.d.ts +1 -0
- package/dist/commands/localization/glossary/list.js +22 -0
- package/dist/commands/localization/glossary/save.d.ts +1 -0
- package/dist/commands/localization/glossary/save.js +38 -0
- package/dist/commands/localization/glossary/suggested.d.ts +1 -0
- package/dist/commands/localization/glossary/suggested.js +20 -0
- package/dist/commands/localization/key/delete-keys.d.ts +1 -0
- package/dist/commands/localization/key/delete-keys.js +28 -0
- package/dist/commands/localization/key/delete.d.ts +1 -0
- package/dist/commands/localization/key/delete.js +24 -0
- package/dist/commands/localization/key/generate-uilm-file.d.ts +1 -0
- package/dist/commands/localization/key/generate-uilm-file.js +29 -0
- package/dist/commands/localization/key/get-by-names.d.ts +1 -0
- package/dist/commands/localization/key/get-by-names.js +24 -0
- package/dist/commands/localization/key/get-language-file-generation-history.d.ts +1 -0
- package/dist/commands/localization/key/get-language-file-generation-history.js +19 -0
- package/dist/commands/localization/key/get-localization-timeline.d.ts +1 -0
- package/dist/commands/localization/key/get-localization-timeline.js +28 -0
- package/dist/commands/localization/key/get-timeline-by-operation-id.d.ts +1 -0
- package/dist/commands/localization/key/get-timeline-by-operation-id.js +21 -0
- package/dist/commands/localization/key/get-timeline.d.ts +1 -0
- package/dist/commands/localization/key/get-timeline.js +25 -0
- package/dist/commands/localization/key/get-uilm-exported-files.d.ts +1 -0
- package/dist/commands/localization/key/get-uilm-exported-files.js +22 -0
- package/dist/commands/localization/key/get-uilm-file.d.ts +1 -0
- package/dist/commands/localization/key/get-uilm-file.js +18 -0
- package/dist/commands/localization/key/get.d.ts +1 -0
- package/dist/commands/localization/key/get.js +17 -0
- package/dist/commands/localization/key/list.d.ts +1 -0
- package/dist/commands/localization/key/list.js +39 -0
- package/dist/commands/localization/key/rollback.d.ts +1 -0
- package/dist/commands/localization/key/rollback.js +24 -0
- package/dist/commands/localization/key/save.d.ts +1 -0
- package/dist/commands/localization/key/save.js +44 -0
- package/dist/commands/localization/key/translate-all.d.ts +1 -0
- package/dist/commands/localization/key/translate-all.js +30 -0
- package/dist/commands/localization/key/translate-and-export.d.ts +7 -0
- package/dist/commands/localization/key/translate-and-export.js +132 -0
- package/dist/commands/localization/key/translate-key.d.ts +1 -0
- package/dist/commands/localization/key/translate-key.js +27 -0
- package/dist/commands/localization/key/translate-keys.d.ts +1 -0
- package/dist/commands/localization/key/translate-keys.js +31 -0
- package/dist/commands/localization/key/uilm-export.d.ts +1 -0
- package/dist/commands/localization/key/uilm-export.js +33 -0
- package/dist/commands/localization/key/uilm-import.d.ts +1 -0
- package/dist/commands/localization/key/uilm-import.js +26 -0
- package/dist/commands/localization/language/delete.d.ts +1 -0
- package/dist/commands/localization/language/delete.js +24 -0
- package/dist/commands/localization/language/list-for-tenant.d.ts +1 -0
- package/dist/commands/localization/language/list-for-tenant.js +14 -0
- package/dist/commands/localization/language/list.d.ts +1 -0
- package/dist/commands/localization/language/list.js +14 -0
- package/dist/commands/localization/language/save.d.ts +1 -0
- package/dist/commands/localization/language/save.js +36 -0
- package/dist/commands/localization/language/set-default.d.ts +1 -0
- package/dist/commands/localization/language/set-default.js +24 -0
- package/dist/commands/localization/module/list-for-tenant.d.ts +1 -0
- package/dist/commands/localization/module/list-for-tenant.js +14 -0
- package/dist/commands/localization/module/list.d.ts +1 -0
- package/dist/commands/localization/module/list.js +14 -0
- package/dist/commands/localization/module/save.d.ts +1 -0
- package/dist/commands/localization/module/save.js +32 -0
- package/dist/commands/localization/module/tag-glossary.d.ts +1 -0
- package/dist/commands/localization/module/tag-glossary.js +28 -0
- package/dist/commands/mail/config/delete.d.ts +1 -0
- package/dist/commands/mail/config/delete.js +24 -0
- package/dist/commands/mail/config/duplicate.d.ts +1 -0
- package/dist/commands/mail/config/duplicate.js +24 -0
- package/dist/commands/mail/config/get.d.ts +1 -0
- package/dist/commands/mail/config/get.js +17 -0
- package/dist/commands/mail/config/list.d.ts +1 -0
- package/dist/commands/mail/config/list.js +14 -0
- package/dist/commands/mail/config/save.d.ts +1 -0
- package/dist/commands/mail/config/save.js +44 -0
- package/dist/commands/mail/mailbox/get.d.ts +1 -0
- package/dist/commands/mail/mailbox/get.js +17 -0
- package/dist/commands/mail/mailbox/list.d.ts +1 -0
- package/dist/commands/mail/mailbox/list.js +24 -0
- package/dist/commands/mail/send.d.ts +1 -0
- package/dist/commands/mail/send.js +40 -0
- package/dist/commands/mail/sendtoany.d.ts +1 -0
- package/dist/commands/mail/sendtoany.js +41 -0
- package/dist/commands/mail/template/clone.d.ts +1 -0
- package/dist/commands/mail/template/clone.js +33 -0
- package/dist/commands/mail/template/delete.d.ts +1 -0
- package/dist/commands/mail/template/delete.js +24 -0
- package/dist/commands/mail/template/get.d.ts +1 -0
- package/dist/commands/mail/template/get.js +17 -0
- package/dist/commands/mail/template/list.d.ts +1 -0
- package/dist/commands/mail/template/list.js +24 -0
- package/dist/commands/mail/template/save.d.ts +1 -0
- package/dist/commands/mail/template/save.js +37 -0
- package/dist/commands/mfa/backup-codes/generate.d.ts +1 -0
- package/dist/commands/mfa/backup-codes/generate.js +22 -0
- package/dist/commands/mfa/backup-codes/list.d.ts +1 -0
- package/dist/commands/mfa/backup-codes/list.js +14 -0
- package/dist/commands/mfa/backup-codes/use.d.ts +1 -0
- package/dist/commands/mfa/backup-codes/use.js +18 -0
- package/dist/commands/mfa/config-get.d.ts +1 -0
- package/dist/commands/mfa/config-get.js +14 -0
- package/dist/commands/mfa/config-save.d.ts +1 -0
- package/dist/commands/mfa/config-save.js +36 -0
- package/dist/commands/mfa/disable.d.ts +1 -0
- package/dist/commands/mfa/disable.js +22 -0
- package/dist/commands/mfa/generate.d.ts +1 -0
- package/dist/commands/mfa/generate.js +22 -0
- package/dist/commands/mfa/method-set.d.ts +1 -0
- package/dist/commands/mfa/method-set.js +20 -0
- package/dist/commands/mfa/resend.d.ts +1 -0
- package/dist/commands/mfa/resend.js +20 -0
- package/dist/commands/mfa/totp-enable.d.ts +10 -0
- package/dist/commands/mfa/totp-enable.js +52 -0
- package/dist/commands/mfa/totp-setup.d.ts +1 -0
- package/dist/commands/mfa/totp-setup.js +15 -0
- package/dist/commands/mfa/totp-verify-setup.d.ts +1 -0
- package/dist/commands/mfa/totp-verify-setup.js +17 -0
- package/dist/commands/mfa/verify.d.ts +1 -0
- package/dist/commands/mfa/verify.js +26 -0
- package/dist/commands/new/web.js +115 -15
- package/dist/commands/notification/delete.d.ts +1 -0
- package/dist/commands/notification/delete.js +24 -0
- package/dist/commands/notification/get.d.ts +1 -0
- package/dist/commands/notification/get.js +17 -0
- package/dist/commands/notification/list.d.ts +1 -0
- package/dist/commands/notification/list.js +22 -0
- package/dist/commands/notification/save.d.ts +1 -0
- package/dist/commands/notification/save.js +34 -0
- package/dist/commands/notifier/list.d.ts +1 -0
- package/dist/commands/notifier/list.js +23 -0
- package/dist/commands/notifier/mark-all-read.d.ts +1 -0
- package/dist/commands/notifier/mark-all-read.js +23 -0
- package/dist/commands/notifier/mark-read.d.ts +1 -0
- package/dist/commands/notifier/mark-read.js +24 -0
- package/dist/commands/notifier/notify.d.ts +1 -0
- package/dist/commands/notifier/notify.js +39 -0
- package/dist/commands/notifier/unread.d.ts +1 -0
- package/dist/commands/notifier/unread.js +25 -0
- package/dist/commands/projects/get.js +16 -14
- package/dist/commands/projects/list.js +2 -7
- package/dist/commands/release/builds/list.js +22 -2
- package/dist/commands/release/deploy.js +122 -29
- package/dist/commands/release/status.js +4 -2
- package/dist/commands/sdk/client.d.ts +1 -0
- package/dist/commands/sdk/client.js +99 -0
- package/dist/commands/secrets/get.d.ts +1 -0
- package/dist/commands/secrets/get.js +21 -0
- package/dist/commands/secrets/save.d.ts +1 -0
- package/dist/commands/secrets/save.js +51 -0
- package/dist/commands/skill/add.d.ts +1 -0
- package/dist/commands/skill/add.js +19 -0
- package/dist/commands/skill/list.d.ts +1 -0
- package/dist/commands/skill/list.js +15 -0
- package/dist/commands/skill/show.d.ts +1 -0
- package/dist/commands/skill/show.js +15 -0
- package/dist/commands/storage/config/delete.d.ts +1 -0
- package/dist/commands/storage/config/delete.js +24 -0
- package/dist/commands/storage/config/get.d.ts +1 -0
- package/dist/commands/storage/config/get.js +17 -0
- package/dist/commands/storage/config/list.d.ts +1 -0
- package/dist/commands/storage/config/list.js +14 -0
- package/dist/commands/storage/config/save.d.ts +1 -0
- package/dist/commands/storage/config/save.js +49 -0
- package/dist/index.js +959 -143
- package/dist/lib/api.d.ts +1 -1
- package/dist/lib/api.js +39 -21
- package/dist/lib/args.d.ts +3 -0
- package/dist/lib/args.js +15 -0
- package/dist/lib/auth.d.ts +5 -2
- package/dist/lib/auth.js +23 -35
- package/dist/lib/config.js +7 -7
- package/dist/lib/json-flag.d.ts +17 -0
- package/dist/lib/json-flag.js +55 -0
- package/dist/lib/project-info.d.ts +33 -0
- package/dist/lib/project-info.js +39 -0
- package/dist/lib/prompt.d.ts +2 -0
- package/dist/lib/prompt.js +28 -0
- package/dist/lib/scaffold-web/dashboard.js +1 -1
- package/dist/lib/scaffold-web/root-files.js +1 -1
- package/dist/lib/secret-store.js +7 -7
- package/dist/lib/skills.d.ts +17 -0
- package/dist/lib/skills.js +69 -0
- package/dist/lib/token.d.ts +2 -0
- package/dist/lib/token.js +12 -0
- package/dist/lib/workspace.d.ts +1 -4
- package/dist/lib/workspace.js +18 -2
- package/dist/skills/blocks-data-gateway-configuration/SKILL.md +204 -0
- package/dist/skills/blocks-data-gateway-crud/SKILL.md +223 -0
- package/dist/skills/blocks-data-storage/SKILL.md +161 -0
- package/dist/skills/blocks-frontend-local-https/SKILL.md +100 -0
- package/dist/skills/blocks-iam-access-control/SKILL.md +49 -0
- package/dist/skills/blocks-iam-access-control/flows/feature-gating.md +38 -0
- package/dist/skills/blocks-iam-access-control/flows/manage-roles-permissions.md +109 -0
- package/dist/skills/blocks-iam-account/SKILL.md +169 -0
- package/dist/skills/blocks-iam-mfa/SKILL.md +124 -0
- package/dist/skills/blocks-iam-organizations/SKILL.md +43 -0
- package/dist/skills/blocks-iam-organizations/flows/admin-mutations.md +89 -0
- package/dist/skills/blocks-iam-organizations/flows/read-and-switch.md +57 -0
- package/dist/skills/blocks-iam-sso-oidc-configuration/SKILL.md +89 -0
- package/dist/skills/blocks-iam-sso-oidc-implementation/SKILL.md +80 -0
- package/dist/skills/blocks-iam-users/SKILL.md +131 -0
- package/dist/skills/blocks-localization-configuration/SKILL.md +149 -0
- package/dist/skills/blocks-localization-implementation/SKILL.md +63 -0
- package/dist/skills/blocks-mail/SKILL.md +95 -0
- package/dist/skills/blocks-notification/SKILL.md +69 -0
- package/dist/skills/blocks-notifier/SKILL.md +107 -0
- package/dist/skills/blocks-onboarding/SKILL.md +78 -0
- package/dist/skills/blocks-release-deployment/SKILL.md +81 -0
- package/dist/skills/blocks-secrets/SKILL.md +81 -0
- package/dist/skills/blocks-storage-configuration/SKILL.md +93 -0
- package/dist/skills/lint.mjs +168 -0
- package/package.json +4 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
5
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
6
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
7
|
+
export async function authOidcClientsDelete(argv) {
|
|
8
|
+
const { args, flags } = parseCommand(argv);
|
|
9
|
+
const clientId = args[0] || stringFlag(flags, "client-id", { required: true });
|
|
10
|
+
if (booleanFlag(flags, "dry-run")) {
|
|
11
|
+
writeOutput({ dryRun: true, endpoint: `/iam/v4/oidc-clients/${clientId}` }, flags);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
await confirmMutation(flags, `Delete OIDC client '${clientId}'. This revokes all issued tokens and is irreversible.`);
|
|
15
|
+
const projectKey = await selectedProject(flags);
|
|
16
|
+
const result = await blocksRequest(`/iam/v4/oidc-clients/${encodeURIComponent(clientId)}`, {
|
|
17
|
+
impersonatedProjectAuth: true,
|
|
18
|
+
method: "DELETE",
|
|
19
|
+
...requestContext(flags),
|
|
20
|
+
projectTenantId: projectKey
|
|
21
|
+
});
|
|
22
|
+
writeOutput(result, flags);
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function authOidcClientsGet(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
4
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
5
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
6
|
+
export async function authOidcClientsGet(argv) {
|
|
7
|
+
const { args, flags } = parseCommand(argv);
|
|
8
|
+
const clientId = args[0] || stringFlag(flags, "client-id", { required: true });
|
|
9
|
+
const projectKey = await selectedProject(flags);
|
|
10
|
+
const result = await blocksRequest(`/iam/v4/oidc-clients/${encodeURIComponent(clientId)}`, {
|
|
11
|
+
impersonatedProjectAuth: true,
|
|
12
|
+
...requestContext(flags),
|
|
13
|
+
projectTenantId: projectKey
|
|
14
|
+
});
|
|
15
|
+
writeOutput(result, flags);
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function authOidcClientsList(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
2
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
3
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
4
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
5
|
+
export async function authOidcClientsList(argv) {
|
|
6
|
+
const { flags } = parseCommand(argv);
|
|
7
|
+
const projectKey = await selectedProject(flags);
|
|
8
|
+
const result = await blocksRequest("/iam/v4/oidc-clients", {
|
|
9
|
+
impersonatedProjectAuth: true,
|
|
10
|
+
...requestContext(flags),
|
|
11
|
+
projectTenantId: projectKey
|
|
12
|
+
});
|
|
13
|
+
writeOutput(result, flags);
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function authOidcClientsRotateSecret(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
5
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
6
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
7
|
+
export async function authOidcClientsRotateSecret(argv) {
|
|
8
|
+
const { args, flags } = parseCommand(argv);
|
|
9
|
+
const clientId = args[0] || stringFlag(flags, "client-id", { required: true });
|
|
10
|
+
if (booleanFlag(flags, "dry-run")) {
|
|
11
|
+
writeOutput({ dryRun: true, endpoint: `/iam/v4/oidc-clients/${clientId}/rotate-secret` }, flags);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
await confirmMutation(flags, `Rotate the client secret for OIDC client '${clientId}'. The old secret stops working immediately; the new one is shown once.`);
|
|
15
|
+
const projectKey = await selectedProject(flags);
|
|
16
|
+
const result = await blocksRequest(`/iam/v4/oidc-clients/${encodeURIComponent(clientId)}/rotate-secret`, {
|
|
17
|
+
impersonatedProjectAuth: true,
|
|
18
|
+
method: "POST",
|
|
19
|
+
...requestContext(flags),
|
|
20
|
+
projectTenantId: projectKey
|
|
21
|
+
});
|
|
22
|
+
writeOutput(result, flags);
|
|
23
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { booleanFlag, optionalBooleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
|
+
import { compact, jsonBodyFlag, listFlag } from "../../../lib/json-flag.js";
|
|
5
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
6
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
7
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
8
|
+
/** Upsert: omit --item-id to register a new OIDC client, pass it to update an existing one. */
|
|
9
|
+
export async function authOidcClientsSave(argv) {
|
|
10
|
+
const { flags } = parseCommand(argv);
|
|
11
|
+
const body = {
|
|
12
|
+
...(await jsonBodyFlag(flags)),
|
|
13
|
+
...compact({
|
|
14
|
+
allowedMfaMethods: listFlag(flags, "allowed-mfa-methods")?.map(Number),
|
|
15
|
+
allowedResponseTypes: listFlag(flags, "allowed-response-types"),
|
|
16
|
+
allowedScopes: listFlag(flags, "allowed-scopes"),
|
|
17
|
+
backChannelLogoutUri: stringFlag(flags, "back-channel-logout-uri") || undefined,
|
|
18
|
+
clientBrandColor: stringFlag(flags, "client-brand-color") || undefined,
|
|
19
|
+
clientDisplayName: stringFlag(flags, "client-display-name") || undefined,
|
|
20
|
+
clientLogoUrl: stringFlag(flags, "client-logo-url") || undefined,
|
|
21
|
+
clientType: stringFlag(flags, "client-type") || undefined,
|
|
22
|
+
externalDiscoveryEndpoint: stringFlag(flags, "external-discovery-endpoint") || undefined,
|
|
23
|
+
frontChannelLogoutUri: stringFlag(flags, "front-channel-logout-uri") || undefined,
|
|
24
|
+
isActive: optionalBooleanFlag(flags, "active"),
|
|
25
|
+
isAutoRedirect: optionalBooleanFlag(flags, "auto-redirect"),
|
|
26
|
+
isDeviceFlowClient: optionalBooleanFlag(flags, "device-flow-client"),
|
|
27
|
+
itemId: stringFlag(flags, "item-id") || undefined,
|
|
28
|
+
loginMode: stringFlag(flags, "login-mode") || undefined,
|
|
29
|
+
postLogoutRedirectUris: listFlag(flags, "post-logout-redirect-uris"),
|
|
30
|
+
redirectUris: listFlag(flags, "redirect-uris"),
|
|
31
|
+
registerAsIdentityProvider: optionalBooleanFlag(flags, "register-as-identity-provider"),
|
|
32
|
+
requireConsent: optionalBooleanFlag(flags, "require-consent"),
|
|
33
|
+
requireMfa: optionalBooleanFlag(flags, "require-mfa"),
|
|
34
|
+
requirePkce: optionalBooleanFlag(flags, "require-pkce"),
|
|
35
|
+
scope: stringFlag(flags, "scope") || undefined,
|
|
36
|
+
useTokensCookie: optionalBooleanFlag(flags, "use-tokens-cookie")
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
if (booleanFlag(flags, "dry-run")) {
|
|
40
|
+
writeOutput({ dryRun: true, endpoint: "/iam/v4/oidc-clients", request: redactSecret(body) }, flags);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
await confirmMutation(flags, `Save OIDC client '${body.clientDisplayName ?? body.itemId ?? "(new)"}'. The response's client secret is shown once.`);
|
|
44
|
+
const projectKey = await selectedProject(flags);
|
|
45
|
+
const result = await blocksRequest("/iam/v4/oidc-clients", {
|
|
46
|
+
body,
|
|
47
|
+
impersonatedProjectAuth: true,
|
|
48
|
+
...requestContext(flags),
|
|
49
|
+
projectTenantId: projectKey
|
|
50
|
+
});
|
|
51
|
+
writeOutput(result, flags);
|
|
52
|
+
}
|
|
53
|
+
function redactSecret(body) {
|
|
54
|
+
if (!body.clientSecret)
|
|
55
|
+
return body;
|
|
56
|
+
return { ...body, clientSecret: "***" };
|
|
57
|
+
}
|
|
@@ -13,7 +13,7 @@ export async function authRefresh(argv) {
|
|
|
13
13
|
if (!project)
|
|
14
14
|
return;
|
|
15
15
|
if (!config.selectedProject?.tenantId) {
|
|
16
|
-
throw new Error("No project selected. Run `blocks
|
|
16
|
+
throw new Error("No project selected. Run `blocks use <tenantId>` first.");
|
|
17
17
|
}
|
|
18
18
|
const projectToken = store.accounts[account.account]?.projects?.[config.selectedProject.tenantId];
|
|
19
19
|
if (!projectToken?.refreshToken && !projectToken?.accessToken) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataConfigCreate(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
|
+
import { compact, jsonBodyFlag } from "../../../lib/json-flag.js";
|
|
5
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
6
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
7
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
8
|
+
export async function dataConfigCreate(argv) {
|
|
9
|
+
const { flags } = parseCommand(argv);
|
|
10
|
+
const body = {
|
|
11
|
+
...(await jsonBodyFlag(flags)),
|
|
12
|
+
...compact({
|
|
13
|
+
connectionString: stringFlag(flags, "connection-string") || undefined,
|
|
14
|
+
databaseName: stringFlag(flags, "database-name") || undefined
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
if (!body.connectionString)
|
|
18
|
+
throw new Error("Provide --connection-string (or set it in --body/--file).");
|
|
19
|
+
if (booleanFlag(flags, "dry-run")) {
|
|
20
|
+
writeOutput({ dryRun: true, endpoint: "/data/v4/configurations", request: redactSecret(body) }, flags);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
await confirmMutation(flags, "Create a new data source configuration for this project. This points the Data Gateway at an external database.");
|
|
24
|
+
const projectKey = await selectedProject(flags);
|
|
25
|
+
const result = await blocksRequest("/data/v4/configurations", {
|
|
26
|
+
body: { ...body, projectKey },
|
|
27
|
+
impersonatedProjectAuth: true,
|
|
28
|
+
method: "POST",
|
|
29
|
+
...requestContext(flags),
|
|
30
|
+
projectTenantId: projectKey
|
|
31
|
+
});
|
|
32
|
+
writeOutput(result, flags);
|
|
33
|
+
}
|
|
34
|
+
function redactSecret(body) {
|
|
35
|
+
if (!body.connectionString)
|
|
36
|
+
return body;
|
|
37
|
+
return { ...body, connectionString: "***" };
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataConfigGet(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
2
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
3
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
4
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
5
|
+
export async function dataConfigGet(argv) {
|
|
6
|
+
const { flags } = parseCommand(argv);
|
|
7
|
+
const projectKey = await selectedProject(flags);
|
|
8
|
+
const result = await blocksRequest("/data/v4/configurations", {
|
|
9
|
+
impersonatedProjectAuth: true,
|
|
10
|
+
...requestContext(flags),
|
|
11
|
+
projectTenantId: projectKey
|
|
12
|
+
});
|
|
13
|
+
writeOutput(result, flags);
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataConfigUpdate(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
|
+
import { compact, jsonBodyFlag } from "../../../lib/json-flag.js";
|
|
5
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
6
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
7
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
8
|
+
export async function dataConfigUpdate(argv) {
|
|
9
|
+
const { flags } = parseCommand(argv);
|
|
10
|
+
const body = {
|
|
11
|
+
...(await jsonBodyFlag(flags)),
|
|
12
|
+
...compact({
|
|
13
|
+
collectionNamePattern: stringFlag(flags, "collection-name-pattern") || undefined,
|
|
14
|
+
connectionString: stringFlag(flags, "connection-string") || undefined,
|
|
15
|
+
databaseName: stringFlag(flags, "database-name") || undefined,
|
|
16
|
+
isCollectionNameEditable: booleanFlag(flags, "collection-name-editable") || undefined,
|
|
17
|
+
itemId: stringFlag(flags, "item-id") || undefined
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
if (!body.itemId)
|
|
21
|
+
throw new Error("Provide --item-id (the existing configuration's id).");
|
|
22
|
+
if (booleanFlag(flags, "dry-run")) {
|
|
23
|
+
writeOutput({ dryRun: true, endpoint: "/data/v4/configurations", request: redactSecret(body) }, flags);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
await confirmMutation(flags, `Update data source configuration '${body.itemId}'.`);
|
|
27
|
+
const projectKey = await selectedProject(flags);
|
|
28
|
+
const result = await blocksRequest("/data/v4/configurations", {
|
|
29
|
+
body: { ...body, projectKey },
|
|
30
|
+
impersonatedProjectAuth: true,
|
|
31
|
+
method: "PUT",
|
|
32
|
+
...requestContext(flags),
|
|
33
|
+
projectTenantId: projectKey
|
|
34
|
+
});
|
|
35
|
+
writeOutput(result, flags);
|
|
36
|
+
}
|
|
37
|
+
function redactSecret(body) {
|
|
38
|
+
if (!body.connectionString)
|
|
39
|
+
return body;
|
|
40
|
+
return { ...body, connectionString: "***" };
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataFilesCreateFolder(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
|
+
import { compact, jsonBodyFlag, listFlag } from "../../../lib/json-flag.js";
|
|
5
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
6
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
7
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
8
|
+
export async function dataFilesCreateFolder(argv) {
|
|
9
|
+
const { args, flags } = parseCommand(argv);
|
|
10
|
+
const artifactName = args[0] || stringFlag(flags, "name", { required: true });
|
|
11
|
+
const body = {
|
|
12
|
+
...(await jsonBodyFlag(flags)),
|
|
13
|
+
...compact({
|
|
14
|
+
artifactName,
|
|
15
|
+
configurationName: stringFlag(flags, "configuration-name") || undefined,
|
|
16
|
+
description: stringFlag(flags, "description") || undefined,
|
|
17
|
+
parentId: stringFlag(flags, "parent-id"),
|
|
18
|
+
tags: listFlag(flags, "tags")
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
if (booleanFlag(flags, "dry-run")) {
|
|
22
|
+
writeOutput({ dryRun: true, endpoint: "/data/v4/Files/CreateFolder", request: body }, flags);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
await confirmMutation(flags, `Create DMS folder '${artifactName}'.`);
|
|
26
|
+
const projectKey = await selectedProject(flags);
|
|
27
|
+
const result = await blocksRequest("/data/v4/Files/CreateFolder", {
|
|
28
|
+
body,
|
|
29
|
+
impersonatedProjectAuth: true,
|
|
30
|
+
...requestContext(flags),
|
|
31
|
+
projectTenantId: projectKey
|
|
32
|
+
});
|
|
33
|
+
writeOutput(result, flags);
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataFilesDeleteFolder(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
|
+
import { compact } from "../../../lib/json-flag.js";
|
|
5
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
6
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
7
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
8
|
+
export async function dataFilesDeleteFolder(argv) {
|
|
9
|
+
const { args, flags } = parseCommand(argv);
|
|
10
|
+
const folderId = args[0] || stringFlag(flags, "folder-id", { required: true });
|
|
11
|
+
const body = { folderId, ...compact({ configurationName: stringFlag(flags, "configuration-name") || undefined }) };
|
|
12
|
+
if (booleanFlag(flags, "dry-run")) {
|
|
13
|
+
writeOutput({ dryRun: true, endpoint: "/data/v4/Files/DeleteFolder", request: body }, flags);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
await confirmMutation(flags, `Delete DMS folder '${folderId}'.`);
|
|
17
|
+
const projectKey = await selectedProject(flags);
|
|
18
|
+
const result = await blocksRequest("/data/v4/Files/DeleteFolder", {
|
|
19
|
+
body,
|
|
20
|
+
impersonatedProjectAuth: true,
|
|
21
|
+
...requestContext(flags),
|
|
22
|
+
projectTenantId: projectKey
|
|
23
|
+
});
|
|
24
|
+
writeOutput(result, flags);
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataFilesDelete(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
|
+
import { compact } from "../../../lib/json-flag.js";
|
|
5
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
6
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
7
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
8
|
+
export async function dataFilesDelete(argv) {
|
|
9
|
+
const { args, flags } = parseCommand(argv);
|
|
10
|
+
const fileId = args[0] || stringFlag(flags, "file-id", { required: true });
|
|
11
|
+
const body = { fileId, ...compact({
|
|
12
|
+
configurationName: stringFlag(flags, "configuration-name") || undefined,
|
|
13
|
+
eventQueueName: stringFlag(flags, "event-queue-name") || undefined
|
|
14
|
+
}) };
|
|
15
|
+
if (booleanFlag(flags, "dry-run")) {
|
|
16
|
+
writeOutput({ dryRun: true, endpoint: "/data/v4/Files/DeleteFile", request: body }, flags);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
await confirmMutation(flags, `Delete file '${fileId}'.`);
|
|
20
|
+
const projectKey = await selectedProject(flags);
|
|
21
|
+
const result = await blocksRequest("/data/v4/Files/DeleteFile", {
|
|
22
|
+
body,
|
|
23
|
+
impersonatedProjectAuth: true,
|
|
24
|
+
...requestContext(flags),
|
|
25
|
+
projectTenantId: projectKey
|
|
26
|
+
});
|
|
27
|
+
writeOutput(result, flags);
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataFilesDmsList(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { integerFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { compact } from "../../../lib/json-flag.js";
|
|
4
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
5
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
6
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
7
|
+
export async function dataFilesDmsList(argv) {
|
|
8
|
+
const { flags } = parseCommand(argv);
|
|
9
|
+
const body = {
|
|
10
|
+
parentId: stringFlag(flags, "parent-id"),
|
|
11
|
+
take: integerFlag(flags, "take", 20),
|
|
12
|
+
...compact({
|
|
13
|
+
configurationName: stringFlag(flags, "configuration-name") || undefined,
|
|
14
|
+
moduleName: stringFlag(flags, "module-name") || undefined,
|
|
15
|
+
searchKey: stringFlag(flags, "search") || undefined,
|
|
16
|
+
skip: integerFlag(flags, "skip", 0) || undefined
|
|
17
|
+
})
|
|
18
|
+
};
|
|
19
|
+
const projectKey = await selectedProject(flags);
|
|
20
|
+
const result = await blocksRequest("/data/v4/Files/GetDmsFileAndFolder", {
|
|
21
|
+
body,
|
|
22
|
+
impersonatedProjectAuth: true,
|
|
23
|
+
...requestContext(flags),
|
|
24
|
+
projectTenantId: projectKey
|
|
25
|
+
});
|
|
26
|
+
writeOutput(result, flags);
|
|
27
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers an already-uploaded file (via presigned-upload-url/upload-to-url or
|
|
3
|
+
* upload-to-local-storage) so it shows up in a DMS folder. `--file-storage-id` covers the
|
|
4
|
+
* common single-file case; pass --body/--file with an `upload` array to register several at once.
|
|
5
|
+
*/
|
|
6
|
+
export declare function dataFilesDmsUpload(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
|
+
import { compact, jsonBodyFlag, listFlag } from "../../../lib/json-flag.js";
|
|
5
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
6
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
7
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
8
|
+
/**
|
|
9
|
+
* Registers an already-uploaded file (via presigned-upload-url/upload-to-url or
|
|
10
|
+
* upload-to-local-storage) so it shows up in a DMS folder. `--file-storage-id` covers the
|
|
11
|
+
* common single-file case; pass --body/--file with an `upload` array to register several at once.
|
|
12
|
+
*/
|
|
13
|
+
export async function dataFilesDmsUpload(argv) {
|
|
14
|
+
const { flags } = parseCommand(argv);
|
|
15
|
+
const fileStorageId = stringFlag(flags, "file-storage-id");
|
|
16
|
+
const body = await jsonBodyFlag(flags);
|
|
17
|
+
if (fileStorageId) {
|
|
18
|
+
body.upload = [compact({
|
|
19
|
+
artifactName: stringFlag(flags, "artifact-name") || undefined,
|
|
20
|
+
fileStorageId,
|
|
21
|
+
parentId: stringFlag(flags, "parent-id"),
|
|
22
|
+
tags: listFlag(flags, "tags")
|
|
23
|
+
})];
|
|
24
|
+
}
|
|
25
|
+
if (!Array.isArray(body.upload) || !body.upload.length) {
|
|
26
|
+
throw new Error("Provide --file-storage-id (with --artifact-name) or an 'upload' array via --body/--file.");
|
|
27
|
+
}
|
|
28
|
+
if (booleanFlag(flags, "dry-run")) {
|
|
29
|
+
writeOutput({ dryRun: true, endpoint: "/data/v4/Files/UploadFile", request: body }, flags);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
await confirmMutation(flags, `Register ${body.upload.length} file(s) into DMS.`);
|
|
33
|
+
const projectKey = await selectedProject(flags);
|
|
34
|
+
const result = await blocksRequest("/data/v4/Files/UploadFile", {
|
|
35
|
+
body,
|
|
36
|
+
impersonatedProjectAuth: true,
|
|
37
|
+
...requestContext(flags),
|
|
38
|
+
projectTenantId: projectKey
|
|
39
|
+
});
|
|
40
|
+
writeOutput(result, flags);
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataFilesGetMany(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { compact, listFlag } from "../../../lib/json-flag.js";
|
|
4
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
5
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
6
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
7
|
+
export async function dataFilesGetMany(argv) {
|
|
8
|
+
const { args, flags } = parseCommand(argv);
|
|
9
|
+
const fileIds = listFlag(flags, "file-ids") ?? args;
|
|
10
|
+
if (!fileIds.length)
|
|
11
|
+
throw new Error("Provide file ids as arguments or --file-ids a,b.");
|
|
12
|
+
const body = compact({
|
|
13
|
+
configurationName: stringFlag(flags, "configuration-name") || undefined,
|
|
14
|
+
fileIds
|
|
15
|
+
});
|
|
16
|
+
const projectKey = await selectedProject(flags);
|
|
17
|
+
const result = await blocksRequest("/data/v4/Files/GetFiles", {
|
|
18
|
+
body,
|
|
19
|
+
impersonatedProjectAuth: true,
|
|
20
|
+
...requestContext(flags),
|
|
21
|
+
projectTenantId: projectKey
|
|
22
|
+
});
|
|
23
|
+
writeOutput(result, flags);
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataFilesGet(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { integerFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
4
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
5
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
6
|
+
export async function dataFilesGet(argv) {
|
|
7
|
+
const { args, flags } = parseCommand(argv);
|
|
8
|
+
const fileId = args[0] || stringFlag(flags, "file-id", { required: true });
|
|
9
|
+
const projectKey = await selectedProject(flags);
|
|
10
|
+
const result = await blocksRequest("/data/v4/Files/GetFile", {
|
|
11
|
+
impersonatedProjectAuth: true,
|
|
12
|
+
...requestContext(flags),
|
|
13
|
+
projectTenantId: projectKey,
|
|
14
|
+
query: {
|
|
15
|
+
ConfigurationName: stringFlag(flags, "configuration-name") || undefined,
|
|
16
|
+
FileId: fileId,
|
|
17
|
+
Version: integerFlag(flags, "version", 0) || undefined
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
writeOutput(result, flags);
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataFilesInfo(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { booleanFlag, integerFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { compact } from "../../../lib/json-flag.js";
|
|
4
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
5
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
6
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
7
|
+
export async function dataFilesInfo(argv) {
|
|
8
|
+
const { flags } = parseCommand(argv);
|
|
9
|
+
const filter = compact({
|
|
10
|
+
name: stringFlag(flags, "name") || undefined,
|
|
11
|
+
tenantId: stringFlag(flags, "tenant-id") || undefined
|
|
12
|
+
});
|
|
13
|
+
const body = {
|
|
14
|
+
filter: Object.keys(filter).length ? filter : undefined,
|
|
15
|
+
page: integerFlag(flags, "page", 1),
|
|
16
|
+
pageSize: integerFlag(flags, "page-size", 20),
|
|
17
|
+
sort: {
|
|
18
|
+
isDescending: booleanFlag(flags, "sort-desc"),
|
|
19
|
+
property: stringFlag(flags, "sort-by") || undefined
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const projectKey = await selectedProject(flags);
|
|
23
|
+
const result = await blocksRequest("/data/v4/Files/GetFilesInfo", {
|
|
24
|
+
body,
|
|
25
|
+
impersonatedProjectAuth: true,
|
|
26
|
+
...requestContext(flags),
|
|
27
|
+
projectTenantId: projectKey
|
|
28
|
+
});
|
|
29
|
+
writeOutput(result, flags);
|
|
30
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud-storage upload path, step 1 of 2: get a pre-signed URL, then PUT the file bytes to it
|
|
3
|
+
* with `data:files:upload-to-url`. For local-storage-backed projects use
|
|
4
|
+
* `data:files:upload-to-local-storage` instead (single call, no presign step).
|
|
5
|
+
*/
|
|
6
|
+
export declare function dataFilesPresignedUploadUrl(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { optionalIntegerFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { compact, jsonBodyFlag } from "../../../lib/json-flag.js";
|
|
4
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
5
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
6
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
7
|
+
/**
|
|
8
|
+
* Cloud-storage upload path, step 1 of 2: get a pre-signed URL, then PUT the file bytes to it
|
|
9
|
+
* with `data:files:upload-to-url`. For local-storage-backed projects use
|
|
10
|
+
* `data:files:upload-to-local-storage` instead (single call, no presign step).
|
|
11
|
+
*/
|
|
12
|
+
export async function dataFilesPresignedUploadUrl(argv) {
|
|
13
|
+
const { flags } = parseCommand(argv);
|
|
14
|
+
const body = {
|
|
15
|
+
...(await jsonBodyFlag(flags)),
|
|
16
|
+
...compact({
|
|
17
|
+
accessModifier: stringFlag(flags, "access-modifier") || undefined,
|
|
18
|
+
configurationName: stringFlag(flags, "configuration-name") || undefined,
|
|
19
|
+
metaData: stringFlag(flags, "meta-data") || undefined,
|
|
20
|
+
moduleName: optionalIntegerFlag(flags, "module-name"),
|
|
21
|
+
name: stringFlag(flags, "name", { required: true }),
|
|
22
|
+
parentDirectoryId: stringFlag(flags, "parent-directory-id"),
|
|
23
|
+
tags: stringFlag(flags, "tags") || undefined
|
|
24
|
+
})
|
|
25
|
+
};
|
|
26
|
+
const projectKey = await selectedProject(flags);
|
|
27
|
+
const result = await blocksRequest("/data/v4/Files/GetPreSignedUrlForUpload", {
|
|
28
|
+
body,
|
|
29
|
+
impersonatedProjectAuth: true,
|
|
30
|
+
...requestContext(flags),
|
|
31
|
+
projectTenantId: projectKey
|
|
32
|
+
});
|
|
33
|
+
writeOutput(result, flags);
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dataFilesUpdateAdditionalInfo(argv: string[]): Promise<void>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
|
+
import { blocksRequest } from "../../../lib/api.js";
|
|
3
|
+
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
|
+
import { writeOutput } from "../../../lib/output.js";
|
|
5
|
+
import { requestContext } from "../../../lib/request-context.js";
|
|
6
|
+
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
7
|
+
export async function dataFilesUpdateAdditionalInfo(argv) {
|
|
8
|
+
const { args, flags } = parseCommand(argv);
|
|
9
|
+
const itemId = args[0] || stringFlag(flags, "item-id", { required: true });
|
|
10
|
+
const additionalPropertiesRaw = stringFlag(flags, "additional-properties", { required: true });
|
|
11
|
+
const additionalProperties = JSON.parse(additionalPropertiesRaw);
|
|
12
|
+
const body = { additionalProperties, itemId };
|
|
13
|
+
if (booleanFlag(flags, "dry-run")) {
|
|
14
|
+
writeOutput({ dryRun: true, endpoint: "/data/v4/Files/UpdateFileAdditionalInfo", request: body }, flags);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
await confirmMutation(flags, `Update additional info for file '${itemId}'.`);
|
|
18
|
+
const projectKey = await selectedProject(flags);
|
|
19
|
+
const result = await blocksRequest("/data/v4/Files/UpdateFileAdditionalInfo", {
|
|
20
|
+
body,
|
|
21
|
+
impersonatedProjectAuth: true,
|
|
22
|
+
...requestContext(flags),
|
|
23
|
+
projectTenantId: projectKey
|
|
24
|
+
});
|
|
25
|
+
writeOutput(result, flags);
|
|
26
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one-call alternative to presigned-upload-url + upload-to-url, for projects backed
|
|
3
|
+
* by local storage (not cloud object storage). Sends multipart/form-data with the file bytes.
|
|
4
|
+
*/
|
|
5
|
+
export declare function dataFilesUploadToLocalStorage(argv: string[]): Promise<void>;
|