appwrite-cli 12.0.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 +108 -100
- package/LICENSE.md +1 -1
- package/README.md +58 -35
- package/bun.lock +625 -0
- package/dist/bundle.cjs +94853 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +145 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/client.d.ts +88 -0
- package/dist/lib/client.d.ts.map +1 -0
- package/dist/lib/client.js +238 -0
- package/dist/lib/client.js.map +1 -0
- package/dist/lib/commands/generic.d.ts +17 -0
- package/dist/lib/commands/generic.d.ts.map +1 -0
- package/dist/lib/commands/generic.js +292 -0
- package/dist/lib/commands/generic.js.map +1 -0
- package/dist/lib/commands/init.d.ts +3 -0
- package/dist/lib/commands/init.d.ts.map +1 -0
- package/{lib → dist/lib}/commands/init.js +186 -270
- package/dist/lib/commands/init.js.map +1 -0
- package/dist/lib/commands/pull.d.ts +8 -0
- package/dist/lib/commands/pull.d.ts.map +1 -0
- package/{lib → dist/lib}/commands/pull.js +159 -280
- package/dist/lib/commands/pull.js.map +1 -0
- package/dist/lib/commands/push.d.ts +4 -0
- package/dist/lib/commands/push.d.ts.map +1 -0
- package/dist/lib/commands/push.js +2127 -0
- package/dist/lib/commands/push.js.map +1 -0
- package/dist/lib/commands/run.d.ts +3 -0
- package/dist/lib/commands/run.d.ts.map +1 -0
- package/{lib → dist/lib}/commands/run.js +146 -187
- package/dist/lib/commands/run.js.map +1 -0
- package/dist/lib/commands/services/account.d.ts +3 -0
- package/dist/lib/commands/services/account.d.ts.map +1 -0
- package/dist/lib/commands/services/account.js +306 -0
- package/dist/lib/commands/services/account.js.map +1 -0
- package/dist/lib/commands/services/avatars.d.ts +3 -0
- package/dist/lib/commands/services/avatars.d.ts.map +1 -0
- package/dist/lib/commands/services/avatars.js +118 -0
- package/dist/lib/commands/services/avatars.js.map +1 -0
- package/dist/lib/commands/services/console.d.ts +3 -0
- package/dist/lib/commands/services/console.d.ts.map +1 -0
- package/dist/lib/commands/services/console.js +41 -0
- package/dist/lib/commands/services/console.js.map +1 -0
- package/dist/lib/commands/services/databases.d.ts +3 -0
- package/dist/lib/commands/services/databases.d.ts.map +1 -0
- package/dist/lib/commands/services/databases.js +612 -0
- package/dist/lib/commands/services/databases.js.map +1 -0
- package/dist/lib/commands/services/functions.d.ts +3 -0
- package/dist/lib/commands/services/functions.d.ts.map +1 -0
- package/dist/lib/commands/services/functions.js +258 -0
- package/dist/lib/commands/services/functions.js.map +1 -0
- package/dist/lib/commands/services/graphql.d.ts +3 -0
- package/dist/lib/commands/services/graphql.d.ts.map +1 -0
- package/dist/lib/commands/services/graphql.js +28 -0
- package/dist/lib/commands/services/graphql.js.map +1 -0
- package/dist/lib/commands/services/health.d.ts +3 -0
- package/dist/lib/commands/services/health.d.ts.map +1 -0
- package/dist/lib/commands/services/health.js +123 -0
- package/dist/lib/commands/services/health.js.map +1 -0
- package/dist/lib/commands/services/locale.d.ts +3 -0
- package/dist/lib/commands/services/locale.d.ts.map +1 -0
- package/dist/lib/commands/services/locale.js +52 -0
- package/dist/lib/commands/services/locale.js.map +1 -0
- package/dist/lib/commands/services/messaging.d.ts +3 -0
- package/dist/lib/commands/services/messaging.d.ts.map +1 -0
- package/dist/lib/commands/services/messaging.js +505 -0
- package/dist/lib/commands/services/messaging.js.map +1 -0
- package/dist/lib/commands/services/migrations.d.ts +3 -0
- package/dist/lib/commands/services/migrations.d.ts.map +1 -0
- package/dist/lib/commands/services/migrations.js +135 -0
- package/dist/lib/commands/services/migrations.js.map +1 -0
- package/dist/lib/commands/services/project.d.ts +3 -0
- package/dist/lib/commands/services/project.d.ts.map +1 -0
- package/dist/lib/commands/services/project.js +54 -0
- package/dist/lib/commands/services/project.js.map +1 -0
- package/dist/lib/commands/services/projects.d.ts +3 -0
- package/dist/lib/commands/services/projects.d.ts.map +1 -0
- package/dist/lib/commands/services/projects.js +415 -0
- package/dist/lib/commands/services/projects.js.map +1 -0
- package/dist/lib/commands/services/proxy.d.ts +3 -0
- package/dist/lib/commands/services/proxy.d.ts.map +1 -0
- package/dist/lib/commands/services/proxy.js +68 -0
- package/dist/lib/commands/services/proxy.js.map +1 -0
- package/dist/lib/commands/services/sites.d.ts +3 -0
- package/dist/lib/commands/services/sites.d.ts.map +1 -0
- package/dist/lib/commands/services/sites.js +242 -0
- package/dist/lib/commands/services/sites.js.map +1 -0
- package/dist/lib/commands/services/storage.d.ts +3 -0
- package/dist/lib/commands/services/storage.d.ts.map +1 -0
- package/dist/lib/commands/services/storage.js +153 -0
- package/dist/lib/commands/services/storage.js.map +1 -0
- package/dist/lib/commands/services/tablesdb.d.ts +3 -0
- package/dist/lib/commands/services/tablesdb.d.ts.map +1 -0
- package/dist/lib/commands/services/tablesdb.js +605 -0
- package/dist/lib/commands/services/tablesdb.js.map +1 -0
- package/dist/lib/commands/services/teams.d.ts +3 -0
- package/dist/lib/commands/services/teams.d.ts.map +1 -0
- package/dist/lib/commands/services/teams.js +123 -0
- package/dist/lib/commands/services/teams.js.map +1 -0
- package/dist/lib/commands/services/tokens.d.ts +3 -0
- package/dist/lib/commands/services/tokens.d.ts.map +1 -0
- package/dist/lib/commands/services/tokens.js +49 -0
- package/dist/lib/commands/services/tokens.js.map +1 -0
- package/dist/lib/commands/services/users.d.ts +3 -0
- package/dist/lib/commands/services/users.d.ts.map +1 -0
- package/dist/lib/commands/services/users.js +312 -0
- package/dist/lib/commands/services/users.js.map +1 -0
- package/dist/lib/commands/services/vcs.d.ts +3 -0
- package/dist/lib/commands/services/vcs.d.ts.map +1 -0
- package/dist/lib/commands/services/vcs.js +87 -0
- package/dist/lib/commands/services/vcs.js.map +1 -0
- package/dist/lib/commands/types.d.ts +3 -0
- package/dist/lib/commands/types.d.ts.map +1 -0
- package/dist/lib/commands/types.js +151 -0
- package/dist/lib/commands/types.js.map +1 -0
- package/dist/lib/commands/update.d.ts +3 -0
- package/dist/lib/commands/update.d.ts.map +1 -0
- package/{lib → dist/lib}/commands/update.js +62 -79
- package/dist/lib/commands/update.js.map +1 -0
- package/dist/lib/config.d.ts +118 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/{lib → dist/lib}/config.js +173 -232
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/emulation/docker.d.ts +7 -0
- package/dist/lib/emulation/docker.d.ts.map +1 -0
- package/dist/lib/emulation/docker.js +224 -0
- package/dist/lib/emulation/docker.js.map +1 -0
- package/dist/lib/emulation/utils.d.ts +29 -0
- package/dist/lib/emulation/utils.d.ts.map +1 -0
- package/{lib → dist/lib}/emulation/utils.js +70 -91
- package/dist/lib/emulation/utils.js.map +1 -0
- package/dist/lib/id.d.ts +7 -0
- package/dist/lib/id.d.ts.map +1 -0
- package/{lib → dist/lib}/id.js +5 -8
- package/dist/lib/id.js.map +1 -0
- package/dist/lib/paginate.d.ts +9 -0
- package/dist/lib/paginate.d.ts.map +1 -0
- package/{lib → dist/lib}/paginate.js +10 -19
- package/dist/lib/paginate.js.map +1 -0
- package/dist/lib/parser.d.ts +18 -0
- package/dist/lib/parser.d.ts.map +1 -0
- package/dist/lib/parser.js +225 -0
- package/dist/lib/parser.js.map +1 -0
- package/dist/lib/questions.d.ts +59 -0
- package/dist/lib/questions.d.ts.map +1 -0
- package/{lib → dist/lib}/questions.js +393 -500
- package/dist/lib/questions.js.map +1 -0
- package/dist/lib/sdks.d.ts +4 -0
- package/dist/lib/sdks.d.ts.map +1 -0
- package/dist/lib/sdks.js +61 -0
- package/dist/lib/sdks.js.map +1 -0
- package/dist/lib/services.d.ts +13 -0
- package/dist/lib/services.d.ts.map +1 -0
- package/dist/lib/services.js +47 -0
- package/dist/lib/services.js.map +1 -0
- package/dist/lib/spinner.d.ts +28 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/dist/lib/spinner.js +91 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/type-generation/attribute.d.ts +17 -0
- package/dist/lib/type-generation/attribute.d.ts.map +1 -0
- package/{lib → dist/lib}/type-generation/attribute.js +2 -5
- package/dist/lib/type-generation/attribute.js.map +1 -0
- package/dist/lib/type-generation/languages/csharp.d.ts +7 -0
- package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/csharp.js +180 -0
- package/dist/lib/type-generation/languages/csharp.js.map +1 -0
- package/dist/lib/type-generation/languages/dart.d.ts +8 -0
- package/dist/lib/type-generation/languages/dart.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/dart.js +197 -0
- package/dist/lib/type-generation/languages/dart.js.map +1 -0
- package/dist/lib/type-generation/languages/java.d.ts +7 -0
- package/dist/lib/type-generation/languages/java.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/java.js +140 -0
- package/dist/lib/type-generation/languages/java.js.map +1 -0
- package/dist/lib/type-generation/languages/javascript.d.ts +9 -0
- package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/javascript.js +109 -0
- package/dist/lib/type-generation/languages/javascript.js.map +1 -0
- package/dist/lib/type-generation/languages/kotlin.d.ts +7 -0
- package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/kotlin.js +95 -0
- package/dist/lib/type-generation/languages/kotlin.js.map +1 -0
- package/dist/lib/type-generation/languages/language.d.ts +43 -0
- package/dist/lib/type-generation/languages/language.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/language.js +77 -0
- package/dist/lib/type-generation/languages/language.js.map +1 -0
- package/dist/lib/type-generation/languages/php.d.ts +7 -0
- package/dist/lib/type-generation/languages/php.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/php.js +116 -0
- package/dist/lib/type-generation/languages/php.js.map +1 -0
- package/dist/lib/type-generation/languages/swift.d.ts +7 -0
- package/dist/lib/type-generation/languages/swift.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/swift.js +179 -0
- package/dist/lib/type-generation/languages/swift.js.map +1 -0
- package/dist/lib/type-generation/languages/typescript.d.ts +9 -0
- package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/typescript.js +115 -0
- package/dist/lib/type-generation/languages/typescript.js.map +1 -0
- package/dist/lib/types.d.ts +277 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +15 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/{lib → dist/lib}/utils.js +125 -167
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/validations.d.ts +2 -0
- package/dist/lib/validations.d.ts.map +1 -0
- package/dist/lib/validations.js +16 -0
- package/dist/lib/validations.js.map +1 -0
- package/dist/package.json +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 +168 -0
- package/install.ps1 +2 -5
- package/install.sh +1 -2
- package/lib/client.ts +292 -0
- package/lib/commands/generic.ts +440 -0
- package/lib/commands/init.ts +713 -0
- package/lib/commands/pull.ts +668 -0
- package/lib/commands/push.ts +3183 -0
- package/lib/commands/run.ts +416 -0
- package/lib/commands/services/account.ts +832 -0
- package/lib/commands/services/avatars.ts +400 -0
- package/lib/commands/services/console.ts +73 -0
- package/lib/commands/services/databases.ts +2080 -0
- package/lib/commands/services/functions.ts +855 -0
- package/lib/commands/services/graphql.ts +47 -0
- package/lib/commands/services/health.ts +322 -0
- package/lib/commands/services/locale.ts +99 -0
- package/lib/commands/services/messaging.ts +1871 -0
- package/lib/commands/services/migrations.ts +421 -0
- package/lib/commands/services/project.ts +116 -0
- package/lib/commands/services/projects.ts +1317 -0
- package/lib/commands/services/proxy.ts +163 -0
- package/lib/commands/services/sites.ts +777 -0
- package/lib/commands/services/storage.ts +547 -0
- package/lib/commands/services/tablesdb.ts +1928 -0
- package/lib/commands/services/teams.ts +294 -0
- package/lib/commands/services/tokens.ts +106 -0
- package/lib/commands/services/users.ts +886 -0
- package/lib/commands/services/vcs.ts +268 -0
- package/lib/commands/types.ts +220 -0
- package/lib/commands/update.ts +255 -0
- package/lib/config.ts +969 -0
- package/lib/emulation/docker.ts +312 -0
- package/lib/emulation/utils.ts +207 -0
- package/lib/id.ts +30 -0
- package/lib/paginate.ts +77 -0
- package/lib/parser.ts +264 -0
- package/lib/questions.ts +1167 -0
- package/lib/sdks.ts +84 -0
- package/lib/services.ts +72 -0
- package/lib/spinner.ts +131 -0
- package/lib/type-generation/attribute.ts +18 -0
- package/lib/type-generation/languages/{csharp.js → csharp.ts} +27 -14
- package/lib/type-generation/languages/{dart.js → dart.ts} +61 -46
- package/lib/type-generation/languages/{java.js → java.ts} +31 -18
- package/lib/type-generation/languages/{javascript.js → javascript.ts} +35 -24
- package/lib/type-generation/languages/{kotlin.js → kotlin.ts} +27 -14
- package/lib/type-generation/languages/{language.js → language.ts} +45 -43
- package/lib/type-generation/languages/{php.js → php.ts} +28 -15
- package/lib/type-generation/languages/{swift.js → swift.ts} +27 -14
- package/lib/type-generation/languages/{typescript.js → typescript.ts} +43 -26
- package/lib/types.ts +304 -0
- package/lib/utils.ts +352 -0
- package/lib/validations.ts +20 -0
- package/package.json +36 -19
- package/scoop/appwrite.config.json +19 -29
- package/scripts/generate-commands.ts +539 -0
- package/tsconfig.json +24 -0
- package/.github/workflows/autoclose.yml +0 -11
- 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 -5
- 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/index.js +0 -147
- package/lib/client.js +0 -254
- package/lib/commands/account.js +0 -2121
- package/lib/commands/console.js +0 -127
- package/lib/commands/databases.js +0 -3590
- package/lib/commands/functions.js +0 -1732
- package/lib/commands/generic.js +0 -330
- package/lib/commands/graphql.js +0 -126
- package/lib/commands/health.js +0 -869
- package/lib/commands/locale.js +0 -316
- package/lib/commands/messaging.js +0 -3116
- package/lib/commands/migrations.js +0 -830
- package/lib/commands/organizations.js +0 -48
- package/lib/commands/project.js +0 -302
- package/lib/commands/projects.js +0 -2626
- package/lib/commands/proxy.js +0 -403
- package/lib/commands/push.js +0 -2570
- package/lib/commands/sites.js +0 -1654
- package/lib/commands/storage.js +0 -995
- package/lib/commands/tables-db.js +0 -3569
- package/lib/commands/teams.js +0 -683
- package/lib/commands/tokens.js +0 -261
- package/lib/commands/types.js +0 -191
- package/lib/commands/users.js +0 -2022
- package/lib/commands/vcs.js +0 -484
- package/lib/emulation/docker.js +0 -264
- package/lib/exception.js +0 -9
- package/lib/parser.js +0 -250
- package/lib/sdks.js +0 -60
- package/lib/spinner.js +0 -104
- package/lib/validations.js +0 -17
|
@@ -0,0 +1,886 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { sdkForProject } from "../../sdks.js";
|
|
3
|
+
import {
|
|
4
|
+
actionRunner,
|
|
5
|
+
commandDescriptions,
|
|
6
|
+
parseBool,
|
|
7
|
+
parseInteger,
|
|
8
|
+
} from "../../parser.js";
|
|
9
|
+
import {
|
|
10
|
+
Users,
|
|
11
|
+
PasswordHash,
|
|
12
|
+
UsageRange,
|
|
13
|
+
AuthenticatorType,
|
|
14
|
+
MessagingProviderType,
|
|
15
|
+
} from "@appwrite.io/console";
|
|
16
|
+
|
|
17
|
+
let usersClient: Users | null = null;
|
|
18
|
+
|
|
19
|
+
const getUsersClient = async (): Promise<Users> => {
|
|
20
|
+
if (!usersClient) {
|
|
21
|
+
const sdkClient = await sdkForProject();
|
|
22
|
+
usersClient = new Users(sdkClient);
|
|
23
|
+
}
|
|
24
|
+
return usersClient;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const users = new Command("users")
|
|
28
|
+
.description(commandDescriptions["users"] ?? "")
|
|
29
|
+
.configureHelp({
|
|
30
|
+
helpWidth: process.stdout.columns || 80,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
users
|
|
34
|
+
.command(`list`)
|
|
35
|
+
.description(
|
|
36
|
+
`Get a list of all the project's users. You can use the query params to filter your results.`,
|
|
37
|
+
)
|
|
38
|
+
.option(
|
|
39
|
+
`--queries [queries...]`,
|
|
40
|
+
`Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels`,
|
|
41
|
+
)
|
|
42
|
+
.option(
|
|
43
|
+
`--search <search>`,
|
|
44
|
+
`Search term to filter your list results. Max length: 256 chars.`,
|
|
45
|
+
)
|
|
46
|
+
.option(
|
|
47
|
+
`--total [value]`,
|
|
48
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
49
|
+
(value: string | undefined) =>
|
|
50
|
+
value === undefined ? true : parseBool(value),
|
|
51
|
+
)
|
|
52
|
+
.action(
|
|
53
|
+
actionRunner(
|
|
54
|
+
async ({ queries, search, total }) =>
|
|
55
|
+
await (await getUsersClient()).list(queries, search, total),
|
|
56
|
+
),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
users
|
|
60
|
+
.command(`create`)
|
|
61
|
+
.description(`Create a new user.`)
|
|
62
|
+
.requiredOption(
|
|
63
|
+
`--user-id <user-id>`,
|
|
64
|
+
`User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
|
|
65
|
+
)
|
|
66
|
+
.option(`--email <email>`, `User email.`)
|
|
67
|
+
.option(
|
|
68
|
+
`--phone <phone>`,
|
|
69
|
+
`Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`,
|
|
70
|
+
)
|
|
71
|
+
.option(
|
|
72
|
+
`--password <password>`,
|
|
73
|
+
`Plain text user password. Must be at least 8 chars.`,
|
|
74
|
+
)
|
|
75
|
+
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
76
|
+
.action(
|
|
77
|
+
actionRunner(
|
|
78
|
+
async ({ userId, email, phone, password, name }) =>
|
|
79
|
+
await (
|
|
80
|
+
await getUsersClient()
|
|
81
|
+
).create(userId, email, phone, password, name),
|
|
82
|
+
),
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
users
|
|
86
|
+
.command(`create-argon2-user`)
|
|
87
|
+
.description(
|
|
88
|
+
`Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`,
|
|
89
|
+
)
|
|
90
|
+
.requiredOption(
|
|
91
|
+
`--user-id <user-id>`,
|
|
92
|
+
`User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
|
|
93
|
+
)
|
|
94
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
95
|
+
.requiredOption(`--password <password>`, `User password hashed using Argon2.`)
|
|
96
|
+
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
97
|
+
.action(
|
|
98
|
+
actionRunner(
|
|
99
|
+
async ({ userId, email, password, name }) =>
|
|
100
|
+
await (
|
|
101
|
+
await getUsersClient()
|
|
102
|
+
).createArgon2User(userId, email, password, name),
|
|
103
|
+
),
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
users
|
|
107
|
+
.command(`create-bcrypt-user`)
|
|
108
|
+
.description(
|
|
109
|
+
`Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`,
|
|
110
|
+
)
|
|
111
|
+
.requiredOption(
|
|
112
|
+
`--user-id <user-id>`,
|
|
113
|
+
`User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
|
|
114
|
+
)
|
|
115
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
116
|
+
.requiredOption(`--password <password>`, `User password hashed using Bcrypt.`)
|
|
117
|
+
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
118
|
+
.action(
|
|
119
|
+
actionRunner(
|
|
120
|
+
async ({ userId, email, password, name }) =>
|
|
121
|
+
await (
|
|
122
|
+
await getUsersClient()
|
|
123
|
+
).createBcryptUser(userId, email, password, name),
|
|
124
|
+
),
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
users
|
|
128
|
+
.command(`list-identities`)
|
|
129
|
+
.description(`Get identities for all users.`)
|
|
130
|
+
.option(
|
|
131
|
+
`--queries [queries...]`,
|
|
132
|
+
`Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry`,
|
|
133
|
+
)
|
|
134
|
+
.option(
|
|
135
|
+
`--search <search>`,
|
|
136
|
+
`Search term to filter your list results. Max length: 256 chars.`,
|
|
137
|
+
)
|
|
138
|
+
.option(
|
|
139
|
+
`--total [value]`,
|
|
140
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
141
|
+
(value: string | undefined) =>
|
|
142
|
+
value === undefined ? true : parseBool(value),
|
|
143
|
+
)
|
|
144
|
+
.action(
|
|
145
|
+
actionRunner(
|
|
146
|
+
async ({ queries, search, total }) =>
|
|
147
|
+
await (await getUsersClient()).listIdentities(queries, search, total),
|
|
148
|
+
),
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
users
|
|
152
|
+
.command(`delete-identity`)
|
|
153
|
+
.description(`Delete an identity by its unique ID.`)
|
|
154
|
+
.requiredOption(`--identity-id <identity-id>`, `Identity ID.`)
|
|
155
|
+
.action(
|
|
156
|
+
actionRunner(
|
|
157
|
+
async ({ identityId }) =>
|
|
158
|
+
await (await getUsersClient()).deleteIdentity(identityId),
|
|
159
|
+
),
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
users
|
|
163
|
+
.command(`create-md5-user`)
|
|
164
|
+
.description(
|
|
165
|
+
`Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`,
|
|
166
|
+
)
|
|
167
|
+
.requiredOption(
|
|
168
|
+
`--user-id <user-id>`,
|
|
169
|
+
`User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
|
|
170
|
+
)
|
|
171
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
172
|
+
.requiredOption(`--password <password>`, `User password hashed using MD5.`)
|
|
173
|
+
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
174
|
+
.action(
|
|
175
|
+
actionRunner(
|
|
176
|
+
async ({ userId, email, password, name }) =>
|
|
177
|
+
await (
|
|
178
|
+
await getUsersClient()
|
|
179
|
+
).createMD5User(userId, email, password, name),
|
|
180
|
+
),
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
users
|
|
184
|
+
.command(`create-phpass-user`)
|
|
185
|
+
.description(
|
|
186
|
+
`Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`,
|
|
187
|
+
)
|
|
188
|
+
.requiredOption(
|
|
189
|
+
`--user-id <user-id>`,
|
|
190
|
+
`User ID. Choose a custom ID or pass the string \`ID.unique()\`to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
|
|
191
|
+
)
|
|
192
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
193
|
+
.requiredOption(`--password <password>`, `User password hashed using PHPass.`)
|
|
194
|
+
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
195
|
+
.action(
|
|
196
|
+
actionRunner(
|
|
197
|
+
async ({ userId, email, password, name }) =>
|
|
198
|
+
await (
|
|
199
|
+
await getUsersClient()
|
|
200
|
+
).createPHPassUser(userId, email, password, name),
|
|
201
|
+
),
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
users
|
|
205
|
+
.command(`create-scrypt-user`)
|
|
206
|
+
.description(
|
|
207
|
+
`Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`,
|
|
208
|
+
)
|
|
209
|
+
.requiredOption(
|
|
210
|
+
`--user-id <user-id>`,
|
|
211
|
+
`User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
|
|
212
|
+
)
|
|
213
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
214
|
+
.requiredOption(`--password <password>`, `User password hashed using Scrypt.`)
|
|
215
|
+
.requiredOption(
|
|
216
|
+
`--password-salt <password-salt>`,
|
|
217
|
+
`Optional salt used to hash password.`,
|
|
218
|
+
)
|
|
219
|
+
.requiredOption(
|
|
220
|
+
`--password-cpu <password-cpu>`,
|
|
221
|
+
`Optional CPU cost used to hash password.`,
|
|
222
|
+
parseInteger,
|
|
223
|
+
)
|
|
224
|
+
.requiredOption(
|
|
225
|
+
`--password-memory <password-memory>`,
|
|
226
|
+
`Optional memory cost used to hash password.`,
|
|
227
|
+
parseInteger,
|
|
228
|
+
)
|
|
229
|
+
.requiredOption(
|
|
230
|
+
`--password-parallel <password-parallel>`,
|
|
231
|
+
`Optional parallelization cost used to hash password.`,
|
|
232
|
+
parseInteger,
|
|
233
|
+
)
|
|
234
|
+
.requiredOption(
|
|
235
|
+
`--password-length <password-length>`,
|
|
236
|
+
`Optional hash length used to hash password.`,
|
|
237
|
+
parseInteger,
|
|
238
|
+
)
|
|
239
|
+
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
240
|
+
.action(
|
|
241
|
+
actionRunner(
|
|
242
|
+
async ({
|
|
243
|
+
userId,
|
|
244
|
+
email,
|
|
245
|
+
password,
|
|
246
|
+
passwordSalt,
|
|
247
|
+
passwordCpu,
|
|
248
|
+
passwordMemory,
|
|
249
|
+
passwordParallel,
|
|
250
|
+
passwordLength,
|
|
251
|
+
name,
|
|
252
|
+
}) =>
|
|
253
|
+
await (
|
|
254
|
+
await getUsersClient()
|
|
255
|
+
).createScryptUser(
|
|
256
|
+
userId,
|
|
257
|
+
email,
|
|
258
|
+
password,
|
|
259
|
+
passwordSalt,
|
|
260
|
+
passwordCpu,
|
|
261
|
+
passwordMemory,
|
|
262
|
+
passwordParallel,
|
|
263
|
+
passwordLength,
|
|
264
|
+
name,
|
|
265
|
+
),
|
|
266
|
+
),
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
users
|
|
270
|
+
.command(`create-scrypt-modified-user`)
|
|
271
|
+
.description(
|
|
272
|
+
`Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`,
|
|
273
|
+
)
|
|
274
|
+
.requiredOption(
|
|
275
|
+
`--user-id <user-id>`,
|
|
276
|
+
`User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
|
|
277
|
+
)
|
|
278
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
279
|
+
.requiredOption(
|
|
280
|
+
`--password <password>`,
|
|
281
|
+
`User password hashed using Scrypt Modified.`,
|
|
282
|
+
)
|
|
283
|
+
.requiredOption(
|
|
284
|
+
`--password-salt <password-salt>`,
|
|
285
|
+
`Salt used to hash password.`,
|
|
286
|
+
)
|
|
287
|
+
.requiredOption(
|
|
288
|
+
`--password-salt-separator <password-salt-separator>`,
|
|
289
|
+
`Salt separator used to hash password.`,
|
|
290
|
+
)
|
|
291
|
+
.requiredOption(
|
|
292
|
+
`--password-signer-key <password-signer-key>`,
|
|
293
|
+
`Signer key used to hash password.`,
|
|
294
|
+
)
|
|
295
|
+
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
296
|
+
.action(
|
|
297
|
+
actionRunner(
|
|
298
|
+
async ({
|
|
299
|
+
userId,
|
|
300
|
+
email,
|
|
301
|
+
password,
|
|
302
|
+
passwordSalt,
|
|
303
|
+
passwordSaltSeparator,
|
|
304
|
+
passwordSignerKey,
|
|
305
|
+
name,
|
|
306
|
+
}) =>
|
|
307
|
+
await (
|
|
308
|
+
await getUsersClient()
|
|
309
|
+
).createScryptModifiedUser(
|
|
310
|
+
userId,
|
|
311
|
+
email,
|
|
312
|
+
password,
|
|
313
|
+
passwordSalt,
|
|
314
|
+
passwordSaltSeparator,
|
|
315
|
+
passwordSignerKey,
|
|
316
|
+
name,
|
|
317
|
+
),
|
|
318
|
+
),
|
|
319
|
+
);
|
|
320
|
+
|
|
321
|
+
users
|
|
322
|
+
.command(`create-shauser`)
|
|
323
|
+
.description(
|
|
324
|
+
`Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.`,
|
|
325
|
+
)
|
|
326
|
+
.requiredOption(
|
|
327
|
+
`--user-id <user-id>`,
|
|
328
|
+
`User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
|
|
329
|
+
)
|
|
330
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
331
|
+
.requiredOption(`--password <password>`, `User password hashed using SHA.`)
|
|
332
|
+
.option(
|
|
333
|
+
`--password-version <password-version>`,
|
|
334
|
+
`Optional SHA version used to hash password. Allowed values are: 'sha1', 'sha224', 'sha256', 'sha384', 'sha512/224', 'sha512/256', 'sha512', 'sha3-224', 'sha3-256', 'sha3-384', 'sha3-512'`,
|
|
335
|
+
)
|
|
336
|
+
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
337
|
+
.action(
|
|
338
|
+
actionRunner(
|
|
339
|
+
async ({ userId, email, password, passwordVersion, name }) =>
|
|
340
|
+
await (
|
|
341
|
+
await getUsersClient()
|
|
342
|
+
).createSHAUser(
|
|
343
|
+
userId,
|
|
344
|
+
email,
|
|
345
|
+
password,
|
|
346
|
+
passwordVersion as PasswordHash,
|
|
347
|
+
name,
|
|
348
|
+
),
|
|
349
|
+
),
|
|
350
|
+
);
|
|
351
|
+
|
|
352
|
+
users
|
|
353
|
+
.command(`get-usage`)
|
|
354
|
+
.description(
|
|
355
|
+
`Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
|
|
356
|
+
`,
|
|
357
|
+
)
|
|
358
|
+
.option(`--range <range>`, `Date range.`)
|
|
359
|
+
.action(
|
|
360
|
+
actionRunner(
|
|
361
|
+
async ({ range }) =>
|
|
362
|
+
await (await getUsersClient()).getUsage(range as UsageRange),
|
|
363
|
+
),
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
users
|
|
367
|
+
.command(`get`)
|
|
368
|
+
.description(`Get a user by its unique ID.`)
|
|
369
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
370
|
+
.action(
|
|
371
|
+
actionRunner(
|
|
372
|
+
async ({ userId }) => await (await getUsersClient()).get(userId),
|
|
373
|
+
),
|
|
374
|
+
);
|
|
375
|
+
|
|
376
|
+
users
|
|
377
|
+
.command(`delete`)
|
|
378
|
+
.description(
|
|
379
|
+
`Delete a user by its unique ID, thereby releasing it's ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead.`,
|
|
380
|
+
)
|
|
381
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
382
|
+
.action(
|
|
383
|
+
actionRunner(
|
|
384
|
+
async ({ userId }) => await (await getUsersClient()).delete(userId),
|
|
385
|
+
),
|
|
386
|
+
);
|
|
387
|
+
|
|
388
|
+
users
|
|
389
|
+
.command(`update-email`)
|
|
390
|
+
.description(`Update the user email by its unique ID.`)
|
|
391
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
392
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
393
|
+
.action(
|
|
394
|
+
actionRunner(
|
|
395
|
+
async ({ userId, email }) =>
|
|
396
|
+
await (await getUsersClient()).updateEmail(userId, email),
|
|
397
|
+
),
|
|
398
|
+
);
|
|
399
|
+
|
|
400
|
+
users
|
|
401
|
+
.command(`create-jwt`)
|
|
402
|
+
.description(
|
|
403
|
+
`Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.`,
|
|
404
|
+
)
|
|
405
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
406
|
+
.option(
|
|
407
|
+
`--session-id <session-id>`,
|
|
408
|
+
`Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.`,
|
|
409
|
+
)
|
|
410
|
+
.option(
|
|
411
|
+
`--duration <duration>`,
|
|
412
|
+
`Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`,
|
|
413
|
+
parseInteger,
|
|
414
|
+
)
|
|
415
|
+
.action(
|
|
416
|
+
actionRunner(
|
|
417
|
+
async ({ userId, sessionId, duration }) =>
|
|
418
|
+
await (await getUsersClient()).createJWT(userId, sessionId, duration),
|
|
419
|
+
),
|
|
420
|
+
);
|
|
421
|
+
|
|
422
|
+
users
|
|
423
|
+
.command(`update-labels`)
|
|
424
|
+
.description(
|
|
425
|
+
`Update the user labels by its unique ID.
|
|
426
|
+
|
|
427
|
+
Labels can be used to grant access to resources. While teams are a way for user's to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.`,
|
|
428
|
+
)
|
|
429
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
430
|
+
.requiredOption(
|
|
431
|
+
`--labels [labels...]`,
|
|
432
|
+
`Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.`,
|
|
433
|
+
)
|
|
434
|
+
.action(
|
|
435
|
+
actionRunner(
|
|
436
|
+
async ({ userId, labels }) =>
|
|
437
|
+
await (await getUsersClient()).updateLabels(userId, labels),
|
|
438
|
+
),
|
|
439
|
+
);
|
|
440
|
+
|
|
441
|
+
users
|
|
442
|
+
.command(`list-logs`)
|
|
443
|
+
.description(`Get the user activity logs list by its unique ID.`)
|
|
444
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
445
|
+
.option(
|
|
446
|
+
`--queries [queries...]`,
|
|
447
|
+
`Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`,
|
|
448
|
+
)
|
|
449
|
+
.option(
|
|
450
|
+
`--total [value]`,
|
|
451
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
452
|
+
(value: string | undefined) =>
|
|
453
|
+
value === undefined ? true : parseBool(value),
|
|
454
|
+
)
|
|
455
|
+
.action(
|
|
456
|
+
actionRunner(
|
|
457
|
+
async ({ userId, queries, total }) =>
|
|
458
|
+
await (await getUsersClient()).listLogs(userId, queries, total),
|
|
459
|
+
),
|
|
460
|
+
);
|
|
461
|
+
|
|
462
|
+
users
|
|
463
|
+
.command(`list-memberships`)
|
|
464
|
+
.description(`Get the user membership list by its unique ID.`)
|
|
465
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
466
|
+
.option(
|
|
467
|
+
`--queries [queries...]`,
|
|
468
|
+
`Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles`,
|
|
469
|
+
)
|
|
470
|
+
.option(
|
|
471
|
+
`--search <search>`,
|
|
472
|
+
`Search term to filter your list results. Max length: 256 chars.`,
|
|
473
|
+
)
|
|
474
|
+
.option(
|
|
475
|
+
`--total [value]`,
|
|
476
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
477
|
+
(value: string | undefined) =>
|
|
478
|
+
value === undefined ? true : parseBool(value),
|
|
479
|
+
)
|
|
480
|
+
.action(
|
|
481
|
+
actionRunner(
|
|
482
|
+
async ({ userId, queries, search, total }) =>
|
|
483
|
+
await (
|
|
484
|
+
await getUsersClient()
|
|
485
|
+
).listMemberships(userId, queries, search, total),
|
|
486
|
+
),
|
|
487
|
+
);
|
|
488
|
+
|
|
489
|
+
users
|
|
490
|
+
.command(`update-mfa`)
|
|
491
|
+
.description(
|
|
492
|
+
`[**DEPRECATED** - This command is deprecated. Please use 'users updateMfa' instead] Enable or disable MFA on a user account.`,
|
|
493
|
+
)
|
|
494
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
495
|
+
.requiredOption(`--mfa <mfa>`, `Enable or disable MFA.`, parseBool)
|
|
496
|
+
.action(
|
|
497
|
+
actionRunner(
|
|
498
|
+
async ({ userId, mfa }) =>
|
|
499
|
+
await (await getUsersClient()).updateMfa(userId, mfa),
|
|
500
|
+
),
|
|
501
|
+
);
|
|
502
|
+
|
|
503
|
+
users
|
|
504
|
+
.command(`delete-mfa-authenticator`)
|
|
505
|
+
.description(
|
|
506
|
+
`[**DEPRECATED** - This command is deprecated. Please use 'users deleteMfaAuthenticator' instead] Delete an authenticator app.`,
|
|
507
|
+
)
|
|
508
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
509
|
+
.requiredOption(`--type <type>`, `Type of authenticator.`)
|
|
510
|
+
.action(
|
|
511
|
+
actionRunner(
|
|
512
|
+
async ({ userId, xType }) =>
|
|
513
|
+
await (
|
|
514
|
+
await getUsersClient()
|
|
515
|
+
).deleteMfaAuthenticator(userId, xType as AuthenticatorType),
|
|
516
|
+
),
|
|
517
|
+
);
|
|
518
|
+
|
|
519
|
+
users
|
|
520
|
+
.command(`list-mfa-factors`)
|
|
521
|
+
.description(
|
|
522
|
+
`[**DEPRECATED** - This command is deprecated. Please use 'users listMfaFactors' instead] List the factors available on the account to be used as a MFA challange.`,
|
|
523
|
+
)
|
|
524
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
525
|
+
.action(
|
|
526
|
+
actionRunner(
|
|
527
|
+
async ({ userId }) =>
|
|
528
|
+
await (await getUsersClient()).listMfaFactors(userId),
|
|
529
|
+
),
|
|
530
|
+
);
|
|
531
|
+
|
|
532
|
+
users
|
|
533
|
+
.command(`get-mfa-recovery-codes`)
|
|
534
|
+
.description(
|
|
535
|
+
`[**DEPRECATED** - This command is deprecated. Please use 'users getMfaRecoveryCodes' instead] Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.`,
|
|
536
|
+
)
|
|
537
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
538
|
+
.action(
|
|
539
|
+
actionRunner(
|
|
540
|
+
async ({ userId }) =>
|
|
541
|
+
await (await getUsersClient()).getMfaRecoveryCodes(userId),
|
|
542
|
+
),
|
|
543
|
+
);
|
|
544
|
+
|
|
545
|
+
users
|
|
546
|
+
.command(`update-mfa-recovery-codes`)
|
|
547
|
+
.description(
|
|
548
|
+
`[**DEPRECATED** - This command is deprecated. Please use 'users updateMfaRecoveryCodes' instead] Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.`,
|
|
549
|
+
)
|
|
550
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
551
|
+
.action(
|
|
552
|
+
actionRunner(
|
|
553
|
+
async ({ userId }) =>
|
|
554
|
+
await (await getUsersClient()).updateMfaRecoveryCodes(userId),
|
|
555
|
+
),
|
|
556
|
+
);
|
|
557
|
+
|
|
558
|
+
users
|
|
559
|
+
.command(`create-mfa-recovery-codes`)
|
|
560
|
+
.description(
|
|
561
|
+
`[**DEPRECATED** - This command is deprecated. Please use 'users createMfaRecoveryCodes' instead] Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.`,
|
|
562
|
+
)
|
|
563
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
564
|
+
.action(
|
|
565
|
+
actionRunner(
|
|
566
|
+
async ({ userId }) =>
|
|
567
|
+
await (await getUsersClient()).createMfaRecoveryCodes(userId),
|
|
568
|
+
),
|
|
569
|
+
);
|
|
570
|
+
|
|
571
|
+
users
|
|
572
|
+
.command(`update-name`)
|
|
573
|
+
.description(`Update the user name by its unique ID.`)
|
|
574
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
575
|
+
.requiredOption(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
576
|
+
.action(
|
|
577
|
+
actionRunner(
|
|
578
|
+
async ({ userId, name }) =>
|
|
579
|
+
await (await getUsersClient()).updateName(userId, name),
|
|
580
|
+
),
|
|
581
|
+
);
|
|
582
|
+
|
|
583
|
+
users
|
|
584
|
+
.command(`update-password`)
|
|
585
|
+
.description(`Update the user password by its unique ID.`)
|
|
586
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
587
|
+
.requiredOption(
|
|
588
|
+
`--password <password>`,
|
|
589
|
+
`New user password. Must be at least 8 chars.`,
|
|
590
|
+
)
|
|
591
|
+
.action(
|
|
592
|
+
actionRunner(
|
|
593
|
+
async ({ userId, password }) =>
|
|
594
|
+
await (await getUsersClient()).updatePassword(userId, password),
|
|
595
|
+
),
|
|
596
|
+
);
|
|
597
|
+
|
|
598
|
+
users
|
|
599
|
+
.command(`update-phone`)
|
|
600
|
+
.description(`Update the user phone by its unique ID.`)
|
|
601
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
602
|
+
.requiredOption(`--number <number>`, `User phone number.`)
|
|
603
|
+
.action(
|
|
604
|
+
actionRunner(
|
|
605
|
+
async ({ userId, number }) =>
|
|
606
|
+
await (await getUsersClient()).updatePhone(userId, number),
|
|
607
|
+
),
|
|
608
|
+
);
|
|
609
|
+
|
|
610
|
+
users
|
|
611
|
+
.command(`get-prefs`)
|
|
612
|
+
.description(`Get the user preferences by its unique ID.`)
|
|
613
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
614
|
+
.action(
|
|
615
|
+
actionRunner(
|
|
616
|
+
async ({ userId }) => await (await getUsersClient()).getPrefs(userId),
|
|
617
|
+
),
|
|
618
|
+
);
|
|
619
|
+
|
|
620
|
+
users
|
|
621
|
+
.command(`update-prefs`)
|
|
622
|
+
.description(
|
|
623
|
+
`Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.`,
|
|
624
|
+
)
|
|
625
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
626
|
+
.requiredOption(`--prefs <prefs>`, `Prefs key-value JSON object.`)
|
|
627
|
+
.action(
|
|
628
|
+
actionRunner(
|
|
629
|
+
async ({ userId, prefs }) =>
|
|
630
|
+
await (await getUsersClient()).updatePrefs(userId, JSON.parse(prefs)),
|
|
631
|
+
),
|
|
632
|
+
);
|
|
633
|
+
|
|
634
|
+
users
|
|
635
|
+
.command(`list-sessions`)
|
|
636
|
+
.description(`Get the user sessions list by its unique ID.`)
|
|
637
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
638
|
+
.option(
|
|
639
|
+
`--total [value]`,
|
|
640
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
641
|
+
(value: string | undefined) =>
|
|
642
|
+
value === undefined ? true : parseBool(value),
|
|
643
|
+
)
|
|
644
|
+
.action(
|
|
645
|
+
actionRunner(
|
|
646
|
+
async ({ userId, total }) =>
|
|
647
|
+
await (await getUsersClient()).listSessions(userId, total),
|
|
648
|
+
),
|
|
649
|
+
);
|
|
650
|
+
|
|
651
|
+
users
|
|
652
|
+
.command(`create-session`)
|
|
653
|
+
.description(
|
|
654
|
+
`Creates a session for a user. Returns an immediately usable session object.
|
|
655
|
+
|
|
656
|
+
If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.`,
|
|
657
|
+
)
|
|
658
|
+
.requiredOption(
|
|
659
|
+
`--user-id <user-id>`,
|
|
660
|
+
`User ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
|
|
661
|
+
)
|
|
662
|
+
.action(
|
|
663
|
+
actionRunner(
|
|
664
|
+
async ({ userId }) =>
|
|
665
|
+
await (await getUsersClient()).createSession(userId),
|
|
666
|
+
),
|
|
667
|
+
);
|
|
668
|
+
|
|
669
|
+
users
|
|
670
|
+
.command(`delete-sessions`)
|
|
671
|
+
.description(`Delete all user's sessions by using the user's unique ID.`)
|
|
672
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
673
|
+
.action(
|
|
674
|
+
actionRunner(
|
|
675
|
+
async ({ userId }) =>
|
|
676
|
+
await (await getUsersClient()).deleteSessions(userId),
|
|
677
|
+
),
|
|
678
|
+
);
|
|
679
|
+
|
|
680
|
+
users
|
|
681
|
+
.command(`delete-session`)
|
|
682
|
+
.description(`Delete a user sessions by its unique ID.`)
|
|
683
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
684
|
+
.requiredOption(`--session-id <session-id>`, `Session ID.`)
|
|
685
|
+
.action(
|
|
686
|
+
actionRunner(
|
|
687
|
+
async ({ userId, sessionId }) =>
|
|
688
|
+
await (await getUsersClient()).deleteSession(userId, sessionId),
|
|
689
|
+
),
|
|
690
|
+
);
|
|
691
|
+
|
|
692
|
+
users
|
|
693
|
+
.command(`update-status`)
|
|
694
|
+
.description(
|
|
695
|
+
`Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user's ID reserved.`,
|
|
696
|
+
)
|
|
697
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
698
|
+
.requiredOption(
|
|
699
|
+
`--status <status>`,
|
|
700
|
+
`User Status. To activate the user pass \`true\` and to block the user pass \`false\`.`,
|
|
701
|
+
parseBool,
|
|
702
|
+
)
|
|
703
|
+
.action(
|
|
704
|
+
actionRunner(
|
|
705
|
+
async ({ userId, status }) =>
|
|
706
|
+
await (await getUsersClient()).updateStatus(userId, status),
|
|
707
|
+
),
|
|
708
|
+
);
|
|
709
|
+
|
|
710
|
+
users
|
|
711
|
+
.command(`list-targets`)
|
|
712
|
+
.description(`List the messaging targets that are associated with a user.`)
|
|
713
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
714
|
+
.option(
|
|
715
|
+
`--queries [queries...]`,
|
|
716
|
+
`Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType`,
|
|
717
|
+
)
|
|
718
|
+
.option(
|
|
719
|
+
`--total [value]`,
|
|
720
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
721
|
+
(value: string | undefined) =>
|
|
722
|
+
value === undefined ? true : parseBool(value),
|
|
723
|
+
)
|
|
724
|
+
.action(
|
|
725
|
+
actionRunner(
|
|
726
|
+
async ({ userId, queries, total }) =>
|
|
727
|
+
await (await getUsersClient()).listTargets(userId, queries, total),
|
|
728
|
+
),
|
|
729
|
+
);
|
|
730
|
+
|
|
731
|
+
users
|
|
732
|
+
.command(`create-target`)
|
|
733
|
+
.description(`Create a messaging target.`)
|
|
734
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
735
|
+
.requiredOption(
|
|
736
|
+
`--target-id <target-id>`,
|
|
737
|
+
`Target ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
|
|
738
|
+
)
|
|
739
|
+
.requiredOption(
|
|
740
|
+
`--provider-type <provider-type>`,
|
|
741
|
+
`The target provider type. Can be one of the following: \`email\`, \`sms\` or \`push\`.`,
|
|
742
|
+
)
|
|
743
|
+
.requiredOption(
|
|
744
|
+
`--identifier <identifier>`,
|
|
745
|
+
`The target identifier (token, email, phone etc.)`,
|
|
746
|
+
)
|
|
747
|
+
.option(
|
|
748
|
+
`--provider-id <provider-id>`,
|
|
749
|
+
`Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.`,
|
|
750
|
+
)
|
|
751
|
+
.option(
|
|
752
|
+
`--name <name>`,
|
|
753
|
+
`Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.`,
|
|
754
|
+
)
|
|
755
|
+
.action(
|
|
756
|
+
actionRunner(
|
|
757
|
+
async ({
|
|
758
|
+
userId,
|
|
759
|
+
targetId,
|
|
760
|
+
providerType,
|
|
761
|
+
identifier,
|
|
762
|
+
providerId,
|
|
763
|
+
name,
|
|
764
|
+
}) =>
|
|
765
|
+
await (
|
|
766
|
+
await getUsersClient()
|
|
767
|
+
).createTarget(
|
|
768
|
+
userId,
|
|
769
|
+
targetId,
|
|
770
|
+
providerType as MessagingProviderType,
|
|
771
|
+
identifier,
|
|
772
|
+
providerId,
|
|
773
|
+
name,
|
|
774
|
+
),
|
|
775
|
+
),
|
|
776
|
+
);
|
|
777
|
+
|
|
778
|
+
users
|
|
779
|
+
.command(`get-target`)
|
|
780
|
+
.description(`Get a user's push notification target by ID.`)
|
|
781
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
782
|
+
.requiredOption(`--target-id <target-id>`, `Target ID.`)
|
|
783
|
+
.action(
|
|
784
|
+
actionRunner(
|
|
785
|
+
async ({ userId, targetId }) =>
|
|
786
|
+
await (await getUsersClient()).getTarget(userId, targetId),
|
|
787
|
+
),
|
|
788
|
+
);
|
|
789
|
+
|
|
790
|
+
users
|
|
791
|
+
.command(`update-target`)
|
|
792
|
+
.description(`Update a messaging target.`)
|
|
793
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
794
|
+
.requiredOption(`--target-id <target-id>`, `Target ID.`)
|
|
795
|
+
.option(
|
|
796
|
+
`--identifier <identifier>`,
|
|
797
|
+
`The target identifier (token, email, phone etc.)`,
|
|
798
|
+
)
|
|
799
|
+
.option(
|
|
800
|
+
`--provider-id <provider-id>`,
|
|
801
|
+
`Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.`,
|
|
802
|
+
)
|
|
803
|
+
.option(
|
|
804
|
+
`--name <name>`,
|
|
805
|
+
`Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.`,
|
|
806
|
+
)
|
|
807
|
+
.action(
|
|
808
|
+
actionRunner(
|
|
809
|
+
async ({ userId, targetId, identifier, providerId, name }) =>
|
|
810
|
+
await (
|
|
811
|
+
await getUsersClient()
|
|
812
|
+
).updateTarget(userId, targetId, identifier, providerId, name),
|
|
813
|
+
),
|
|
814
|
+
);
|
|
815
|
+
|
|
816
|
+
users
|
|
817
|
+
.command(`delete-target`)
|
|
818
|
+
.description(`Delete a messaging target.`)
|
|
819
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
820
|
+
.requiredOption(`--target-id <target-id>`, `Target ID.`)
|
|
821
|
+
.action(
|
|
822
|
+
actionRunner(
|
|
823
|
+
async ({ userId, targetId }) =>
|
|
824
|
+
await (await getUsersClient()).deleteTarget(userId, targetId),
|
|
825
|
+
),
|
|
826
|
+
);
|
|
827
|
+
|
|
828
|
+
users
|
|
829
|
+
.command(`create-token`)
|
|
830
|
+
.description(
|
|
831
|
+
`Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
|
|
832
|
+
`,
|
|
833
|
+
)
|
|
834
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
835
|
+
.option(
|
|
836
|
+
`--length <length>`,
|
|
837
|
+
`Token length in characters. The default length is 6 characters`,
|
|
838
|
+
parseInteger,
|
|
839
|
+
)
|
|
840
|
+
.option(
|
|
841
|
+
`--expire <expire>`,
|
|
842
|
+
`Token expiration period in seconds. The default expiration is 15 minutes.`,
|
|
843
|
+
parseInteger,
|
|
844
|
+
)
|
|
845
|
+
.action(
|
|
846
|
+
actionRunner(
|
|
847
|
+
async ({ userId, length, expire }) =>
|
|
848
|
+
await (await getUsersClient()).createToken(userId, length, expire),
|
|
849
|
+
),
|
|
850
|
+
);
|
|
851
|
+
|
|
852
|
+
users
|
|
853
|
+
.command(`update-email-verification`)
|
|
854
|
+
.description(`Update the user email verification status by its unique ID.`)
|
|
855
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
856
|
+
.requiredOption(
|
|
857
|
+
`--email-verification <email-verification>`,
|
|
858
|
+
`User email verification status.`,
|
|
859
|
+
parseBool,
|
|
860
|
+
)
|
|
861
|
+
.action(
|
|
862
|
+
actionRunner(
|
|
863
|
+
async ({ userId, emailVerification }) =>
|
|
864
|
+
await (
|
|
865
|
+
await getUsersClient()
|
|
866
|
+
).updateEmailVerification(userId, emailVerification),
|
|
867
|
+
),
|
|
868
|
+
);
|
|
869
|
+
|
|
870
|
+
users
|
|
871
|
+
.command(`update-phone-verification`)
|
|
872
|
+
.description(`Update the user phone verification status by its unique ID.`)
|
|
873
|
+
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
874
|
+
.requiredOption(
|
|
875
|
+
`--phone-verification <phone-verification>`,
|
|
876
|
+
`User phone verification status.`,
|
|
877
|
+
parseBool,
|
|
878
|
+
)
|
|
879
|
+
.action(
|
|
880
|
+
actionRunner(
|
|
881
|
+
async ({ userId, phoneVerification }) =>
|
|
882
|
+
await (
|
|
883
|
+
await getUsersClient()
|
|
884
|
+
).updatePhoneVerification(userId, phoneVerification),
|
|
885
|
+
),
|
|
886
|
+
);
|