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