appwrite-cli 13.0.0-rc.1 → 13.0.0-rc.3
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/publish.yml +68 -0
- package/CHANGELOG.md +10 -1
- package/LICENSE.md +1 -1
- package/README.md +3 -3
- package/cli.ts +152 -0
- package/dist/bundle.cjs +95813 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +145 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -142
- 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 +57 -45
- package/dist/lib/client.js.map +1 -1
- package/dist/lib/commands/config.d.ts +562 -0
- package/dist/lib/commands/config.d.ts.map +1 -0
- package/dist/lib/commands/config.js +416 -0
- package/dist/lib/commands/config.js.map +1 -0
- package/dist/lib/commands/db.d.ts +34 -0
- package/dist/lib/commands/db.d.ts.map +1 -0
- package/dist/lib/commands/db.js +247 -0
- package/dist/lib/commands/db.js.map +1 -0
- package/dist/lib/commands/errors.d.ts +68 -0
- package/dist/lib/commands/errors.d.ts.map +1 -0
- package/dist/lib/commands/errors.js +72 -0
- package/dist/lib/commands/errors.js.map +1 -0
- package/dist/lib/commands/generic.d.ts +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 +201 -192
- package/dist/lib/commands/init.js.map +1 -1
- package/dist/lib/commands/pull.d.ts +105 -3
- package/dist/lib/commands/pull.d.ts.map +1 -1
- package/dist/lib/commands/pull.js +530 -370
- package/dist/lib/commands/pull.js.map +1 -1
- package/dist/lib/commands/push.d.ts +106 -0
- package/dist/lib/commands/push.d.ts.map +1 -1
- package/dist/lib/commands/push.js +1432 -1830
- 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/schema.d.ts +59 -0
- package/dist/lib/commands/schema.d.ts.map +1 -0
- package/dist/lib/commands/schema.js +86 -0
- package/dist/lib/commands/schema.js.map +1 -0
- package/dist/lib/commands/services/account.d.ts +3 -0
- package/dist/lib/commands/services/account.d.ts.map +1 -0
- package/dist/lib/commands/services/account.js +328 -0
- package/dist/lib/commands/services/account.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 +28 -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 +620 -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 +266 -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 +250 -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 +175 -0
- package/dist/lib/commands/services/storage.js.map +1 -0
- package/dist/lib/commands/services/tables-db.d.ts +3 -0
- package/dist/lib/commands/services/tables-db.d.ts.map +1 -0
- package/dist/lib/commands/services/tables-db.js +613 -0
- package/dist/lib/commands/services/tables-db.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 +69 -69
- package/dist/lib/commands/update.js.map +1 -1
- package/dist/lib/commands/utils/attributes.d.ts +47 -0
- package/dist/lib/commands/utils/attributes.d.ts.map +1 -0
- package/dist/lib/commands/utils/attributes.js +514 -0
- package/dist/lib/commands/utils/attributes.js.map +1 -0
- package/dist/lib/commands/utils/change-approval.d.ts +25 -0
- package/dist/lib/commands/utils/change-approval.d.ts.map +1 -0
- package/dist/lib/commands/utils/change-approval.js +129 -0
- package/dist/lib/commands/utils/change-approval.js.map +1 -0
- package/dist/lib/commands/utils/database-sync.d.ts +10 -0
- package/dist/lib/commands/utils/database-sync.d.ts.map +1 -0
- package/dist/lib/commands/utils/database-sync.js +136 -0
- package/dist/lib/commands/utils/database-sync.js.map +1 -0
- package/dist/lib/commands/utils/deployment.d.ts +34 -0
- package/dist/lib/commands/utils/deployment.d.ts.map +1 -0
- package/dist/lib/commands/utils/deployment.js +109 -0
- package/dist/lib/commands/utils/deployment.js.map +1 -0
- package/dist/lib/commands/utils/error-formatter.d.ts +19 -0
- package/dist/lib/commands/utils/error-formatter.d.ts.map +1 -0
- package/dist/lib/commands/utils/error-formatter.js +333 -0
- package/dist/lib/commands/utils/error-formatter.js.map +1 -0
- package/dist/lib/commands/utils/pools.d.ts +16 -0
- package/dist/lib/commands/utils/pools.d.ts.map +1 -0
- package/dist/lib/commands/utils/pools.js +198 -0
- package/dist/lib/commands/utils/pools.js.map +1 -0
- package/dist/lib/config.d.ts +41 -40
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +264 -239
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/constants.d.ts +14 -0
- package/dist/lib/constants.d.ts.map +1 -0
- package/dist/lib/constants.js +19 -0
- package/dist/lib/constants.js.map +1 -0
- package/dist/lib/emulation/docker.d.ts +4 -12
- package/dist/lib/emulation/docker.d.ts.map +1 -1
- package/dist/lib/emulation/docker.js +159 -142
- 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 +92 -103
- 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 +381 -385
- 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 +39 -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 +38 -108
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +1 -2
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +142 -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 +68 -0
- package/index.ts +25 -149
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.ts +261 -220
- package/lib/commands/config.ts +494 -0
- package/lib/commands/db.ts +324 -0
- package/lib/commands/errors.ts +93 -0
- package/lib/commands/generic.ts +371 -269
- package/lib/commands/init.ts +631 -519
- package/lib/commands/pull.ts +827 -453
- package/lib/commands/push.ts +2191 -2349
- package/lib/commands/run.ts +382 -302
- package/lib/commands/schema.ts +122 -0
- package/lib/commands/services/account.ts +647 -0
- package/lib/commands/services/console.ts +52 -0
- package/lib/commands/services/databases.ts +1163 -0
- package/lib/commands/services/functions.ts +536 -0
- package/lib/commands/services/graphql.ts +50 -0
- package/lib/commands/services/health.ts +260 -0
- package/lib/commands/services/locale.ts +102 -0
- package/lib/commands/services/messaging.ts +1052 -0
- package/lib/commands/services/migrations.ts +249 -0
- package/lib/commands/services/project.ts +112 -0
- package/lib/commands/services/projects.ts +785 -0
- package/lib/commands/services/proxy.ts +135 -0
- package/lib/commands/services/sites.ts +505 -0
- package/lib/commands/services/storage.ts +338 -0
- package/lib/commands/services/tables-db.ts +1150 -0
- package/lib/commands/services/teams.ts +232 -0
- package/lib/commands/services/tokens.ts +94 -0
- package/lib/commands/services/users.ts +616 -0
- package/lib/commands/services/vcs.ts +165 -0
- package/lib/commands/types.ts +145 -118
- package/lib/commands/update.ts +189 -159
- package/lib/commands/utils/attributes.ts +719 -0
- package/lib/commands/utils/change-approval.ts +186 -0
- package/lib/commands/utils/database-sync.ts +180 -0
- package/lib/commands/utils/deployment.ts +184 -0
- package/lib/commands/utils/error-formatter.ts +417 -0
- package/lib/commands/utils/pools.ts +355 -0
- package/lib/config.ts +766 -687
- package/lib/constants.ts +22 -0
- package/lib/emulation/docker.ts +277 -216
- package/lib/emulation/utils.ts +188 -174
- package/lib/id.ts +23 -23
- package/lib/paginate.ts +69 -55
- package/lib/parser.ts +220 -189
- package/lib/questions.ts +1024 -948
- package/lib/sdks.ts +84 -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 +50 -125
- package/lib/utils.ts +304 -233
- package/lib/validations.ts +17 -14
- package/package.json +31 -22
- package/scoop/appwrite.config.json +3 -3
- package/tsconfig.json +7 -13
- package/.github/workflows/autoclose.yml +0 -11
- package/.github/workflows/npm-publish.yml +0 -49
- 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/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/lib/commands/users.ts
DELETED
|
@@ -1,1804 +0,0 @@
|
|
|
1
|
-
import fs = require('fs');
|
|
2
|
-
import pathLib = require('path');
|
|
3
|
-
import tar = require('tar');
|
|
4
|
-
import ignore = require('ignore');
|
|
5
|
-
import { promisify } from 'util';
|
|
6
|
-
import Client from '../client';
|
|
7
|
-
import { getAllFiles, showConsoleLink } from '../utils';
|
|
8
|
-
import { Command } from 'commander';
|
|
9
|
-
import { sdkForProject, sdkForConsole } from '../sdks';
|
|
10
|
-
import { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } from '../parser';
|
|
11
|
-
import { localConfig, globalConfig } from '../config';
|
|
12
|
-
import { File } from 'undici';
|
|
13
|
-
import { ReadableStream } from 'stream/web';
|
|
14
|
-
|
|
15
|
-
function convertReadStreamToReadableStream(readStream: fs.ReadStream): ReadableStream {
|
|
16
|
-
return new ReadableStream({
|
|
17
|
-
start(controller) {
|
|
18
|
-
readStream.on("data", (chunk: Buffer) => {
|
|
19
|
-
controller.enqueue(chunk);
|
|
20
|
-
});
|
|
21
|
-
readStream.on("end", () => {
|
|
22
|
-
controller.close();
|
|
23
|
-
});
|
|
24
|
-
readStream.on("error", (err: Error) => {
|
|
25
|
-
controller.error(err);
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
cancel() {
|
|
29
|
-
readStream.destroy();
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const users = new Command("users").description(commandDescriptions['users'] ?? '').configureHelp({
|
|
35
|
-
helpWidth: process.stdout.columns || 80
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
interface UsersListRequestParams {
|
|
39
|
-
queries?: string[];
|
|
40
|
-
search?: string;
|
|
41
|
-
total?: boolean;
|
|
42
|
-
overrideForCli?: boolean;
|
|
43
|
-
parseOutput?: boolean;
|
|
44
|
-
sdk?: Client;
|
|
45
|
-
console?: boolean;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const usersList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: UsersListRequestParams): Promise<any> => {
|
|
49
|
-
let client = !sdk ? await sdkForProject() :
|
|
50
|
-
sdk;
|
|
51
|
-
let apiPath = '/users';
|
|
52
|
-
let payload = {};
|
|
53
|
-
if (typeof queries !== 'undefined') {
|
|
54
|
-
payload['queries'] = queries;
|
|
55
|
-
}
|
|
56
|
-
if (typeof search !== 'undefined') {
|
|
57
|
-
payload['search'] = search;
|
|
58
|
-
}
|
|
59
|
-
if (typeof total !== 'undefined') {
|
|
60
|
-
payload['total'] = total;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
let response = undefined;
|
|
64
|
-
|
|
65
|
-
response = await client.call('get', apiPath, {
|
|
66
|
-
}, payload);
|
|
67
|
-
|
|
68
|
-
if (parseOutput) {
|
|
69
|
-
if(showConsole) {
|
|
70
|
-
showConsoleLink('users', 'list');
|
|
71
|
-
} else {
|
|
72
|
-
parse(response)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return response;
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
interface UsersCreateRequestParams {
|
|
80
|
-
userId: string;
|
|
81
|
-
email?: string;
|
|
82
|
-
phone?: string;
|
|
83
|
-
password?: string;
|
|
84
|
-
name?: string;
|
|
85
|
-
overrideForCli?: boolean;
|
|
86
|
-
parseOutput?: boolean;
|
|
87
|
-
sdk?: Client;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export const usersCreate = async ({userId,email,phone,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateRequestParams): Promise<any> => {
|
|
91
|
-
let client = !sdk ? await sdkForProject() :
|
|
92
|
-
sdk;
|
|
93
|
-
let apiPath = '/users';
|
|
94
|
-
let payload = {};
|
|
95
|
-
if (typeof userId !== 'undefined') {
|
|
96
|
-
payload['userId'] = userId;
|
|
97
|
-
}
|
|
98
|
-
if (typeof email !== 'undefined') {
|
|
99
|
-
payload['email'] = email;
|
|
100
|
-
}
|
|
101
|
-
if (typeof phone !== 'undefined') {
|
|
102
|
-
payload['phone'] = phone;
|
|
103
|
-
}
|
|
104
|
-
if (typeof password !== 'undefined') {
|
|
105
|
-
payload['password'] = password;
|
|
106
|
-
}
|
|
107
|
-
if (typeof name !== 'undefined') {
|
|
108
|
-
payload['name'] = name;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
let response = undefined;
|
|
112
|
-
|
|
113
|
-
response = await client.call('post', apiPath, {
|
|
114
|
-
'content-type': 'application/json',
|
|
115
|
-
}, payload);
|
|
116
|
-
|
|
117
|
-
if (parseOutput) {
|
|
118
|
-
parse(response)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return response;
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
interface UsersCreateArgon2UserRequestParams {
|
|
125
|
-
userId: string;
|
|
126
|
-
email: string;
|
|
127
|
-
password: string;
|
|
128
|
-
name?: string;
|
|
129
|
-
overrideForCli?: boolean;
|
|
130
|
-
parseOutput?: boolean;
|
|
131
|
-
sdk?: Client;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export const usersCreateArgon2User = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateArgon2UserRequestParams): Promise<any> => {
|
|
135
|
-
let client = !sdk ? await sdkForProject() :
|
|
136
|
-
sdk;
|
|
137
|
-
let apiPath = '/users/argon2';
|
|
138
|
-
let payload = {};
|
|
139
|
-
if (typeof userId !== 'undefined') {
|
|
140
|
-
payload['userId'] = userId;
|
|
141
|
-
}
|
|
142
|
-
if (typeof email !== 'undefined') {
|
|
143
|
-
payload['email'] = email;
|
|
144
|
-
}
|
|
145
|
-
if (typeof password !== 'undefined') {
|
|
146
|
-
payload['password'] = password;
|
|
147
|
-
}
|
|
148
|
-
if (typeof name !== 'undefined') {
|
|
149
|
-
payload['name'] = name;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
let response = undefined;
|
|
153
|
-
|
|
154
|
-
response = await client.call('post', apiPath, {
|
|
155
|
-
'content-type': 'application/json',
|
|
156
|
-
}, payload);
|
|
157
|
-
|
|
158
|
-
if (parseOutput) {
|
|
159
|
-
parse(response)
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return response;
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
interface UsersCreateBcryptUserRequestParams {
|
|
166
|
-
userId: string;
|
|
167
|
-
email: string;
|
|
168
|
-
password: string;
|
|
169
|
-
name?: string;
|
|
170
|
-
overrideForCli?: boolean;
|
|
171
|
-
parseOutput?: boolean;
|
|
172
|
-
sdk?: Client;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export const usersCreateBcryptUser = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateBcryptUserRequestParams): Promise<any> => {
|
|
176
|
-
let client = !sdk ? await sdkForProject() :
|
|
177
|
-
sdk;
|
|
178
|
-
let apiPath = '/users/bcrypt';
|
|
179
|
-
let payload = {};
|
|
180
|
-
if (typeof userId !== 'undefined') {
|
|
181
|
-
payload['userId'] = userId;
|
|
182
|
-
}
|
|
183
|
-
if (typeof email !== 'undefined') {
|
|
184
|
-
payload['email'] = email;
|
|
185
|
-
}
|
|
186
|
-
if (typeof password !== 'undefined') {
|
|
187
|
-
payload['password'] = password;
|
|
188
|
-
}
|
|
189
|
-
if (typeof name !== 'undefined') {
|
|
190
|
-
payload['name'] = name;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
let response = undefined;
|
|
194
|
-
|
|
195
|
-
response = await client.call('post', apiPath, {
|
|
196
|
-
'content-type': 'application/json',
|
|
197
|
-
}, payload);
|
|
198
|
-
|
|
199
|
-
if (parseOutput) {
|
|
200
|
-
parse(response)
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return response;
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
interface UsersListIdentitiesRequestParams {
|
|
207
|
-
queries?: string[];
|
|
208
|
-
search?: string;
|
|
209
|
-
total?: boolean;
|
|
210
|
-
overrideForCli?: boolean;
|
|
211
|
-
parseOutput?: boolean;
|
|
212
|
-
sdk?: Client;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export const usersListIdentities = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersListIdentitiesRequestParams): Promise<any> => {
|
|
216
|
-
let client = !sdk ? await sdkForProject() :
|
|
217
|
-
sdk;
|
|
218
|
-
let apiPath = '/users/identities';
|
|
219
|
-
let payload = {};
|
|
220
|
-
if (typeof queries !== 'undefined') {
|
|
221
|
-
payload['queries'] = queries;
|
|
222
|
-
}
|
|
223
|
-
if (typeof search !== 'undefined') {
|
|
224
|
-
payload['search'] = search;
|
|
225
|
-
}
|
|
226
|
-
if (typeof total !== 'undefined') {
|
|
227
|
-
payload['total'] = total;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
let response = undefined;
|
|
231
|
-
|
|
232
|
-
response = await client.call('get', apiPath, {
|
|
233
|
-
}, payload);
|
|
234
|
-
|
|
235
|
-
if (parseOutput) {
|
|
236
|
-
parse(response)
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
return response;
|
|
240
|
-
|
|
241
|
-
}
|
|
242
|
-
interface UsersDeleteIdentityRequestParams {
|
|
243
|
-
identityId: string;
|
|
244
|
-
overrideForCli?: boolean;
|
|
245
|
-
parseOutput?: boolean;
|
|
246
|
-
sdk?: Client;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export const usersDeleteIdentity = async ({identityId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteIdentityRequestParams): Promise<any> => {
|
|
250
|
-
let client = !sdk ? await sdkForProject() :
|
|
251
|
-
sdk;
|
|
252
|
-
let apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId);
|
|
253
|
-
let payload = {};
|
|
254
|
-
|
|
255
|
-
let response = undefined;
|
|
256
|
-
|
|
257
|
-
response = await client.call('delete', apiPath, {
|
|
258
|
-
'content-type': 'application/json',
|
|
259
|
-
}, payload);
|
|
260
|
-
|
|
261
|
-
if (parseOutput) {
|
|
262
|
-
parse(response)
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return response;
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
interface UsersCreateMD5UserRequestParams {
|
|
269
|
-
userId: string;
|
|
270
|
-
email: string;
|
|
271
|
-
password: string;
|
|
272
|
-
name?: string;
|
|
273
|
-
overrideForCli?: boolean;
|
|
274
|
-
parseOutput?: boolean;
|
|
275
|
-
sdk?: Client;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
export const usersCreateMD5User = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateMD5UserRequestParams): Promise<any> => {
|
|
279
|
-
let client = !sdk ? await sdkForProject() :
|
|
280
|
-
sdk;
|
|
281
|
-
let apiPath = '/users/md5';
|
|
282
|
-
let payload = {};
|
|
283
|
-
if (typeof userId !== 'undefined') {
|
|
284
|
-
payload['userId'] = userId;
|
|
285
|
-
}
|
|
286
|
-
if (typeof email !== 'undefined') {
|
|
287
|
-
payload['email'] = email;
|
|
288
|
-
}
|
|
289
|
-
if (typeof password !== 'undefined') {
|
|
290
|
-
payload['password'] = password;
|
|
291
|
-
}
|
|
292
|
-
if (typeof name !== 'undefined') {
|
|
293
|
-
payload['name'] = name;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
let response = undefined;
|
|
297
|
-
|
|
298
|
-
response = await client.call('post', apiPath, {
|
|
299
|
-
'content-type': 'application/json',
|
|
300
|
-
}, payload);
|
|
301
|
-
|
|
302
|
-
if (parseOutput) {
|
|
303
|
-
parse(response)
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
return response;
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
interface UsersCreatePHPassUserRequestParams {
|
|
310
|
-
userId: string;
|
|
311
|
-
email: string;
|
|
312
|
-
password: string;
|
|
313
|
-
name?: string;
|
|
314
|
-
overrideForCli?: boolean;
|
|
315
|
-
parseOutput?: boolean;
|
|
316
|
-
sdk?: Client;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
export const usersCreatePHPassUser = async ({userId,email,password,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreatePHPassUserRequestParams): Promise<any> => {
|
|
320
|
-
let client = !sdk ? await sdkForProject() :
|
|
321
|
-
sdk;
|
|
322
|
-
let apiPath = '/users/phpass';
|
|
323
|
-
let payload = {};
|
|
324
|
-
if (typeof userId !== 'undefined') {
|
|
325
|
-
payload['userId'] = userId;
|
|
326
|
-
}
|
|
327
|
-
if (typeof email !== 'undefined') {
|
|
328
|
-
payload['email'] = email;
|
|
329
|
-
}
|
|
330
|
-
if (typeof password !== 'undefined') {
|
|
331
|
-
payload['password'] = password;
|
|
332
|
-
}
|
|
333
|
-
if (typeof name !== 'undefined') {
|
|
334
|
-
payload['name'] = name;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
let response = undefined;
|
|
338
|
-
|
|
339
|
-
response = await client.call('post', apiPath, {
|
|
340
|
-
'content-type': 'application/json',
|
|
341
|
-
}, payload);
|
|
342
|
-
|
|
343
|
-
if (parseOutput) {
|
|
344
|
-
parse(response)
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
return response;
|
|
348
|
-
|
|
349
|
-
}
|
|
350
|
-
interface UsersCreateScryptUserRequestParams {
|
|
351
|
-
userId: string;
|
|
352
|
-
email: string;
|
|
353
|
-
password: string;
|
|
354
|
-
passwordSalt: string;
|
|
355
|
-
passwordCpu: number;
|
|
356
|
-
passwordMemory: number;
|
|
357
|
-
passwordParallel: number;
|
|
358
|
-
passwordLength: number;
|
|
359
|
-
name?: string;
|
|
360
|
-
overrideForCli?: boolean;
|
|
361
|
-
parseOutput?: boolean;
|
|
362
|
-
sdk?: Client;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
export const usersCreateScryptUser = async ({userId,email,password,passwordSalt,passwordCpu,passwordMemory,passwordParallel,passwordLength,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateScryptUserRequestParams): Promise<any> => {
|
|
366
|
-
let client = !sdk ? await sdkForProject() :
|
|
367
|
-
sdk;
|
|
368
|
-
let apiPath = '/users/scrypt';
|
|
369
|
-
let payload = {};
|
|
370
|
-
if (typeof userId !== 'undefined') {
|
|
371
|
-
payload['userId'] = userId;
|
|
372
|
-
}
|
|
373
|
-
if (typeof email !== 'undefined') {
|
|
374
|
-
payload['email'] = email;
|
|
375
|
-
}
|
|
376
|
-
if (typeof password !== 'undefined') {
|
|
377
|
-
payload['password'] = password;
|
|
378
|
-
}
|
|
379
|
-
if (typeof passwordSalt !== 'undefined') {
|
|
380
|
-
payload['passwordSalt'] = passwordSalt;
|
|
381
|
-
}
|
|
382
|
-
if (typeof passwordCpu !== 'undefined') {
|
|
383
|
-
payload['passwordCpu'] = passwordCpu;
|
|
384
|
-
}
|
|
385
|
-
if (typeof passwordMemory !== 'undefined') {
|
|
386
|
-
payload['passwordMemory'] = passwordMemory;
|
|
387
|
-
}
|
|
388
|
-
if (typeof passwordParallel !== 'undefined') {
|
|
389
|
-
payload['passwordParallel'] = passwordParallel;
|
|
390
|
-
}
|
|
391
|
-
if (typeof passwordLength !== 'undefined') {
|
|
392
|
-
payload['passwordLength'] = passwordLength;
|
|
393
|
-
}
|
|
394
|
-
if (typeof name !== 'undefined') {
|
|
395
|
-
payload['name'] = name;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
let response = undefined;
|
|
399
|
-
|
|
400
|
-
response = await client.call('post', apiPath, {
|
|
401
|
-
'content-type': 'application/json',
|
|
402
|
-
}, payload);
|
|
403
|
-
|
|
404
|
-
if (parseOutput) {
|
|
405
|
-
parse(response)
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
return response;
|
|
409
|
-
|
|
410
|
-
}
|
|
411
|
-
interface UsersCreateScryptModifiedUserRequestParams {
|
|
412
|
-
userId: string;
|
|
413
|
-
email: string;
|
|
414
|
-
password: string;
|
|
415
|
-
passwordSalt: string;
|
|
416
|
-
passwordSaltSeparator: string;
|
|
417
|
-
passwordSignerKey: string;
|
|
418
|
-
name?: string;
|
|
419
|
-
overrideForCli?: boolean;
|
|
420
|
-
parseOutput?: boolean;
|
|
421
|
-
sdk?: Client;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
export const usersCreateScryptModifiedUser = async ({userId,email,password,passwordSalt,passwordSaltSeparator,passwordSignerKey,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateScryptModifiedUserRequestParams): Promise<any> => {
|
|
425
|
-
let client = !sdk ? await sdkForProject() :
|
|
426
|
-
sdk;
|
|
427
|
-
let apiPath = '/users/scrypt-modified';
|
|
428
|
-
let payload = {};
|
|
429
|
-
if (typeof userId !== 'undefined') {
|
|
430
|
-
payload['userId'] = userId;
|
|
431
|
-
}
|
|
432
|
-
if (typeof email !== 'undefined') {
|
|
433
|
-
payload['email'] = email;
|
|
434
|
-
}
|
|
435
|
-
if (typeof password !== 'undefined') {
|
|
436
|
-
payload['password'] = password;
|
|
437
|
-
}
|
|
438
|
-
if (typeof passwordSalt !== 'undefined') {
|
|
439
|
-
payload['passwordSalt'] = passwordSalt;
|
|
440
|
-
}
|
|
441
|
-
if (typeof passwordSaltSeparator !== 'undefined') {
|
|
442
|
-
payload['passwordSaltSeparator'] = passwordSaltSeparator;
|
|
443
|
-
}
|
|
444
|
-
if (typeof passwordSignerKey !== 'undefined') {
|
|
445
|
-
payload['passwordSignerKey'] = passwordSignerKey;
|
|
446
|
-
}
|
|
447
|
-
if (typeof name !== 'undefined') {
|
|
448
|
-
payload['name'] = name;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
let response = undefined;
|
|
452
|
-
|
|
453
|
-
response = await client.call('post', apiPath, {
|
|
454
|
-
'content-type': 'application/json',
|
|
455
|
-
}, payload);
|
|
456
|
-
|
|
457
|
-
if (parseOutput) {
|
|
458
|
-
parse(response)
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
return response;
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
interface UsersCreateSHAUserRequestParams {
|
|
465
|
-
userId: string;
|
|
466
|
-
email: string;
|
|
467
|
-
password: string;
|
|
468
|
-
passwordVersion?: PasswordHash;
|
|
469
|
-
name?: string;
|
|
470
|
-
overrideForCli?: boolean;
|
|
471
|
-
parseOutput?: boolean;
|
|
472
|
-
sdk?: Client;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
export const usersCreateSHAUser = async ({userId,email,password,passwordVersion,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateSHAUserRequestParams): Promise<any> => {
|
|
476
|
-
let client = !sdk ? await sdkForProject() :
|
|
477
|
-
sdk;
|
|
478
|
-
let apiPath = '/users/sha';
|
|
479
|
-
let payload = {};
|
|
480
|
-
if (typeof userId !== 'undefined') {
|
|
481
|
-
payload['userId'] = userId;
|
|
482
|
-
}
|
|
483
|
-
if (typeof email !== 'undefined') {
|
|
484
|
-
payload['email'] = email;
|
|
485
|
-
}
|
|
486
|
-
if (typeof password !== 'undefined') {
|
|
487
|
-
payload['password'] = password;
|
|
488
|
-
}
|
|
489
|
-
if (typeof passwordVersion !== 'undefined') {
|
|
490
|
-
payload['passwordVersion'] = passwordVersion;
|
|
491
|
-
}
|
|
492
|
-
if (typeof name !== 'undefined') {
|
|
493
|
-
payload['name'] = name;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
let response = undefined;
|
|
497
|
-
|
|
498
|
-
response = await client.call('post', apiPath, {
|
|
499
|
-
'content-type': 'application/json',
|
|
500
|
-
}, payload);
|
|
501
|
-
|
|
502
|
-
if (parseOutput) {
|
|
503
|
-
parse(response)
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
return response;
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
interface UsersGetUsageRequestParams {
|
|
510
|
-
range?: UsageRange;
|
|
511
|
-
overrideForCli?: boolean;
|
|
512
|
-
parseOutput?: boolean;
|
|
513
|
-
sdk?: Client;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
export const usersGetUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersGetUsageRequestParams): Promise<any> => {
|
|
517
|
-
let client = !sdk ? await sdkForProject() :
|
|
518
|
-
sdk;
|
|
519
|
-
let apiPath = '/users/usage';
|
|
520
|
-
let payload = {};
|
|
521
|
-
if (typeof range !== 'undefined') {
|
|
522
|
-
payload['range'] = range;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
let response = undefined;
|
|
526
|
-
|
|
527
|
-
response = await client.call('get', apiPath, {
|
|
528
|
-
}, payload);
|
|
529
|
-
|
|
530
|
-
if (parseOutput) {
|
|
531
|
-
parse(response)
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
return response;
|
|
535
|
-
|
|
536
|
-
}
|
|
537
|
-
interface UsersGetRequestParams {
|
|
538
|
-
userId: string;
|
|
539
|
-
overrideForCli?: boolean;
|
|
540
|
-
parseOutput?: boolean;
|
|
541
|
-
sdk?: Client;
|
|
542
|
-
console?: boolean;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
export const usersGet = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: UsersGetRequestParams): Promise<any> => {
|
|
546
|
-
let client = !sdk ? await sdkForProject() :
|
|
547
|
-
sdk;
|
|
548
|
-
let apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
549
|
-
let payload = {};
|
|
550
|
-
|
|
551
|
-
let response = undefined;
|
|
552
|
-
|
|
553
|
-
response = await client.call('get', apiPath, {
|
|
554
|
-
}, payload);
|
|
555
|
-
|
|
556
|
-
if (parseOutput) {
|
|
557
|
-
if(showConsole) {
|
|
558
|
-
showConsoleLink('users', 'get', userId);
|
|
559
|
-
} else {
|
|
560
|
-
parse(response)
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
return response;
|
|
565
|
-
|
|
566
|
-
}
|
|
567
|
-
interface UsersDeleteRequestParams {
|
|
568
|
-
userId: string;
|
|
569
|
-
overrideForCli?: boolean;
|
|
570
|
-
parseOutput?: boolean;
|
|
571
|
-
sdk?: Client;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
export const usersDelete = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteRequestParams): Promise<any> => {
|
|
575
|
-
let client = !sdk ? await sdkForProject() :
|
|
576
|
-
sdk;
|
|
577
|
-
let apiPath = '/users/{userId}'.replace('{userId}', userId);
|
|
578
|
-
let payload = {};
|
|
579
|
-
|
|
580
|
-
let response = undefined;
|
|
581
|
-
|
|
582
|
-
response = await client.call('delete', apiPath, {
|
|
583
|
-
'content-type': 'application/json',
|
|
584
|
-
}, payload);
|
|
585
|
-
|
|
586
|
-
if (parseOutput) {
|
|
587
|
-
parse(response)
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
return response;
|
|
591
|
-
|
|
592
|
-
}
|
|
593
|
-
interface UsersUpdateEmailRequestParams {
|
|
594
|
-
userId: string;
|
|
595
|
-
email: string;
|
|
596
|
-
overrideForCli?: boolean;
|
|
597
|
-
parseOutput?: boolean;
|
|
598
|
-
sdk?: Client;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
export const usersUpdateEmail = async ({userId,email,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateEmailRequestParams): Promise<any> => {
|
|
602
|
-
let client = !sdk ? await sdkForProject() :
|
|
603
|
-
sdk;
|
|
604
|
-
let apiPath = '/users/{userId}/email'.replace('{userId}', userId);
|
|
605
|
-
let payload = {};
|
|
606
|
-
if (typeof email !== 'undefined') {
|
|
607
|
-
payload['email'] = email;
|
|
608
|
-
}
|
|
609
|
-
|
|
610
|
-
let response = undefined;
|
|
611
|
-
|
|
612
|
-
response = await client.call('patch', apiPath, {
|
|
613
|
-
'content-type': 'application/json',
|
|
614
|
-
}, payload);
|
|
615
|
-
|
|
616
|
-
if (parseOutput) {
|
|
617
|
-
parse(response)
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
return response;
|
|
621
|
-
|
|
622
|
-
}
|
|
623
|
-
interface UsersCreateJWTRequestParams {
|
|
624
|
-
userId: string;
|
|
625
|
-
sessionId?: string;
|
|
626
|
-
duration?: number;
|
|
627
|
-
overrideForCli?: boolean;
|
|
628
|
-
parseOutput?: boolean;
|
|
629
|
-
sdk?: Client;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
export const usersCreateJWT = async ({userId,sessionId,duration,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateJWTRequestParams): Promise<any> => {
|
|
633
|
-
let client = !sdk ? await sdkForProject() :
|
|
634
|
-
sdk;
|
|
635
|
-
let apiPath = '/users/{userId}/jwts'.replace('{userId}', userId);
|
|
636
|
-
let payload = {};
|
|
637
|
-
if (typeof sessionId !== 'undefined') {
|
|
638
|
-
payload['sessionId'] = sessionId;
|
|
639
|
-
}
|
|
640
|
-
if (typeof duration !== 'undefined') {
|
|
641
|
-
payload['duration'] = duration;
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
let response = undefined;
|
|
645
|
-
|
|
646
|
-
response = await client.call('post', apiPath, {
|
|
647
|
-
'content-type': 'application/json',
|
|
648
|
-
}, payload);
|
|
649
|
-
|
|
650
|
-
if (parseOutput) {
|
|
651
|
-
parse(response)
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
return response;
|
|
655
|
-
|
|
656
|
-
}
|
|
657
|
-
interface UsersUpdateLabelsRequestParams {
|
|
658
|
-
userId: string;
|
|
659
|
-
labels: string[];
|
|
660
|
-
overrideForCli?: boolean;
|
|
661
|
-
parseOutput?: boolean;
|
|
662
|
-
sdk?: Client;
|
|
663
|
-
}
|
|
664
|
-
|
|
665
|
-
export const usersUpdateLabels = async ({userId,labels,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateLabelsRequestParams): Promise<any> => {
|
|
666
|
-
let client = !sdk ? await sdkForProject() :
|
|
667
|
-
sdk;
|
|
668
|
-
let apiPath = '/users/{userId}/labels'.replace('{userId}', userId);
|
|
669
|
-
let payload = {};
|
|
670
|
-
labels = labels === true ? [] : labels;
|
|
671
|
-
if (typeof labels !== 'undefined') {
|
|
672
|
-
payload['labels'] = labels;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
let response = undefined;
|
|
676
|
-
|
|
677
|
-
response = await client.call('put', apiPath, {
|
|
678
|
-
'content-type': 'application/json',
|
|
679
|
-
}, payload);
|
|
680
|
-
|
|
681
|
-
if (parseOutput) {
|
|
682
|
-
parse(response)
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
return response;
|
|
686
|
-
|
|
687
|
-
}
|
|
688
|
-
interface UsersListLogsRequestParams {
|
|
689
|
-
userId: string;
|
|
690
|
-
queries?: string[];
|
|
691
|
-
total?: boolean;
|
|
692
|
-
overrideForCli?: boolean;
|
|
693
|
-
parseOutput?: boolean;
|
|
694
|
-
sdk?: Client;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
export const usersListLogs = async ({userId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersListLogsRequestParams): Promise<any> => {
|
|
698
|
-
let client = !sdk ? await sdkForProject() :
|
|
699
|
-
sdk;
|
|
700
|
-
let apiPath = '/users/{userId}/logs'.replace('{userId}', userId);
|
|
701
|
-
let payload = {};
|
|
702
|
-
if (typeof queries !== 'undefined') {
|
|
703
|
-
payload['queries'] = queries;
|
|
704
|
-
}
|
|
705
|
-
if (typeof total !== 'undefined') {
|
|
706
|
-
payload['total'] = total;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
let response = undefined;
|
|
710
|
-
|
|
711
|
-
response = await client.call('get', apiPath, {
|
|
712
|
-
}, payload);
|
|
713
|
-
|
|
714
|
-
if (parseOutput) {
|
|
715
|
-
parse(response)
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
return response;
|
|
719
|
-
|
|
720
|
-
}
|
|
721
|
-
interface UsersListMembershipsRequestParams {
|
|
722
|
-
userId: string;
|
|
723
|
-
queries?: string[];
|
|
724
|
-
search?: string;
|
|
725
|
-
total?: boolean;
|
|
726
|
-
overrideForCli?: boolean;
|
|
727
|
-
parseOutput?: boolean;
|
|
728
|
-
sdk?: Client;
|
|
729
|
-
}
|
|
730
|
-
|
|
731
|
-
export const usersListMemberships = async ({userId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersListMembershipsRequestParams): Promise<any> => {
|
|
732
|
-
let client = !sdk ? await sdkForProject() :
|
|
733
|
-
sdk;
|
|
734
|
-
let apiPath = '/users/{userId}/memberships'.replace('{userId}', userId);
|
|
735
|
-
let payload = {};
|
|
736
|
-
if (typeof queries !== 'undefined') {
|
|
737
|
-
payload['queries'] = queries;
|
|
738
|
-
}
|
|
739
|
-
if (typeof search !== 'undefined') {
|
|
740
|
-
payload['search'] = search;
|
|
741
|
-
}
|
|
742
|
-
if (typeof total !== 'undefined') {
|
|
743
|
-
payload['total'] = total;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
let response = undefined;
|
|
747
|
-
|
|
748
|
-
response = await client.call('get', apiPath, {
|
|
749
|
-
}, payload);
|
|
750
|
-
|
|
751
|
-
if (parseOutput) {
|
|
752
|
-
parse(response)
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
return response;
|
|
756
|
-
|
|
757
|
-
}
|
|
758
|
-
interface UsersUpdateMFARequestParams {
|
|
759
|
-
userId: string;
|
|
760
|
-
mfa: boolean;
|
|
761
|
-
overrideForCli?: boolean;
|
|
762
|
-
parseOutput?: boolean;
|
|
763
|
-
sdk?: Client;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
export const usersUpdateMFA = async ({userId,mfa,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateMFARequestParams): Promise<any> => {
|
|
767
|
-
let client = !sdk ? await sdkForProject() :
|
|
768
|
-
sdk;
|
|
769
|
-
let apiPath = '/users/{userId}/mfa'.replace('{userId}', userId);
|
|
770
|
-
let payload = {};
|
|
771
|
-
if (typeof mfa !== 'undefined') {
|
|
772
|
-
payload['mfa'] = mfa;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
let response = undefined;
|
|
776
|
-
|
|
777
|
-
response = await client.call('patch', apiPath, {
|
|
778
|
-
'content-type': 'application/json',
|
|
779
|
-
}, payload);
|
|
780
|
-
|
|
781
|
-
if (parseOutput) {
|
|
782
|
-
parse(response)
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
return response;
|
|
786
|
-
|
|
787
|
-
}
|
|
788
|
-
interface UsersDeleteMFAAuthenticatorRequestParams {
|
|
789
|
-
userId: string;
|
|
790
|
-
type: AuthenticatorType;
|
|
791
|
-
overrideForCli?: boolean;
|
|
792
|
-
parseOutput?: boolean;
|
|
793
|
-
sdk?: Client;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
export const usersDeleteMFAAuthenticator = async ({userId,type,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteMFAAuthenticatorRequestParams): Promise<any> => {
|
|
797
|
-
let client = !sdk ? await sdkForProject() :
|
|
798
|
-
sdk;
|
|
799
|
-
let apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type);
|
|
800
|
-
let payload = {};
|
|
801
|
-
|
|
802
|
-
let response = undefined;
|
|
803
|
-
|
|
804
|
-
response = await client.call('delete', apiPath, {
|
|
805
|
-
'content-type': 'application/json',
|
|
806
|
-
}, payload);
|
|
807
|
-
|
|
808
|
-
if (parseOutput) {
|
|
809
|
-
parse(response)
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
return response;
|
|
813
|
-
|
|
814
|
-
}
|
|
815
|
-
interface UsersListMFAFactorsRequestParams {
|
|
816
|
-
userId: string;
|
|
817
|
-
overrideForCli?: boolean;
|
|
818
|
-
parseOutput?: boolean;
|
|
819
|
-
sdk?: Client;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
export const usersListMFAFactors = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersListMFAFactorsRequestParams): Promise<any> => {
|
|
823
|
-
let client = !sdk ? await sdkForProject() :
|
|
824
|
-
sdk;
|
|
825
|
-
let apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId);
|
|
826
|
-
let payload = {};
|
|
827
|
-
|
|
828
|
-
let response = undefined;
|
|
829
|
-
|
|
830
|
-
response = await client.call('get', apiPath, {
|
|
831
|
-
}, payload);
|
|
832
|
-
|
|
833
|
-
if (parseOutput) {
|
|
834
|
-
parse(response)
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
return response;
|
|
838
|
-
|
|
839
|
-
}
|
|
840
|
-
interface UsersGetMFARecoveryCodesRequestParams {
|
|
841
|
-
userId: string;
|
|
842
|
-
overrideForCli?: boolean;
|
|
843
|
-
parseOutput?: boolean;
|
|
844
|
-
sdk?: Client;
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
export const usersGetMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersGetMFARecoveryCodesRequestParams): Promise<any> => {
|
|
848
|
-
let client = !sdk ? await sdkForProject() :
|
|
849
|
-
sdk;
|
|
850
|
-
let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
851
|
-
let payload = {};
|
|
852
|
-
|
|
853
|
-
let response = undefined;
|
|
854
|
-
|
|
855
|
-
response = await client.call('get', apiPath, {
|
|
856
|
-
}, payload);
|
|
857
|
-
|
|
858
|
-
if (parseOutput) {
|
|
859
|
-
parse(response)
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
return response;
|
|
863
|
-
|
|
864
|
-
}
|
|
865
|
-
interface UsersUpdateMFARecoveryCodesRequestParams {
|
|
866
|
-
userId: string;
|
|
867
|
-
overrideForCli?: boolean;
|
|
868
|
-
parseOutput?: boolean;
|
|
869
|
-
sdk?: Client;
|
|
870
|
-
}
|
|
871
|
-
|
|
872
|
-
export const usersUpdateMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateMFARecoveryCodesRequestParams): Promise<any> => {
|
|
873
|
-
let client = !sdk ? await sdkForProject() :
|
|
874
|
-
sdk;
|
|
875
|
-
let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
876
|
-
let payload = {};
|
|
877
|
-
|
|
878
|
-
let response = undefined;
|
|
879
|
-
|
|
880
|
-
response = await client.call('put', apiPath, {
|
|
881
|
-
'content-type': 'application/json',
|
|
882
|
-
}, payload);
|
|
883
|
-
|
|
884
|
-
if (parseOutput) {
|
|
885
|
-
parse(response)
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
return response;
|
|
889
|
-
|
|
890
|
-
}
|
|
891
|
-
interface UsersCreateMFARecoveryCodesRequestParams {
|
|
892
|
-
userId: string;
|
|
893
|
-
overrideForCli?: boolean;
|
|
894
|
-
parseOutput?: boolean;
|
|
895
|
-
sdk?: Client;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
export const usersCreateMFARecoveryCodes = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateMFARecoveryCodesRequestParams): Promise<any> => {
|
|
899
|
-
let client = !sdk ? await sdkForProject() :
|
|
900
|
-
sdk;
|
|
901
|
-
let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
|
|
902
|
-
let payload = {};
|
|
903
|
-
|
|
904
|
-
let response = undefined;
|
|
905
|
-
|
|
906
|
-
response = await client.call('patch', apiPath, {
|
|
907
|
-
'content-type': 'application/json',
|
|
908
|
-
}, payload);
|
|
909
|
-
|
|
910
|
-
if (parseOutput) {
|
|
911
|
-
parse(response)
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
return response;
|
|
915
|
-
|
|
916
|
-
}
|
|
917
|
-
interface UsersUpdateNameRequestParams {
|
|
918
|
-
userId: string;
|
|
919
|
-
name: string;
|
|
920
|
-
overrideForCli?: boolean;
|
|
921
|
-
parseOutput?: boolean;
|
|
922
|
-
sdk?: Client;
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
export const usersUpdateName = async ({userId,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateNameRequestParams): Promise<any> => {
|
|
926
|
-
let client = !sdk ? await sdkForProject() :
|
|
927
|
-
sdk;
|
|
928
|
-
let apiPath = '/users/{userId}/name'.replace('{userId}', userId);
|
|
929
|
-
let payload = {};
|
|
930
|
-
if (typeof name !== 'undefined') {
|
|
931
|
-
payload['name'] = name;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
let response = undefined;
|
|
935
|
-
|
|
936
|
-
response = await client.call('patch', apiPath, {
|
|
937
|
-
'content-type': 'application/json',
|
|
938
|
-
}, payload);
|
|
939
|
-
|
|
940
|
-
if (parseOutput) {
|
|
941
|
-
parse(response)
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
return response;
|
|
945
|
-
|
|
946
|
-
}
|
|
947
|
-
interface UsersUpdatePasswordRequestParams {
|
|
948
|
-
userId: string;
|
|
949
|
-
password: string;
|
|
950
|
-
overrideForCli?: boolean;
|
|
951
|
-
parseOutput?: boolean;
|
|
952
|
-
sdk?: Client;
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
export const usersUpdatePassword = async ({userId,password,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdatePasswordRequestParams): Promise<any> => {
|
|
956
|
-
let client = !sdk ? await sdkForProject() :
|
|
957
|
-
sdk;
|
|
958
|
-
let apiPath = '/users/{userId}/password'.replace('{userId}', userId);
|
|
959
|
-
let payload = {};
|
|
960
|
-
if (typeof password !== 'undefined') {
|
|
961
|
-
payload['password'] = password;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
let response = undefined;
|
|
965
|
-
|
|
966
|
-
response = await client.call('patch', apiPath, {
|
|
967
|
-
'content-type': 'application/json',
|
|
968
|
-
}, payload);
|
|
969
|
-
|
|
970
|
-
if (parseOutput) {
|
|
971
|
-
parse(response)
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
return response;
|
|
975
|
-
|
|
976
|
-
}
|
|
977
|
-
interface UsersUpdatePhoneRequestParams {
|
|
978
|
-
userId: string;
|
|
979
|
-
number: string;
|
|
980
|
-
overrideForCli?: boolean;
|
|
981
|
-
parseOutput?: boolean;
|
|
982
|
-
sdk?: Client;
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
export const usersUpdatePhone = async ({userId,number,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdatePhoneRequestParams): Promise<any> => {
|
|
986
|
-
let client = !sdk ? await sdkForProject() :
|
|
987
|
-
sdk;
|
|
988
|
-
let apiPath = '/users/{userId}/phone'.replace('{userId}', userId);
|
|
989
|
-
let payload = {};
|
|
990
|
-
if (typeof number !== 'undefined') {
|
|
991
|
-
payload['number'] = number;
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
let response = undefined;
|
|
995
|
-
|
|
996
|
-
response = await client.call('patch', apiPath, {
|
|
997
|
-
'content-type': 'application/json',
|
|
998
|
-
}, payload);
|
|
999
|
-
|
|
1000
|
-
if (parseOutput) {
|
|
1001
|
-
parse(response)
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
return response;
|
|
1005
|
-
|
|
1006
|
-
}
|
|
1007
|
-
interface UsersGetPrefsRequestParams {
|
|
1008
|
-
userId: string;
|
|
1009
|
-
overrideForCli?: boolean;
|
|
1010
|
-
parseOutput?: boolean;
|
|
1011
|
-
sdk?: Client;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
export const usersGetPrefs = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersGetPrefsRequestParams): Promise<any> => {
|
|
1015
|
-
let client = !sdk ? await sdkForProject() :
|
|
1016
|
-
sdk;
|
|
1017
|
-
let apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
1018
|
-
let payload = {};
|
|
1019
|
-
|
|
1020
|
-
let response = undefined;
|
|
1021
|
-
|
|
1022
|
-
response = await client.call('get', apiPath, {
|
|
1023
|
-
}, payload);
|
|
1024
|
-
|
|
1025
|
-
if (parseOutput) {
|
|
1026
|
-
parse(response)
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
return response;
|
|
1030
|
-
|
|
1031
|
-
}
|
|
1032
|
-
interface UsersUpdatePrefsRequestParams {
|
|
1033
|
-
userId: string;
|
|
1034
|
-
prefs: object;
|
|
1035
|
-
overrideForCli?: boolean;
|
|
1036
|
-
parseOutput?: boolean;
|
|
1037
|
-
sdk?: Client;
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
export const usersUpdatePrefs = async ({userId,prefs,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdatePrefsRequestParams): Promise<any> => {
|
|
1041
|
-
let client = !sdk ? await sdkForProject() :
|
|
1042
|
-
sdk;
|
|
1043
|
-
let apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
|
|
1044
|
-
let payload = {};
|
|
1045
|
-
if (typeof prefs !== 'undefined') {
|
|
1046
|
-
payload['prefs'] = JSON.parse(prefs);
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
let response = undefined;
|
|
1050
|
-
|
|
1051
|
-
response = await client.call('patch', apiPath, {
|
|
1052
|
-
'content-type': 'application/json',
|
|
1053
|
-
}, payload);
|
|
1054
|
-
|
|
1055
|
-
if (parseOutput) {
|
|
1056
|
-
parse(response)
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
return response;
|
|
1060
|
-
|
|
1061
|
-
}
|
|
1062
|
-
interface UsersListSessionsRequestParams {
|
|
1063
|
-
userId: string;
|
|
1064
|
-
total?: boolean;
|
|
1065
|
-
overrideForCli?: boolean;
|
|
1066
|
-
parseOutput?: boolean;
|
|
1067
|
-
sdk?: Client;
|
|
1068
|
-
console?: boolean;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
export const usersListSessions = async ({userId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: UsersListSessionsRequestParams): Promise<any> => {
|
|
1072
|
-
let client = !sdk ? await sdkForProject() :
|
|
1073
|
-
sdk;
|
|
1074
|
-
let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1075
|
-
let payload = {};
|
|
1076
|
-
if (typeof total !== 'undefined') {
|
|
1077
|
-
payload['total'] = total;
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
let response = undefined;
|
|
1081
|
-
|
|
1082
|
-
response = await client.call('get', apiPath, {
|
|
1083
|
-
}, payload);
|
|
1084
|
-
|
|
1085
|
-
if (parseOutput) {
|
|
1086
|
-
if(showConsole) {
|
|
1087
|
-
showConsoleLink('users', 'listSessions', userId);
|
|
1088
|
-
} else {
|
|
1089
|
-
parse(response)
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
return response;
|
|
1094
|
-
|
|
1095
|
-
}
|
|
1096
|
-
interface UsersCreateSessionRequestParams {
|
|
1097
|
-
userId: string;
|
|
1098
|
-
overrideForCli?: boolean;
|
|
1099
|
-
parseOutput?: boolean;
|
|
1100
|
-
sdk?: Client;
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
export const usersCreateSession = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateSessionRequestParams): Promise<any> => {
|
|
1104
|
-
let client = !sdk ? await sdkForProject() :
|
|
1105
|
-
sdk;
|
|
1106
|
-
let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1107
|
-
let payload = {};
|
|
1108
|
-
|
|
1109
|
-
let response = undefined;
|
|
1110
|
-
|
|
1111
|
-
response = await client.call('post', apiPath, {
|
|
1112
|
-
'content-type': 'application/json',
|
|
1113
|
-
}, payload);
|
|
1114
|
-
|
|
1115
|
-
if (parseOutput) {
|
|
1116
|
-
parse(response)
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
return response;
|
|
1120
|
-
|
|
1121
|
-
}
|
|
1122
|
-
interface UsersDeleteSessionsRequestParams {
|
|
1123
|
-
userId: string;
|
|
1124
|
-
overrideForCli?: boolean;
|
|
1125
|
-
parseOutput?: boolean;
|
|
1126
|
-
sdk?: Client;
|
|
1127
|
-
}
|
|
1128
|
-
|
|
1129
|
-
export const usersDeleteSessions = async ({userId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteSessionsRequestParams): Promise<any> => {
|
|
1130
|
-
let client = !sdk ? await sdkForProject() :
|
|
1131
|
-
sdk;
|
|
1132
|
-
let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
|
|
1133
|
-
let payload = {};
|
|
1134
|
-
|
|
1135
|
-
let response = undefined;
|
|
1136
|
-
|
|
1137
|
-
response = await client.call('delete', apiPath, {
|
|
1138
|
-
'content-type': 'application/json',
|
|
1139
|
-
}, payload);
|
|
1140
|
-
|
|
1141
|
-
if (parseOutput) {
|
|
1142
|
-
parse(response)
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
return response;
|
|
1146
|
-
|
|
1147
|
-
}
|
|
1148
|
-
interface UsersDeleteSessionRequestParams {
|
|
1149
|
-
userId: string;
|
|
1150
|
-
sessionId: string;
|
|
1151
|
-
overrideForCli?: boolean;
|
|
1152
|
-
parseOutput?: boolean;
|
|
1153
|
-
sdk?: Client;
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1156
|
-
export const usersDeleteSession = async ({userId,sessionId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteSessionRequestParams): Promise<any> => {
|
|
1157
|
-
let client = !sdk ? await sdkForProject() :
|
|
1158
|
-
sdk;
|
|
1159
|
-
let apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId);
|
|
1160
|
-
let payload = {};
|
|
1161
|
-
|
|
1162
|
-
let response = undefined;
|
|
1163
|
-
|
|
1164
|
-
response = await client.call('delete', apiPath, {
|
|
1165
|
-
'content-type': 'application/json',
|
|
1166
|
-
}, payload);
|
|
1167
|
-
|
|
1168
|
-
if (parseOutput) {
|
|
1169
|
-
parse(response)
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
return response;
|
|
1173
|
-
|
|
1174
|
-
}
|
|
1175
|
-
interface UsersUpdateStatusRequestParams {
|
|
1176
|
-
userId: string;
|
|
1177
|
-
status: boolean;
|
|
1178
|
-
overrideForCli?: boolean;
|
|
1179
|
-
parseOutput?: boolean;
|
|
1180
|
-
sdk?: Client;
|
|
1181
|
-
}
|
|
1182
|
-
|
|
1183
|
-
export const usersUpdateStatus = async ({userId,status,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateStatusRequestParams): Promise<any> => {
|
|
1184
|
-
let client = !sdk ? await sdkForProject() :
|
|
1185
|
-
sdk;
|
|
1186
|
-
let apiPath = '/users/{userId}/status'.replace('{userId}', userId);
|
|
1187
|
-
let payload = {};
|
|
1188
|
-
if (typeof status !== 'undefined') {
|
|
1189
|
-
payload['status'] = status;
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
let response = undefined;
|
|
1193
|
-
|
|
1194
|
-
response = await client.call('patch', apiPath, {
|
|
1195
|
-
'content-type': 'application/json',
|
|
1196
|
-
}, payload);
|
|
1197
|
-
|
|
1198
|
-
if (parseOutput) {
|
|
1199
|
-
parse(response)
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
return response;
|
|
1203
|
-
|
|
1204
|
-
}
|
|
1205
|
-
interface UsersListTargetsRequestParams {
|
|
1206
|
-
userId: string;
|
|
1207
|
-
queries?: string[];
|
|
1208
|
-
total?: boolean;
|
|
1209
|
-
overrideForCli?: boolean;
|
|
1210
|
-
parseOutput?: boolean;
|
|
1211
|
-
sdk?: Client;
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
export const usersListTargets = async ({userId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersListTargetsRequestParams): Promise<any> => {
|
|
1215
|
-
let client = !sdk ? await sdkForProject() :
|
|
1216
|
-
sdk;
|
|
1217
|
-
let apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
|
|
1218
|
-
let payload = {};
|
|
1219
|
-
if (typeof queries !== 'undefined') {
|
|
1220
|
-
payload['queries'] = queries;
|
|
1221
|
-
}
|
|
1222
|
-
if (typeof total !== 'undefined') {
|
|
1223
|
-
payload['total'] = total;
|
|
1224
|
-
}
|
|
1225
|
-
|
|
1226
|
-
let response = undefined;
|
|
1227
|
-
|
|
1228
|
-
response = await client.call('get', apiPath, {
|
|
1229
|
-
}, payload);
|
|
1230
|
-
|
|
1231
|
-
if (parseOutput) {
|
|
1232
|
-
parse(response)
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
return response;
|
|
1236
|
-
|
|
1237
|
-
}
|
|
1238
|
-
interface UsersCreateTargetRequestParams {
|
|
1239
|
-
userId: string;
|
|
1240
|
-
targetId: string;
|
|
1241
|
-
providerType: MessagingProviderType;
|
|
1242
|
-
identifier: string;
|
|
1243
|
-
providerId?: string;
|
|
1244
|
-
name?: string;
|
|
1245
|
-
overrideForCli?: boolean;
|
|
1246
|
-
parseOutput?: boolean;
|
|
1247
|
-
sdk?: Client;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
export const usersCreateTarget = async ({userId,targetId,providerType,identifier,providerId,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateTargetRequestParams): Promise<any> => {
|
|
1251
|
-
let client = !sdk ? await sdkForProject() :
|
|
1252
|
-
sdk;
|
|
1253
|
-
let apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
|
|
1254
|
-
let payload = {};
|
|
1255
|
-
if (typeof targetId !== 'undefined') {
|
|
1256
|
-
payload['targetId'] = targetId;
|
|
1257
|
-
}
|
|
1258
|
-
if (typeof providerType !== 'undefined') {
|
|
1259
|
-
payload['providerType'] = providerType;
|
|
1260
|
-
}
|
|
1261
|
-
if (typeof identifier !== 'undefined') {
|
|
1262
|
-
payload['identifier'] = identifier;
|
|
1263
|
-
}
|
|
1264
|
-
if (typeof providerId !== 'undefined') {
|
|
1265
|
-
payload['providerId'] = providerId;
|
|
1266
|
-
}
|
|
1267
|
-
if (typeof name !== 'undefined') {
|
|
1268
|
-
payload['name'] = name;
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
let response = undefined;
|
|
1272
|
-
|
|
1273
|
-
response = await client.call('post', apiPath, {
|
|
1274
|
-
'content-type': 'application/json',
|
|
1275
|
-
}, payload);
|
|
1276
|
-
|
|
1277
|
-
if (parseOutput) {
|
|
1278
|
-
parse(response)
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
return response;
|
|
1282
|
-
|
|
1283
|
-
}
|
|
1284
|
-
interface UsersGetTargetRequestParams {
|
|
1285
|
-
userId: string;
|
|
1286
|
-
targetId: string;
|
|
1287
|
-
overrideForCli?: boolean;
|
|
1288
|
-
parseOutput?: boolean;
|
|
1289
|
-
sdk?: Client;
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
export const usersGetTarget = async ({userId,targetId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersGetTargetRequestParams): Promise<any> => {
|
|
1293
|
-
let client = !sdk ? await sdkForProject() :
|
|
1294
|
-
sdk;
|
|
1295
|
-
let apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
|
|
1296
|
-
let payload = {};
|
|
1297
|
-
|
|
1298
|
-
let response = undefined;
|
|
1299
|
-
|
|
1300
|
-
response = await client.call('get', apiPath, {
|
|
1301
|
-
}, payload);
|
|
1302
|
-
|
|
1303
|
-
if (parseOutput) {
|
|
1304
|
-
parse(response)
|
|
1305
|
-
}
|
|
1306
|
-
|
|
1307
|
-
return response;
|
|
1308
|
-
|
|
1309
|
-
}
|
|
1310
|
-
interface UsersUpdateTargetRequestParams {
|
|
1311
|
-
userId: string;
|
|
1312
|
-
targetId: string;
|
|
1313
|
-
identifier?: string;
|
|
1314
|
-
providerId?: string;
|
|
1315
|
-
name?: string;
|
|
1316
|
-
overrideForCli?: boolean;
|
|
1317
|
-
parseOutput?: boolean;
|
|
1318
|
-
sdk?: Client;
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
export const usersUpdateTarget = async ({userId,targetId,identifier,providerId,name,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateTargetRequestParams): Promise<any> => {
|
|
1322
|
-
let client = !sdk ? await sdkForProject() :
|
|
1323
|
-
sdk;
|
|
1324
|
-
let apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
|
|
1325
|
-
let payload = {};
|
|
1326
|
-
if (typeof identifier !== 'undefined') {
|
|
1327
|
-
payload['identifier'] = identifier;
|
|
1328
|
-
}
|
|
1329
|
-
if (typeof providerId !== 'undefined') {
|
|
1330
|
-
payload['providerId'] = providerId;
|
|
1331
|
-
}
|
|
1332
|
-
if (typeof name !== 'undefined') {
|
|
1333
|
-
payload['name'] = name;
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
let response = undefined;
|
|
1337
|
-
|
|
1338
|
-
response = await client.call('patch', apiPath, {
|
|
1339
|
-
'content-type': 'application/json',
|
|
1340
|
-
}, payload);
|
|
1341
|
-
|
|
1342
|
-
if (parseOutput) {
|
|
1343
|
-
parse(response)
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
return response;
|
|
1347
|
-
|
|
1348
|
-
}
|
|
1349
|
-
interface UsersDeleteTargetRequestParams {
|
|
1350
|
-
userId: string;
|
|
1351
|
-
targetId: string;
|
|
1352
|
-
overrideForCli?: boolean;
|
|
1353
|
-
parseOutput?: boolean;
|
|
1354
|
-
sdk?: Client;
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
export const usersDeleteTarget = async ({userId,targetId,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersDeleteTargetRequestParams): Promise<any> => {
|
|
1358
|
-
let client = !sdk ? await sdkForProject() :
|
|
1359
|
-
sdk;
|
|
1360
|
-
let apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
|
|
1361
|
-
let payload = {};
|
|
1362
|
-
|
|
1363
|
-
let response = undefined;
|
|
1364
|
-
|
|
1365
|
-
response = await client.call('delete', apiPath, {
|
|
1366
|
-
'content-type': 'application/json',
|
|
1367
|
-
}, payload);
|
|
1368
|
-
|
|
1369
|
-
if (parseOutput) {
|
|
1370
|
-
parse(response)
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
return response;
|
|
1374
|
-
|
|
1375
|
-
}
|
|
1376
|
-
interface UsersCreateTokenRequestParams {
|
|
1377
|
-
userId: string;
|
|
1378
|
-
length?: number;
|
|
1379
|
-
expire?: number;
|
|
1380
|
-
overrideForCli?: boolean;
|
|
1381
|
-
parseOutput?: boolean;
|
|
1382
|
-
sdk?: Client;
|
|
1383
|
-
}
|
|
1384
|
-
|
|
1385
|
-
export const usersCreateToken = async ({userId,length,expire,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersCreateTokenRequestParams): Promise<any> => {
|
|
1386
|
-
let client = !sdk ? await sdkForProject() :
|
|
1387
|
-
sdk;
|
|
1388
|
-
let apiPath = '/users/{userId}/tokens'.replace('{userId}', userId);
|
|
1389
|
-
let payload = {};
|
|
1390
|
-
if (typeof length !== 'undefined') {
|
|
1391
|
-
payload['length'] = length;
|
|
1392
|
-
}
|
|
1393
|
-
if (typeof expire !== 'undefined') {
|
|
1394
|
-
payload['expire'] = expire;
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
let response = undefined;
|
|
1398
|
-
|
|
1399
|
-
response = await client.call('post', apiPath, {
|
|
1400
|
-
'content-type': 'application/json',
|
|
1401
|
-
}, payload);
|
|
1402
|
-
|
|
1403
|
-
if (parseOutput) {
|
|
1404
|
-
parse(response)
|
|
1405
|
-
}
|
|
1406
|
-
|
|
1407
|
-
return response;
|
|
1408
|
-
|
|
1409
|
-
}
|
|
1410
|
-
interface UsersUpdateEmailVerificationRequestParams {
|
|
1411
|
-
userId: string;
|
|
1412
|
-
emailVerification: boolean;
|
|
1413
|
-
overrideForCli?: boolean;
|
|
1414
|
-
parseOutput?: boolean;
|
|
1415
|
-
sdk?: Client;
|
|
1416
|
-
}
|
|
1417
|
-
|
|
1418
|
-
export const usersUpdateEmailVerification = async ({userId,emailVerification,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdateEmailVerificationRequestParams): Promise<any> => {
|
|
1419
|
-
let client = !sdk ? await sdkForProject() :
|
|
1420
|
-
sdk;
|
|
1421
|
-
let apiPath = '/users/{userId}/verification'.replace('{userId}', userId);
|
|
1422
|
-
let payload = {};
|
|
1423
|
-
if (typeof emailVerification !== 'undefined') {
|
|
1424
|
-
payload['emailVerification'] = emailVerification;
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
let response = undefined;
|
|
1428
|
-
|
|
1429
|
-
response = await client.call('patch', apiPath, {
|
|
1430
|
-
'content-type': 'application/json',
|
|
1431
|
-
}, payload);
|
|
1432
|
-
|
|
1433
|
-
if (parseOutput) {
|
|
1434
|
-
parse(response)
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
return response;
|
|
1438
|
-
|
|
1439
|
-
}
|
|
1440
|
-
interface UsersUpdatePhoneVerificationRequestParams {
|
|
1441
|
-
userId: string;
|
|
1442
|
-
phoneVerification: boolean;
|
|
1443
|
-
overrideForCli?: boolean;
|
|
1444
|
-
parseOutput?: boolean;
|
|
1445
|
-
sdk?: Client;
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
export const usersUpdatePhoneVerification = async ({userId,phoneVerification,parseOutput = true, overrideForCli = false, sdk = undefined}: UsersUpdatePhoneVerificationRequestParams): Promise<any> => {
|
|
1449
|
-
let client = !sdk ? await sdkForProject() :
|
|
1450
|
-
sdk;
|
|
1451
|
-
let apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId);
|
|
1452
|
-
let payload = {};
|
|
1453
|
-
if (typeof phoneVerification !== 'undefined') {
|
|
1454
|
-
payload['phoneVerification'] = phoneVerification;
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
let response = undefined;
|
|
1458
|
-
|
|
1459
|
-
response = await client.call('patch', apiPath, {
|
|
1460
|
-
'content-type': 'application/json',
|
|
1461
|
-
}, payload);
|
|
1462
|
-
|
|
1463
|
-
if (parseOutput) {
|
|
1464
|
-
parse(response)
|
|
1465
|
-
}
|
|
1466
|
-
|
|
1467
|
-
return response;
|
|
1468
|
-
|
|
1469
|
-
}
|
|
1470
|
-
users
|
|
1471
|
-
.command(`list`)
|
|
1472
|
-
.description(`Get a list of all the project's users. You can use the query params to filter your results.`)
|
|
1473
|
-
.option(`--queries [queries...]`, `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`)
|
|
1474
|
-
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
1475
|
-
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1476
|
-
.option(`--console`, `Get the resource console url`)
|
|
1477
|
-
.action(actionRunner(usersList))
|
|
1478
|
-
|
|
1479
|
-
users
|
|
1480
|
-
.command(`create`)
|
|
1481
|
-
.description(`Create a new user.`)
|
|
1482
|
-
.requiredOption(`--user-id <user-id>`, `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.`)
|
|
1483
|
-
.option(`--email <email>`, `User email.`)
|
|
1484
|
-
.option(`--phone <phone>`, `Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
|
|
1485
|
-
.option(`--password <password>`, `Plain text user password. Must be at least 8 chars.`)
|
|
1486
|
-
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
1487
|
-
.action(actionRunner(usersCreate))
|
|
1488
|
-
|
|
1489
|
-
users
|
|
1490
|
-
.command(`create-argon-2-user`)
|
|
1491
|
-
.description(`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.`)
|
|
1492
|
-
.requiredOption(`--user-id <user-id>`, `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.`)
|
|
1493
|
-
.requiredOption(`--email <email>`, `User email.`)
|
|
1494
|
-
.requiredOption(`--password <password>`, `User password hashed using Argon2.`)
|
|
1495
|
-
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
1496
|
-
.action(actionRunner(usersCreateArgon2User))
|
|
1497
|
-
|
|
1498
|
-
users
|
|
1499
|
-
.command(`create-bcrypt-user`)
|
|
1500
|
-
.description(`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.`)
|
|
1501
|
-
.requiredOption(`--user-id <user-id>`, `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.`)
|
|
1502
|
-
.requiredOption(`--email <email>`, `User email.`)
|
|
1503
|
-
.requiredOption(`--password <password>`, `User password hashed using Bcrypt.`)
|
|
1504
|
-
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
1505
|
-
.action(actionRunner(usersCreateBcryptUser))
|
|
1506
|
-
|
|
1507
|
-
users
|
|
1508
|
-
.command(`list-identities`)
|
|
1509
|
-
.description(`Get identities for all users.`)
|
|
1510
|
-
.option(`--queries [queries...]`, `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`)
|
|
1511
|
-
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
1512
|
-
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1513
|
-
.action(actionRunner(usersListIdentities))
|
|
1514
|
-
|
|
1515
|
-
users
|
|
1516
|
-
.command(`delete-identity`)
|
|
1517
|
-
.description(`Delete an identity by its unique ID.`)
|
|
1518
|
-
.requiredOption(`--identity-id <identity-id>`, `Identity ID.`)
|
|
1519
|
-
.action(actionRunner(usersDeleteIdentity))
|
|
1520
|
-
|
|
1521
|
-
users
|
|
1522
|
-
.command(`create-md-5-user`)
|
|
1523
|
-
.description(`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.`)
|
|
1524
|
-
.requiredOption(`--user-id <user-id>`, `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.`)
|
|
1525
|
-
.requiredOption(`--email <email>`, `User email.`)
|
|
1526
|
-
.requiredOption(`--password <password>`, `User password hashed using MD5.`)
|
|
1527
|
-
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
1528
|
-
.action(actionRunner(usersCreateMD5User))
|
|
1529
|
-
|
|
1530
|
-
users
|
|
1531
|
-
.command(`create-ph-pass-user`)
|
|
1532
|
-
.description(`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.`)
|
|
1533
|
-
.requiredOption(`--user-id <user-id>`, `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.`)
|
|
1534
|
-
.requiredOption(`--email <email>`, `User email.`)
|
|
1535
|
-
.requiredOption(`--password <password>`, `User password hashed using PHPass.`)
|
|
1536
|
-
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
1537
|
-
.action(actionRunner(usersCreatePHPassUser))
|
|
1538
|
-
|
|
1539
|
-
users
|
|
1540
|
-
.command(`create-scrypt-user`)
|
|
1541
|
-
.description(`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.`)
|
|
1542
|
-
.requiredOption(`--user-id <user-id>`, `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.`)
|
|
1543
|
-
.requiredOption(`--email <email>`, `User email.`)
|
|
1544
|
-
.requiredOption(`--password <password>`, `User password hashed using Scrypt.`)
|
|
1545
|
-
.requiredOption(`--password-salt <password-salt>`, `Optional salt used to hash password.`)
|
|
1546
|
-
.requiredOption(`--password-cpu <password-cpu>`, `Optional CPU cost used to hash password.`, parseInteger)
|
|
1547
|
-
.requiredOption(`--password-memory <password-memory>`, `Optional memory cost used to hash password.`, parseInteger)
|
|
1548
|
-
.requiredOption(`--password-parallel <password-parallel>`, `Optional parallelization cost used to hash password.`, parseInteger)
|
|
1549
|
-
.requiredOption(`--password-length <password-length>`, `Optional hash length used to hash password.`, parseInteger)
|
|
1550
|
-
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
1551
|
-
.action(actionRunner(usersCreateScryptUser))
|
|
1552
|
-
|
|
1553
|
-
users
|
|
1554
|
-
.command(`create-scrypt-modified-user`)
|
|
1555
|
-
.description(`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.`)
|
|
1556
|
-
.requiredOption(`--user-id <user-id>`, `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.`)
|
|
1557
|
-
.requiredOption(`--email <email>`, `User email.`)
|
|
1558
|
-
.requiredOption(`--password <password>`, `User password hashed using Scrypt Modified.`)
|
|
1559
|
-
.requiredOption(`--password-salt <password-salt>`, `Salt used to hash password.`)
|
|
1560
|
-
.requiredOption(`--password-salt-separator <password-salt-separator>`, `Salt separator used to hash password.`)
|
|
1561
|
-
.requiredOption(`--password-signer-key <password-signer-key>`, `Signer key used to hash password.`)
|
|
1562
|
-
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
1563
|
-
.action(actionRunner(usersCreateScryptModifiedUser))
|
|
1564
|
-
|
|
1565
|
-
users
|
|
1566
|
-
.command(`create-sha-user`)
|
|
1567
|
-
.description(`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.`)
|
|
1568
|
-
.requiredOption(`--user-id <user-id>`, `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.`)
|
|
1569
|
-
.requiredOption(`--email <email>`, `User email.`)
|
|
1570
|
-
.requiredOption(`--password <password>`, `User password hashed using SHA.`)
|
|
1571
|
-
.option(`--password-version <password-version>`, `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'`)
|
|
1572
|
-
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
1573
|
-
.action(actionRunner(usersCreateSHAUser))
|
|
1574
|
-
|
|
1575
|
-
users
|
|
1576
|
-
.command(`get-usage`)
|
|
1577
|
-
.description(`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. `)
|
|
1578
|
-
.option(`--range <range>`, `Date range.`)
|
|
1579
|
-
.action(actionRunner(usersGetUsage))
|
|
1580
|
-
|
|
1581
|
-
users
|
|
1582
|
-
.command(`get`)
|
|
1583
|
-
.description(`Get a user by its unique ID.`)
|
|
1584
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1585
|
-
.option(`--console`, `Get the resource console url`)
|
|
1586
|
-
.action(actionRunner(usersGet))
|
|
1587
|
-
|
|
1588
|
-
users
|
|
1589
|
-
.command(`delete`)
|
|
1590
|
-
.description(`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.`)
|
|
1591
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1592
|
-
.action(actionRunner(usersDelete))
|
|
1593
|
-
|
|
1594
|
-
users
|
|
1595
|
-
.command(`update-email`)
|
|
1596
|
-
.description(`Update the user email by its unique ID.`)
|
|
1597
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1598
|
-
.requiredOption(`--email <email>`, `User email.`)
|
|
1599
|
-
.action(actionRunner(usersUpdateEmail))
|
|
1600
|
-
|
|
1601
|
-
users
|
|
1602
|
-
.command(`create-jwt`)
|
|
1603
|
-
.description(`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.`)
|
|
1604
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1605
|
-
.option(`--session-id <session-id>`, `Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.`)
|
|
1606
|
-
.option(`--duration <duration>`, `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`, parseInteger)
|
|
1607
|
-
.action(actionRunner(usersCreateJWT))
|
|
1608
|
-
|
|
1609
|
-
users
|
|
1610
|
-
.command(`update-labels`)
|
|
1611
|
-
.description(`Update the user labels by its unique ID. 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.`)
|
|
1612
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1613
|
-
.requiredOption(`--labels [labels...]`, `Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.`)
|
|
1614
|
-
.action(actionRunner(usersUpdateLabels))
|
|
1615
|
-
|
|
1616
|
-
users
|
|
1617
|
-
.command(`list-logs`)
|
|
1618
|
-
.description(`Get the user activity logs list by its unique ID.`)
|
|
1619
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1620
|
-
.option(`--queries [queries...]`, `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`)
|
|
1621
|
-
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1622
|
-
.action(actionRunner(usersListLogs))
|
|
1623
|
-
|
|
1624
|
-
users
|
|
1625
|
-
.command(`list-memberships`)
|
|
1626
|
-
.description(`Get the user membership list by its unique ID.`)
|
|
1627
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1628
|
-
.option(`--queries [queries...]`, `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`)
|
|
1629
|
-
.option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
|
|
1630
|
-
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1631
|
-
.action(actionRunner(usersListMemberships))
|
|
1632
|
-
|
|
1633
|
-
users
|
|
1634
|
-
.command(`update-mfa`)
|
|
1635
|
-
.description(`Enable or disable MFA on a user account.`)
|
|
1636
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1637
|
-
.requiredOption(`--mfa [value]`, `Enable or disable MFA.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1638
|
-
.action(actionRunner(usersUpdateMFA))
|
|
1639
|
-
|
|
1640
|
-
users
|
|
1641
|
-
.command(`delete-mfa-authenticator`)
|
|
1642
|
-
.description(`Delete an authenticator app.`)
|
|
1643
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1644
|
-
.requiredOption(`--type <type>`, `Type of authenticator.`)
|
|
1645
|
-
.action(actionRunner(usersDeleteMFAAuthenticator))
|
|
1646
|
-
|
|
1647
|
-
users
|
|
1648
|
-
.command(`list-mfa-factors`)
|
|
1649
|
-
.description(`List the factors available on the account to be used as a MFA challange.`)
|
|
1650
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1651
|
-
.action(actionRunner(usersListMFAFactors))
|
|
1652
|
-
|
|
1653
|
-
users
|
|
1654
|
-
.command(`get-mfa-recovery-codes`)
|
|
1655
|
-
.description(`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.`)
|
|
1656
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1657
|
-
.action(actionRunner(usersGetMFARecoveryCodes))
|
|
1658
|
-
|
|
1659
|
-
users
|
|
1660
|
-
.command(`update-mfa-recovery-codes`)
|
|
1661
|
-
.description(`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.`)
|
|
1662
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1663
|
-
.action(actionRunner(usersUpdateMFARecoveryCodes))
|
|
1664
|
-
|
|
1665
|
-
users
|
|
1666
|
-
.command(`create-mfa-recovery-codes`)
|
|
1667
|
-
.description(`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.`)
|
|
1668
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1669
|
-
.action(actionRunner(usersCreateMFARecoveryCodes))
|
|
1670
|
-
|
|
1671
|
-
users
|
|
1672
|
-
.command(`update-name`)
|
|
1673
|
-
.description(`Update the user name by its unique ID.`)
|
|
1674
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1675
|
-
.requiredOption(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
1676
|
-
.action(actionRunner(usersUpdateName))
|
|
1677
|
-
|
|
1678
|
-
users
|
|
1679
|
-
.command(`update-password`)
|
|
1680
|
-
.description(`Update the user password by its unique ID.`)
|
|
1681
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1682
|
-
.requiredOption(`--password <password>`, `New user password. Must be at least 8 chars.`)
|
|
1683
|
-
.action(actionRunner(usersUpdatePassword))
|
|
1684
|
-
|
|
1685
|
-
users
|
|
1686
|
-
.command(`update-phone`)
|
|
1687
|
-
.description(`Update the user phone by its unique ID.`)
|
|
1688
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1689
|
-
.requiredOption(`--number <number>`, `User phone number.`)
|
|
1690
|
-
.action(actionRunner(usersUpdatePhone))
|
|
1691
|
-
|
|
1692
|
-
users
|
|
1693
|
-
.command(`get-prefs`)
|
|
1694
|
-
.description(`Get the user preferences by its unique ID.`)
|
|
1695
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1696
|
-
.action(actionRunner(usersGetPrefs))
|
|
1697
|
-
|
|
1698
|
-
users
|
|
1699
|
-
.command(`update-prefs`)
|
|
1700
|
-
.description(`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.`)
|
|
1701
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1702
|
-
.requiredOption(`--prefs <prefs>`, `Prefs key-value JSON object.`)
|
|
1703
|
-
.action(actionRunner(usersUpdatePrefs))
|
|
1704
|
-
|
|
1705
|
-
users
|
|
1706
|
-
.command(`list-sessions`)
|
|
1707
|
-
.description(`Get the user sessions list by its unique ID.`)
|
|
1708
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1709
|
-
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1710
|
-
.option(`--console`, `Get the resource console url`)
|
|
1711
|
-
.action(actionRunner(usersListSessions))
|
|
1712
|
-
|
|
1713
|
-
users
|
|
1714
|
-
.command(`create-session`)
|
|
1715
|
-
.description(`Creates a session for a user. Returns an immediately usable session object. 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.`)
|
|
1716
|
-
.requiredOption(`--user-id <user-id>`, `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.`)
|
|
1717
|
-
.action(actionRunner(usersCreateSession))
|
|
1718
|
-
|
|
1719
|
-
users
|
|
1720
|
-
.command(`delete-sessions`)
|
|
1721
|
-
.description(`Delete all user's sessions by using the user's unique ID.`)
|
|
1722
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1723
|
-
.action(actionRunner(usersDeleteSessions))
|
|
1724
|
-
|
|
1725
|
-
users
|
|
1726
|
-
.command(`delete-session`)
|
|
1727
|
-
.description(`Delete a user sessions by its unique ID.`)
|
|
1728
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1729
|
-
.requiredOption(`--session-id <session-id>`, `Session ID.`)
|
|
1730
|
-
.action(actionRunner(usersDeleteSession))
|
|
1731
|
-
|
|
1732
|
-
users
|
|
1733
|
-
.command(`update-status`)
|
|
1734
|
-
.description(`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.`)
|
|
1735
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1736
|
-
.requiredOption(`--status [value]`, `User Status. To activate the user pass 'true' and to block the user pass 'false'.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1737
|
-
.action(actionRunner(usersUpdateStatus))
|
|
1738
|
-
|
|
1739
|
-
users
|
|
1740
|
-
.command(`list-targets`)
|
|
1741
|
-
.description(`List the messaging targets that are associated with a user.`)
|
|
1742
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1743
|
-
.option(`--queries [queries...]`, `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`)
|
|
1744
|
-
.option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1745
|
-
.action(actionRunner(usersListTargets))
|
|
1746
|
-
|
|
1747
|
-
users
|
|
1748
|
-
.command(`create-target`)
|
|
1749
|
-
.description(`Create a messaging target.`)
|
|
1750
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1751
|
-
.requiredOption(`--target-id <target-id>`, `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.`)
|
|
1752
|
-
.requiredOption(`--provider-type <provider-type>`, `The target provider type. Can be one of the following: 'email', 'sms' or 'push'.`)
|
|
1753
|
-
.requiredOption(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
|
|
1754
|
-
.option(`--provider-id <provider-id>`, `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.`)
|
|
1755
|
-
.option(`--name <name>`, `Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.`)
|
|
1756
|
-
.action(actionRunner(usersCreateTarget))
|
|
1757
|
-
|
|
1758
|
-
users
|
|
1759
|
-
.command(`get-target`)
|
|
1760
|
-
.description(`Get a user's push notification target by ID.`)
|
|
1761
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1762
|
-
.requiredOption(`--target-id <target-id>`, `Target ID.`)
|
|
1763
|
-
.action(actionRunner(usersGetTarget))
|
|
1764
|
-
|
|
1765
|
-
users
|
|
1766
|
-
.command(`update-target`)
|
|
1767
|
-
.description(`Update a messaging target.`)
|
|
1768
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1769
|
-
.requiredOption(`--target-id <target-id>`, `Target ID.`)
|
|
1770
|
-
.option(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
|
|
1771
|
-
.option(`--provider-id <provider-id>`, `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.`)
|
|
1772
|
-
.option(`--name <name>`, `Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.`)
|
|
1773
|
-
.action(actionRunner(usersUpdateTarget))
|
|
1774
|
-
|
|
1775
|
-
users
|
|
1776
|
-
.command(`delete-target`)
|
|
1777
|
-
.description(`Delete a messaging target.`)
|
|
1778
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1779
|
-
.requiredOption(`--target-id <target-id>`, `Target ID.`)
|
|
1780
|
-
.action(actionRunner(usersDeleteTarget))
|
|
1781
|
-
|
|
1782
|
-
users
|
|
1783
|
-
.command(`create-token`)
|
|
1784
|
-
.description(`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. `)
|
|
1785
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1786
|
-
.option(`--length <length>`, `Token length in characters. The default length is 6 characters`, parseInteger)
|
|
1787
|
-
.option(`--expire <expire>`, `Token expiration period in seconds. The default expiration is 15 minutes.`, parseInteger)
|
|
1788
|
-
.action(actionRunner(usersCreateToken))
|
|
1789
|
-
|
|
1790
|
-
users
|
|
1791
|
-
.command(`update-email-verification`)
|
|
1792
|
-
.description(`Update the user email verification status by its unique ID.`)
|
|
1793
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1794
|
-
.requiredOption(`--email-verification [value]`, `User email verification status.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1795
|
-
.action(actionRunner(usersUpdateEmailVerification))
|
|
1796
|
-
|
|
1797
|
-
users
|
|
1798
|
-
.command(`update-phone-verification`)
|
|
1799
|
-
.description(`Update the user phone verification status by its unique ID.`)
|
|
1800
|
-
.requiredOption(`--user-id <user-id>`, `User ID.`)
|
|
1801
|
-
.requiredOption(`--phone-verification [value]`, `User phone verification status.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
|
|
1802
|
-
.action(actionRunner(usersUpdatePhoneVerification))
|
|
1803
|
-
|
|
1804
|
-
|