chirag-appwrite-cli 0.1.0

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