appwrite-cli 4.2.2 → 5.0.1

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.
Files changed (315) hide show
  1. package/.github/workflows/npm-publish.yml +1 -1
  2. package/README.md +6 -9
  3. package/docs/examples/account/{create-email-session.md → create-email-password-session.md} +1 -1
  4. package/docs/examples/account/create-email-token.md +4 -0
  5. package/docs/examples/account/create-magic-u-r-l-token.md +5 -0
  6. package/docs/examples/account/create-mfa-authenticator.md +2 -0
  7. package/docs/examples/account/create-mfa-challenge.md +2 -0
  8. package/docs/examples/account/create-mfa-recovery-codes.md +1 -0
  9. package/docs/examples/account/create-o-auth2token.md +5 -0
  10. package/docs/examples/account/create-phone-token.md +3 -0
  11. package/docs/examples/account/create-push-target.md +4 -0
  12. package/docs/examples/account/create-session.md +3 -0
  13. package/docs/examples/account/create.md +1 -1
  14. package/docs/examples/account/delete-identity.md +1 -1
  15. package/docs/examples/account/delete-mfa-authenticator.md +3 -0
  16. package/docs/examples/account/delete-push-target.md +2 -0
  17. package/docs/examples/account/delete-session.md +1 -1
  18. package/docs/examples/account/delete.md +1 -0
  19. package/docs/examples/account/get-mfa-recovery-codes.md +1 -0
  20. package/docs/examples/account/get-session.md +1 -1
  21. package/docs/examples/account/list-mfa-factors.md +1 -0
  22. package/docs/examples/account/update-m-f-a.md +2 -0
  23. package/docs/examples/account/update-magic-u-r-l-session.md +2 -2
  24. package/docs/examples/account/update-mfa-authenticator.md +3 -0
  25. package/docs/examples/account/update-mfa-challenge.md +3 -0
  26. package/docs/examples/account/update-mfa-recovery-codes.md +1 -0
  27. package/docs/examples/account/update-name.md +1 -1
  28. package/docs/examples/account/update-phone-session.md +2 -2
  29. package/docs/examples/account/update-phone-verification.md +2 -2
  30. package/docs/examples/account/update-push-target.md +3 -0
  31. package/docs/examples/account/update-recovery.md +3 -4
  32. package/docs/examples/account/update-session.md +1 -1
  33. package/docs/examples/account/update-verification.md +2 -2
  34. package/docs/examples/assistant/chat.md +1 -1
  35. package/docs/examples/avatars/get-q-r.md +1 -1
  36. package/docs/examples/databases/create-boolean-attribute.md +2 -2
  37. package/docs/examples/databases/create-collection.md +3 -3
  38. package/docs/examples/databases/create-datetime-attribute.md +2 -2
  39. package/docs/examples/databases/create-document.md +3 -3
  40. package/docs/examples/databases/create-email-attribute.md +2 -2
  41. package/docs/examples/databases/create-enum-attribute.md +2 -2
  42. package/docs/examples/databases/create-float-attribute.md +2 -2
  43. package/docs/examples/databases/create-index.md +2 -2
  44. package/docs/examples/databases/create-integer-attribute.md +2 -2
  45. package/docs/examples/databases/create-ip-attribute.md +2 -2
  46. package/docs/examples/databases/create-relationship-attribute.md +3 -3
  47. package/docs/examples/databases/create-string-attribute.md +2 -2
  48. package/docs/examples/databases/create-url-attribute.md +2 -2
  49. package/docs/examples/databases/create.md +2 -2
  50. package/docs/examples/databases/delete-attribute.md +2 -2
  51. package/docs/examples/databases/delete-collection.md +2 -2
  52. package/docs/examples/databases/delete-document.md +3 -3
  53. package/docs/examples/databases/delete-index.md +2 -2
  54. package/docs/examples/databases/delete.md +1 -1
  55. package/docs/examples/databases/get-attribute.md +2 -2
  56. package/docs/examples/databases/get-collection-usage.md +2 -2
  57. package/docs/examples/databases/get-collection.md +2 -2
  58. package/docs/examples/databases/get-database-usage.md +1 -1
  59. package/docs/examples/databases/get-document.md +3 -3
  60. package/docs/examples/databases/get-index.md +2 -2
  61. package/docs/examples/databases/get.md +1 -1
  62. package/docs/examples/databases/list-attributes.md +2 -2
  63. package/docs/examples/databases/list-collection-logs.md +2 -2
  64. package/docs/examples/databases/list-collections.md +1 -1
  65. package/docs/examples/databases/list-document-logs.md +3 -3
  66. package/docs/examples/databases/list-documents.md +2 -2
  67. package/docs/examples/databases/list-indexes.md +2 -2
  68. package/docs/examples/databases/list-logs.md +1 -1
  69. package/docs/examples/databases/update-boolean-attribute.md +2 -2
  70. package/docs/examples/databases/update-collection.md +3 -3
  71. package/docs/examples/databases/update-datetime-attribute.md +2 -2
  72. package/docs/examples/databases/update-document.md +3 -3
  73. package/docs/examples/databases/update-email-attribute.md +2 -2
  74. package/docs/examples/databases/update-enum-attribute.md +3 -3
  75. package/docs/examples/databases/update-float-attribute.md +2 -2
  76. package/docs/examples/databases/update-integer-attribute.md +2 -2
  77. package/docs/examples/databases/update-ip-attribute.md +2 -2
  78. package/docs/examples/databases/update-relationship-attribute.md +2 -2
  79. package/docs/examples/databases/update-string-attribute.md +3 -3
  80. package/docs/examples/databases/update-url-attribute.md +2 -2
  81. package/docs/examples/databases/update.md +2 -2
  82. package/docs/examples/functions/create-build.md +3 -3
  83. package/docs/examples/functions/create-deployment.md +1 -1
  84. package/docs/examples/functions/create-execution.md +1 -1
  85. package/docs/examples/functions/create-variable.md +3 -3
  86. package/docs/examples/functions/create.md +3 -3
  87. package/docs/examples/functions/delete-deployment.md +2 -2
  88. package/docs/examples/functions/delete-variable.md +2 -2
  89. package/docs/examples/functions/delete.md +1 -1
  90. package/docs/examples/functions/download-deployment.md +2 -2
  91. package/docs/examples/functions/get-deployment.md +2 -2
  92. package/docs/examples/functions/get-execution.md +2 -2
  93. package/docs/examples/functions/get-function-usage.md +1 -1
  94. package/docs/examples/functions/get-variable.md +2 -2
  95. package/docs/examples/functions/get.md +1 -1
  96. package/docs/examples/functions/list-deployments.md +1 -1
  97. package/docs/examples/functions/list-executions.md +1 -1
  98. package/docs/examples/functions/list-variables.md +1 -1
  99. package/docs/examples/functions/update-deployment.md +2 -2
  100. package/docs/examples/functions/update-variable.md +3 -3
  101. package/docs/examples/functions/update.md +2 -2
  102. package/docs/examples/health/get-certificate.md +2 -0
  103. package/docs/examples/health/get-failed-jobs.md +3 -0
  104. package/docs/examples/health/get-queue-usage-dump.md +2 -0
  105. package/docs/examples/health/get-queue-usage.md +2 -0
  106. package/docs/examples/health/get-storage.md +1 -0
  107. package/docs/examples/messaging/create-apns-provider.md +9 -0
  108. package/docs/examples/messaging/create-email.md +13 -0
  109. package/docs/examples/messaging/create-fcm-provider.md +5 -0
  110. package/docs/examples/messaging/create-mailgun-provider.md +11 -0
  111. package/docs/examples/messaging/create-msg91provider.md +7 -0
  112. package/docs/examples/messaging/create-push.md +17 -0
  113. package/docs/examples/messaging/create-sendgrid-provider.md +9 -0
  114. package/docs/examples/messaging/create-sms.md +8 -0
  115. package/docs/examples/messaging/create-smtp-provider.md +15 -0
  116. package/docs/examples/messaging/create-subscriber.md +4 -0
  117. package/docs/examples/messaging/create-telesign-provider.md +7 -0
  118. package/docs/examples/messaging/create-textmagic-provider.md +7 -0
  119. package/docs/examples/messaging/create-topic.md +4 -0
  120. package/docs/examples/messaging/create-twilio-provider.md +7 -0
  121. package/docs/examples/messaging/create-vonage-provider.md +7 -0
  122. package/docs/examples/messaging/delete-provider.md +2 -0
  123. package/docs/examples/messaging/delete-subscriber.md +3 -0
  124. package/docs/examples/messaging/delete-topic.md +2 -0
  125. package/docs/examples/messaging/delete.md +2 -0
  126. package/docs/examples/messaging/get-message.md +2 -0
  127. package/docs/examples/messaging/get-provider.md +2 -0
  128. package/docs/examples/messaging/get-subscriber.md +3 -0
  129. package/docs/examples/messaging/get-topic.md +2 -0
  130. package/docs/examples/messaging/list-message-logs.md +3 -0
  131. package/docs/examples/messaging/list-messages.md +3 -0
  132. package/docs/examples/messaging/list-provider-logs.md +3 -0
  133. package/docs/examples/messaging/list-providers.md +3 -0
  134. package/docs/examples/messaging/list-subscriber-logs.md +3 -0
  135. package/docs/examples/messaging/list-subscribers.md +4 -0
  136. package/docs/examples/messaging/list-targets.md +3 -0
  137. package/docs/examples/messaging/list-topic-logs.md +3 -0
  138. package/docs/examples/messaging/list-topics.md +3 -0
  139. package/docs/examples/messaging/update-apns-provider.md +9 -0
  140. package/docs/examples/messaging/update-email.md +12 -0
  141. package/docs/examples/messaging/update-fcm-provider.md +5 -0
  142. package/docs/examples/messaging/update-mailgun-provider.md +11 -0
  143. package/docs/examples/messaging/update-msg91provider.md +7 -0
  144. package/docs/examples/messaging/update-push.md +17 -0
  145. package/docs/examples/messaging/update-sendgrid-provider.md +9 -0
  146. package/docs/examples/messaging/update-sms.md +8 -0
  147. package/docs/examples/messaging/update-smtp-provider.md +15 -0
  148. package/docs/examples/messaging/update-telesign-provider.md +7 -0
  149. package/docs/examples/messaging/update-textmagic-provider.md +7 -0
  150. package/docs/examples/messaging/update-topic.md +4 -0
  151. package/docs/examples/messaging/update-twilio-provider.md +7 -0
  152. package/docs/examples/messaging/update-vonage-provider.md +7 -0
  153. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  154. package/docs/examples/migrations/create-firebase-migration.md +1 -1
  155. package/docs/examples/migrations/create-firebase-o-auth-migration.md +1 -1
  156. package/docs/examples/migrations/create-n-host-migration.md +6 -6
  157. package/docs/examples/migrations/create-supabase-migration.md +4 -4
  158. package/docs/examples/migrations/delete.md +1 -1
  159. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  160. package/docs/examples/migrations/get-firebase-report-o-auth.md +1 -1
  161. package/docs/examples/migrations/get-firebase-report.md +1 -1
  162. package/docs/examples/migrations/get-n-host-report.md +6 -6
  163. package/docs/examples/migrations/get-supabase-report.md +4 -4
  164. package/docs/examples/migrations/get.md +1 -1
  165. package/docs/examples/migrations/retry.md +1 -1
  166. package/docs/examples/project/create-variable.md +2 -2
  167. package/docs/examples/project/delete-variable.md +1 -1
  168. package/docs/examples/project/get-usage.md +2 -0
  169. package/docs/examples/project/get-variable.md +1 -1
  170. package/docs/examples/project/update-variable.md +2 -2
  171. package/docs/examples/projects/create-key.md +2 -2
  172. package/docs/examples/projects/create-platform.md +2 -2
  173. package/docs/examples/projects/create-smtp-test.md +11 -0
  174. package/docs/examples/projects/create-webhook.md +4 -3
  175. package/docs/examples/projects/create.md +2 -2
  176. package/docs/examples/projects/delete-email-template.md +1 -1
  177. package/docs/examples/projects/delete-key.md +2 -2
  178. package/docs/examples/projects/delete-platform.md +2 -2
  179. package/docs/examples/projects/delete-sms-template.md +1 -1
  180. package/docs/examples/projects/delete-webhook.md +2 -2
  181. package/docs/examples/projects/delete.md +1 -1
  182. package/docs/examples/projects/get-email-template.md +1 -1
  183. package/docs/examples/projects/get-key.md +2 -2
  184. package/docs/examples/projects/get-platform.md +2 -2
  185. package/docs/examples/projects/get-sms-template.md +1 -1
  186. package/docs/examples/projects/get-webhook.md +2 -2
  187. package/docs/examples/projects/get.md +1 -1
  188. package/docs/examples/projects/list-keys.md +1 -1
  189. package/docs/examples/projects/list-platforms.md +1 -1
  190. package/docs/examples/projects/list-webhooks.md +1 -1
  191. package/docs/examples/projects/update-api-status-all.md +3 -0
  192. package/docs/examples/projects/update-api-status.md +4 -0
  193. package/docs/examples/projects/update-auth-duration.md +1 -1
  194. package/docs/examples/projects/update-auth-limit.md +1 -1
  195. package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
  196. package/docs/examples/projects/update-auth-password-history.md +1 -1
  197. package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
  198. package/docs/examples/projects/update-auth-status.md +1 -1
  199. package/docs/examples/projects/update-email-template.md +3 -3
  200. package/docs/examples/projects/update-key.md +3 -3
  201. package/docs/examples/projects/update-o-auth2.md +1 -1
  202. package/docs/examples/projects/update-personal-data-check.md +1 -1
  203. package/docs/examples/projects/update-platform.md +3 -3
  204. package/docs/examples/projects/update-service-status-all.md +1 -1
  205. package/docs/examples/projects/update-service-status.md +1 -1
  206. package/docs/examples/projects/update-sms-template.md +2 -2
  207. package/docs/examples/projects/update-smtp.md +11 -0
  208. package/docs/examples/projects/update-team.md +2 -2
  209. package/docs/examples/projects/update-webhook-signature.md +2 -2
  210. package/docs/examples/projects/update-webhook.md +5 -4
  211. package/docs/examples/projects/update.md +2 -2
  212. package/docs/examples/proxy/delete-rule.md +1 -1
  213. package/docs/examples/proxy/get-rule.md +1 -1
  214. package/docs/examples/proxy/update-rule-verification.md +1 -1
  215. package/docs/examples/storage/create-bucket.md +2 -2
  216. package/docs/examples/storage/create-file.md +2 -2
  217. package/docs/examples/storage/delete-bucket.md +1 -1
  218. package/docs/examples/storage/delete-file.md +2 -2
  219. package/docs/examples/storage/get-bucket-usage.md +1 -1
  220. package/docs/examples/storage/get-bucket.md +1 -1
  221. package/docs/examples/storage/get-file-download.md +2 -2
  222. package/docs/examples/storage/get-file-preview.md +2 -2
  223. package/docs/examples/storage/get-file-view.md +2 -2
  224. package/docs/examples/storage/get-file.md +2 -2
  225. package/docs/examples/storage/list-files.md +1 -1
  226. package/docs/examples/storage/update-bucket.md +2 -2
  227. package/docs/examples/storage/update-file.md +2 -2
  228. package/docs/examples/teams/create-membership.md +1 -1
  229. package/docs/examples/teams/create.md +2 -2
  230. package/docs/examples/teams/delete-membership.md +2 -2
  231. package/docs/examples/teams/delete.md +1 -1
  232. package/docs/examples/teams/get-membership.md +2 -2
  233. package/docs/examples/teams/get-prefs.md +1 -1
  234. package/docs/examples/teams/get.md +1 -1
  235. package/docs/examples/teams/list-logs.md +1 -1
  236. package/docs/examples/teams/list-memberships.md +1 -1
  237. package/docs/examples/teams/update-membership-status.md +4 -4
  238. package/docs/examples/teams/update-membership.md +2 -2
  239. package/docs/examples/teams/update-name.md +2 -2
  240. package/docs/examples/teams/update-prefs.md +1 -1
  241. package/docs/examples/users/create-argon2user.md +1 -1
  242. package/docs/examples/users/create-bcrypt-user.md +1 -1
  243. package/docs/examples/users/create-m-d5user.md +1 -1
  244. package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
  245. package/docs/examples/users/create-p-h-pass-user.md +1 -1
  246. package/docs/examples/users/create-s-h-a-user.md +1 -1
  247. package/docs/examples/users/create-scrypt-modified-user.md +4 -4
  248. package/docs/examples/users/create-scrypt-user.md +2 -2
  249. package/docs/examples/users/create-session.md +2 -0
  250. package/docs/examples/users/create-target.md +7 -0
  251. package/docs/examples/users/create-token.md +4 -0
  252. package/docs/examples/users/create.md +1 -1
  253. package/docs/examples/users/delete-identity.md +1 -1
  254. package/docs/examples/users/delete-mfa-authenticator.md +3 -0
  255. package/docs/examples/users/delete-session.md +2 -2
  256. package/docs/examples/users/delete-sessions.md +1 -1
  257. package/docs/examples/users/delete-target.md +3 -0
  258. package/docs/examples/users/delete.md +1 -1
  259. package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
  260. package/docs/examples/users/get-prefs.md +1 -1
  261. package/docs/examples/users/get-target.md +3 -0
  262. package/docs/examples/users/get-usage.md +0 -1
  263. package/docs/examples/users/get.md +1 -1
  264. package/docs/examples/users/list-logs.md +1 -1
  265. package/docs/examples/users/list-memberships.md +1 -1
  266. package/docs/examples/users/list-mfa-factors.md +2 -0
  267. package/docs/examples/users/list-sessions.md +1 -1
  268. package/docs/examples/users/list-targets.md +3 -0
  269. package/docs/examples/users/update-email-verification.md +1 -1
  270. package/docs/examples/users/update-email.md +1 -1
  271. package/docs/examples/users/update-labels.md +1 -1
  272. package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
  273. package/docs/examples/users/update-mfa.md +3 -0
  274. package/docs/examples/users/update-name.md +2 -2
  275. package/docs/examples/users/update-password.md +1 -1
  276. package/docs/examples/users/update-phone-verification.md +1 -1
  277. package/docs/examples/users/update-phone.md +1 -1
  278. package/docs/examples/users/update-prefs.md +1 -1
  279. package/docs/examples/users/update-status.md +1 -1
  280. package/docs/examples/users/update-target.md +6 -0
  281. package/docs/examples/vcs/create-repository-detection.md +2 -2
  282. package/docs/examples/vcs/create-repository.md +2 -2
  283. package/docs/examples/vcs/delete-installation.md +1 -1
  284. package/docs/examples/vcs/get-installation.md +1 -1
  285. package/docs/examples/vcs/get-repository.md +2 -2
  286. package/docs/examples/vcs/list-repositories.md +1 -1
  287. package/docs/examples/vcs/list-repository-branches.md +2 -2
  288. package/docs/examples/vcs/update-external-deployments.md +3 -3
  289. package/index.js +2 -0
  290. package/install.ps1 +5 -5
  291. package/install.sh +4 -4
  292. package/lib/client.js +4 -4
  293. package/lib/commands/account.js +906 -226
  294. package/lib/commands/avatars.js +3 -3
  295. package/lib/commands/databases.js +22 -22
  296. package/lib/commands/deploy.js +45 -6
  297. package/lib/commands/functions.js +5 -5
  298. package/lib/commands/generic.js +2 -2
  299. package/lib/commands/health.js +193 -1
  300. package/lib/commands/messaging.js +2815 -0
  301. package/lib/commands/migrations.js +2 -2
  302. package/lib/commands/project.js +15 -5
  303. package/lib/commands/projects.js +210 -72
  304. package/lib/commands/proxy.js +1 -1
  305. package/lib/commands/storage.js +6 -6
  306. package/lib/commands/teams.js +2 -2
  307. package/lib/commands/users.js +545 -14
  308. package/lib/paginate.js +2 -2
  309. package/lib/parser.js +2 -1
  310. package/package.json +1 -1
  311. package/scoop/appwrite.json +3 -3
  312. package/docs/examples/account/create-magic-u-r-l-session.md +0 -4
  313. package/docs/examples/account/create-phone-session.md +0 -3
  314. package/docs/examples/projects/get-usage.md +0 -3
  315. package/docs/examples/projects/update-smtp-configuration.md +0 -11
