chirag-appwrite-cli 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/build-verify.yml +71 -0
- package/.github/workflows/npm-publish.yml +41 -22
- package/CHANGELOG.md +190 -1
- package/LICENSE.md +12 -1
- package/README.md +182 -15
- package/bun.lock +627 -0
- package/dist/bundle.cjs +108228 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +149 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/client.d.ts +88 -0
- package/dist/lib/client.d.ts.map +1 -0
- package/dist/lib/client.js +238 -0
- package/dist/lib/client.js.map +1 -0
- package/dist/lib/commands/config.d.ts +557 -0
- package/dist/lib/commands/config.d.ts.map +1 -0
- package/dist/lib/commands/config.js +415 -0
- package/dist/lib/commands/config.js.map +1 -0
- package/dist/lib/commands/db.d.ts +34 -0
- package/dist/lib/commands/db.d.ts.map +1 -0
- package/dist/lib/commands/db.js +247 -0
- package/dist/lib/commands/db.js.map +1 -0
- package/dist/lib/commands/errors.d.ts +68 -0
- package/dist/lib/commands/errors.d.ts.map +1 -0
- package/dist/lib/commands/errors.js +72 -0
- package/dist/lib/commands/errors.js.map +1 -0
- package/dist/lib/commands/generic.d.ts +17 -0
- package/dist/lib/commands/generic.d.ts.map +1 -0
- package/dist/lib/commands/generic.js +292 -0
- package/dist/lib/commands/generic.js.map +1 -0
- package/dist/lib/commands/init.d.ts +3 -0
- package/dist/lib/commands/init.d.ts.map +1 -0
- package/dist/lib/commands/init.js +526 -0
- package/dist/lib/commands/init.js.map +1 -0
- package/dist/lib/commands/pull.d.ts +110 -0
- package/dist/lib/commands/pull.d.ts.map +1 -0
- package/dist/lib/commands/pull.js +626 -0
- package/dist/lib/commands/pull.js.map +1 -0
- package/dist/lib/commands/push.d.ts +82 -0
- package/dist/lib/commands/push.d.ts.map +1 -0
- package/dist/lib/commands/push.js +1666 -0
- package/dist/lib/commands/push.js.map +1 -0
- package/dist/lib/commands/run.d.ts +3 -0
- package/dist/lib/commands/run.d.ts.map +1 -0
- package/dist/lib/commands/run.js +289 -0
- package/dist/lib/commands/run.js.map +1 -0
- package/dist/lib/commands/schema.d.ts +57 -0
- package/dist/lib/commands/schema.d.ts.map +1 -0
- package/dist/lib/commands/schema.js +75 -0
- package/dist/lib/commands/schema.js.map +1 -0
- package/dist/lib/commands/services/account.d.ts +3 -0
- package/dist/lib/commands/services/account.d.ts.map +1 -0
- package/dist/lib/commands/services/account.js +306 -0
- package/dist/lib/commands/services/account.js.map +1 -0
- package/dist/lib/commands/services/avatars.d.ts +3 -0
- package/dist/lib/commands/services/avatars.d.ts.map +1 -0
- package/dist/lib/commands/services/avatars.js +118 -0
- package/dist/lib/commands/services/avatars.js.map +1 -0
- package/dist/lib/commands/services/console.d.ts +3 -0
- package/dist/lib/commands/services/console.d.ts.map +1 -0
- package/dist/lib/commands/services/console.js +41 -0
- package/dist/lib/commands/services/console.js.map +1 -0
- package/dist/lib/commands/services/databases.d.ts +3 -0
- package/dist/lib/commands/services/databases.d.ts.map +1 -0
- package/dist/lib/commands/services/databases.js +612 -0
- package/dist/lib/commands/services/databases.js.map +1 -0
- package/dist/lib/commands/services/functions.d.ts +3 -0
- package/dist/lib/commands/services/functions.d.ts.map +1 -0
- package/dist/lib/commands/services/functions.js +258 -0
- package/dist/lib/commands/services/functions.js.map +1 -0
- package/dist/lib/commands/services/graphql.d.ts +3 -0
- package/dist/lib/commands/services/graphql.d.ts.map +1 -0
- package/dist/lib/commands/services/graphql.js +28 -0
- package/dist/lib/commands/services/graphql.js.map +1 -0
- package/dist/lib/commands/services/health.d.ts +3 -0
- package/dist/lib/commands/services/health.d.ts.map +1 -0
- package/dist/lib/commands/services/health.js +123 -0
- package/dist/lib/commands/services/health.js.map +1 -0
- package/dist/lib/commands/services/locale.d.ts +3 -0
- package/dist/lib/commands/services/locale.d.ts.map +1 -0
- package/dist/lib/commands/services/locale.js +52 -0
- package/dist/lib/commands/services/locale.js.map +1 -0
- package/dist/lib/commands/services/messaging.d.ts +3 -0
- package/dist/lib/commands/services/messaging.d.ts.map +1 -0
- package/dist/lib/commands/services/messaging.js +505 -0
- package/dist/lib/commands/services/messaging.js.map +1 -0
- package/dist/lib/commands/services/migrations.d.ts +3 -0
- package/dist/lib/commands/services/migrations.d.ts.map +1 -0
- package/dist/lib/commands/services/migrations.js +135 -0
- package/dist/lib/commands/services/migrations.js.map +1 -0
- package/dist/lib/commands/services/project.d.ts +3 -0
- package/dist/lib/commands/services/project.d.ts.map +1 -0
- package/dist/lib/commands/services/project.js +54 -0
- package/dist/lib/commands/services/project.js.map +1 -0
- package/dist/lib/commands/services/projects.d.ts +3 -0
- package/dist/lib/commands/services/projects.d.ts.map +1 -0
- package/dist/lib/commands/services/projects.js +415 -0
- package/dist/lib/commands/services/projects.js.map +1 -0
- package/dist/lib/commands/services/proxy.d.ts +3 -0
- package/dist/lib/commands/services/proxy.d.ts.map +1 -0
- package/dist/lib/commands/services/proxy.js +68 -0
- package/dist/lib/commands/services/proxy.js.map +1 -0
- package/dist/lib/commands/services/sites.d.ts +3 -0
- package/dist/lib/commands/services/sites.d.ts.map +1 -0
- package/dist/lib/commands/services/sites.js +242 -0
- package/dist/lib/commands/services/sites.js.map +1 -0
- package/dist/lib/commands/services/storage.d.ts +3 -0
- package/dist/lib/commands/services/storage.d.ts.map +1 -0
- package/dist/lib/commands/services/storage.js +153 -0
- package/dist/lib/commands/services/storage.js.map +1 -0
- package/dist/lib/commands/services/tablesdb.d.ts +3 -0
- package/dist/lib/commands/services/tablesdb.d.ts.map +1 -0
- package/dist/lib/commands/services/tablesdb.js +605 -0
- package/dist/lib/commands/services/tablesdb.js.map +1 -0
- package/dist/lib/commands/services/teams.d.ts +3 -0
- package/dist/lib/commands/services/teams.d.ts.map +1 -0
- package/dist/lib/commands/services/teams.js +123 -0
- package/dist/lib/commands/services/teams.js.map +1 -0
- package/dist/lib/commands/services/tokens.d.ts +3 -0
- package/dist/lib/commands/services/tokens.d.ts.map +1 -0
- package/dist/lib/commands/services/tokens.js +49 -0
- package/dist/lib/commands/services/tokens.js.map +1 -0
- package/dist/lib/commands/services/users.d.ts +3 -0
- package/dist/lib/commands/services/users.d.ts.map +1 -0
- package/dist/lib/commands/services/users.js +312 -0
- package/dist/lib/commands/services/users.js.map +1 -0
- package/dist/lib/commands/services/vcs.d.ts +3 -0
- package/dist/lib/commands/services/vcs.d.ts.map +1 -0
- package/dist/lib/commands/services/vcs.js +87 -0
- package/dist/lib/commands/services/vcs.js.map +1 -0
- package/dist/lib/commands/types.d.ts +3 -0
- package/dist/lib/commands/types.d.ts.map +1 -0
- package/dist/lib/commands/types.js +151 -0
- package/dist/lib/commands/types.js.map +1 -0
- package/dist/lib/commands/update.d.ts +3 -0
- package/dist/lib/commands/update.d.ts.map +1 -0
- package/dist/lib/commands/update.js +201 -0
- package/dist/lib/commands/update.js.map +1 -0
- package/dist/lib/commands/utils/attributes.d.ts +46 -0
- package/dist/lib/commands/utils/attributes.d.ts.map +1 -0
- package/dist/lib/commands/utils/attributes.js +521 -0
- package/dist/lib/commands/utils/attributes.js.map +1 -0
- package/dist/lib/commands/utils/change-approval.d.ts +25 -0
- package/dist/lib/commands/utils/change-approval.d.ts.map +1 -0
- package/dist/lib/commands/utils/change-approval.js +129 -0
- package/dist/lib/commands/utils/change-approval.js.map +1 -0
- package/dist/lib/commands/utils/database-sync.d.ts +10 -0
- package/dist/lib/commands/utils/database-sync.d.ts.map +1 -0
- package/dist/lib/commands/utils/database-sync.js +136 -0
- package/dist/lib/commands/utils/database-sync.js.map +1 -0
- package/dist/lib/commands/utils/deployment.d.ts +34 -0
- package/dist/lib/commands/utils/deployment.d.ts.map +1 -0
- package/dist/lib/commands/utils/deployment.js +108 -0
- package/dist/lib/commands/utils/deployment.js.map +1 -0
- package/dist/lib/commands/utils/error-formatter.d.ts +19 -0
- package/dist/lib/commands/utils/error-formatter.d.ts.map +1 -0
- package/dist/lib/commands/utils/error-formatter.js +333 -0
- package/dist/lib/commands/utils/error-formatter.js.map +1 -0
- package/dist/lib/commands/utils/pools.d.ts +16 -0
- package/dist/lib/commands/utils/pools.d.ts.map +1 -0
- package/dist/lib/commands/utils/pools.js +197 -0
- package/dist/lib/commands/utils/pools.js.map +1 -0
- package/dist/lib/config.d.ts +119 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +728 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/emulation/docker.d.ts +7 -0
- package/dist/lib/emulation/docker.d.ts.map +1 -0
- package/dist/lib/emulation/docker.js +224 -0
- package/dist/lib/emulation/docker.js.map +1 -0
- package/dist/lib/emulation/utils.d.ts +29 -0
- package/dist/lib/emulation/utils.d.ts.map +1 -0
- package/dist/lib/emulation/utils.js +165 -0
- package/dist/lib/emulation/utils.js.map +1 -0
- package/dist/lib/id.d.ts +7 -0
- package/dist/lib/id.d.ts.map +1 -0
- package/dist/lib/id.js +27 -0
- package/dist/lib/id.js.map +1 -0
- package/dist/lib/paginate.d.ts +9 -0
- package/dist/lib/paginate.d.ts.map +1 -0
- package/dist/lib/paginate.js +43 -0
- package/dist/lib/paginate.js.map +1 -0
- package/dist/lib/parser.d.ts +18 -0
- package/dist/lib/parser.d.ts.map +1 -0
- package/dist/lib/parser.js +225 -0
- package/dist/lib/parser.js.map +1 -0
- package/dist/lib/questions.d.ts +59 -0
- package/dist/lib/questions.d.ts.map +1 -0
- package/dist/lib/questions.js +991 -0
- package/dist/lib/questions.js.map +1 -0
- package/dist/lib/sdks.d.ts +4 -0
- package/dist/lib/sdks.d.ts.map +1 -0
- package/dist/lib/sdks.js +61 -0
- package/dist/lib/sdks.js.map +1 -0
- package/dist/lib/services.d.ts +13 -0
- package/dist/lib/services.d.ts.map +1 -0
- package/dist/lib/services.js +47 -0
- package/dist/lib/services.js.map +1 -0
- package/dist/lib/spinner.d.ts +28 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/dist/lib/spinner.js +91 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/type-generation/attribute.d.ts +17 -0
- package/dist/lib/type-generation/attribute.d.ts.map +1 -0
- package/dist/lib/type-generation/attribute.js +16 -0
- package/dist/lib/type-generation/attribute.js.map +1 -0
- package/dist/lib/type-generation/languages/csharp.d.ts +7 -0
- package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/csharp.js +180 -0
- package/dist/lib/type-generation/languages/csharp.js.map +1 -0
- package/dist/lib/type-generation/languages/dart.d.ts +8 -0
- package/dist/lib/type-generation/languages/dart.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/dart.js +197 -0
- package/dist/lib/type-generation/languages/dart.js.map +1 -0
- package/dist/lib/type-generation/languages/java.d.ts +7 -0
- package/dist/lib/type-generation/languages/java.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/java.js +140 -0
- package/dist/lib/type-generation/languages/java.js.map +1 -0
- package/dist/lib/type-generation/languages/javascript.d.ts +9 -0
- package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/javascript.js +109 -0
- package/dist/lib/type-generation/languages/javascript.js.map +1 -0
- package/dist/lib/type-generation/languages/kotlin.d.ts +7 -0
- package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/kotlin.js +95 -0
- package/dist/lib/type-generation/languages/kotlin.js.map +1 -0
- package/dist/lib/type-generation/languages/language.d.ts +43 -0
- package/dist/lib/type-generation/languages/language.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/language.js +77 -0
- package/dist/lib/type-generation/languages/language.js.map +1 -0
- package/dist/lib/type-generation/languages/php.d.ts +7 -0
- package/dist/lib/type-generation/languages/php.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/php.js +116 -0
- package/dist/lib/type-generation/languages/php.js.map +1 -0
- package/dist/lib/type-generation/languages/swift.d.ts +7 -0
- package/dist/lib/type-generation/languages/swift.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/swift.js +179 -0
- package/dist/lib/type-generation/languages/swift.js.map +1 -0
- package/dist/lib/type-generation/languages/typescript.d.ts +9 -0
- package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/typescript.js +115 -0
- package/dist/lib/type-generation/languages/typescript.js.map +1 -0
- package/dist/lib/types.d.ts +63 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +18 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +323 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/validations.d.ts +2 -0
- package/dist/lib/validations.d.ts.map +1 -0
- package/dist/lib/validations.js +16 -0
- package/dist/lib/validations.js.map +1 -0
- package/dist/package.json +68 -0
- package/dist/scripts/generate-commands.d.ts +2 -0
- package/dist/scripts/generate-commands.d.ts.map +1 -0
- package/dist/scripts/generate-commands.js +398 -0
- package/dist/scripts/generate-commands.js.map +1 -0
- package/dist/sites/profile-website/src/lib/utils.d.ts +4 -0
- package/dist/sites/profile-website/src/lib/utils.d.ts.map +1 -0
- package/dist/sites/profile-website/src/lib/utils.js +32 -0
- package/dist/sites/profile-website/src/lib/utils.js.map +1 -0
- package/dist/sites/profile-website/tailwind.config.d.ts +3 -0
- package/dist/sites/profile-website/tailwind.config.d.ts.map +1 -0
- package/dist/sites/profile-website/tailwind.config.js +110 -0
- package/dist/sites/profile-website/tailwind.config.js.map +1 -0
- package/dist/test.d.ts +2 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/test.js +38 -0
- package/dist/test.js.map +1 -0
- package/index.ts +190 -0
- package/install.ps1 +5 -8
- package/install.sh +4 -5
- package/lib/client.ts +292 -0
- package/lib/commands/config.ts +493 -0
- package/lib/commands/db.ts +324 -0
- package/lib/commands/errors.ts +93 -0
- package/lib/commands/generic.ts +440 -0
- package/lib/commands/init.ts +713 -0
- package/lib/commands/pull.ts +944 -0
- package/lib/commands/push.ts +2355 -0
- package/lib/commands/run.ts +416 -0
- package/lib/commands/schema.ts +103 -0
- package/lib/commands/services/account.ts +832 -0
- package/lib/commands/services/avatars.ts +400 -0
- package/lib/commands/services/console.ts +73 -0
- package/lib/commands/services/databases.ts +2080 -0
- package/lib/commands/services/functions.ts +855 -0
- package/lib/commands/services/graphql.ts +47 -0
- package/lib/commands/services/health.ts +322 -0
- package/lib/commands/services/locale.ts +99 -0
- package/lib/commands/services/messaging.ts +1871 -0
- package/lib/commands/services/migrations.ts +421 -0
- package/lib/commands/services/project.ts +116 -0
- package/lib/commands/services/projects.ts +1317 -0
- package/lib/commands/services/proxy.ts +163 -0
- package/lib/commands/services/sites.ts +777 -0
- package/lib/commands/services/storage.ts +547 -0
- package/lib/commands/services/tablesdb.ts +1928 -0
- package/lib/commands/services/teams.ts +294 -0
- package/lib/commands/services/tokens.ts +106 -0
- package/lib/commands/services/users.ts +886 -0
- package/lib/commands/services/vcs.ts +268 -0
- package/lib/commands/types.ts +220 -0
- package/lib/commands/update.ts +245 -0
- package/lib/commands/utils/attributes.ts +734 -0
- package/lib/commands/utils/change-approval.ts +186 -0
- package/lib/commands/utils/database-sync.ts +180 -0
- package/lib/commands/utils/deployment.ts +180 -0
- package/lib/commands/utils/error-formatter.ts +417 -0
- package/lib/commands/utils/pools.ts +354 -0
- package/lib/config.ts +932 -0
- package/lib/emulation/docker.ts +312 -0
- package/lib/emulation/utils.ts +207 -0
- package/lib/id.ts +30 -0
- package/lib/paginate.ts +77 -0
- package/lib/parser.ts +264 -0
- package/lib/questions.ts +1167 -0
- package/lib/sdks.ts +84 -0
- package/lib/services.ts +72 -0
- package/lib/spinner.ts +131 -0
- package/lib/type-generation/attribute.ts +18 -0
- package/lib/type-generation/languages/csharp.ts +192 -0
- package/lib/type-generation/languages/dart.ts +217 -0
- package/lib/type-generation/languages/java.ts +152 -0
- package/lib/type-generation/languages/javascript.ts +122 -0
- package/lib/type-generation/languages/kotlin.ts +107 -0
- package/lib/type-generation/languages/language.ts +127 -0
- package/lib/type-generation/languages/php.ts +128 -0
- package/lib/type-generation/languages/swift.ts +191 -0
- package/lib/type-generation/languages/typescript.ts +133 -0
- package/lib/types.ts +75 -0
- package/lib/utils.ts +394 -0
- package/lib/validations.ts +20 -0
- package/package.json +39 -21
- package/scoop/appwrite.config.json +20 -0
- package/scripts/generate-commands.ts +539 -0
- package/tsconfig.json +24 -0
- package/appwrite.config.json +0 -420
- package/docs/examples/account/create-anonymous-session.md +0 -1
- package/docs/examples/account/create-email-password-session.md +0 -3
- package/docs/examples/account/create-email-token.md +0 -4
- package/docs/examples/account/create-j-w-t.md +0 -1
- package/docs/examples/account/create-magic-u-r-l-token.md +0 -5
- package/docs/examples/account/create-mfa-authenticator.md +0 -2
- package/docs/examples/account/create-mfa-challenge.md +0 -2
- package/docs/examples/account/create-mfa-recovery-codes.md +0 -1
- package/docs/examples/account/create-o-auth2session.md +0 -5
- package/docs/examples/account/create-o-auth2token.md +0 -5
- package/docs/examples/account/create-phone-token.md +0 -3
- package/docs/examples/account/create-phone-verification.md +0 -1
- package/docs/examples/account/create-push-target.md +0 -4
- package/docs/examples/account/create-recovery.md +0 -3
- package/docs/examples/account/create-session.md +0 -3
- package/docs/examples/account/create-verification.md +0 -2
- package/docs/examples/account/create.md +0 -5
- package/docs/examples/account/delete-identity.md +0 -2
- package/docs/examples/account/delete-mfa-authenticator.md +0 -2
- package/docs/examples/account/delete-push-target.md +0 -2
- package/docs/examples/account/delete-session.md +0 -2
- package/docs/examples/account/delete-sessions.md +0 -1
- package/docs/examples/account/delete.md +0 -1
- package/docs/examples/account/get-mfa-recovery-codes.md +0 -1
- package/docs/examples/account/get-prefs.md +0 -1
- package/docs/examples/account/get-session.md +0 -2
- package/docs/examples/account/get.md +0 -1
- package/docs/examples/account/list-identities.md +0 -2
- package/docs/examples/account/list-logs.md +0 -2
- package/docs/examples/account/list-mfa-factors.md +0 -1
- package/docs/examples/account/list-sessions.md +0 -1
- package/docs/examples/account/update-email.md +0 -3
- package/docs/examples/account/update-m-f-a.md +0 -2
- package/docs/examples/account/update-magic-u-r-l-session.md +0 -3
- package/docs/examples/account/update-mfa-authenticator.md +0 -3
- package/docs/examples/account/update-mfa-challenge.md +0 -3
- package/docs/examples/account/update-mfa-recovery-codes.md +0 -1
- package/docs/examples/account/update-name.md +0 -2
- package/docs/examples/account/update-password.md +0 -3
- package/docs/examples/account/update-phone-session.md +0 -3
- package/docs/examples/account/update-phone-verification.md +0 -3
- package/docs/examples/account/update-phone.md +0 -3
- package/docs/examples/account/update-prefs.md +0 -2
- package/docs/examples/account/update-push-target.md +0 -3
- package/docs/examples/account/update-recovery.md +0 -4
- package/docs/examples/account/update-session.md +0 -2
- package/docs/examples/account/update-status.md +0 -1
- package/docs/examples/account/update-verification.md +0 -3
- package/docs/examples/avatars/get-browser.md +0 -5
- package/docs/examples/avatars/get-credit-card.md +0 -5
- package/docs/examples/avatars/get-favicon.md +0 -2
- package/docs/examples/avatars/get-flag.md +0 -5
- package/docs/examples/avatars/get-image.md +0 -4
- package/docs/examples/avatars/get-initials.md +0 -5
- package/docs/examples/avatars/get-q-r.md +0 -5
- package/docs/examples/console/get-resource.md +0 -3
- package/docs/examples/console/variables.md +0 -1
- package/docs/examples/databases/create-boolean-attribute.md +0 -7
- package/docs/examples/databases/create-collection.md +0 -7
- package/docs/examples/databases/create-datetime-attribute.md +0 -7
- package/docs/examples/databases/create-document.md +0 -6
- package/docs/examples/databases/create-documents.md +0 -4
- package/docs/examples/databases/create-email-attribute.md +0 -7
- package/docs/examples/databases/create-enum-attribute.md +0 -8
- package/docs/examples/databases/create-float-attribute.md +0 -9
- package/docs/examples/databases/create-index.md +0 -8
- package/docs/examples/databases/create-integer-attribute.md +0 -9
- package/docs/examples/databases/create-ip-attribute.md +0 -7
- package/docs/examples/databases/create-relationship-attribute.md +0 -9
- package/docs/examples/databases/create-string-attribute.md +0 -9
- package/docs/examples/databases/create-url-attribute.md +0 -7
- package/docs/examples/databases/create.md +0 -4
- package/docs/examples/databases/decrement-document-attribute.md +0 -7
- package/docs/examples/databases/delete-attribute.md +0 -4
- package/docs/examples/databases/delete-collection.md +0 -3
- package/docs/examples/databases/delete-document.md +0 -4
- package/docs/examples/databases/delete-documents.md +0 -4
- package/docs/examples/databases/delete-index.md +0 -4
- package/docs/examples/databases/delete.md +0 -2
- package/docs/examples/databases/get-attribute.md +0 -4
- package/docs/examples/databases/get-collection-usage.md +0 -4
- package/docs/examples/databases/get-collection.md +0 -3
- package/docs/examples/databases/get-database-usage.md +0 -3
- package/docs/examples/databases/get-document.md +0 -5
- package/docs/examples/databases/get-index.md +0 -4
- package/docs/examples/databases/get-usage.md +0 -2
- package/docs/examples/databases/get.md +0 -2
- package/docs/examples/databases/increment-document-attribute.md +0 -7
- package/docs/examples/databases/list-attributes.md +0 -4
- package/docs/examples/databases/list-collection-logs.md +0 -4
- package/docs/examples/databases/list-collections.md +0 -4
- package/docs/examples/databases/list-document-logs.md +0 -5
- package/docs/examples/databases/list-documents.md +0 -4
- package/docs/examples/databases/list-indexes.md +0 -4
- package/docs/examples/databases/list-logs.md +0 -3
- package/docs/examples/databases/list-usage.md +0 -2
- package/docs/examples/databases/list.md +0 -3
- package/docs/examples/databases/update-boolean-attribute.md +0 -7
- package/docs/examples/databases/update-collection.md +0 -7
- package/docs/examples/databases/update-datetime-attribute.md +0 -7
- package/docs/examples/databases/update-document.md +0 -6
- package/docs/examples/databases/update-documents.md +0 -5
- package/docs/examples/databases/update-email-attribute.md +0 -7
- package/docs/examples/databases/update-enum-attribute.md +0 -8
- package/docs/examples/databases/update-float-attribute.md +0 -9
- package/docs/examples/databases/update-integer-attribute.md +0 -9
- package/docs/examples/databases/update-ip-attribute.md +0 -7
- package/docs/examples/databases/update-relationship-attribute.md +0 -6
- package/docs/examples/databases/update-string-attribute.md +0 -8
- package/docs/examples/databases/update-url-attribute.md +0 -7
- package/docs/examples/databases/update.md +0 -4
- package/docs/examples/databases/upsert-document.md +0 -6
- package/docs/examples/databases/upsert-documents.md +0 -4
- package/docs/examples/functions/create-deployment.md +0 -6
- package/docs/examples/functions/create-duplicate-deployment.md +0 -4
- package/docs/examples/functions/create-execution.md +0 -8
- package/docs/examples/functions/create-template-deployment.md +0 -7
- package/docs/examples/functions/create-variable.md +0 -5
- package/docs/examples/functions/create-vcs-deployment.md +0 -5
- package/docs/examples/functions/create.md +0 -19
- package/docs/examples/functions/delete-deployment.md +0 -3
- package/docs/examples/functions/delete-execution.md +0 -3
- package/docs/examples/functions/delete-variable.md +0 -3
- package/docs/examples/functions/delete.md +0 -2
- package/docs/examples/functions/get-deployment-download.md +0 -4
- package/docs/examples/functions/get-deployment.md +0 -3
- package/docs/examples/functions/get-execution.md +0 -3
- package/docs/examples/functions/get-template.md +0 -2
- package/docs/examples/functions/get-usage.md +0 -3
- package/docs/examples/functions/get-variable.md +0 -3
- package/docs/examples/functions/get.md +0 -2
- package/docs/examples/functions/list-deployments.md +0 -4
- package/docs/examples/functions/list-executions.md +0 -3
- package/docs/examples/functions/list-runtimes.md +0 -1
- package/docs/examples/functions/list-specifications.md +0 -1
- package/docs/examples/functions/list-templates.md +0 -5
- package/docs/examples/functions/list-usage.md +0 -2
- package/docs/examples/functions/list-variables.md +0 -2
- package/docs/examples/functions/list.md +0 -3
- package/docs/examples/functions/update-deployment-status.md +0 -3
- package/docs/examples/functions/update-function-deployment.md +0 -3
- package/docs/examples/functions/update-variable.md +0 -6
- package/docs/examples/functions/update.md +0 -19
- package/docs/examples/graphql/mutation.md +0 -2
- package/docs/examples/graphql/query.md +0 -2
- package/docs/examples/health/get-antivirus.md +0 -1
- package/docs/examples/health/get-cache.md +0 -1
- package/docs/examples/health/get-certificate.md +0 -2
- package/docs/examples/health/get-d-b.md +0 -1
- package/docs/examples/health/get-failed-jobs.md +0 -3
- package/docs/examples/health/get-pub-sub.md +0 -1
- package/docs/examples/health/get-queue-builds.md +0 -2
- package/docs/examples/health/get-queue-certificates.md +0 -2
- package/docs/examples/health/get-queue-databases.md +0 -3
- package/docs/examples/health/get-queue-deletes.md +0 -2
- package/docs/examples/health/get-queue-functions.md +0 -2
- package/docs/examples/health/get-queue-logs.md +0 -2
- package/docs/examples/health/get-queue-mails.md +0 -2
- package/docs/examples/health/get-queue-messaging.md +0 -2
- package/docs/examples/health/get-queue-migrations.md +0 -2
- package/docs/examples/health/get-queue-stats-resources.md +0 -2
- package/docs/examples/health/get-queue-usage.md +0 -2
- package/docs/examples/health/get-queue-webhooks.md +0 -2
- package/docs/examples/health/get-storage-local.md +0 -1
- package/docs/examples/health/get-storage.md +0 -1
- package/docs/examples/health/get-time.md +0 -1
- package/docs/examples/health/get.md +0 -1
- package/docs/examples/locale/get.md +0 -1
- package/docs/examples/locale/list-codes.md +0 -1
- package/docs/examples/locale/list-continents.md +0 -1
- package/docs/examples/locale/list-countries-e-u.md +0 -1
- package/docs/examples/locale/list-countries-phones.md +0 -1
- package/docs/examples/locale/list-countries.md +0 -1
- package/docs/examples/locale/list-currencies.md +0 -1
- package/docs/examples/locale/list-languages.md +0 -1
- package/docs/examples/messaging/create-apns-provider.md +0 -9
- package/docs/examples/messaging/create-email.md +0 -13
- package/docs/examples/messaging/create-fcm-provider.md +0 -5
- package/docs/examples/messaging/create-mailgun-provider.md +0 -11
- package/docs/examples/messaging/create-msg91provider.md +0 -7
- package/docs/examples/messaging/create-push.md +0 -20
- package/docs/examples/messaging/create-sendgrid-provider.md +0 -9
- package/docs/examples/messaging/create-sms.md +0 -8
- package/docs/examples/messaging/create-smtp-provider.md +0 -15
- package/docs/examples/messaging/create-subscriber.md +0 -4
- package/docs/examples/messaging/create-telesign-provider.md +0 -7
- package/docs/examples/messaging/create-textmagic-provider.md +0 -7
- package/docs/examples/messaging/create-topic.md +0 -4
- package/docs/examples/messaging/create-twilio-provider.md +0 -7
- package/docs/examples/messaging/create-vonage-provider.md +0 -7
- package/docs/examples/messaging/delete-provider.md +0 -2
- package/docs/examples/messaging/delete-subscriber.md +0 -3
- package/docs/examples/messaging/delete-topic.md +0 -2
- package/docs/examples/messaging/delete.md +0 -2
- package/docs/examples/messaging/get-message.md +0 -2
- package/docs/examples/messaging/get-provider.md +0 -2
- package/docs/examples/messaging/get-subscriber.md +0 -3
- package/docs/examples/messaging/get-topic.md +0 -2
- package/docs/examples/messaging/list-message-logs.md +0 -3
- package/docs/examples/messaging/list-messages.md +0 -3
- package/docs/examples/messaging/list-provider-logs.md +0 -3
- package/docs/examples/messaging/list-providers.md +0 -3
- package/docs/examples/messaging/list-subscriber-logs.md +0 -3
- package/docs/examples/messaging/list-subscribers.md +0 -4
- package/docs/examples/messaging/list-targets.md +0 -3
- package/docs/examples/messaging/list-topic-logs.md +0 -3
- package/docs/examples/messaging/list-topics.md +0 -3
- package/docs/examples/messaging/update-apns-provider.md +0 -9
- package/docs/examples/messaging/update-email.md +0 -13
- package/docs/examples/messaging/update-fcm-provider.md +0 -5
- package/docs/examples/messaging/update-mailgun-provider.md +0 -11
- package/docs/examples/messaging/update-msg91provider.md +0 -7
- package/docs/examples/messaging/update-push.md +0 -20
- package/docs/examples/messaging/update-sendgrid-provider.md +0 -9
- package/docs/examples/messaging/update-sms.md +0 -8
- package/docs/examples/messaging/update-smtp-provider.md +0 -15
- package/docs/examples/messaging/update-telesign-provider.md +0 -7
- package/docs/examples/messaging/update-textmagic-provider.md +0 -7
- package/docs/examples/messaging/update-topic.md +0 -4
- package/docs/examples/messaging/update-twilio-provider.md +0 -7
- package/docs/examples/messaging/update-vonage-provider.md +0 -7
- package/docs/examples/migrations/create-appwrite-migration.md +0 -5
- package/docs/examples/migrations/create-csv-migration.md +0 -4
- package/docs/examples/migrations/create-firebase-migration.md +0 -3
- package/docs/examples/migrations/create-n-host-migration.md +0 -9
- package/docs/examples/migrations/create-supabase-migration.md +0 -8
- package/docs/examples/migrations/delete.md +0 -2
- package/docs/examples/migrations/get-appwrite-report.md +0 -5
- package/docs/examples/migrations/get-firebase-report.md +0 -3
- package/docs/examples/migrations/get-n-host-report.md +0 -9
- package/docs/examples/migrations/get-supabase-report.md +0 -8
- package/docs/examples/migrations/get.md +0 -2
- package/docs/examples/migrations/list.md +0 -3
- package/docs/examples/migrations/retry.md +0 -2
- package/docs/examples/project/create-variable.md +0 -4
- package/docs/examples/project/delete-variable.md +0 -2
- package/docs/examples/project/get-usage.md +0 -4
- package/docs/examples/project/get-variable.md +0 -2
- package/docs/examples/project/list-variables.md +0 -1
- package/docs/examples/project/update-variable.md +0 -5
- package/docs/examples/projects/create-dev-key.md +0 -4
- package/docs/examples/projects/create-j-w-t.md +0 -4
- package/docs/examples/projects/create-key.md +0 -5
- package/docs/examples/projects/create-platform.md +0 -7
- package/docs/examples/projects/create-smtp-test.md +0 -11
- package/docs/examples/projects/create-webhook.md +0 -9
- package/docs/examples/projects/create.md +0 -14
- package/docs/examples/projects/delete-dev-key.md +0 -3
- package/docs/examples/projects/delete-email-template.md +0 -4
- package/docs/examples/projects/delete-key.md +0 -3
- package/docs/examples/projects/delete-platform.md +0 -3
- package/docs/examples/projects/delete-sms-template.md +0 -4
- package/docs/examples/projects/delete-webhook.md +0 -3
- package/docs/examples/projects/delete.md +0 -2
- package/docs/examples/projects/get-dev-key.md +0 -3
- package/docs/examples/projects/get-email-template.md +0 -4
- package/docs/examples/projects/get-key.md +0 -3
- package/docs/examples/projects/get-platform.md +0 -3
- package/docs/examples/projects/get-sms-template.md +0 -4
- package/docs/examples/projects/get-webhook.md +0 -3
- package/docs/examples/projects/get.md +0 -2
- package/docs/examples/projects/list-dev-keys.md +0 -3
- package/docs/examples/projects/list-keys.md +0 -2
- package/docs/examples/projects/list-platforms.md +0 -2
- package/docs/examples/projects/list-webhooks.md +0 -2
- package/docs/examples/projects/list.md +0 -3
- package/docs/examples/projects/update-api-status-all.md +0 -3
- package/docs/examples/projects/update-api-status.md +0 -4
- package/docs/examples/projects/update-auth-duration.md +0 -3
- package/docs/examples/projects/update-auth-limit.md +0 -3
- package/docs/examples/projects/update-auth-password-dictionary.md +0 -3
- package/docs/examples/projects/update-auth-password-history.md +0 -3
- package/docs/examples/projects/update-auth-sessions-limit.md +0 -3
- package/docs/examples/projects/update-auth-status.md +0 -4
- package/docs/examples/projects/update-dev-key.md +0 -5
- package/docs/examples/projects/update-email-template.md +0 -9
- package/docs/examples/projects/update-key.md +0 -6
- package/docs/examples/projects/update-memberships-privacy.md +0 -5
- package/docs/examples/projects/update-mock-numbers.md +0 -3
- package/docs/examples/projects/update-o-auth2.md +0 -6
- package/docs/examples/projects/update-personal-data-check.md +0 -3
- package/docs/examples/projects/update-platform.md +0 -7
- package/docs/examples/projects/update-service-status-all.md +0 -3
- package/docs/examples/projects/update-service-status.md +0 -4
- package/docs/examples/projects/update-session-alerts.md +0 -3
- package/docs/examples/projects/update-session-invalidation.md +0 -3
- package/docs/examples/projects/update-sms-template.md +0 -5
- package/docs/examples/projects/update-smtp.md +0 -11
- package/docs/examples/projects/update-team.md +0 -3
- package/docs/examples/projects/update-webhook-signature.md +0 -3
- package/docs/examples/projects/update-webhook.md +0 -10
- package/docs/examples/projects/update.md +0 -12
- package/docs/examples/proxy/create-a-p-i-rule.md +0 -2
- package/docs/examples/proxy/create-function-rule.md +0 -4
- package/docs/examples/proxy/create-redirect-rule.md +0 -6
- package/docs/examples/proxy/create-site-rule.md +0 -4
- package/docs/examples/proxy/delete-rule.md +0 -2
- package/docs/examples/proxy/get-rule.md +0 -2
- package/docs/examples/proxy/list-rules.md +0 -3
- package/docs/examples/proxy/update-rule-verification.md +0 -2
- package/docs/examples/sites/create-deployment.md +0 -7
- package/docs/examples/sites/create-duplicate-deployment.md +0 -3
- package/docs/examples/sites/create-template-deployment.md +0 -7
- package/docs/examples/sites/create-variable.md +0 -5
- package/docs/examples/sites/create-vcs-deployment.md +0 -5
- package/docs/examples/sites/create.md +0 -19
- package/docs/examples/sites/delete-deployment.md +0 -3
- package/docs/examples/sites/delete-log.md +0 -3
- package/docs/examples/sites/delete-variable.md +0 -3
- package/docs/examples/sites/delete.md +0 -2
- package/docs/examples/sites/get-deployment-download.md +0 -4
- package/docs/examples/sites/get-deployment.md +0 -3
- package/docs/examples/sites/get-log.md +0 -3
- package/docs/examples/sites/get-template.md +0 -2
- package/docs/examples/sites/get-usage.md +0 -3
- package/docs/examples/sites/get-variable.md +0 -3
- package/docs/examples/sites/get.md +0 -2
- package/docs/examples/sites/list-deployments.md +0 -4
- package/docs/examples/sites/list-frameworks.md +0 -1
- package/docs/examples/sites/list-logs.md +0 -3
- package/docs/examples/sites/list-specifications.md +0 -1
- package/docs/examples/sites/list-templates.md +0 -5
- package/docs/examples/sites/list-usage.md +0 -2
- package/docs/examples/sites/list-variables.md +0 -2
- package/docs/examples/sites/list.md +0 -3
- package/docs/examples/sites/update-deployment-status.md +0 -3
- package/docs/examples/sites/update-site-deployment.md +0 -3
- package/docs/examples/sites/update-variable.md +0 -6
- package/docs/examples/sites/update.md +0 -19
- package/docs/examples/storage/create-bucket.md +0 -11
- package/docs/examples/storage/create-file.md +0 -5
- package/docs/examples/storage/delete-bucket.md +0 -2
- package/docs/examples/storage/delete-file.md +0 -3
- package/docs/examples/storage/get-bucket-usage.md +0 -3
- package/docs/examples/storage/get-bucket.md +0 -2
- package/docs/examples/storage/get-file-download.md +0 -4
- package/docs/examples/storage/get-file-preview.md +0 -15
- package/docs/examples/storage/get-file-view.md +0 -4
- package/docs/examples/storage/get-file.md +0 -3
- package/docs/examples/storage/get-usage.md +0 -2
- package/docs/examples/storage/list-buckets.md +0 -3
- package/docs/examples/storage/list-files.md +0 -4
- package/docs/examples/storage/update-bucket.md +0 -11
- package/docs/examples/storage/update-file.md +0 -5
- package/docs/examples/tables/create-boolean-column.md +0 -7
- package/docs/examples/tables/create-datetime-column.md +0 -7
- package/docs/examples/tables/create-email-column.md +0 -7
- package/docs/examples/tables/create-enum-column.md +0 -8
- package/docs/examples/tables/create-float-column.md +0 -9
- package/docs/examples/tables/create-index.md +0 -8
- package/docs/examples/tables/create-integer-column.md +0 -9
- package/docs/examples/tables/create-ip-column.md +0 -7
- package/docs/examples/tables/create-relationship-column.md +0 -9
- package/docs/examples/tables/create-row.md +0 -6
- package/docs/examples/tables/create-rows.md +0 -4
- package/docs/examples/tables/create-string-column.md +0 -9
- package/docs/examples/tables/create-url-column.md +0 -7
- package/docs/examples/tables/create.md +0 -7
- package/docs/examples/tables/decrement-row-column.md +0 -7
- package/docs/examples/tables/delete-column.md +0 -4
- package/docs/examples/tables/delete-index.md +0 -4
- package/docs/examples/tables/delete-row.md +0 -4
- package/docs/examples/tables/delete-rows.md +0 -4
- package/docs/examples/tables/delete.md +0 -3
- package/docs/examples/tables/get-column.md +0 -4
- package/docs/examples/tables/get-index.md +0 -4
- package/docs/examples/tables/get-row.md +0 -5
- package/docs/examples/tables/get-usage.md +0 -4
- package/docs/examples/tables/get.md +0 -3
- package/docs/examples/tables/increment-row-column.md +0 -7
- package/docs/examples/tables/list-columns.md +0 -4
- package/docs/examples/tables/list-indexes.md +0 -4
- package/docs/examples/tables/list-logs.md +0 -4
- package/docs/examples/tables/list-row-logs.md +0 -5
- package/docs/examples/tables/list-rows.md +0 -4
- package/docs/examples/tables/list.md +0 -4
- package/docs/examples/tables/update-boolean-column.md +0 -7
- package/docs/examples/tables/update-datetime-column.md +0 -7
- package/docs/examples/tables/update-email-column.md +0 -7
- package/docs/examples/tables/update-enum-column.md +0 -8
- package/docs/examples/tables/update-float-column.md +0 -9
- package/docs/examples/tables/update-integer-column.md +0 -9
- package/docs/examples/tables/update-ip-column.md +0 -7
- package/docs/examples/tables/update-relationship-column.md +0 -6
- package/docs/examples/tables/update-row.md +0 -6
- package/docs/examples/tables/update-rows.md +0 -5
- package/docs/examples/tables/update-string-column.md +0 -8
- package/docs/examples/tables/update-url-column.md +0 -7
- package/docs/examples/tables/update.md +0 -7
- package/docs/examples/tables/upsert-row.md +0 -4
- package/docs/examples/tables/upsert-rows.md +0 -3
- package/docs/examples/teams/create-membership.md +0 -8
- package/docs/examples/teams/create.md +0 -4
- package/docs/examples/teams/delete-membership.md +0 -3
- package/docs/examples/teams/delete.md +0 -2
- package/docs/examples/teams/get-membership.md +0 -3
- package/docs/examples/teams/get-prefs.md +0 -2
- package/docs/examples/teams/get.md +0 -2
- package/docs/examples/teams/list-logs.md +0 -3
- package/docs/examples/teams/list-memberships.md +0 -4
- package/docs/examples/teams/list.md +0 -3
- package/docs/examples/teams/update-membership-status.md +0 -5
- package/docs/examples/teams/update-membership.md +0 -4
- package/docs/examples/teams/update-name.md +0 -3
- package/docs/examples/teams/update-prefs.md +0 -3
- package/docs/examples/tokens/create-file-token.md +0 -4
- package/docs/examples/tokens/delete.md +0 -2
- package/docs/examples/tokens/get.md +0 -2
- package/docs/examples/tokens/list.md +0 -4
- package/docs/examples/tokens/update.md +0 -3
- package/docs/examples/users/create-argon2user.md +0 -5
- package/docs/examples/users/create-bcrypt-user.md +0 -5
- package/docs/examples/users/create-j-w-t.md +0 -4
- package/docs/examples/users/create-m-d5user.md +0 -5
- package/docs/examples/users/create-mfa-recovery-codes.md +0 -2
- package/docs/examples/users/create-p-h-pass-user.md +0 -5
- package/docs/examples/users/create-s-h-a-user.md +0 -6
- package/docs/examples/users/create-scrypt-modified-user.md +0 -8
- package/docs/examples/users/create-scrypt-user.md +0 -10
- package/docs/examples/users/create-session.md +0 -2
- package/docs/examples/users/create-target.md +0 -7
- package/docs/examples/users/create-token.md +0 -4
- package/docs/examples/users/create.md +0 -6
- package/docs/examples/users/delete-identity.md +0 -2
- package/docs/examples/users/delete-mfa-authenticator.md +0 -3
- package/docs/examples/users/delete-session.md +0 -3
- package/docs/examples/users/delete-sessions.md +0 -2
- package/docs/examples/users/delete-target.md +0 -3
- package/docs/examples/users/delete.md +0 -2
- package/docs/examples/users/get-mfa-recovery-codes.md +0 -2
- package/docs/examples/users/get-prefs.md +0 -2
- package/docs/examples/users/get-target.md +0 -3
- package/docs/examples/users/get-usage.md +0 -2
- package/docs/examples/users/get.md +0 -2
- package/docs/examples/users/list-identities.md +0 -3
- package/docs/examples/users/list-logs.md +0 -3
- package/docs/examples/users/list-memberships.md +0 -4
- package/docs/examples/users/list-mfa-factors.md +0 -2
- package/docs/examples/users/list-sessions.md +0 -2
- package/docs/examples/users/list-targets.md +0 -3
- package/docs/examples/users/list.md +0 -3
- package/docs/examples/users/update-email-verification.md +0 -3
- package/docs/examples/users/update-email.md +0 -3
- package/docs/examples/users/update-labels.md +0 -3
- package/docs/examples/users/update-mfa-recovery-codes.md +0 -2
- package/docs/examples/users/update-mfa.md +0 -3
- package/docs/examples/users/update-name.md +0 -3
- package/docs/examples/users/update-password.md +0 -3
- package/docs/examples/users/update-phone-verification.md +0 -3
- package/docs/examples/users/update-phone.md +0 -3
- package/docs/examples/users/update-prefs.md +0 -3
- package/docs/examples/users/update-status.md +0 -3
- package/docs/examples/users/update-target.md +0 -6
- package/docs/examples/vcs/create-repository-detection.md +0 -5
- package/docs/examples/vcs/create-repository.md +0 -4
- package/docs/examples/vcs/delete-installation.md +0 -2
- package/docs/examples/vcs/get-installation.md +0 -2
- package/docs/examples/vcs/get-repository-contents.md +0 -5
- package/docs/examples/vcs/get-repository.md +0 -3
- package/docs/examples/vcs/list-installations.md +0 -3
- package/docs/examples/vcs/list-repositories.md +0 -4
- package/docs/examples/vcs/list-repository-branches.md +0 -3
- package/docs/examples/vcs/update-external-deployments.md +0 -4
- package/functions/Starter function/.prettierrc.json +0 -6
- package/functions/Starter function/README.md +0 -48
- package/functions/Starter function/package-lock.json +0 -60
- package/functions/Starter function/package.json +0 -16
- package/functions/Starter function/src/main.js +0 -35
- package/generate/appwrite.d.ts +0 -55
- package/generate/appwrite.db.ts +0 -75
- package/index.js +0 -109
- package/lib/client-generation/languages/typescript.js +0 -65
- package/lib/client.js +0 -259
- package/lib/commands/account.js +0 -2074
- package/lib/commands/avatars.js +0 -491
- package/lib/commands/console.js +0 -129
- package/lib/commands/databases.js +0 -2972
- package/lib/commands/functions.js +0 -1737
- package/lib/commands/generic.js +0 -328
- package/lib/commands/graphql.js +0 -128
- package/lib/commands/health.js +0 -891
- package/lib/commands/init.js +0 -566
- package/lib/commands/locale.js +0 -324
- package/lib/commands/messaging.js +0 -2970
- package/lib/commands/migrations.js +0 -751
- package/lib/commands/organizations.js +0 -48
- package/lib/commands/project.js +0 -308
- package/lib/commands/projects.js +0 -2615
- package/lib/commands/proxy.js +0 -406
- package/lib/commands/pull.js +0 -474
- package/lib/commands/push.js +0 -2117
- package/lib/commands/run.js +0 -330
- package/lib/commands/sites.js +0 -1663
- package/lib/commands/storage.js +0 -990
- package/lib/commands/tables.js +0 -2607
- package/lib/commands/teams.js +0 -682
- package/lib/commands/tokens.js +0 -261
- package/lib/commands/types.js +0 -191
- package/lib/commands/users.js +0 -2035
- package/lib/commands/vcs.js +0 -484
- package/lib/config.js +0 -717
- package/lib/emulation/docker.js +0 -264
- package/lib/emulation/utils.js +0 -186
- package/lib/exception.js +0 -9
- package/lib/id.js +0 -30
- package/lib/paginate.js +0 -52
- package/lib/parser.js +0 -246
- package/lib/questions.js +0 -1006
- package/lib/sdks.js +0 -60
- package/lib/spinner.js +0 -104
- package/lib/type-generation/attribute.js +0 -16
- package/lib/type-generation/languages/dart.js +0 -196
- package/lib/type-generation/languages/java.js +0 -130
- package/lib/type-generation/languages/javascript.js +0 -102
- package/lib/type-generation/languages/kotlin.js +0 -85
- package/lib/type-generation/languages/language.js +0 -125
- package/lib/type-generation/languages/php.js +0 -110
- package/lib/type-generation/languages/swift.js +0 -169
- package/lib/type-generation/languages/typescript.js +0 -105
- package/lib/utils.js +0 -289
- package/lib/validations.js +0 -17
- package/scoop/appwrite.json +0 -30
- package/sites/JavaScript starter2/.env.example +0 -3
- package/sites/JavaScript starter2/LICENSE +0 -21
- package/sites/JavaScript starter2/images/appwrite.svg +0 -8
- package/sites/JavaScript starter2/images/javascript.svg +0 -5
- package/sites/JavaScript starter2/index.html +0 -250
- package/sites/JavaScript starter2/lib/appwrite.js +0 -10
- package/sites/JavaScript starter2/package-lock.json +0 -1431
- package/sites/JavaScript starter2/package.json +0 -21
- package/sites/JavaScript starter2/readme.md +0 -26
- package/sites/JavaScript starter2/src/javascript.svg +0 -1
- package/sites/JavaScript starter2/style/app.css +0 -20
- package/sites/JavaScript starter2/vite.config.js +0 -7
package/lib/questions.js
DELETED
|
@@ -1,1006 +0,0 @@
|
|
|
1
|
-
const chalk = require("chalk");
|
|
2
|
-
const Client = require("./client");
|
|
3
|
-
const { localConfig, globalConfig } = require('./config');
|
|
4
|
-
const { projectsList } = require('./commands/projects');
|
|
5
|
-
const { organizationsList } = require('./commands/organizations');
|
|
6
|
-
const { teamsList } = require('./commands/teams');
|
|
7
|
-
const { functionsListRuntimes, functionsListSpecifications, functionsList } = require('./commands/functions');
|
|
8
|
-
const { accountListMfaFactors } = require("./commands/account");
|
|
9
|
-
const { sdkForConsole } = require("./sdks");
|
|
10
|
-
const { validateRequired } = require("./validations");
|
|
11
|
-
const { paginate } = require('./paginate');
|
|
12
|
-
const { isPortTaken } = require('./utils');
|
|
13
|
-
const { databasesList } = require('./commands/databases');
|
|
14
|
-
const { checkDeployConditions, isCloud } = require('./utils');
|
|
15
|
-
const JSONbig = require("json-bigint")({ storeAsString: false });
|
|
16
|
-
const { sitesListFrameworks, sitesListSpecifications, sitesList } = require('./commands/sites');
|
|
17
|
-
|
|
18
|
-
const whenOverride = (answers) => answers.override === undefined ? true : answers.override;
|
|
19
|
-
|
|
20
|
-
const getIgnores = (runtime) => {
|
|
21
|
-
const languge = runtime.split("-").slice(0, -1).join("-");
|
|
22
|
-
|
|
23
|
-
switch (languge) {
|
|
24
|
-
case 'cpp':
|
|
25
|
-
return ['build', 'CMakeFiles', 'CMakeCaches.txt'];
|
|
26
|
-
case 'dart':
|
|
27
|
-
return ['.packages', '.dart_tool'];
|
|
28
|
-
case 'deno':
|
|
29
|
-
return [];
|
|
30
|
-
case 'dotnet':
|
|
31
|
-
return ['bin', 'obj', '.nuget'];
|
|
32
|
-
case 'java':
|
|
33
|
-
case 'kotlin':
|
|
34
|
-
return ['build'];
|
|
35
|
-
case 'node':
|
|
36
|
-
case 'bun':
|
|
37
|
-
return ['node_modules', '.npm'];
|
|
38
|
-
case 'php':
|
|
39
|
-
return ['vendor'];
|
|
40
|
-
case 'python':
|
|
41
|
-
case 'python-ml':
|
|
42
|
-
return ['__pypackages__'];
|
|
43
|
-
case 'ruby':
|
|
44
|
-
return ['vendor'];
|
|
45
|
-
case 'rust':
|
|
46
|
-
return ['target', 'debug', '*.rs.bk', '*.pdb'];
|
|
47
|
-
case 'swift':
|
|
48
|
-
return ['.build', '.swiftpm'];
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return [];
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const getEntrypoint = (runtime) => {
|
|
55
|
-
const languge = runtime.split("-").slice(0, -1).join("-");
|
|
56
|
-
|
|
57
|
-
switch (languge) {
|
|
58
|
-
case 'dart':
|
|
59
|
-
return 'lib/main.dart';
|
|
60
|
-
case 'deno':
|
|
61
|
-
return 'src/main.ts';
|
|
62
|
-
case 'node':
|
|
63
|
-
return 'src/main.js';
|
|
64
|
-
case 'bun':
|
|
65
|
-
return 'src/main.ts';
|
|
66
|
-
case 'php':
|
|
67
|
-
return 'src/index.php';
|
|
68
|
-
case 'python':
|
|
69
|
-
case 'python-ml':
|
|
70
|
-
return 'src/main.py';
|
|
71
|
-
case 'ruby':
|
|
72
|
-
return 'lib/main.rb';
|
|
73
|
-
case 'rust':
|
|
74
|
-
return 'main.rs';
|
|
75
|
-
case 'swift':
|
|
76
|
-
return 'Sources/index.swift';
|
|
77
|
-
case 'cpp':
|
|
78
|
-
return 'src/main.cc';
|
|
79
|
-
case 'dotnet':
|
|
80
|
-
return 'src/Index.cs';
|
|
81
|
-
case 'java':
|
|
82
|
-
return 'src/Main.java';
|
|
83
|
-
case 'kotlin':
|
|
84
|
-
return 'src/Main.kt';
|
|
85
|
-
case 'go':
|
|
86
|
-
return 'main.go';
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return undefined;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const getInstallCommand = (runtime) => {
|
|
93
|
-
const languge = runtime.split("-").slice(0, -1).join("-");
|
|
94
|
-
|
|
95
|
-
switch (languge) {
|
|
96
|
-
case 'dart':
|
|
97
|
-
return 'dart pub get';
|
|
98
|
-
case 'deno':
|
|
99
|
-
return "deno cache src/main.ts";
|
|
100
|
-
case 'node':
|
|
101
|
-
return 'npm install';
|
|
102
|
-
case 'bun':
|
|
103
|
-
return 'bun install';
|
|
104
|
-
case 'php':
|
|
105
|
-
return 'composer install';
|
|
106
|
-
case 'python':
|
|
107
|
-
case 'python-ml':
|
|
108
|
-
return 'pip install -r requirements.txt';
|
|
109
|
-
case 'ruby':
|
|
110
|
-
return 'bundle install';
|
|
111
|
-
case 'rust':
|
|
112
|
-
return 'cargo install';
|
|
113
|
-
case 'dotnet':
|
|
114
|
-
return 'dotnet restore';
|
|
115
|
-
case 'swift':
|
|
116
|
-
case 'java':
|
|
117
|
-
case 'kotlin':
|
|
118
|
-
case 'cpp':
|
|
119
|
-
return '';
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
return undefined;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
const questionsInitProject = [
|
|
126
|
-
{
|
|
127
|
-
type: "confirm",
|
|
128
|
-
name: "override",
|
|
129
|
-
message:
|
|
130
|
-
`An Appwrite project ( ${localConfig.getProject()['projectId']} ) is already associated with the current directory. Would you like to override`,
|
|
131
|
-
when() {
|
|
132
|
-
return Object.keys(localConfig.getProject()).length !== 0;
|
|
133
|
-
}
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
type: "list",
|
|
137
|
-
name: "start",
|
|
138
|
-
when: whenOverride,
|
|
139
|
-
message: "How would you like to start?",
|
|
140
|
-
choices: [
|
|
141
|
-
{
|
|
142
|
-
name: "Create new project",
|
|
143
|
-
value: "new"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "Link directory to an existing project",
|
|
147
|
-
value: "existing"
|
|
148
|
-
}
|
|
149
|
-
]
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
type: "search-list",
|
|
153
|
-
name: "organization",
|
|
154
|
-
message: "Choose your organization",
|
|
155
|
-
choices: async () => {
|
|
156
|
-
let client = await sdkForConsole(true);
|
|
157
|
-
const { teams } = isCloud()
|
|
158
|
-
? await paginate(organizationsList, { parseOutput: false, sdk: client }, 100, 'teams')
|
|
159
|
-
: await paginate(teamsList, { parseOutput: false, sdk: client }, 100, 'teams');
|
|
160
|
-
|
|
161
|
-
let choices = teams.map((team, idx) => {
|
|
162
|
-
return {
|
|
163
|
-
name: `${team.name} (${team['$id']})`,
|
|
164
|
-
value: team['$id']
|
|
165
|
-
}
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
if (choices.length == 0) {
|
|
169
|
-
throw new Error(`No organizations found. Please create a new organization at ${globalConfig.getEndpoint().replace('/v1', '/console/onboarding')}`)
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
return choices;
|
|
173
|
-
},
|
|
174
|
-
when: whenOverride
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
type: "input",
|
|
178
|
-
name: "project",
|
|
179
|
-
message: "What would you like to name your project?",
|
|
180
|
-
default: "My Awesome Project",
|
|
181
|
-
when: (answer) => answer.start !== 'existing'
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
type: "input",
|
|
185
|
-
name: "id",
|
|
186
|
-
message: "What ID would you like to have for your project?",
|
|
187
|
-
default: "unique()",
|
|
188
|
-
when: (answer) => answer.start !== 'existing'
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
type: "search-list",
|
|
192
|
-
name: "project",
|
|
193
|
-
message: "Choose your Appwrite project.",
|
|
194
|
-
choices: async (answers) => {
|
|
195
|
-
const queries = [
|
|
196
|
-
JSON.stringify({ method: 'equal', attribute: 'teamId', values: [answers.organization] }),
|
|
197
|
-
JSON.stringify({ method: 'orderDesc', attribute: '$id' })
|
|
198
|
-
]
|
|
199
|
-
|
|
200
|
-
const { projects } = await paginate(projectsList, { parseOutput: false }, 100, 'projects', queries);
|
|
201
|
-
|
|
202
|
-
let choices = projects.map((project) => {
|
|
203
|
-
return {
|
|
204
|
-
name: `${project.name} (${project['$id']})`,
|
|
205
|
-
value: {
|
|
206
|
-
"$id": project['$id'],
|
|
207
|
-
"region": project.region || ''
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
})
|
|
211
|
-
|
|
212
|
-
if (choices.length === 0) {
|
|
213
|
-
throw new Error("No projects found. Please create a new project.")
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
return choices;
|
|
217
|
-
},
|
|
218
|
-
when: (answer) => answer.start === 'existing'
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
type: "list",
|
|
222
|
-
name: "region",
|
|
223
|
-
message: "Select your Appwrite Cloud region",
|
|
224
|
-
choices: async () => {
|
|
225
|
-
let client = await sdkForConsole(true);
|
|
226
|
-
let response = await client.call("GET", "/console/regions");
|
|
227
|
-
let regions = response.regions || [];
|
|
228
|
-
if (!regions.length) {
|
|
229
|
-
throw new Error("No regions found. Please check your network or Appwrite Cloud availability.");
|
|
230
|
-
}
|
|
231
|
-
return regions.filter(region => !region.disabled).map(region => ({
|
|
232
|
-
name: `${region.name} (${region.$id})`,
|
|
233
|
-
value: region.$id
|
|
234
|
-
}));
|
|
235
|
-
},
|
|
236
|
-
when: (answer) => {
|
|
237
|
-
if (answer.start === 'existing') return false;
|
|
238
|
-
return isCloud();
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
];
|
|
242
|
-
const questionsInitProjectAutopull = [
|
|
243
|
-
{
|
|
244
|
-
type: "confirm",
|
|
245
|
-
name: "autopull",
|
|
246
|
-
message:
|
|
247
|
-
`Would you like to pull all resources from project you just linked?`
|
|
248
|
-
},
|
|
249
|
-
];
|
|
250
|
-
const questionsPullResources = [
|
|
251
|
-
{
|
|
252
|
-
type: "list",
|
|
253
|
-
name: "resource",
|
|
254
|
-
message: "Which resources would you like to pull?",
|
|
255
|
-
choices: [
|
|
256
|
-
{ name: `Settings ${chalk.blackBright(`(Project)`)}`, value: 'settings' },
|
|
257
|
-
{ name: `Functions ${chalk.blackBright(`(Deployment)`)}`, value: 'functions' },
|
|
258
|
-
{ name: `Collections ${chalk.blackBright(`(Databases)`)}`, value: 'collections' },
|
|
259
|
-
{ name: `Buckets ${chalk.blackBright(`(Storage)`)}`, value: 'buckets' },
|
|
260
|
-
{ name: `Teams ${chalk.blackBright(`(Auth)`)}`, value: 'teams' },
|
|
261
|
-
{ name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' }
|
|
262
|
-
]
|
|
263
|
-
}
|
|
264
|
-
]
|
|
265
|
-
|
|
266
|
-
const questionsPullFunctions = [
|
|
267
|
-
{
|
|
268
|
-
type: "checkbox",
|
|
269
|
-
name: "functions",
|
|
270
|
-
message: "Which functions would you like to pull?",
|
|
271
|
-
validate: (value) => validateRequired('function', value),
|
|
272
|
-
choices: async () => {
|
|
273
|
-
const { functions } = await paginate(functionsList, { parseOutput: false }, 100, 'functions');
|
|
274
|
-
|
|
275
|
-
if (functions.length === 0) {
|
|
276
|
-
throw "We couldn't find any functions in your Appwrite project";
|
|
277
|
-
}
|
|
278
|
-
return functions.map(func => {
|
|
279
|
-
return {
|
|
280
|
-
name: `${func.name} (${func.$id})`,
|
|
281
|
-
value: { ...func }
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
];
|
|
287
|
-
|
|
288
|
-
const questionsPullFunctionsCode = [
|
|
289
|
-
{
|
|
290
|
-
type: "confirm",
|
|
291
|
-
name: "override",
|
|
292
|
-
message: "Do you want to pull source code of the latest deployment?"
|
|
293
|
-
},
|
|
294
|
-
];
|
|
295
|
-
|
|
296
|
-
const questionsPullSites = [
|
|
297
|
-
{
|
|
298
|
-
type: "checkbox",
|
|
299
|
-
name: "sites",
|
|
300
|
-
message: "Which sites would you like to pull?",
|
|
301
|
-
validate: (value) => validateRequired('site', value),
|
|
302
|
-
choices: async () => {
|
|
303
|
-
const { sites } = await paginate(sitesList, { parseOutput: false }, 100, 'sites');
|
|
304
|
-
|
|
305
|
-
if (sites.length === 0) {
|
|
306
|
-
throw "We couldn't find any sites in your Appwrite project";
|
|
307
|
-
}
|
|
308
|
-
return sites.map(site => {
|
|
309
|
-
return {
|
|
310
|
-
name: `${site.name} (${site.$id})`,
|
|
311
|
-
value: { ...site }
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
];
|
|
317
|
-
|
|
318
|
-
const questionsPullSitesCode = [
|
|
319
|
-
{
|
|
320
|
-
type: "confirm",
|
|
321
|
-
name: "override",
|
|
322
|
-
message: "Do you want to pull source code of the latest deployment?"
|
|
323
|
-
},
|
|
324
|
-
];
|
|
325
|
-
|
|
326
|
-
const questionsCreateFunction = [
|
|
327
|
-
{
|
|
328
|
-
type: "input",
|
|
329
|
-
name: "name",
|
|
330
|
-
message: "What would you like to name your function?",
|
|
331
|
-
default: "My Awesome Function"
|
|
332
|
-
},
|
|
333
|
-
{
|
|
334
|
-
type: "input",
|
|
335
|
-
name: "id",
|
|
336
|
-
message: "What ID would you like to have for your function?",
|
|
337
|
-
default: "unique()"
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
type: "list",
|
|
341
|
-
name: "runtime",
|
|
342
|
-
message: "What runtime would you like to use?",
|
|
343
|
-
choices: async () => {
|
|
344
|
-
let response = await functionsListRuntimes({
|
|
345
|
-
parseOutput: false
|
|
346
|
-
})
|
|
347
|
-
let runtimes = response["runtimes"]
|
|
348
|
-
let choices = runtimes.map((runtime, idx) => {
|
|
349
|
-
return {
|
|
350
|
-
name: `${runtime.name} (${runtime['$id']})`,
|
|
351
|
-
value: {
|
|
352
|
-
id: runtime['$id'],
|
|
353
|
-
name: runtime['$id'].split('-')[0],
|
|
354
|
-
entrypoint: getEntrypoint(runtime['$id']),
|
|
355
|
-
ignore: getIgnores(runtime['$id']),
|
|
356
|
-
commands: getInstallCommand(runtime['$id'])
|
|
357
|
-
},
|
|
358
|
-
}
|
|
359
|
-
})
|
|
360
|
-
return choices;
|
|
361
|
-
},
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
type: "list",
|
|
365
|
-
name: "specification",
|
|
366
|
-
message: "What specification would you like to use?",
|
|
367
|
-
choices: async () => {
|
|
368
|
-
let response = await functionsListSpecifications({
|
|
369
|
-
parseOutput: false
|
|
370
|
-
})
|
|
371
|
-
let specifications = response["specifications"]
|
|
372
|
-
let choices = specifications.map((spec, idx) => {
|
|
373
|
-
return {
|
|
374
|
-
name: `${spec.cpus} CPU, ${spec.memory}MB RAM`,
|
|
375
|
-
value: spec.slug,
|
|
376
|
-
disabled: spec.enabled === false ? 'Upgrade to use' : false
|
|
377
|
-
}
|
|
378
|
-
})
|
|
379
|
-
return choices;
|
|
380
|
-
},
|
|
381
|
-
}
|
|
382
|
-
];
|
|
383
|
-
|
|
384
|
-
const questionsCreateFunctionSelectTemplate = (templates) => {
|
|
385
|
-
return [
|
|
386
|
-
{
|
|
387
|
-
type: "search-list",
|
|
388
|
-
name: "template",
|
|
389
|
-
message: "What template would you like to use?",
|
|
390
|
-
choices: templates.map((template) => {
|
|
391
|
-
const name = `${template[0].toUpperCase()}${template.split('').slice(1).join('')}`.replace(/[-_]/g, ' ');
|
|
392
|
-
|
|
393
|
-
return { value: template, name }
|
|
394
|
-
})
|
|
395
|
-
}
|
|
396
|
-
];
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
const questionsCreateBucket = [
|
|
402
|
-
{
|
|
403
|
-
type: "input",
|
|
404
|
-
name: "bucket",
|
|
405
|
-
message: "What would you like to name your bucket?",
|
|
406
|
-
default: "My Awesome Bucket"
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
type: "input",
|
|
410
|
-
name: "id",
|
|
411
|
-
message: "What ID would you like to have for your bucket?",
|
|
412
|
-
default: "unique()"
|
|
413
|
-
},
|
|
414
|
-
{
|
|
415
|
-
type: "list",
|
|
416
|
-
name: "fileSecurity",
|
|
417
|
-
message: "Enable File-Security configuring permissions for individual file",
|
|
418
|
-
choices: ["No", "Yes"]
|
|
419
|
-
}
|
|
420
|
-
];
|
|
421
|
-
|
|
422
|
-
const questionsCreateTeam = [
|
|
423
|
-
{
|
|
424
|
-
type: "input",
|
|
425
|
-
name: "bucket",
|
|
426
|
-
message: "What would you like to name your team?",
|
|
427
|
-
default: "My Awesome Team"
|
|
428
|
-
},
|
|
429
|
-
{
|
|
430
|
-
type: "input",
|
|
431
|
-
name: "id",
|
|
432
|
-
message: "What ID would you like to have for your team?",
|
|
433
|
-
default: "unique()"
|
|
434
|
-
}
|
|
435
|
-
];
|
|
436
|
-
|
|
437
|
-
const questionsCreateCollection = [
|
|
438
|
-
{
|
|
439
|
-
type: "list",
|
|
440
|
-
name: "method",
|
|
441
|
-
message: "What database would you like to use for your collection",
|
|
442
|
-
choices: ["New", "Existing"],
|
|
443
|
-
when: async () => {
|
|
444
|
-
return localConfig.getDatabases().length !== 0;
|
|
445
|
-
}
|
|
446
|
-
},
|
|
447
|
-
{
|
|
448
|
-
type: "search-list",
|
|
449
|
-
name: "database",
|
|
450
|
-
message: "Choose the collection database",
|
|
451
|
-
choices: async () => {
|
|
452
|
-
const databases = localConfig.getDatabases();
|
|
453
|
-
|
|
454
|
-
let choices = databases.map((database, idx) => {
|
|
455
|
-
return {
|
|
456
|
-
name: `${database.name} (${database.$id})`,
|
|
457
|
-
value: database.$id
|
|
458
|
-
}
|
|
459
|
-
})
|
|
460
|
-
|
|
461
|
-
if (choices.length === 0) {
|
|
462
|
-
throw new Error("No databases found. Please create one in project console.")
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
return choices;
|
|
466
|
-
},
|
|
467
|
-
when: (answers) => (answers.method ?? '').toLowerCase() === 'existing'
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
type: "input",
|
|
471
|
-
name: "databaseName",
|
|
472
|
-
message: "What would you like to name your database?",
|
|
473
|
-
default: "My Awesome Database",
|
|
474
|
-
when: (answers) => (answers.method ?? '').toLowerCase() !== 'existing'
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
type: "input",
|
|
478
|
-
name: "databaseId",
|
|
479
|
-
message: "What ID would you like to have for your database?",
|
|
480
|
-
default: "unique()",
|
|
481
|
-
when: (answers) => (answers.method ?? '').toLowerCase() !== 'existing'
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
type: "input",
|
|
485
|
-
name: "collection",
|
|
486
|
-
message: "What would you like to name your collection?",
|
|
487
|
-
default: "My Awesome Collection"
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
type: "input",
|
|
491
|
-
name: "id",
|
|
492
|
-
message: "What ID would you like to have for your collection?",
|
|
493
|
-
default: "unique()"
|
|
494
|
-
},
|
|
495
|
-
{
|
|
496
|
-
type: "list",
|
|
497
|
-
name: "documentSecurity",
|
|
498
|
-
message: "Enable Document-Security for configuring permissions for individual documents",
|
|
499
|
-
choices: ["No", "Yes"]
|
|
500
|
-
}
|
|
501
|
-
];
|
|
502
|
-
|
|
503
|
-
const questionsCreateMessagingTopic = [
|
|
504
|
-
{
|
|
505
|
-
type: "input",
|
|
506
|
-
name: "topic",
|
|
507
|
-
message: "What would you like to name your messaging topic?",
|
|
508
|
-
default: "My Awesome Topic"
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
type: "input",
|
|
512
|
-
name: "id",
|
|
513
|
-
message: "What ID would you like to have for your messaging topic?",
|
|
514
|
-
default: "unique()"
|
|
515
|
-
}
|
|
516
|
-
];
|
|
517
|
-
|
|
518
|
-
const questionsPullCollection = [
|
|
519
|
-
{
|
|
520
|
-
type: "checkbox",
|
|
521
|
-
name: "databases",
|
|
522
|
-
message: "From which database would you like to pull collections?",
|
|
523
|
-
validate: (value) => validateRequired('collection', value),
|
|
524
|
-
choices: async () => {
|
|
525
|
-
let response = await databasesList({
|
|
526
|
-
parseOutput: false
|
|
527
|
-
})
|
|
528
|
-
let databases = response["databases"]
|
|
529
|
-
|
|
530
|
-
if (databases.length <= 0) {
|
|
531
|
-
throw new Error("No databases found. Please create one in project console.")
|
|
532
|
-
}
|
|
533
|
-
let choices = databases.map((database, idx) => {
|
|
534
|
-
return {
|
|
535
|
-
name: `${database.name} (${database.$id})`,
|
|
536
|
-
value: database.$id
|
|
537
|
-
}
|
|
538
|
-
})
|
|
539
|
-
return choices;
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
];
|
|
543
|
-
|
|
544
|
-
const questionsLogin = [
|
|
545
|
-
{
|
|
546
|
-
type: "list",
|
|
547
|
-
name: "method",
|
|
548
|
-
message: "What you like to do?",
|
|
549
|
-
choices: [
|
|
550
|
-
{ name: 'Login to an account', value: 'login' },
|
|
551
|
-
{ name: 'Switch to an account', value: 'select' }
|
|
552
|
-
],
|
|
553
|
-
when: () => globalConfig.getSessions().length >= 2
|
|
554
|
-
},
|
|
555
|
-
{
|
|
556
|
-
type: "input",
|
|
557
|
-
name: "email",
|
|
558
|
-
message: "Enter your email",
|
|
559
|
-
validate(value) {
|
|
560
|
-
if (!value) {
|
|
561
|
-
return "Please enter your email";
|
|
562
|
-
}
|
|
563
|
-
return true;
|
|
564
|
-
},
|
|
565
|
-
when: (answers) => answers.method !== 'select'
|
|
566
|
-
},
|
|
567
|
-
{
|
|
568
|
-
type: "password",
|
|
569
|
-
name: "password",
|
|
570
|
-
message: "Enter your password",
|
|
571
|
-
mask: "*",
|
|
572
|
-
validate(value) {
|
|
573
|
-
if (!value) {
|
|
574
|
-
return "Please enter your password";
|
|
575
|
-
}
|
|
576
|
-
return true;
|
|
577
|
-
},
|
|
578
|
-
when: (answers) => answers.method !== 'select'
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
type: "search-list",
|
|
582
|
-
name: "accountId",
|
|
583
|
-
message: "Select an account to use",
|
|
584
|
-
choices() {
|
|
585
|
-
const sessions = globalConfig.getSessions();
|
|
586
|
-
const current = globalConfig.getCurrentSession();
|
|
587
|
-
|
|
588
|
-
const data = [];
|
|
589
|
-
|
|
590
|
-
const longestEmail = sessions.reduce((prev, current) => (prev && (prev.email ?? '').length > (current.email ?? '').length) ? prev : current).email.length;
|
|
591
|
-
|
|
592
|
-
sessions.forEach((session) => {
|
|
593
|
-
if (session.email) {
|
|
594
|
-
data.push({
|
|
595
|
-
current: current === session.id,
|
|
596
|
-
value: session.id,
|
|
597
|
-
name: `${session.email.padEnd(longestEmail)} ${current === session.id ? chalk.green.bold('current') : ' '.repeat(6)} ${session.endpoint}`,
|
|
598
|
-
});
|
|
599
|
-
}
|
|
600
|
-
})
|
|
601
|
-
|
|
602
|
-
return data.sort((a, b) => Number(b.current) - Number(a.current))
|
|
603
|
-
},
|
|
604
|
-
when: (answers) => answers.method === 'select'
|
|
605
|
-
},
|
|
606
|
-
];
|
|
607
|
-
const questionGetEndpoint = [
|
|
608
|
-
{
|
|
609
|
-
type: "input",
|
|
610
|
-
name: "endpoint",
|
|
611
|
-
message: "Enter the endpoint of your Appwrite server",
|
|
612
|
-
default: "http://localhost/v1",
|
|
613
|
-
async validate(value) {
|
|
614
|
-
if (!value) {
|
|
615
|
-
return "Please enter a valid endpoint.";
|
|
616
|
-
}
|
|
617
|
-
let client = new Client().setEndpoint(value);
|
|
618
|
-
try {
|
|
619
|
-
let response = await client.call('get', '/health/version');
|
|
620
|
-
if (response.version) {
|
|
621
|
-
return true;
|
|
622
|
-
} else {
|
|
623
|
-
throw new Error();
|
|
624
|
-
}
|
|
625
|
-
} catch (error) {
|
|
626
|
-
return "Invalid endpoint or your Appwrite server is not running as expected.";
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
];
|
|
631
|
-
|
|
632
|
-
const questionsLogout = [
|
|
633
|
-
{
|
|
634
|
-
type: "checkbox",
|
|
635
|
-
name: "accounts",
|
|
636
|
-
message: "Select accounts to logout from",
|
|
637
|
-
validate: (value) => validateRequired('account', value),
|
|
638
|
-
choices() {
|
|
639
|
-
const sessions = globalConfig.getSessions();
|
|
640
|
-
const current = globalConfig.getCurrentSession();
|
|
641
|
-
|
|
642
|
-
const data = [];
|
|
643
|
-
|
|
644
|
-
const longestEmail = sessions.reduce((prev, current) => (prev && (prev.email ?? '').length > (current.email ?? '').length) ? prev : current).email.length;
|
|
645
|
-
|
|
646
|
-
sessions.forEach((session) => {
|
|
647
|
-
if (session.email) {
|
|
648
|
-
data.push({
|
|
649
|
-
current: current === session.id,
|
|
650
|
-
value: session.id,
|
|
651
|
-
name: `${session.email.padEnd(longestEmail)} ${current === session.id ? chalk.green.bold('current') : ' '.repeat(6)} ${session.endpoint}`,
|
|
652
|
-
});
|
|
653
|
-
}
|
|
654
|
-
})
|
|
655
|
-
|
|
656
|
-
return data.sort((a, b) => Number(b.current) - Number(a.current))
|
|
657
|
-
}
|
|
658
|
-
}
|
|
659
|
-
];
|
|
660
|
-
|
|
661
|
-
const questionsPushResources = [
|
|
662
|
-
{
|
|
663
|
-
type: "list",
|
|
664
|
-
name: "resource",
|
|
665
|
-
message: "Which resources would you like to push?",
|
|
666
|
-
choices: [
|
|
667
|
-
{ name: `Settings ${chalk.blackBright(`(Project)`)}`, value: 'settings' },
|
|
668
|
-
{ name: `Functions ${chalk.blackBright(`(Deployment)`)}`, value: 'functions' },
|
|
669
|
-
{ name: `Collections ${chalk.blackBright(`(Databases)`)}`, value: 'collections' },
|
|
670
|
-
{ name: `Buckets ${chalk.blackBright(`(Storage)`)}`, value: 'buckets' },
|
|
671
|
-
{ name: `Teams ${chalk.blackBright(`(Auth)`)}`, value: 'teams' },
|
|
672
|
-
{ name: `Topics ${chalk.blackBright(`(Messaging)`)}`, value: 'messages' }
|
|
673
|
-
]
|
|
674
|
-
}
|
|
675
|
-
];
|
|
676
|
-
|
|
677
|
-
const questionsInitResources = [
|
|
678
|
-
{
|
|
679
|
-
type: "list",
|
|
680
|
-
name: "resource",
|
|
681
|
-
message: "Which resource would you create?",
|
|
682
|
-
choices: [
|
|
683
|
-
{ name: 'Function', value: 'function' },
|
|
684
|
-
{ name: 'Site', value: 'site' },
|
|
685
|
-
{ name: 'Collection', value: 'collection' },
|
|
686
|
-
{ name: 'Bucket', value: 'bucket' },
|
|
687
|
-
{ name: 'Team', value: 'team' },
|
|
688
|
-
{ name: 'Topic', value: 'message' }
|
|
689
|
-
]
|
|
690
|
-
}
|
|
691
|
-
];
|
|
692
|
-
|
|
693
|
-
const questionsPushSites = [
|
|
694
|
-
{
|
|
695
|
-
type: "checkbox",
|
|
696
|
-
name: "sites",
|
|
697
|
-
message: "Which sites would you like to push?",
|
|
698
|
-
validate: (value) => validateRequired('site', value),
|
|
699
|
-
when: () => localConfig.getSites().length > 0,
|
|
700
|
-
choices: () => {
|
|
701
|
-
let sites = localConfig.getSites();
|
|
702
|
-
checkDeployConditions(localConfig)
|
|
703
|
-
let choices = sites.map((site, idx) => {
|
|
704
|
-
return {
|
|
705
|
-
name: `${site.name} (${site.$id})`,
|
|
706
|
-
value: site.$id
|
|
707
|
-
}
|
|
708
|
-
})
|
|
709
|
-
return choices;
|
|
710
|
-
}
|
|
711
|
-
},
|
|
712
|
-
];
|
|
713
|
-
|
|
714
|
-
const questionsPushFunctions = [
|
|
715
|
-
{
|
|
716
|
-
type: "checkbox",
|
|
717
|
-
name: "functions",
|
|
718
|
-
message: "Which functions would you like to push?",
|
|
719
|
-
validate: (value) => validateRequired('function', value),
|
|
720
|
-
when: () => localConfig.getFunctions().length > 0,
|
|
721
|
-
choices: () => {
|
|
722
|
-
let functions = localConfig.getFunctions();
|
|
723
|
-
checkDeployConditions(localConfig)
|
|
724
|
-
let choices = functions.map((func, idx) => {
|
|
725
|
-
return {
|
|
726
|
-
name: `${func.name} (${func.$id})`,
|
|
727
|
-
value: func.$id
|
|
728
|
-
}
|
|
729
|
-
})
|
|
730
|
-
return choices;
|
|
731
|
-
}
|
|
732
|
-
},
|
|
733
|
-
]
|
|
734
|
-
|
|
735
|
-
const questionsPushCollections = [
|
|
736
|
-
{
|
|
737
|
-
type: "checkbox",
|
|
738
|
-
name: "collections",
|
|
739
|
-
message: "Which collections would you like to push?",
|
|
740
|
-
validate: (value) => validateRequired('collection', value),
|
|
741
|
-
when: () => localConfig.getCollections().length > 0,
|
|
742
|
-
choices: () => {
|
|
743
|
-
let collections = localConfig.getCollections();
|
|
744
|
-
checkDeployConditions(localConfig)
|
|
745
|
-
|
|
746
|
-
return collections.map(collection => {
|
|
747
|
-
return {
|
|
748
|
-
name: `${collection.name} (${collection['databaseId']} - ${collection['$id']})`,
|
|
749
|
-
value: `${collection['databaseId']}|${collection['$id']}`
|
|
750
|
-
}
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
];
|
|
755
|
-
|
|
756
|
-
const questionPushChanges = [
|
|
757
|
-
{
|
|
758
|
-
type: "input",
|
|
759
|
-
name: "changes",
|
|
760
|
-
message: `Are you sure you want to apply these changes? (YES/NO)`
|
|
761
|
-
}
|
|
762
|
-
];
|
|
763
|
-
|
|
764
|
-
const questionPushChangesConfirmation = [
|
|
765
|
-
{
|
|
766
|
-
type: "input",
|
|
767
|
-
name: "changes",
|
|
768
|
-
message: `Please type 'YES' or 'NO':`
|
|
769
|
-
}
|
|
770
|
-
];
|
|
771
|
-
|
|
772
|
-
const questionsPushBuckets = [
|
|
773
|
-
{
|
|
774
|
-
type: "checkbox",
|
|
775
|
-
name: "buckets",
|
|
776
|
-
message: "Which buckets would you like to push?",
|
|
777
|
-
validate: (value) => validateRequired('bucket', value),
|
|
778
|
-
when: () => localConfig.getBuckets().length > 0,
|
|
779
|
-
choices: () => {
|
|
780
|
-
let buckets = localConfig.getBuckets();
|
|
781
|
-
checkDeployConditions(localConfig)
|
|
782
|
-
|
|
783
|
-
return buckets.map(bucket => {
|
|
784
|
-
return {
|
|
785
|
-
name: `${bucket.name} (${bucket['$id']})`,
|
|
786
|
-
value: bucket.$id
|
|
787
|
-
}
|
|
788
|
-
});
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
]
|
|
792
|
-
|
|
793
|
-
const questionsPushMessagingTopics = [
|
|
794
|
-
{
|
|
795
|
-
type: "checkbox",
|
|
796
|
-
name: "topics",
|
|
797
|
-
message: "Which messaging topic would you like to push?",
|
|
798
|
-
validate: (value) => validateRequired('topics', value),
|
|
799
|
-
when: () => localConfig.getMessagingTopics().length > 0,
|
|
800
|
-
choices: () => {
|
|
801
|
-
let topics = localConfig.getMessagingTopics();
|
|
802
|
-
|
|
803
|
-
return topics.map(topic => {
|
|
804
|
-
return {
|
|
805
|
-
name: `${topic.name} (${topic['$id']})`,
|
|
806
|
-
value: topic.$id
|
|
807
|
-
}
|
|
808
|
-
});
|
|
809
|
-
}
|
|
810
|
-
}
|
|
811
|
-
]
|
|
812
|
-
|
|
813
|
-
const questionsGetEntrypoint = [
|
|
814
|
-
{
|
|
815
|
-
type: "input",
|
|
816
|
-
name: "entrypoint",
|
|
817
|
-
message: "Enter the entrypoint",
|
|
818
|
-
default: null,
|
|
819
|
-
validate(value) {
|
|
820
|
-
if (!value) {
|
|
821
|
-
return "Please enter your entrypoint";
|
|
822
|
-
}
|
|
823
|
-
return true;
|
|
824
|
-
}
|
|
825
|
-
},
|
|
826
|
-
]
|
|
827
|
-
|
|
828
|
-
const questionsPushTeams = [
|
|
829
|
-
{
|
|
830
|
-
type: "checkbox",
|
|
831
|
-
name: "teams",
|
|
832
|
-
message: "Which teams would you like to push?",
|
|
833
|
-
validate: (value) => validateRequired('team', value),
|
|
834
|
-
when: () => localConfig.getTeams().length > 0,
|
|
835
|
-
choices: () => {
|
|
836
|
-
let teams = localConfig.getTeams();
|
|
837
|
-
checkDeployConditions(localConfig);
|
|
838
|
-
|
|
839
|
-
return teams.map(team => {
|
|
840
|
-
return {
|
|
841
|
-
name: `${team.name} (${team['$id']})`,
|
|
842
|
-
value: team.$id
|
|
843
|
-
}
|
|
844
|
-
});
|
|
845
|
-
}
|
|
846
|
-
},
|
|
847
|
-
];
|
|
848
|
-
|
|
849
|
-
const questionsListFactors = [
|
|
850
|
-
{
|
|
851
|
-
type: "list",
|
|
852
|
-
name: "factor",
|
|
853
|
-
message: "Your account is protected by multi-factor authentication. Please choose one for verification.",
|
|
854
|
-
choices: async () => {
|
|
855
|
-
let client = await sdkForConsole(false);
|
|
856
|
-
const factors = await accountListMfaFactors({
|
|
857
|
-
sdk: client,
|
|
858
|
-
parseOutput: false
|
|
859
|
-
});
|
|
860
|
-
|
|
861
|
-
const choices = [
|
|
862
|
-
{
|
|
863
|
-
name: `Authenticator app (Get a code from a third-party authenticator app)`,
|
|
864
|
-
value: 'totp'
|
|
865
|
-
},
|
|
866
|
-
{
|
|
867
|
-
name: `Email (Get a security code at your Appwrite email address)`,
|
|
868
|
-
value: 'email'
|
|
869
|
-
},
|
|
870
|
-
{
|
|
871
|
-
name: `SMS (Get a security code on your Appwrite phone number)`,
|
|
872
|
-
value: 'phone'
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
name: `Recovery code (Use one of your recovery codes for verification)`,
|
|
876
|
-
value: 'recoveryCode'
|
|
877
|
-
}
|
|
878
|
-
].filter((ch) => factors[ch.value] === true);
|
|
879
|
-
|
|
880
|
-
return choices;
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
];
|
|
884
|
-
|
|
885
|
-
const questionsMfaChallenge = [
|
|
886
|
-
{
|
|
887
|
-
type: "input",
|
|
888
|
-
name: "otp",
|
|
889
|
-
message: "Enter OTP",
|
|
890
|
-
validate(value) {
|
|
891
|
-
if (!value) {
|
|
892
|
-
return "Please enter OTP";
|
|
893
|
-
}
|
|
894
|
-
return true;
|
|
895
|
-
},
|
|
896
|
-
}
|
|
897
|
-
];
|
|
898
|
-
|
|
899
|
-
const questionsRunFunctions = [
|
|
900
|
-
{
|
|
901
|
-
type: "list",
|
|
902
|
-
name: "function",
|
|
903
|
-
message: "Which function would you like to develop locally?",
|
|
904
|
-
validate: (value) => validateRequired('function', value),
|
|
905
|
-
choices: () => {
|
|
906
|
-
let functions = localConfig.getFunctions();
|
|
907
|
-
if (functions.length === 0) {
|
|
908
|
-
throw new Error("No functions found. Use 'appwrite pull functions' to synchronize existing one, or use 'appwrite init function' to create a new one.");
|
|
909
|
-
}
|
|
910
|
-
let choices = functions.map((func, idx) => {
|
|
911
|
-
return {
|
|
912
|
-
name: `${func.name} (${func.$id})`,
|
|
913
|
-
value: func.$id
|
|
914
|
-
}
|
|
915
|
-
})
|
|
916
|
-
return choices;
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
];
|
|
920
|
-
|
|
921
|
-
const questionsCreateSite = [
|
|
922
|
-
{
|
|
923
|
-
type: "input",
|
|
924
|
-
name: "name",
|
|
925
|
-
message: "What would you like to name your site?",
|
|
926
|
-
default: "My Awesome Site"
|
|
927
|
-
},
|
|
928
|
-
{
|
|
929
|
-
type: "input",
|
|
930
|
-
name: "id",
|
|
931
|
-
message: "What ID would you like to have for your site?",
|
|
932
|
-
default: "unique()"
|
|
933
|
-
},
|
|
934
|
-
{
|
|
935
|
-
type: "list",
|
|
936
|
-
name: "framework",
|
|
937
|
-
message: "What framework would you like to use?",
|
|
938
|
-
choices: async () => {
|
|
939
|
-
let response = await sitesListFrameworks({
|
|
940
|
-
parseOutput: false
|
|
941
|
-
});
|
|
942
|
-
let frameworks = response["frameworks"];
|
|
943
|
-
let choices = frameworks.map((framework) => {
|
|
944
|
-
return {
|
|
945
|
-
name: `${framework.name} (${framework.key})`,
|
|
946
|
-
value: framework,
|
|
947
|
-
}
|
|
948
|
-
});
|
|
949
|
-
return choices;
|
|
950
|
-
},
|
|
951
|
-
},
|
|
952
|
-
{
|
|
953
|
-
type: "list",
|
|
954
|
-
name: "specification",
|
|
955
|
-
message: "What specification would you like to use?",
|
|
956
|
-
choices: async () => {
|
|
957
|
-
let response = await sitesListSpecifications({
|
|
958
|
-
parseOutput: false
|
|
959
|
-
});
|
|
960
|
-
let specifications = response["specifications"];
|
|
961
|
-
let choices = specifications.map((spec) => {
|
|
962
|
-
return {
|
|
963
|
-
name: `${spec.cpus} CPU, ${spec.memory}MB RAM`,
|
|
964
|
-
value: spec.slug,
|
|
965
|
-
disabled: spec.enabled === false ? 'Upgrade to use' : false
|
|
966
|
-
}
|
|
967
|
-
});
|
|
968
|
-
return choices;
|
|
969
|
-
},
|
|
970
|
-
}
|
|
971
|
-
];
|
|
972
|
-
|
|
973
|
-
module.exports = {
|
|
974
|
-
questionsInitProject,
|
|
975
|
-
questionsInitProjectAutopull,
|
|
976
|
-
questionsCreateFunction,
|
|
977
|
-
questionsCreateFunctionSelectTemplate,
|
|
978
|
-
questionsCreateBucket,
|
|
979
|
-
questionsCreateCollection,
|
|
980
|
-
questionsCreateMessagingTopic,
|
|
981
|
-
questionsPullFunctions,
|
|
982
|
-
questionsPullFunctionsCode,
|
|
983
|
-
questionsPullSites,
|
|
984
|
-
questionsPullSitesCode,
|
|
985
|
-
questionsLogin,
|
|
986
|
-
questionsPullResources,
|
|
987
|
-
questionsLogout,
|
|
988
|
-
questionsPullCollection,
|
|
989
|
-
questionsPushResources,
|
|
990
|
-
questionsPushFunctions,
|
|
991
|
-
questionsPushSites,
|
|
992
|
-
questionsPushCollections,
|
|
993
|
-
questionsPushBuckets,
|
|
994
|
-
questionsPushMessagingTopics,
|
|
995
|
-
questionsPushTeams,
|
|
996
|
-
questionsGetEntrypoint,
|
|
997
|
-
questionsListFactors,
|
|
998
|
-
questionsMfaChallenge,
|
|
999
|
-
questionsRunFunctions,
|
|
1000
|
-
questionGetEndpoint,
|
|
1001
|
-
questionsInitResources,
|
|
1002
|
-
questionsCreateTeam,
|
|
1003
|
-
questionPushChanges,
|
|
1004
|
-
questionPushChangesConfirmation,
|
|
1005
|
-
questionsCreateSite
|
|
1006
|
-
};
|