@@ -41,7 +41,7 @@ const users = new Command("users").description(commandDescriptions['users']).con
41
41
 
42
42
  /**
43
43
  * @typedef {Object} UsersListRequestParams
44
- * @property {string[]} 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
44
+ * @property {string[]} 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
45
45
  * @property {string} search Search term to filter your list results. Max length: 256 chars.
46
46
  * @property {boolean} parseOutput
47
47
  * @property {libClient | undefined} sdk
@@ -213,7 +213,7 @@ const usersCreateBcryptUser = async ({ userId, email, password, name, parseOutpu
213
213
 
214
214
  /**
215
215
  * @typedef {Object} UsersListIdentitiesRequestParams
216
- * @property {string} 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
216
+ * @property {string[]} 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
217
217
  * @property {string} search Search term to filter your list results. Max length: 256 chars.
218
218
  * @property {boolean} parseOutput
219
219
  * @property {libClient | undefined} sdk
@@ -489,7 +489,7 @@ const usersCreateScryptModifiedUser = async ({ userId, email, password, password
489
489
  * @property {string} userId 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.
490
490
  * @property {string} email User email.
491
491
  * @property {string} password User password hashed using SHA.
492
- * @property {string} passwordVersion 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'
492
+ * @property {PasswordHash} passwordVersion 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'
493
493
  * @property {string} name User name. Max length: 128 chars.
494
494
  * @property {boolean} parseOutput
495
495
  * @property {libClient | undefined} sdk
@@ -534,8 +534,7 @@ const usersCreateSHAUser = async ({ userId, email, password, passwordVersion, na
534
534
 
535
535
  /**
536
536
  * @typedef {Object} UsersGetUsageRequestParams
537
- * @property {string} range Date range.
538
- * @property {string} provider Provider Name.
537
+ * @property {UserUsageRange} range Date range.
539
538
  * @property {boolean} parseOutput
540
539
  * @property {libClient | undefined} sdk
541
540
  */
@@ -543,16 +542,13 @@ const usersCreateSHAUser = async ({ userId, email, password, passwordVersion, na
543
542
  /**
544
543
  * @param {UsersGetUsageRequestParams} params
545
544
  */
546
- const usersGetUsage = async ({ range, provider, parseOutput = true, sdk = undefined}) => {
545
+ const usersGetUsage = async ({ range, parseOutput = true, sdk = undefined}) => {
547
546
  let client = !sdk ? await sdkForProject() : sdk;
548
547
  let apiPath = '/users/usage';
549
548
  let payload = {};
550
549
  if (typeof range !== 'undefined') {
551
550
  payload['range'] = range;
552
551
  }
553
- if (typeof provider !== 'undefined') {
554
- payload['provider'] = provider;
555
- }
556
552
 
557
553
  let response = undefined;
558
554
 
@@ -662,7 +658,7 @@ const usersUpdateEmail = async ({ userId, email, parseOutput = true, sdk = undef
662
658
  /**
663
659
  * @typedef {Object} UsersUpdateLabelsRequestParams
664
660
  * @property {string} userId User ID.
665
- * @property {string[]} labels Array of user labels. Replaces the previous labels. Maximum of 100 labels are allowed, each up to 36 alphanumeric characters long.
661
+ * @property {string[]} labels Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
666
662
  * @property {boolean} parseOutput
667
663
  * @property {libClient | undefined} sdk
668
664
  */
@@ -755,6 +751,185 @@ const usersListMemberships = async ({ userId, parseOutput = true, sdk = undefine
755
751
  return response;
756
752
  }
757
753
 
754
+ /**
755
+ * @typedef {Object} UsersUpdateMfaRequestParams
756
+ * @property {string} userId User ID.
757
+ * @property {boolean} mfa Enable or disable MFA.
758
+ * @property {boolean} parseOutput
759
+ * @property {libClient | undefined} sdk
760
+ */
761
+
762
+ /**
763
+ * @param {UsersUpdateMfaRequestParams} params
764
+ */
765
+ const usersUpdateMfa = async ({ userId, mfa, parseOutput = true, sdk = undefined}) => {
766
+ let client = !sdk ? await sdkForProject() : sdk;
767
+ let apiPath = '/users/{userId}/mfa'.replace('{userId}', userId);
768
+ let payload = {};
769
+ if (typeof mfa !== 'undefined') {
770
+ payload['mfa'] = mfa;
771
+ }
772
+
773
+ let response = undefined;
774
+
775
+ response = await client.call('patch', apiPath, {
776
+ 'content-type': 'application/json',
777
+ }, payload);
778
+
779
+ if (parseOutput) {
780
+ parse(response)
781
+ success()
782
+ }
783
+
784
+ return response;
785
+ }
786
+
787
+ /**
788
+ * @typedef {Object} UsersDeleteMfaAuthenticatorRequestParams
789
+ * @property {string} userId User ID.
790
+ * @property {AuthenticatorType} type Type of authenticator.
791
+ * @property {boolean} parseOutput
792
+ * @property {libClient | undefined} sdk
793
+ */
794
+
795
+ /**
796
+ * @param {UsersDeleteMfaAuthenticatorRequestParams} params
797
+ */
798
+ const usersDeleteMfaAuthenticator = async ({ userId, type, parseOutput = true, sdk = undefined}) => {
799
+ let client = !sdk ? await sdkForProject() : sdk;
800
+ let apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type);
801
+ let payload = {};
802
+
803
+ let response = undefined;
804
+
805
+ response = await client.call('delete', apiPath, {
806
+ 'content-type': 'application/json',
807
+ }, payload);
808
+
809
+ if (parseOutput) {
810
+ parse(response)
811
+ success()
812
+ }
813
+
814
+ return response;
815
+ }
816
+
817
+ /**
818
+ * @typedef {Object} UsersListMfaFactorsRequestParams
819
+ * @property {string} userId User ID.
820
+ * @property {boolean} parseOutput
821
+ * @property {libClient | undefined} sdk
822
+ */
823
+
824
+ /**
825
+ * @param {UsersListMfaFactorsRequestParams} params
826
+ */
827
+ const usersListMfaFactors = async ({ userId, parseOutput = true, sdk = undefined}) => {
828
+ let client = !sdk ? await sdkForProject() : sdk;
829
+ let apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId);
830
+ let payload = {};
831
+
832
+ let response = undefined;
833
+
834
+ response = await client.call('get', apiPath, {
835
+ 'content-type': 'application/json',
836
+ }, payload);
837
+
838
+ if (parseOutput) {
839
+ parse(response)
840
+ success()
841
+ }
842
+
843
+ return response;
844
+ }
845
+
846
+ /**
847
+ * @typedef {Object} UsersGetMfaRecoveryCodesRequestParams
848
+ * @property {string} userId User ID.
849
+ * @property {boolean} parseOutput
850
+ * @property {libClient | undefined} sdk
851
+ */
852
+
853
+ /**
854
+ * @param {UsersGetMfaRecoveryCodesRequestParams} params
855
+ */
856
+ const usersGetMfaRecoveryCodes = async ({ userId, parseOutput = true, sdk = undefined}) => {
857
+ let client = !sdk ? await sdkForProject() : sdk;
858
+ let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
859
+ let payload = {};
860
+
861
+ let response = undefined;
862
+
863
+ response = await client.call('get', apiPath, {
864
+ 'content-type': 'application/json',
865
+ }, payload);
866
+
867
+ if (parseOutput) {
868
+ parse(response)
869
+ success()
870
+ }
871
+
872
+ return response;
873
+ }
874
+
875
+ /**
876
+ * @typedef {Object} UsersUpdateMfaRecoveryCodesRequestParams
877
+ * @property {string} userId User ID.
878
+ * @property {boolean} parseOutput
879
+ * @property {libClient | undefined} sdk
880
+ */
881
+
882
+ /**
883
+ * @param {UsersUpdateMfaRecoveryCodesRequestParams} params
884
+ */
885
+ const usersUpdateMfaRecoveryCodes = async ({ userId, parseOutput = true, sdk = undefined}) => {
886
+ let client = !sdk ? await sdkForProject() : sdk;
887
+ let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
888
+ let payload = {};
889
+
890
+ let response = undefined;
891
+
892
+ response = await client.call('put', apiPath, {
893
+ 'content-type': 'application/json',
894
+ }, payload);
895
+
896
+ if (parseOutput) {
897
+ parse(response)
898
+ success()
899
+ }
900
+
901
+ return response;
902
+ }
903
+
904
+ /**
905
+ * @typedef {Object} UsersCreateMfaRecoveryCodesRequestParams
906
+ * @property {string} userId User ID.
907
+ * @property {boolean} parseOutput
908
+ * @property {libClient | undefined} sdk
909
+ */
910
+
911
+ /**
912
+ * @param {UsersCreateMfaRecoveryCodesRequestParams} params
913
+ */
914
+ const usersCreateMfaRecoveryCodes = async ({ userId, parseOutput = true, sdk = undefined}) => {
915
+ let client = !sdk ? await sdkForProject() : sdk;
916
+ let apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
917
+ let payload = {};
918
+
919
+ let response = undefined;
920
+
921
+ response = await client.call('patch', apiPath, {
922
+ 'content-type': 'application/json',
923
+ }, payload);
924
+
925
+ if (parseOutput) {
926
+ parse(response)
927
+ success()
928
+ }
929
+
930
+ return response;
931
+ }
932
+
758
933
  /**
759
934
  * @typedef {Object} UsersUpdateNameRequestParams
760
935
  * @property {string} userId User ID.
@@ -945,6 +1120,35 @@ const usersListSessions = async ({ userId, parseOutput = true, sdk = undefined})
945
1120
  return response;
946
1121
  }
947
1122
 
1123
+ /**
1124
+ * @typedef {Object} UsersCreateSessionRequestParams
1125
+ * @property {string} userId 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.
1126
+ * @property {boolean} parseOutput
1127
+ * @property {libClient | undefined} sdk
1128
+ */
1129
+
1130
+ /**
1131
+ * @param {UsersCreateSessionRequestParams} params
1132
+ */
1133
+ const usersCreateSession = async ({ userId, parseOutput = true, sdk = undefined}) => {
1134
+ let client = !sdk ? await sdkForProject() : sdk;
1135
+ let apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
1136
+ let payload = {};
1137
+
1138
+ let response = undefined;
1139
+
1140
+ response = await client.call('post', apiPath, {
1141
+ 'content-type': 'application/json',
1142
+ }, payload);
1143
+
1144
+ if (parseOutput) {
1145
+ parse(response)
1146
+ success()
1147
+ }
1148
+
1149
+ return response;
1150
+ }
1151
+
948
1152
  /**
949
1153
  * @typedef {Object} UsersDeleteSessionsRequestParams
950
1154
  * @property {string} userId User ID.
@@ -1037,6 +1241,227 @@ const usersUpdateStatus = async ({ userId, status, parseOutput = true, sdk = und
1037
1241
  return response;
1038
1242
  }
1039
1243
 
1244
+ /**
1245
+ * @typedef {Object} UsersListTargetsRequestParams
1246
+ * @property {string} userId User ID.
1247
+ * @property {string[]} 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
1248
+ * @property {boolean} parseOutput
1249
+ * @property {libClient | undefined} sdk
1250
+ */
1251
+
1252
+ /**
1253
+ * @param {UsersListTargetsRequestParams} params
1254
+ */
1255
+ const usersListTargets = async ({ userId, queries, parseOutput = true, sdk = undefined}) => {
1256
+ let client = !sdk ? await sdkForProject() : sdk;
1257
+ let apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
1258
+ let payload = {};
1259
+ if (typeof queries !== 'undefined') {
1260
+ payload['queries'] = queries;
1261
+ }
1262
+
1263
+ let response = undefined;
1264
+
1265
+ response = await client.call('get', apiPath, {
1266
+ 'content-type': 'application/json',
1267
+ }, payload);
1268
+
1269
+ if (parseOutput) {
1270
+ parse(response)
1271
+ success()
1272
+ }
1273
+
1274
+ return response;
1275
+ }
1276
+
1277
+ /**
1278
+ * @typedef {Object} UsersCreateTargetRequestParams
1279
+ * @property {string} userId User ID.
1280
+ * @property {string} targetId 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.
1281
+ * @property {MessagingProviderType} providerType The target provider type. Can be one of the following: 'email', 'sms' or 'push'.
1282
+ * @property {string} identifier The target identifier (token, email, phone etc.)
1283
+ * @property {string} providerId 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.
1284
+ * @property {string} name Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
1285
+ * @property {boolean} parseOutput
1286
+ * @property {libClient | undefined} sdk
1287
+ */
1288
+
1289
+ /**
1290
+ * @param {UsersCreateTargetRequestParams} params
1291
+ */
1292
+ const usersCreateTarget = async ({ userId, targetId, providerType, identifier, providerId, name, parseOutput = true, sdk = undefined}) => {
1293
+ let client = !sdk ? await sdkForProject() : sdk;
1294
+ let apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
1295
+ let payload = {};
1296
+ if (typeof targetId !== 'undefined') {
1297
+ payload['targetId'] = targetId;
1298
+ }
1299
+ if (typeof providerType !== 'undefined') {
1300
+ payload['providerType'] = providerType;
1301
+ }
1302
+ if (typeof identifier !== 'undefined') {
1303
+ payload['identifier'] = identifier;
1304
+ }
1305
+ if (typeof providerId !== 'undefined') {
1306
+ payload['providerId'] = providerId;
1307
+ }
1308
+ if (typeof name !== 'undefined') {
1309
+ payload['name'] = name;
1310
+ }
1311
+
1312
+ let response = undefined;
1313
+
1314
+ response = await client.call('post', apiPath, {
1315
+ 'content-type': 'application/json',
1316
+ }, payload);
1317
+
1318
+ if (parseOutput) {
1319
+ parse(response)
1320
+ success()
1321
+ }
1322
+
1323
+ return response;
1324
+ }
1325
+
1326
+ /**
1327
+ * @typedef {Object} UsersGetTargetRequestParams
1328
+ * @property {string} userId User ID.
1329
+ * @property {string} targetId Target ID.
1330
+ * @property {boolean} parseOutput
1331
+ * @property {libClient | undefined} sdk
1332
+ */
1333
+
1334
+ /**
1335
+ * @param {UsersGetTargetRequestParams} params
1336
+ */
1337
+ const usersGetTarget = async ({ userId, targetId, parseOutput = true, sdk = undefined}) => {
1338
+ let client = !sdk ? await sdkForProject() : sdk;
1339
+ let apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
1340
+ let payload = {};
1341
+
1342
+ let response = undefined;
1343
+
1344
+ response = await client.call('get', apiPath, {
1345
+ 'content-type': 'application/json',
1346
+ }, payload);
1347
+
1348
+ if (parseOutput) {
1349
+ parse(response)
1350
+ success()
1351
+ }
1352
+
1353
+ return response;
1354
+ }
1355
+
1356
+ /**
1357
+ * @typedef {Object} UsersUpdateTargetRequestParams
1358
+ * @property {string} userId User ID.
1359
+ * @property {string} targetId Target ID.
1360
+ * @property {string} identifier The target identifier (token, email, phone etc.)
1361
+ * @property {string} providerId 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.
1362
+ * @property {string} name Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
1363
+ * @property {boolean} parseOutput
1364
+ * @property {libClient | undefined} sdk
1365
+ */
1366
+
1367
+ /**
1368
+ * @param {UsersUpdateTargetRequestParams} params
1369
+ */
1370
+ const usersUpdateTarget = async ({ userId, targetId, identifier, providerId, name, parseOutput = true, sdk = undefined}) => {
1371
+ let client = !sdk ? await sdkForProject() : sdk;
1372
+ let apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
1373
+ let payload = {};
1374
+ if (typeof identifier !== 'undefined') {
1375
+ payload['identifier'] = identifier;
1376
+ }
1377
+ if (typeof providerId !== 'undefined') {
1378
+ payload['providerId'] = providerId;
1379
+ }
1380
+ if (typeof name !== 'undefined') {
1381
+ payload['name'] = name;
1382
+ }
1383
+
1384
+ let response = undefined;
1385
+
1386
+ response = await client.call('patch', apiPath, {
1387
+ 'content-type': 'application/json',
1388
+ }, payload);
1389
+
1390
+ if (parseOutput) {
1391
+ parse(response)
1392
+ success()
1393
+ }
1394
+
1395
+ return response;
1396
+ }
1397
+
1398
+ /**
1399
+ * @typedef {Object} UsersDeleteTargetRequestParams
1400
+ * @property {string} userId User ID.
1401
+ * @property {string} targetId Target ID.
1402
+ * @property {boolean} parseOutput
1403
+ * @property {libClient | undefined} sdk
1404
+ */
1405
+
1406
+ /**
1407
+ * @param {UsersDeleteTargetRequestParams} params
1408
+ */
1409
+ const usersDeleteTarget = async ({ userId, targetId, parseOutput = true, sdk = undefined}) => {
1410
+ let client = !sdk ? await sdkForProject() : sdk;
1411
+ let apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
1412
+ let payload = {};
1413
+
1414
+ let response = undefined;
1415
+
1416
+ response = await client.call('delete', apiPath, {
1417
+ 'content-type': 'application/json',
1418
+ }, payload);
1419
+
1420
+ if (parseOutput) {
1421
+ parse(response)
1422
+ success()
1423
+ }
1424
+
1425
+ return response;
1426
+ }
1427
+
1428
+ /**
1429
+ * @typedef {Object} UsersCreateTokenRequestParams
1430
+ * @property {string} userId User ID.
1431
+ * @property {number} length Token length in characters. The default length is 6 characters
1432
+ * @property {number} expire Token expiration period in seconds. The default expiration is 15 minutes.
1433
+ * @property {boolean} parseOutput
1434
+ * @property {libClient | undefined} sdk
1435
+ */
1436
+
1437
+ /**
1438
+ * @param {UsersCreateTokenRequestParams} params
1439
+ */
1440
+ const usersCreateToken = async ({ userId, length, expire, parseOutput = true, sdk = undefined}) => {
1441
+ let client = !sdk ? await sdkForProject() : sdk;
1442
+ let apiPath = '/users/{userId}/tokens'.replace('{userId}', userId);
1443
+ let payload = {};
1444
+ if (typeof length !== 'undefined') {
1445
+ payload['length'] = length;
1446
+ }
1447
+ if (typeof expire !== 'undefined') {
1448
+ payload['expire'] = expire;
1449
+ }
1450
+
1451
+ let response = undefined;
1452
+
1453
+ response = await client.call('post', apiPath, {
1454
+ 'content-type': 'application/json',
1455
+ }, payload);
1456
+
1457
+ if (parseOutput) {
1458
+ parse(response)
1459
+ success()
1460
+ }
1461
+
1462
+ return response;
1463
+ }
1464
+
1040
1465
  /**
1041
1466
  * @typedef {Object} UsersUpdateEmailVerificationRequestParams
1042
1467
  * @property {string} userId User ID.
@@ -1106,7 +1531,7 @@ const usersUpdatePhoneVerification = async ({ userId, phoneVerification, parseOu
1106
1531
  users
1107
1532
  .command(`list`)
1108
1533
  .description(`Get a list of all the project's users. You can use the query params to filter your results.`)
1109
- .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`)
1534
+ .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`)
1110
1535
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1111
1536
  .action(actionRunner(usersList))
1112
1537
 
@@ -1141,7 +1566,7 @@ users
1141
1566
  users
1142
1567
  .command(`listIdentities`)
1143
1568
  .description(`Get identities for all users.`)
1144
- .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`)
1569
+ .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`)
1145
1570
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1146
1571
  .action(actionRunner(usersListIdentities))
1147
1572
 
@@ -1209,7 +1634,6 @@ users
1209
1634
  .command(`getUsage`)
1210
1635
  .description(``)
1211
1636
  .option(`--range <range>`, `Date range.`)
1212
- .option(`--provider <provider>`, `Provider Name.`)
1213
1637
  .action(actionRunner(usersGetUsage))
1214
1638
 
1215
1639
  users
@@ -1235,7 +1659,7 @@ users
1235
1659
  .command(`updateLabels`)
1236
1660
  .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.`)
1237
1661
  .requiredOption(`--userId <userId>`, `User ID.`)
1238
- .requiredOption(`--labels [labels...]`, `Array of user labels. Replaces the previous labels. Maximum of 100 labels are allowed, each up to 36 alphanumeric characters long.`)
1662
+ .requiredOption(`--labels [labels...]`, `Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.`)
1239
1663
  .action(actionRunner(usersUpdateLabels))
1240
1664
 
1241
1665
  users
@@ -1251,6 +1675,44 @@ users
1251
1675
  .requiredOption(`--userId <userId>`, `User ID.`)
1252
1676
  .action(actionRunner(usersListMemberships))
1253
1677
 
1678
+ users
1679
+ .command(`updateMfa`)
1680
+ .description(`Enable or disable MFA on a user account.`)
1681
+ .requiredOption(`--userId <userId>`, `User ID.`)
1682
+ .requiredOption(`--mfa <mfa>`, `Enable or disable MFA.`, parseBool)
1683
+ .action(actionRunner(usersUpdateMfa))
1684
+
1685
+ users
1686
+ .command(`deleteMfaAuthenticator`)
1687
+ .description(`Delete an authenticator app.`)
1688
+ .requiredOption(`--userId <userId>`, `User ID.`)
1689
+ .requiredOption(`--type <type>`, `Type of authenticator.`)
1690
+ .action(actionRunner(usersDeleteMfaAuthenticator))
1691
+
1692
+ users
1693
+ .command(`listMfaFactors`)
1694
+ .description(`List the factors available on the account to be used as a MFA challange.`)
1695
+ .requiredOption(`--userId <userId>`, `User ID.`)
1696
+ .action(actionRunner(usersListMfaFactors))
1697
+
1698
+ users
1699
+ .command(`getMfaRecoveryCodes`)
1700
+ .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.`)
1701
+ .requiredOption(`--userId <userId>`, `User ID.`)
1702
+ .action(actionRunner(usersGetMfaRecoveryCodes))
1703
+
1704
+ users
1705
+ .command(`updateMfaRecoveryCodes`)
1706
+ .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.`)
1707
+ .requiredOption(`--userId <userId>`, `User ID.`)
1708
+ .action(actionRunner(usersUpdateMfaRecoveryCodes))
1709
+
1710
+ users
1711
+ .command(`createMfaRecoveryCodes`)
1712
+ .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.`)
1713
+ .requiredOption(`--userId <userId>`, `User ID.`)
1714
+ .action(actionRunner(usersCreateMfaRecoveryCodes))
1715
+
1254
1716
  users
1255
1717
  .command(`updateName`)
1256
1718
  .description(`Update the user name by its unique ID.`)
@@ -1291,6 +1753,12 @@ users
1291
1753
  .requiredOption(`--userId <userId>`, `User ID.`)
1292
1754
  .action(actionRunner(usersListSessions))
1293
1755
 
1756
+ users
1757
+ .command(`createSession`)
1758
+ .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.`)
1759
+ .requiredOption(`--userId <userId>`, `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.`)
1760
+ .action(actionRunner(usersCreateSession))
1761
+
1294
1762
  users
1295
1763
  .command(`deleteSessions`)
1296
1764
  .description(`Delete all user's sessions by using the user's unique ID.`)
@@ -1311,6 +1779,56 @@ users
1311
1779
  .requiredOption(`--status <status>`, `User Status. To activate the user pass 'true' and to block the user pass 'false'.`, parseBool)
1312
1780
  .action(actionRunner(usersUpdateStatus))
1313
1781
 
1782
+ users
1783
+ .command(`listTargets`)
1784
+ .description(`List the messaging targets that are associated with a user.`)
1785
+ .requiredOption(`--userId <userId>`, `User ID.`)
1786
+ .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`)
1787
+ .action(actionRunner(usersListTargets))
1788
+
1789
+ users
1790
+ .command(`createTarget`)
1791
+ .description(`Create a messaging target.`)
1792
+ .requiredOption(`--userId <userId>`, `User ID.`)
1793
+ .requiredOption(`--targetId <targetId>`, `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.`)
1794
+ .requiredOption(`--providerType <providerType>`, `The target provider type. Can be one of the following: 'email', 'sms' or 'push'.`)
1795
+ .requiredOption(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
1796
+ .option(`--providerId <providerId>`, `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.`)
1797
+ .option(`--name <name>`, `Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.`)
1798
+ .action(actionRunner(usersCreateTarget))
1799
+
1800
+ users
1801
+ .command(`getTarget`)
1802
+ .description(`Get a user's push notification target by ID.`)
1803
+ .requiredOption(`--userId <userId>`, `User ID.`)
1804
+ .requiredOption(`--targetId <targetId>`, `Target ID.`)
1805
+ .action(actionRunner(usersGetTarget))
1806
+
1807
+ users
1808
+ .command(`updateTarget`)
1809
+ .description(`Update a messaging target.`)
1810
+ .requiredOption(`--userId <userId>`, `User ID.`)
1811
+ .requiredOption(`--targetId <targetId>`, `Target ID.`)
1812
+ .option(`--identifier <identifier>`, `The target identifier (token, email, phone etc.)`)
1813
+ .option(`--providerId <providerId>`, `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.`)
1814
+ .option(`--name <name>`, `Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.`)
1815
+ .action(actionRunner(usersUpdateTarget))
1816
+
1817
+ users
1818
+ .command(`deleteTarget`)
1819
+ .description(`Delete a messaging target.`)
1820
+ .requiredOption(`--userId <userId>`, `User ID.`)
1821
+ .requiredOption(`--targetId <targetId>`, `Target ID.`)
1822
+ .action(actionRunner(usersDeleteTarget))
1823
+
1824
+ users
1825
+ .command(`createToken`)
1826
+ .description(`Returns a token with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [PUT /account/sessions/custom](https://appwrite.io/docs/references/cloud/client-web/account#updateCustomSession) endpoint to complete the login process.`)
1827
+ .requiredOption(`--userId <userId>`, `User ID.`)
1828
+ .option(`--length <length>`, `Token length in characters. The default length is 6 characters`, parseInteger)
1829
+ .option(`--expire <expire>`, `Token expiration period in seconds. The default expiration is 15 minutes.`, parseInteger)
1830
+ .action(actionRunner(usersCreateToken))
1831
+
1314
1832
  users
1315
1833
  .command(`updateEmailVerification`)
1316
1834
  .description(`Update the user email verification status by its unique ID.`)
@@ -1345,15 +1863,28 @@ module.exports = {
1345
1863
  usersUpdateLabels,
1346
1864
  usersListLogs,
1347
1865
  usersListMemberships,
1866
+ usersUpdateMfa,
1867
+ usersDeleteMfaAuthenticator,
1868
+ usersListMfaFactors,
1869
+ usersGetMfaRecoveryCodes,
1870
+ usersUpdateMfaRecoveryCodes,
1871
+ usersCreateMfaRecoveryCodes,
1348
1872
  usersUpdateName,
1349
1873
  usersUpdatePassword,
1350
1874
  usersUpdatePhone,
1351
1875
  usersGetPrefs,
1352
1876
  usersUpdatePrefs,
1353
1877
  usersListSessions,
1878
+ usersCreateSession,
1354
1879
  usersDeleteSessions,
1355
1880
  usersDeleteSession,
1356
1881
  usersUpdateStatus,
1882
+ usersListTargets,
1883
+ usersCreateTarget,
1884
+ usersGetTarget,
1885
+ usersUpdateTarget,
1886
+ usersDeleteTarget,
1887
+ usersCreateToken,
1357
1888
  usersUpdateEmailVerification,
1358
1889
  usersUpdatePhoneVerification
1359
1890
  };