@appwrite.io/console 8.0.0 → 8.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (794) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/sdk.js +12 -1
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +12 -1
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +12 -1
  7. package/package.json +5 -1
  8. package/types/client.d.ts +9 -0
  9. package/types/models.d.ts +119 -0
  10. package/types/services/vcs.d.ts +8 -8
  11. package/.github/workflows/autoclose.yml +0 -11
  12. package/.github/workflows/publish.yml +0 -43
  13. package/CHANGELOG.md +0 -161
  14. package/docs/examples/account/create-anonymous-session.md +0 -13
  15. package/docs/examples/account/create-billing-address.md +0 -20
  16. package/docs/examples/account/create-email-password-session.md +0 -16
  17. package/docs/examples/account/create-email-token.md +0 -17
  18. package/docs/examples/account/create-email-verification.md +0 -15
  19. package/docs/examples/account/create-jwt.md +0 -15
  20. package/docs/examples/account/create-key.md +0 -17
  21. package/docs/examples/account/create-magic-url-token.md +0 -18
  22. package/docs/examples/account/create-mfa-authenticator.md +0 -15
  23. package/docs/examples/account/create-mfa-challenge.md +0 -15
  24. package/docs/examples/account/create-mfa-recovery-codes.md +0 -13
  25. package/docs/examples/account/create-o-auth-2-session.md +0 -17
  26. package/docs/examples/account/create-o-auth-2-token.md +0 -17
  27. package/docs/examples/account/create-payment-method.md +0 -13
  28. package/docs/examples/account/create-phone-token.md +0 -16
  29. package/docs/examples/account/create-phone-verification.md +0 -13
  30. package/docs/examples/account/create-push-target.md +0 -17
  31. package/docs/examples/account/create-recovery.md +0 -16
  32. package/docs/examples/account/create-session.md +0 -16
  33. package/docs/examples/account/create-verification.md +0 -15
  34. package/docs/examples/account/create.md +0 -18
  35. package/docs/examples/account/delete-billing-address.md +0 -15
  36. package/docs/examples/account/delete-identity.md +0 -15
  37. package/docs/examples/account/delete-key.md +0 -15
  38. package/docs/examples/account/delete-mfa-authenticator.md +0 -15
  39. package/docs/examples/account/delete-payment-method.md +0 -15
  40. package/docs/examples/account/delete-push-target.md +0 -15
  41. package/docs/examples/account/delete-session.md +0 -15
  42. package/docs/examples/account/delete-sessions.md +0 -13
  43. package/docs/examples/account/delete.md +0 -13
  44. package/docs/examples/account/get-billing-address.md +0 -15
  45. package/docs/examples/account/get-coupon.md +0 -15
  46. package/docs/examples/account/get-key.md +0 -15
  47. package/docs/examples/account/get-mfa-recovery-codes.md +0 -13
  48. package/docs/examples/account/get-payment-method.md +0 -15
  49. package/docs/examples/account/get-prefs.md +0 -13
  50. package/docs/examples/account/get-session.md +0 -15
  51. package/docs/examples/account/get.md +0 -13
  52. package/docs/examples/account/list-billing-addresses.md +0 -15
  53. package/docs/examples/account/list-identities.md +0 -16
  54. package/docs/examples/account/list-invoices.md +0 -15
  55. package/docs/examples/account/list-keys.md +0 -15
  56. package/docs/examples/account/list-logs.md +0 -16
  57. package/docs/examples/account/list-mfa-factors.md +0 -13
  58. package/docs/examples/account/list-payment-methods.md +0 -15
  59. package/docs/examples/account/list-sessions.md +0 -13
  60. package/docs/examples/account/update-billing-address.md +0 -21
  61. package/docs/examples/account/update-email-verification.md +0 -16
  62. package/docs/examples/account/update-email.md +0 -16
  63. package/docs/examples/account/update-key.md +0 -18
  64. package/docs/examples/account/update-magic-url-session.md +0 -16
  65. package/docs/examples/account/update-mfa-authenticator.md +0 -16
  66. package/docs/examples/account/update-mfa-challenge.md +0 -16
  67. package/docs/examples/account/update-mfa-recovery-codes.md +0 -13
  68. package/docs/examples/account/update-mfa.md +0 -15
  69. package/docs/examples/account/update-name.md +0 -15
  70. package/docs/examples/account/update-password.md +0 -16
  71. package/docs/examples/account/update-payment-method-mandate-options.md +0 -15
  72. package/docs/examples/account/update-payment-method-provider.md +0 -18
  73. package/docs/examples/account/update-payment-method.md +0 -18
  74. package/docs/examples/account/update-phone-session.md +0 -16
  75. package/docs/examples/account/update-phone-verification.md +0 -16
  76. package/docs/examples/account/update-phone.md +0 -16
  77. package/docs/examples/account/update-prefs.md +0 -19
  78. package/docs/examples/account/update-push-target.md +0 -16
  79. package/docs/examples/account/update-recovery.md +0 -17
  80. package/docs/examples/account/update-session.md +0 -15
  81. package/docs/examples/account/update-status.md +0 -13
  82. package/docs/examples/account/update-verification.md +0 -16
  83. package/docs/examples/activities/get-event.md +0 -15
  84. package/docs/examples/activities/list-events.md +0 -15
  85. package/docs/examples/assistant/chat.md +0 -15
  86. package/docs/examples/avatars/get-browser.md +0 -18
  87. package/docs/examples/avatars/get-credit-card.md +0 -18
  88. package/docs/examples/avatars/get-favicon.md +0 -15
  89. package/docs/examples/avatars/get-flag.md +0 -18
  90. package/docs/examples/avatars/get-image.md +0 -17
  91. package/docs/examples/avatars/get-initials.md +0 -18
  92. package/docs/examples/avatars/get-qr.md +0 -18
  93. package/docs/examples/avatars/get-screenshot.md +0 -37
  94. package/docs/examples/backups/create-archive.md +0 -16
  95. package/docs/examples/backups/create-policy.md +0 -21
  96. package/docs/examples/backups/create-restoration.md +0 -18
  97. package/docs/examples/backups/delete-archive.md +0 -15
  98. package/docs/examples/backups/delete-policy.md +0 -15
  99. package/docs/examples/backups/get-archive.md +0 -15
  100. package/docs/examples/backups/get-policy.md +0 -15
  101. package/docs/examples/backups/get-restoration.md +0 -15
  102. package/docs/examples/backups/list-archives.md +0 -15
  103. package/docs/examples/backups/list-policies.md +0 -15
  104. package/docs/examples/backups/list-restorations.md +0 -15
  105. package/docs/examples/backups/update-policy.md +0 -19
  106. package/docs/examples/console/create-program-membership.md +0 -15
  107. package/docs/examples/console/create-source.md +0 -19
  108. package/docs/examples/console/get-campaign.md +0 -15
  109. package/docs/examples/console/get-coupon.md +0 -15
  110. package/docs/examples/console/get-plan.md +0 -15
  111. package/docs/examples/console/get-plans.md +0 -15
  112. package/docs/examples/console/get-program.md +0 -15
  113. package/docs/examples/console/get-resource.md +0 -16
  114. package/docs/examples/console/list-regions.md +0 -13
  115. package/docs/examples/console/suggest-columns.md +0 -19
  116. package/docs/examples/console/suggest-indexes.md +0 -18
  117. package/docs/examples/console/variables.md +0 -13
  118. package/docs/examples/databases/create-boolean-attribute.md +0 -20
  119. package/docs/examples/databases/create-collection.md +0 -22
  120. package/docs/examples/databases/create-datetime-attribute.md +0 -20
  121. package/docs/examples/databases/create-document.md +0 -26
  122. package/docs/examples/databases/create-documents.md +0 -18
  123. package/docs/examples/databases/create-email-attribute.md +0 -20
  124. package/docs/examples/databases/create-enum-attribute.md +0 -21
  125. package/docs/examples/databases/create-float-attribute.md +0 -22
  126. package/docs/examples/databases/create-index.md +0 -21
  127. package/docs/examples/databases/create-integer-attribute.md +0 -22
  128. package/docs/examples/databases/create-ip-attribute.md +0 -20
  129. package/docs/examples/databases/create-line-attribute.md +0 -19
  130. package/docs/examples/databases/create-longtext-attribute.md +0 -21
  131. package/docs/examples/databases/create-mediumtext-attribute.md +0 -21
  132. package/docs/examples/databases/create-operations.md +0 -26
  133. package/docs/examples/databases/create-point-attribute.md +0 -19
  134. package/docs/examples/databases/create-polygon-attribute.md +0 -19
  135. package/docs/examples/databases/create-relationship-attribute.md +0 -22
  136. package/docs/examples/databases/create-string-attribute.md +0 -22
  137. package/docs/examples/databases/create-text-attribute.md +0 -21
  138. package/docs/examples/databases/create-transaction.md +0 -15
  139. package/docs/examples/databases/create-url-attribute.md +0 -20
  140. package/docs/examples/databases/create-varchar-attribute.md +0 -22
  141. package/docs/examples/databases/create.md +0 -17
  142. package/docs/examples/databases/decrement-document-attribute.md +0 -21
  143. package/docs/examples/databases/delete-attribute.md +0 -17
  144. package/docs/examples/databases/delete-collection.md +0 -16
  145. package/docs/examples/databases/delete-document.md +0 -18
  146. package/docs/examples/databases/delete-documents.md +0 -18
  147. package/docs/examples/databases/delete-index.md +0 -17
  148. package/docs/examples/databases/delete-transaction.md +0 -15
  149. package/docs/examples/databases/delete.md +0 -15
  150. package/docs/examples/databases/get-attribute.md +0 -17
  151. package/docs/examples/databases/get-collection-usage.md +0 -17
  152. package/docs/examples/databases/get-collection.md +0 -16
  153. package/docs/examples/databases/get-document.md +0 -19
  154. package/docs/examples/databases/get-index.md +0 -17
  155. package/docs/examples/databases/get-transaction.md +0 -15
  156. package/docs/examples/databases/get-usage.md +0 -16
  157. package/docs/examples/databases/get.md +0 -15
  158. package/docs/examples/databases/increment-document-attribute.md +0 -21
  159. package/docs/examples/databases/list-attributes.md +0 -18
  160. package/docs/examples/databases/list-collection-logs.md +0 -17
  161. package/docs/examples/databases/list-collections.md +0 -18
  162. package/docs/examples/databases/list-document-logs.md +0 -18
  163. package/docs/examples/databases/list-documents.md +0 -20
  164. package/docs/examples/databases/list-indexes.md +0 -18
  165. package/docs/examples/databases/list-logs.md +0 -16
  166. package/docs/examples/databases/list-transactions.md +0 -15
  167. package/docs/examples/databases/list-usage.md +0 -15
  168. package/docs/examples/databases/list.md +0 -17
  169. package/docs/examples/databases/update-boolean-attribute.md +0 -20
  170. package/docs/examples/databases/update-collection.md +0 -20
  171. package/docs/examples/databases/update-datetime-attribute.md +0 -20
  172. package/docs/examples/databases/update-document.md +0 -26
  173. package/docs/examples/databases/update-documents.md +0 -25
  174. package/docs/examples/databases/update-email-attribute.md +0 -20
  175. package/docs/examples/databases/update-enum-attribute.md +0 -21
  176. package/docs/examples/databases/update-float-attribute.md +0 -22
  177. package/docs/examples/databases/update-integer-attribute.md +0 -22
  178. package/docs/examples/databases/update-ip-attribute.md +0 -20
  179. package/docs/examples/databases/update-line-attribute.md +0 -20
  180. package/docs/examples/databases/update-longtext-attribute.md +0 -20
  181. package/docs/examples/databases/update-mediumtext-attribute.md +0 -20
  182. package/docs/examples/databases/update-point-attribute.md +0 -20
  183. package/docs/examples/databases/update-polygon-attribute.md +0 -20
  184. package/docs/examples/databases/update-relationship-attribute.md +0 -19
  185. package/docs/examples/databases/update-string-attribute.md +0 -21
  186. package/docs/examples/databases/update-text-attribute.md +0 -20
  187. package/docs/examples/databases/update-transaction.md +0 -17
  188. package/docs/examples/databases/update-url-attribute.md +0 -20
  189. package/docs/examples/databases/update-varchar-attribute.md +0 -21
  190. package/docs/examples/databases/update.md +0 -17
  191. package/docs/examples/databases/upsert-document.md +0 -26
  192. package/docs/examples/databases/upsert-documents.md +0 -18
  193. package/docs/examples/domains/create-preset-google-workspace.md +0 -15
  194. package/docs/examples/domains/create-preset-i-cloud.md +0 -15
  195. package/docs/examples/domains/create-preset-mailgun.md +0 -15
  196. package/docs/examples/domains/create-preset-outlook.md +0 -15
  197. package/docs/examples/domains/create-preset-proton-mail.md +0 -15
  198. package/docs/examples/domains/create-preset-zoho.md +0 -15
  199. package/docs/examples/domains/create-purchase.md +0 -26
  200. package/docs/examples/domains/create-record-a.md +0 -19
  201. package/docs/examples/domains/create-record-aaaa.md +0 -19
  202. package/docs/examples/domains/create-record-alias.md +0 -19
  203. package/docs/examples/domains/create-record-caa.md +0 -19
  204. package/docs/examples/domains/create-record-cname.md +0 -19
  205. package/docs/examples/domains/create-record-https.md +0 -19
  206. package/docs/examples/domains/create-record-mx.md +0 -20
  207. package/docs/examples/domains/create-record-ns.md +0 -19
  208. package/docs/examples/domains/create-record-srv.md +0 -22
  209. package/docs/examples/domains/create-record-txt.md +0 -19
  210. package/docs/examples/domains/create-transfer-in.md +0 -19
  211. package/docs/examples/domains/create-transfer-out.md +0 -16
  212. package/docs/examples/domains/create.md +0 -16
  213. package/docs/examples/domains/delete-record.md +0 -16
  214. package/docs/examples/domains/delete.md +0 -15
  215. package/docs/examples/domains/get-preset-google-workspace.md +0 -15
  216. package/docs/examples/domains/get-preset-i-cloud.md +0 -15
  217. package/docs/examples/domains/get-preset-mailgun.md +0 -15
  218. package/docs/examples/domains/get-preset-outlook.md +0 -15
  219. package/docs/examples/domains/get-preset-proton-mail.md +0 -15
  220. package/docs/examples/domains/get-preset-zoho.md +0 -15
  221. package/docs/examples/domains/get-price.md +0 -17
  222. package/docs/examples/domains/get-record.md +0 -16
  223. package/docs/examples/domains/get-transfer-status.md +0 -15
  224. package/docs/examples/domains/get-zone.md +0 -15
  225. package/docs/examples/domains/get.md +0 -15
  226. package/docs/examples/domains/list-records.md +0 -16
  227. package/docs/examples/domains/list-suggestions.md +0 -20
  228. package/docs/examples/domains/list.md +0 -16
  229. package/docs/examples/domains/update-auto-renewal.md +0 -16
  230. package/docs/examples/domains/update-nameservers.md +0 -15
  231. package/docs/examples/domains/update-purchase.md +0 -16
  232. package/docs/examples/domains/update-record-a.md +0 -20
  233. package/docs/examples/domains/update-record-aaaa.md +0 -20
  234. package/docs/examples/domains/update-record-alias.md +0 -20
  235. package/docs/examples/domains/update-record-caa.md +0 -20
  236. package/docs/examples/domains/update-record-cname.md +0 -20
  237. package/docs/examples/domains/update-record-https.md +0 -20
  238. package/docs/examples/domains/update-record-mx.md +0 -21
  239. package/docs/examples/domains/update-record-ns.md +0 -20
  240. package/docs/examples/domains/update-record-srv.md +0 -23
  241. package/docs/examples/domains/update-record-txt.md +0 -20
  242. package/docs/examples/domains/update-team.md +0 -16
  243. package/docs/examples/domains/update-transfer-in.md +0 -16
  244. package/docs/examples/domains/update-zone.md +0 -16
  245. package/docs/examples/functions/create-deployment.md +0 -19
  246. package/docs/examples/functions/create-duplicate-deployment.md +0 -17
  247. package/docs/examples/functions/create-execution.md +0 -21
  248. package/docs/examples/functions/create-template-deployment.md +0 -21
  249. package/docs/examples/functions/create-variable.md +0 -18
  250. package/docs/examples/functions/create-vcs-deployment.md +0 -18
  251. package/docs/examples/functions/create.md +0 -34
  252. package/docs/examples/functions/delete-deployment.md +0 -16
  253. package/docs/examples/functions/delete-execution.md +0 -16
  254. package/docs/examples/functions/delete-variable.md +0 -16
  255. package/docs/examples/functions/delete.md +0 -15
  256. package/docs/examples/functions/get-deployment-download.md +0 -17
  257. package/docs/examples/functions/get-deployment.md +0 -16
  258. package/docs/examples/functions/get-execution.md +0 -16
  259. package/docs/examples/functions/get-template.md +0 -15
  260. package/docs/examples/functions/get-usage.md +0 -16
  261. package/docs/examples/functions/get-variable.md +0 -16
  262. package/docs/examples/functions/get.md +0 -15
  263. package/docs/examples/functions/list-deployments.md +0 -18
  264. package/docs/examples/functions/list-executions.md +0 -17
  265. package/docs/examples/functions/list-runtimes.md +0 -13
  266. package/docs/examples/functions/list-specifications.md +0 -13
  267. package/docs/examples/functions/list-templates.md +0 -19
  268. package/docs/examples/functions/list-usage.md +0 -15
  269. package/docs/examples/functions/list-variables.md +0 -15
  270. package/docs/examples/functions/list.md +0 -17
  271. package/docs/examples/functions/update-deployment-status.md +0 -16
  272. package/docs/examples/functions/update-function-deployment.md +0 -16
  273. package/docs/examples/functions/update-variable.md +0 -19
  274. package/docs/examples/functions/update.md +0 -34
  275. package/docs/examples/graphql/mutation.md +0 -15
  276. package/docs/examples/graphql/query.md +0 -15
  277. package/docs/examples/health/get-antivirus.md +0 -13
  278. package/docs/examples/health/get-cache.md +0 -13
  279. package/docs/examples/health/get-certificate.md +0 -15
  280. package/docs/examples/health/get-console-pausing.md +0 -16
  281. package/docs/examples/health/get-db.md +0 -13
  282. package/docs/examples/health/get-failed-jobs.md +0 -16
  283. package/docs/examples/health/get-pub-sub.md +0 -13
  284. package/docs/examples/health/get-queue-audits.md +0 -15
  285. package/docs/examples/health/get-queue-billing-project-aggregation.md +0 -15
  286. package/docs/examples/health/get-queue-billing-team-aggregation.md +0 -15
  287. package/docs/examples/health/get-queue-builds.md +0 -15
  288. package/docs/examples/health/get-queue-certificates.md +0 -15
  289. package/docs/examples/health/get-queue-databases.md +0 -16
  290. package/docs/examples/health/get-queue-deletes.md +0 -15
  291. package/docs/examples/health/get-queue-functions.md +0 -15
  292. package/docs/examples/health/get-queue-logs.md +0 -15
  293. package/docs/examples/health/get-queue-mails.md +0 -15
  294. package/docs/examples/health/get-queue-messaging.md +0 -15
  295. package/docs/examples/health/get-queue-migrations.md +0 -15
  296. package/docs/examples/health/get-queue-priority-builds.md +0 -15
  297. package/docs/examples/health/get-queue-region-manager.md +0 -15
  298. package/docs/examples/health/get-queue-stats-resources.md +0 -15
  299. package/docs/examples/health/get-queue-threats.md +0 -15
  300. package/docs/examples/health/get-queue-usage.md +0 -15
  301. package/docs/examples/health/get-queue-webhooks.md +0 -15
  302. package/docs/examples/health/get-storage-local.md +0 -13
  303. package/docs/examples/health/get-storage.md +0 -13
  304. package/docs/examples/health/get-time.md +0 -13
  305. package/docs/examples/health/get.md +0 -13
  306. package/docs/examples/locale/get.md +0 -13
  307. package/docs/examples/locale/list-codes.md +0 -13
  308. package/docs/examples/locale/list-continents.md +0 -13
  309. package/docs/examples/locale/list-countries-eu.md +0 -13
  310. package/docs/examples/locale/list-countries-phones.md +0 -13
  311. package/docs/examples/locale/list-countries.md +0 -13
  312. package/docs/examples/locale/list-currencies.md +0 -13
  313. package/docs/examples/locale/list-languages.md +0 -13
  314. package/docs/examples/messaging/create-apns-provider.md +0 -22
  315. package/docs/examples/messaging/create-email.md +0 -26
  316. package/docs/examples/messaging/create-fcm-provider.md +0 -18
  317. package/docs/examples/messaging/create-mailgun-provider.md +0 -24
  318. package/docs/examples/messaging/create-msg-91-provider.md +0 -20
  319. package/docs/examples/messaging/create-push.md +0 -33
  320. package/docs/examples/messaging/create-resend-provider.md +0 -22
  321. package/docs/examples/messaging/create-sendgrid-provider.md +0 -22
  322. package/docs/examples/messaging/create-sms.md +0 -21
  323. package/docs/examples/messaging/create-smtp-provider.md +0 -28
  324. package/docs/examples/messaging/create-subscriber.md +0 -17
  325. package/docs/examples/messaging/create-telesign-provider.md +0 -20
  326. package/docs/examples/messaging/create-textmagic-provider.md +0 -20
  327. package/docs/examples/messaging/create-topic.md +0 -17
  328. package/docs/examples/messaging/create-twilio-provider.md +0 -20
  329. package/docs/examples/messaging/create-vonage-provider.md +0 -20
  330. package/docs/examples/messaging/delete-provider.md +0 -15
  331. package/docs/examples/messaging/delete-subscriber.md +0 -16
  332. package/docs/examples/messaging/delete-topic.md +0 -15
  333. package/docs/examples/messaging/delete.md +0 -15
  334. package/docs/examples/messaging/get-message.md +0 -15
  335. package/docs/examples/messaging/get-provider.md +0 -15
  336. package/docs/examples/messaging/get-subscriber.md +0 -16
  337. package/docs/examples/messaging/get-topic.md +0 -15
  338. package/docs/examples/messaging/list-message-logs.md +0 -17
  339. package/docs/examples/messaging/list-messages.md +0 -17
  340. package/docs/examples/messaging/list-provider-logs.md +0 -17
  341. package/docs/examples/messaging/list-providers.md +0 -17
  342. package/docs/examples/messaging/list-subscriber-logs.md +0 -17
  343. package/docs/examples/messaging/list-subscribers.md +0 -18
  344. package/docs/examples/messaging/list-targets.md +0 -17
  345. package/docs/examples/messaging/list-topic-logs.md +0 -17
  346. package/docs/examples/messaging/list-topics.md +0 -17
  347. package/docs/examples/messaging/update-apns-provider.md +0 -22
  348. package/docs/examples/messaging/update-email.md +0 -26
  349. package/docs/examples/messaging/update-fcm-provider.md +0 -18
  350. package/docs/examples/messaging/update-mailgun-provider.md +0 -24
  351. package/docs/examples/messaging/update-msg-91-provider.md +0 -20
  352. package/docs/examples/messaging/update-push.md +0 -33
  353. package/docs/examples/messaging/update-resend-provider.md +0 -22
  354. package/docs/examples/messaging/update-sendgrid-provider.md +0 -22
  355. package/docs/examples/messaging/update-sms.md +0 -21
  356. package/docs/examples/messaging/update-smtp-provider.md +0 -28
  357. package/docs/examples/messaging/update-telesign-provider.md +0 -20
  358. package/docs/examples/messaging/update-textmagic-provider.md +0 -20
  359. package/docs/examples/messaging/update-topic.md +0 -17
  360. package/docs/examples/messaging/update-twilio-provider.md +0 -20
  361. package/docs/examples/messaging/update-vonage-provider.md +0 -20
  362. package/docs/examples/migrations/create-appwrite-migration.md +0 -18
  363. package/docs/examples/migrations/create-csv-export.md +0 -23
  364. package/docs/examples/migrations/create-csv-import.md +0 -18
  365. package/docs/examples/migrations/create-firebase-migration.md +0 -16
  366. package/docs/examples/migrations/create-n-host-migration.md +0 -22
  367. package/docs/examples/migrations/create-supabase-migration.md +0 -21
  368. package/docs/examples/migrations/delete.md +0 -15
  369. package/docs/examples/migrations/get-appwrite-report.md +0 -18
  370. package/docs/examples/migrations/get-firebase-report.md +0 -16
  371. package/docs/examples/migrations/get-n-host-report.md +0 -22
  372. package/docs/examples/migrations/get-supabase-report.md +0 -21
  373. package/docs/examples/migrations/get.md +0 -15
  374. package/docs/examples/migrations/list.md +0 -17
  375. package/docs/examples/migrations/retry.md +0 -15
  376. package/docs/examples/organizations/add-credit.md +0 -16
  377. package/docs/examples/organizations/cancel-downgrade.md +0 -15
  378. package/docs/examples/organizations/create-downgrade-feedback.md +0 -19
  379. package/docs/examples/organizations/create-invoice-payment.md +0 -17
  380. package/docs/examples/organizations/create-key.md +0 -18
  381. package/docs/examples/organizations/create.md +0 -24
  382. package/docs/examples/organizations/delete-backup-payment-method.md +0 -15
  383. package/docs/examples/organizations/delete-billing-address.md +0 -15
  384. package/docs/examples/organizations/delete-default-payment-method.md +0 -15
  385. package/docs/examples/organizations/delete-key.md +0 -16
  386. package/docs/examples/organizations/delete.md +0 -15
  387. package/docs/examples/organizations/estimation-create-organization.md +0 -19
  388. package/docs/examples/organizations/estimation-delete-organization.md +0 -15
  389. package/docs/examples/organizations/estimation-update-plan.md +0 -18
  390. package/docs/examples/organizations/get-aggregation.md +0 -18
  391. package/docs/examples/organizations/get-available-credits.md +0 -15
  392. package/docs/examples/organizations/get-billing-address.md +0 -16
  393. package/docs/examples/organizations/get-credit.md +0 -16
  394. package/docs/examples/organizations/get-invoice-download.md +0 -16
  395. package/docs/examples/organizations/get-invoice-view.md +0 -16
  396. package/docs/examples/organizations/get-invoice.md +0 -16
  397. package/docs/examples/organizations/get-key.md +0 -16
  398. package/docs/examples/organizations/get-payment-method.md +0 -16
  399. package/docs/examples/organizations/get-plan.md +0 -15
  400. package/docs/examples/organizations/get-scopes.md +0 -16
  401. package/docs/examples/organizations/get-usage.md +0 -17
  402. package/docs/examples/organizations/list-aggregations.md +0 -16
  403. package/docs/examples/organizations/list-credits.md +0 -16
  404. package/docs/examples/organizations/list-invoices.md +0 -16
  405. package/docs/examples/organizations/list-keys.md +0 -16
  406. package/docs/examples/organizations/list-regions.md +0 -15
  407. package/docs/examples/organizations/list.md +0 -16
  408. package/docs/examples/organizations/set-backup-payment-method.md +0 -16
  409. package/docs/examples/organizations/set-billing-address.md +0 -16
  410. package/docs/examples/organizations/set-billing-email.md +0 -16
  411. package/docs/examples/organizations/set-billing-tax-id.md +0 -16
  412. package/docs/examples/organizations/set-default-payment-method.md +0 -16
  413. package/docs/examples/organizations/update-budget.md +0 -17
  414. package/docs/examples/organizations/update-key.md +0 -19
  415. package/docs/examples/organizations/update-plan.md +0 -22
  416. package/docs/examples/organizations/validate-invoice.md +0 -16
  417. package/docs/examples/organizations/validate-payment.md +0 -16
  418. package/docs/examples/project/create-variable.md +0 -18
  419. package/docs/examples/project/delete-variable.md +0 -15
  420. package/docs/examples/project/get-usage.md +0 -17
  421. package/docs/examples/project/get-variable.md +0 -15
  422. package/docs/examples/project/list-variables.md +0 -16
  423. package/docs/examples/project/update-variable.md +0 -18
  424. package/docs/examples/projects/create-dev-key.md +0 -17
  425. package/docs/examples/projects/create-jwt.md +0 -17
  426. package/docs/examples/projects/create-key.md +0 -19
  427. package/docs/examples/projects/create-platform.md +0 -20
  428. package/docs/examples/projects/create-schedule.md +0 -20
  429. package/docs/examples/projects/create-smtp-test.md +0 -24
  430. package/docs/examples/projects/create.md +0 -27
  431. package/docs/examples/projects/delete-dev-key.md +0 -16
  432. package/docs/examples/projects/delete-email-template.md +0 -17
  433. package/docs/examples/projects/delete-key.md +0 -16
  434. package/docs/examples/projects/delete-platform.md +0 -16
  435. package/docs/examples/projects/delete-sms-template.md +0 -17
  436. package/docs/examples/projects/delete.md +0 -15
  437. package/docs/examples/projects/get-dev-key.md +0 -16
  438. package/docs/examples/projects/get-email-template.md +0 -17
  439. package/docs/examples/projects/get-key.md +0 -16
  440. package/docs/examples/projects/get-platform.md +0 -16
  441. package/docs/examples/projects/get-schedule.md +0 -16
  442. package/docs/examples/projects/get-sms-template.md +0 -17
  443. package/docs/examples/projects/get.md +0 -15
  444. package/docs/examples/projects/list-dev-keys.md +0 -16
  445. package/docs/examples/projects/list-keys.md +0 -17
  446. package/docs/examples/projects/list-platforms.md +0 -16
  447. package/docs/examples/projects/list-schedules.md +0 -17
  448. package/docs/examples/projects/list.md +0 -17
  449. package/docs/examples/projects/update-api-status-all.md +0 -16
  450. package/docs/examples/projects/update-api-status.md +0 -17
  451. package/docs/examples/projects/update-auth-duration.md +0 -16
  452. package/docs/examples/projects/update-auth-limit.md +0 -16
  453. package/docs/examples/projects/update-auth-password-dictionary.md +0 -16
  454. package/docs/examples/projects/update-auth-password-history.md +0 -16
  455. package/docs/examples/projects/update-auth-sessions-limit.md +0 -16
  456. package/docs/examples/projects/update-auth-status.md +0 -17
  457. package/docs/examples/projects/update-console-access.md +0 -15
  458. package/docs/examples/projects/update-dev-key.md +0 -18
  459. package/docs/examples/projects/update-email-template.md +0 -22
  460. package/docs/examples/projects/update-key.md +0 -19
  461. package/docs/examples/projects/update-labels.md +0 -16
  462. package/docs/examples/projects/update-memberships-privacy.md +0 -18
  463. package/docs/examples/projects/update-mock-numbers.md +0 -16
  464. package/docs/examples/projects/update-o-auth-2.md +0 -19
  465. package/docs/examples/projects/update-personal-data-check.md +0 -16
  466. package/docs/examples/projects/update-platform.md +0 -20
  467. package/docs/examples/projects/update-service-status-all.md +0 -16
  468. package/docs/examples/projects/update-service-status.md +0 -17
  469. package/docs/examples/projects/update-session-alerts.md +0 -16
  470. package/docs/examples/projects/update-session-invalidation.md +0 -16
  471. package/docs/examples/projects/update-sms-template.md +0 -18
  472. package/docs/examples/projects/update-smtp.md +0 -24
  473. package/docs/examples/projects/update-status.md +0 -16
  474. package/docs/examples/projects/update-team.md +0 -16
  475. package/docs/examples/projects/update.md +0 -25
  476. package/docs/examples/proxy/create-api-rule.md +0 -15
  477. package/docs/examples/proxy/create-function-rule.md +0 -17
  478. package/docs/examples/proxy/create-redirect-rule.md +0 -19
  479. package/docs/examples/proxy/create-site-rule.md +0 -17
  480. package/docs/examples/proxy/delete-rule.md +0 -15
  481. package/docs/examples/proxy/get-rule.md +0 -15
  482. package/docs/examples/proxy/list-rules.md +0 -17
  483. package/docs/examples/proxy/update-rule-verification.md +0 -15
  484. package/docs/examples/sites/create-deployment.md +0 -20
  485. package/docs/examples/sites/create-duplicate-deployment.md +0 -16
  486. package/docs/examples/sites/create-template-deployment.md +0 -21
  487. package/docs/examples/sites/create-variable.md +0 -18
  488. package/docs/examples/sites/create-vcs-deployment.md +0 -18
  489. package/docs/examples/sites/create.md +0 -35
  490. package/docs/examples/sites/delete-deployment.md +0 -16
  491. package/docs/examples/sites/delete-log.md +0 -16
  492. package/docs/examples/sites/delete-variable.md +0 -16
  493. package/docs/examples/sites/delete.md +0 -15
  494. package/docs/examples/sites/get-deployment-download.md +0 -17
  495. package/docs/examples/sites/get-deployment.md +0 -16
  496. package/docs/examples/sites/get-log.md +0 -16
  497. package/docs/examples/sites/get-template.md +0 -15
  498. package/docs/examples/sites/get-usage.md +0 -16
  499. package/docs/examples/sites/get-variable.md +0 -16
  500. package/docs/examples/sites/get.md +0 -15
  501. package/docs/examples/sites/list-deployments.md +0 -18
  502. package/docs/examples/sites/list-frameworks.md +0 -13
  503. package/docs/examples/sites/list-logs.md +0 -17
  504. package/docs/examples/sites/list-specifications.md +0 -13
  505. package/docs/examples/sites/list-templates.md +0 -18
  506. package/docs/examples/sites/list-usage.md +0 -15
  507. package/docs/examples/sites/list-variables.md +0 -15
  508. package/docs/examples/sites/list.md +0 -17
  509. package/docs/examples/sites/update-deployment-status.md +0 -16
  510. package/docs/examples/sites/update-site-deployment.md +0 -16
  511. package/docs/examples/sites/update-variable.md +0 -19
  512. package/docs/examples/sites/update.md +0 -35
  513. package/docs/examples/storage/create-bucket.md +0 -25
  514. package/docs/examples/storage/create-file.md +0 -18
  515. package/docs/examples/storage/delete-bucket.md +0 -15
  516. package/docs/examples/storage/delete-file.md +0 -16
  517. package/docs/examples/storage/get-bucket-usage.md +0 -16
  518. package/docs/examples/storage/get-bucket.md +0 -15
  519. package/docs/examples/storage/get-file-download.md +0 -17
  520. package/docs/examples/storage/get-file-preview.md +0 -28
  521. package/docs/examples/storage/get-file-view.md +0 -17
  522. package/docs/examples/storage/get-file.md +0 -16
  523. package/docs/examples/storage/get-usage.md +0 -15
  524. package/docs/examples/storage/list-buckets.md +0 -17
  525. package/docs/examples/storage/list-files.md +0 -18
  526. package/docs/examples/storage/update-bucket.md +0 -25
  527. package/docs/examples/storage/update-file.md +0 -18
  528. package/docs/examples/tablesdb/create-boolean-column.md +0 -20
  529. package/docs/examples/tablesdb/create-datetime-column.md +0 -20
  530. package/docs/examples/tablesdb/create-email-column.md +0 -20
  531. package/docs/examples/tablesdb/create-enum-column.md +0 -21
  532. package/docs/examples/tablesdb/create-float-column.md +0 -22
  533. package/docs/examples/tablesdb/create-index.md +0 -21
  534. package/docs/examples/tablesdb/create-integer-column.md +0 -22
  535. package/docs/examples/tablesdb/create-ip-column.md +0 -20
  536. package/docs/examples/tablesdb/create-line-column.md +0 -19
  537. package/docs/examples/tablesdb/create-longtext-column.md +0 -21
  538. package/docs/examples/tablesdb/create-mediumtext-column.md +0 -21
  539. package/docs/examples/tablesdb/create-operations.md +0 -26
  540. package/docs/examples/tablesdb/create-point-column.md +0 -19
  541. package/docs/examples/tablesdb/create-polygon-column.md +0 -19
  542. package/docs/examples/tablesdb/create-relationship-column.md +0 -22
  543. package/docs/examples/tablesdb/create-row.md +0 -26
  544. package/docs/examples/tablesdb/create-rows.md +0 -18
  545. package/docs/examples/tablesdb/create-string-column.md +0 -22
  546. package/docs/examples/tablesdb/create-table.md +0 -22
  547. package/docs/examples/tablesdb/create-text-column.md +0 -21
  548. package/docs/examples/tablesdb/create-transaction.md +0 -15
  549. package/docs/examples/tablesdb/create-url-column.md +0 -20
  550. package/docs/examples/tablesdb/create-varchar-column.md +0 -22
  551. package/docs/examples/tablesdb/create.md +0 -17
  552. package/docs/examples/tablesdb/decrement-row-column.md +0 -21
  553. package/docs/examples/tablesdb/delete-column.md +0 -17
  554. package/docs/examples/tablesdb/delete-index.md +0 -17
  555. package/docs/examples/tablesdb/delete-row.md +0 -18
  556. package/docs/examples/tablesdb/delete-rows.md +0 -18
  557. package/docs/examples/tablesdb/delete-table.md +0 -16
  558. package/docs/examples/tablesdb/delete-transaction.md +0 -15
  559. package/docs/examples/tablesdb/delete.md +0 -15
  560. package/docs/examples/tablesdb/get-column.md +0 -17
  561. package/docs/examples/tablesdb/get-index.md +0 -17
  562. package/docs/examples/tablesdb/get-row.md +0 -19
  563. package/docs/examples/tablesdb/get-table-usage.md +0 -17
  564. package/docs/examples/tablesdb/get-table.md +0 -16
  565. package/docs/examples/tablesdb/get-transaction.md +0 -15
  566. package/docs/examples/tablesdb/get-usage.md +0 -16
  567. package/docs/examples/tablesdb/get.md +0 -15
  568. package/docs/examples/tablesdb/increment-row-column.md +0 -21
  569. package/docs/examples/tablesdb/list-columns.md +0 -18
  570. package/docs/examples/tablesdb/list-indexes.md +0 -18
  571. package/docs/examples/tablesdb/list-row-logs.md +0 -18
  572. package/docs/examples/tablesdb/list-rows.md +0 -20
  573. package/docs/examples/tablesdb/list-table-logs.md +0 -17
  574. package/docs/examples/tablesdb/list-tables.md +0 -18
  575. package/docs/examples/tablesdb/list-transactions.md +0 -15
  576. package/docs/examples/tablesdb/list-usage.md +0 -15
  577. package/docs/examples/tablesdb/list.md +0 -17
  578. package/docs/examples/tablesdb/update-boolean-column.md +0 -20
  579. package/docs/examples/tablesdb/update-datetime-column.md +0 -20
  580. package/docs/examples/tablesdb/update-email-column.md +0 -20
  581. package/docs/examples/tablesdb/update-enum-column.md +0 -21
  582. package/docs/examples/tablesdb/update-float-column.md +0 -22
  583. package/docs/examples/tablesdb/update-integer-column.md +0 -22
  584. package/docs/examples/tablesdb/update-ip-column.md +0 -20
  585. package/docs/examples/tablesdb/update-line-column.md +0 -20
  586. package/docs/examples/tablesdb/update-longtext-column.md +0 -20
  587. package/docs/examples/tablesdb/update-mediumtext-column.md +0 -20
  588. package/docs/examples/tablesdb/update-point-column.md +0 -20
  589. package/docs/examples/tablesdb/update-polygon-column.md +0 -20
  590. package/docs/examples/tablesdb/update-relationship-column.md +0 -19
  591. package/docs/examples/tablesdb/update-row.md +0 -26
  592. package/docs/examples/tablesdb/update-rows.md +0 -25
  593. package/docs/examples/tablesdb/update-string-column.md +0 -21
  594. package/docs/examples/tablesdb/update-table.md +0 -20
  595. package/docs/examples/tablesdb/update-text-column.md +0 -20
  596. package/docs/examples/tablesdb/update-transaction.md +0 -17
  597. package/docs/examples/tablesdb/update-url-column.md +0 -20
  598. package/docs/examples/tablesdb/update-varchar-column.md +0 -21
  599. package/docs/examples/tablesdb/update.md +0 -17
  600. package/docs/examples/tablesdb/upsert-row.md +0 -26
  601. package/docs/examples/tablesdb/upsert-rows.md +0 -18
  602. package/docs/examples/teams/create-membership.md +0 -21
  603. package/docs/examples/teams/create.md +0 -17
  604. package/docs/examples/teams/delete-membership.md +0 -16
  605. package/docs/examples/teams/delete.md +0 -15
  606. package/docs/examples/teams/get-membership.md +0 -16
  607. package/docs/examples/teams/get-prefs.md +0 -15
  608. package/docs/examples/teams/get.md +0 -15
  609. package/docs/examples/teams/list-logs.md +0 -17
  610. package/docs/examples/teams/list-memberships.md +0 -18
  611. package/docs/examples/teams/list.md +0 -17
  612. package/docs/examples/teams/update-membership-status.md +0 -18
  613. package/docs/examples/teams/update-membership.md +0 -17
  614. package/docs/examples/teams/update-name.md +0 -16
  615. package/docs/examples/teams/update-prefs.md +0 -16
  616. package/docs/examples/tokens/create-file-token.md +0 -17
  617. package/docs/examples/tokens/delete.md +0 -15
  618. package/docs/examples/tokens/get.md +0 -15
  619. package/docs/examples/tokens/list.md +0 -18
  620. package/docs/examples/tokens/update.md +0 -16
  621. package/docs/examples/users/create-argon-2-user.md +0 -18
  622. package/docs/examples/users/create-bcrypt-user.md +0 -18
  623. package/docs/examples/users/create-jwt.md +0 -17
  624. package/docs/examples/users/create-md-5-user.md +0 -18
  625. package/docs/examples/users/create-mfa-recovery-codes.md +0 -15
  626. package/docs/examples/users/create-ph-pass-user.md +0 -18
  627. package/docs/examples/users/create-scrypt-modified-user.md +0 -21
  628. package/docs/examples/users/create-scrypt-user.md +0 -23
  629. package/docs/examples/users/create-session.md +0 -15
  630. package/docs/examples/users/create-sha-user.md +0 -19
  631. package/docs/examples/users/create-target.md +0 -20
  632. package/docs/examples/users/create-token.md +0 -17
  633. package/docs/examples/users/create.md +0 -19
  634. package/docs/examples/users/delete-identity.md +0 -15
  635. package/docs/examples/users/delete-mfa-authenticator.md +0 -16
  636. package/docs/examples/users/delete-session.md +0 -16
  637. package/docs/examples/users/delete-sessions.md +0 -15
  638. package/docs/examples/users/delete-target.md +0 -16
  639. package/docs/examples/users/delete.md +0 -15
  640. package/docs/examples/users/get-mfa-recovery-codes.md +0 -15
  641. package/docs/examples/users/get-prefs.md +0 -15
  642. package/docs/examples/users/get-target.md +0 -16
  643. package/docs/examples/users/get-usage.md +0 -15
  644. package/docs/examples/users/get.md +0 -15
  645. package/docs/examples/users/list-identities.md +0 -17
  646. package/docs/examples/users/list-logs.md +0 -17
  647. package/docs/examples/users/list-memberships.md +0 -18
  648. package/docs/examples/users/list-mfa-factors.md +0 -15
  649. package/docs/examples/users/list-sessions.md +0 -16
  650. package/docs/examples/users/list-targets.md +0 -17
  651. package/docs/examples/users/list.md +0 -17
  652. package/docs/examples/users/update-email-verification.md +0 -16
  653. package/docs/examples/users/update-email.md +0 -16
  654. package/docs/examples/users/update-impersonator.md +0 -16
  655. package/docs/examples/users/update-labels.md +0 -16
  656. package/docs/examples/users/update-mfa-recovery-codes.md +0 -15
  657. package/docs/examples/users/update-mfa.md +0 -16
  658. package/docs/examples/users/update-name.md +0 -16
  659. package/docs/examples/users/update-password.md +0 -16
  660. package/docs/examples/users/update-phone-verification.md +0 -16
  661. package/docs/examples/users/update-phone.md +0 -16
  662. package/docs/examples/users/update-prefs.md +0 -16
  663. package/docs/examples/users/update-status.md +0 -16
  664. package/docs/examples/users/update-target.md +0 -19
  665. package/docs/examples/vcs/create-repository-detection.md +0 -18
  666. package/docs/examples/vcs/create-repository.md +0 -17
  667. package/docs/examples/vcs/delete-installation.md +0 -15
  668. package/docs/examples/vcs/get-installation.md +0 -15
  669. package/docs/examples/vcs/get-repository-contents.md +0 -18
  670. package/docs/examples/vcs/get-repository.md +0 -16
  671. package/docs/examples/vcs/list-installations.md +0 -17
  672. package/docs/examples/vcs/list-repositories.md +0 -18
  673. package/docs/examples/vcs/list-repository-branches.md +0 -16
  674. package/docs/examples/vcs/update-external-deployments.md +0 -17
  675. package/docs/examples/webhooks/create.md +0 -22
  676. package/docs/examples/webhooks/delete.md +0 -15
  677. package/docs/examples/webhooks/get.md +0 -15
  678. package/docs/examples/webhooks/list.md +0 -16
  679. package/docs/examples/webhooks/update-signature.md +0 -15
  680. package/docs/examples/webhooks/update.md +0 -22
  681. package/rollup.config.js +0 -44
  682. package/src/channel.ts +0 -158
  683. package/src/client.ts +0 -1073
  684. package/src/enums/adapter.ts +0 -4
  685. package/src/enums/api-service.ts +0 -15
  686. package/src/enums/api.ts +0 -5
  687. package/src/enums/appwrite-migration-resource.ts +0 -27
  688. package/src/enums/attribute-status.ts +0 -7
  689. package/src/enums/auth-method.ts +0 -9
  690. package/src/enums/authentication-factor.ts +0 -6
  691. package/src/enums/authenticator-type.ts +0 -3
  692. package/src/enums/backup-services.ts +0 -8
  693. package/src/enums/billing-plan-group.ts +0 -5
  694. package/src/enums/browser-permission.ts +0 -22
  695. package/src/enums/browser.ts +0 -16
  696. package/src/enums/build-runtime.ts +0 -88
  697. package/src/enums/column-status.ts +0 -7
  698. package/src/enums/compression.ts +0 -5
  699. package/src/enums/console-resource-type.ts +0 -3
  700. package/src/enums/credit-card.ts +0 -19
  701. package/src/enums/database-type.ts +0 -6
  702. package/src/enums/databases-index-type.ts +0 -6
  703. package/src/enums/deployment-download-type.ts +0 -4
  704. package/src/enums/deployment-status.ts +0 -8
  705. package/src/enums/domain-purchase-status.ts +0 -6
  706. package/src/enums/domain-transfer-status-enum.ts +0 -10
  707. package/src/enums/email-template-locale.ts +0 -133
  708. package/src/enums/email-template-type.ts +0 -9
  709. package/src/enums/execution-method.ts +0 -9
  710. package/src/enums/execution-status.ts +0 -7
  711. package/src/enums/execution-trigger.ts +0 -5
  712. package/src/enums/filter-type.ts +0 -4
  713. package/src/enums/firebase-migration-resource.ts +0 -12
  714. package/src/enums/flag.ts +0 -197
  715. package/src/enums/framework.ts +0 -17
  716. package/src/enums/frameworks.ts +0 -17
  717. package/src/enums/health-antivirus-status.ts +0 -5
  718. package/src/enums/health-check-status.ts +0 -4
  719. package/src/enums/image-format.ts +0 -9
  720. package/src/enums/image-gravity.ts +0 -11
  721. package/src/enums/index-status.ts +0 -7
  722. package/src/enums/message-priority.ts +0 -4
  723. package/src/enums/message-status.ts +0 -7
  724. package/src/enums/messaging-provider-type.ts +0 -5
  725. package/src/enums/n-host-migration-resource.ts +0 -13
  726. package/src/enums/name.ts +0 -15
  727. package/src/enums/o-auth-provider.ts +0 -41
  728. package/src/enums/order-by.ts +0 -4
  729. package/src/enums/password-hash.ts +0 -13
  730. package/src/enums/platform-type.ts +0 -17
  731. package/src/enums/platform.ts +0 -4
  732. package/src/enums/project-usage-range.ts +0 -4
  733. package/src/enums/proxy-resource-type.ts +0 -4
  734. package/src/enums/proxy-rule-deployment-resource-type.ts +0 -4
  735. package/src/enums/proxy-rule-status.ts +0 -6
  736. package/src/enums/region.ts +0 -8
  737. package/src/enums/registration-type.ts +0 -6
  738. package/src/enums/relation-mutate.ts +0 -5
  739. package/src/enums/relationship-type.ts +0 -6
  740. package/src/enums/resource-type.ts +0 -6
  741. package/src/enums/runtime.ts +0 -88
  742. package/src/enums/runtimes.ts +0 -88
  743. package/src/enums/scopes.ts +0 -81
  744. package/src/enums/sms-template-locale.ts +0 -133
  745. package/src/enums/sms-template-type.ts +0 -6
  746. package/src/enums/smtp-encryption.ts +0 -5
  747. package/src/enums/smtp-secure.ts +0 -4
  748. package/src/enums/status-code.ts +0 -6
  749. package/src/enums/status.ts +0 -3
  750. package/src/enums/supabase-migration-resource.ts +0 -13
  751. package/src/enums/tables-db-index-type.ts +0 -6
  752. package/src/enums/template-reference-type.ts +0 -5
  753. package/src/enums/theme.ts +0 -4
  754. package/src/enums/timezone.ts +0 -421
  755. package/src/enums/usage-range.ts +0 -5
  756. package/src/enums/use-cases.ts +0 -16
  757. package/src/enums/vcs-detection-type.ts +0 -4
  758. package/src/enums/vcs-reference-type.ts +0 -5
  759. package/src/id.ts +0 -47
  760. package/src/index.ts +0 -118
  761. package/src/models.ts +0 -9367
  762. package/src/operator.ts +0 -308
  763. package/src/permission.ts +0 -57
  764. package/src/query.ts +0 -576
  765. package/src/role.ts +0 -100
  766. package/src/service.ts +0 -30
  767. package/src/services/account.ts +0 -4293
  768. package/src/services/activities.ts +0 -116
  769. package/src/services/assistant.ts +0 -67
  770. package/src/services/avatars.ts +0 -754
  771. package/src/services/backups.ts +0 -754
  772. package/src/services/console.ts +0 -678
  773. package/src/services/databases.ts +0 -6376
  774. package/src/services/domains.ts +0 -4064
  775. package/src/services/functions.ts +0 -2224
  776. package/src/services/graphql.ts +0 -124
  777. package/src/services/health.ts +0 -1296
  778. package/src/services/locale.ts +0 -198
  779. package/src/services/messaging.ts +0 -5194
  780. package/src/services/migrations.ts +0 -1207
  781. package/src/services/organizations.ts +0 -2742
  782. package/src/services/project.ts +0 -404
  783. package/src/services/projects.ts +0 -4431
  784. package/src/services/proxy.ts +0 -532
  785. package/src/services/realtime.ts +0 -537
  786. package/src/services/sites.ts +0 -2131
  787. package/src/services/storage.ts +0 -1196
  788. package/src/services/tables-db.ts +0 -6256
  789. package/src/services/teams.ts +0 -959
  790. package/src/services/tokens.ts +0 -315
  791. package/src/services/users.ts +0 -3324
  792. package/src/services/vcs.ts +0 -676
  793. package/src/services/webhooks.ts +0 -451
  794. package/tsconfig.json +0 -24
@@ -1,3324 +0,0 @@
1
- import { Service } from '../service';
2
- import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
3
- import type { Models } from '../models';
4
-
5
- import { PasswordHash } from '../enums/password-hash';
6
- import { UsageRange } from '../enums/usage-range';
7
- import { AuthenticatorType } from '../enums/authenticator-type';
8
- import { MessagingProviderType } from '../enums/messaging-provider-type';
9
-
10
- export class Users {
11
- client: Client;
12
-
13
- constructor(client: Client) {
14
- this.client = client;
15
- }
16
-
17
- /**
18
- * Get a list of all the project's users. You can use the query params to filter your results.
19
- *
20
- * @param {string[]} params.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, impersonator
21
- * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
22
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
23
- * @throws {AppwriteException}
24
- * @returns {Promise<Models.UserList<Preferences>>}
25
- */
26
- list<Preferences extends Models.Preferences = Models.DefaultPreferences>(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.UserList<Preferences>>;
27
- /**
28
- * Get a list of all the project's users. You can use the query params to filter your results.
29
- *
30
- * @param {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, impersonator
31
- * @param {string} search - Search term to filter your list results. Max length: 256 chars.
32
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
33
- * @throws {AppwriteException}
34
- * @returns {Promise<Models.UserList<Preferences>>}
35
- * @deprecated Use the object parameter style method for a better developer experience.
36
- */
37
- list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string, total?: boolean): Promise<Models.UserList<Preferences>>;
38
- list<Preferences extends Models.Preferences = Models.DefaultPreferences>(
39
- paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
40
- ...rest: [(string)?, (boolean)?]
41
- ): Promise<Models.UserList<Preferences>> {
42
- let params: { queries?: string[], search?: string, total?: boolean };
43
-
44
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
45
- params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
46
- } else {
47
- params = {
48
- queries: paramsOrFirst as string[],
49
- search: rest[0] as string,
50
- total: rest[1] as boolean
51
- };
52
- }
53
-
54
- const queries = params.queries;
55
- const search = params.search;
56
- const total = params.total;
57
-
58
-
59
- const apiPath = '/users';
60
- const payload: Payload = {};
61
- if (typeof queries !== 'undefined') {
62
- payload['queries'] = queries;
63
- }
64
- if (typeof search !== 'undefined') {
65
- payload['search'] = search;
66
- }
67
- if (typeof total !== 'undefined') {
68
- payload['total'] = total;
69
- }
70
- const uri = new URL(this.client.config.endpoint + apiPath);
71
-
72
- const apiHeaders: { [header: string]: string } = {
73
- }
74
-
75
- return this.client.call(
76
- 'get',
77
- uri,
78
- apiHeaders,
79
- payload
80
- );
81
- }
82
-
83
- /**
84
- * Create a new user.
85
- *
86
- * @param {string} params.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.
87
- * @param {string} params.email - User email.
88
- * @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
89
- * @param {string} params.password - Plain text user password. Must be at least 8 chars.
90
- * @param {string} params.name - User name. Max length: 128 chars.
91
- * @throws {AppwriteException}
92
- * @returns {Promise<Models.User<Preferences>>}
93
- */
94
- create<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email?: string, phone?: string, password?: string, name?: string }): Promise<Models.User<Preferences>>;
95
- /**
96
- * Create a new user.
97
- *
98
- * @param {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.
99
- * @param {string} email - User email.
100
- * @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
101
- * @param {string} password - Plain text user password. Must be at least 8 chars.
102
- * @param {string} name - User name. Max length: 128 chars.
103
- * @throws {AppwriteException}
104
- * @returns {Promise<Models.User<Preferences>>}
105
- * @deprecated Use the object parameter style method for a better developer experience.
106
- */
107
- create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>>;
108
- create<Preferences extends Models.Preferences = Models.DefaultPreferences>(
109
- paramsOrFirst: { userId: string, email?: string, phone?: string, password?: string, name?: string } | string,
110
- ...rest: [(string)?, (string)?, (string)?, (string)?]
111
- ): Promise<Models.User<Preferences>> {
112
- let params: { userId: string, email?: string, phone?: string, password?: string, name?: string };
113
-
114
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
115
- params = (paramsOrFirst || {}) as { userId: string, email?: string, phone?: string, password?: string, name?: string };
116
- } else {
117
- params = {
118
- userId: paramsOrFirst as string,
119
- email: rest[0] as string,
120
- phone: rest[1] as string,
121
- password: rest[2] as string,
122
- name: rest[3] as string
123
- };
124
- }
125
-
126
- const userId = params.userId;
127
- const email = params.email;
128
- const phone = params.phone;
129
- const password = params.password;
130
- const name = params.name;
131
-
132
- if (typeof userId === 'undefined') {
133
- throw new AppwriteException('Missing required parameter: "userId"');
134
- }
135
-
136
- const apiPath = '/users';
137
- const payload: Payload = {};
138
- if (typeof userId !== 'undefined') {
139
- payload['userId'] = userId;
140
- }
141
- if (typeof email !== 'undefined') {
142
- payload['email'] = email;
143
- }
144
- if (typeof phone !== 'undefined') {
145
- payload['phone'] = phone;
146
- }
147
- if (typeof password !== 'undefined') {
148
- payload['password'] = password;
149
- }
150
- if (typeof name !== 'undefined') {
151
- payload['name'] = name;
152
- }
153
- const uri = new URL(this.client.config.endpoint + apiPath);
154
-
155
- const apiHeaders: { [header: string]: string } = {
156
- 'content-type': 'application/json',
157
- }
158
-
159
- return this.client.call(
160
- 'post',
161
- uri,
162
- apiHeaders,
163
- payload
164
- );
165
- }
166
-
167
- /**
168
- * 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.
169
- *
170
- * @param {string} params.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.
171
- * @param {string} params.email - User email.
172
- * @param {string} params.password - User password hashed using Argon2.
173
- * @param {string} params.name - User name. Max length: 128 chars.
174
- * @throws {AppwriteException}
175
- * @returns {Promise<Models.User<Preferences>>}
176
- */
177
- createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, name?: string }): Promise<Models.User<Preferences>>;
178
- /**
179
- * 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.
180
- *
181
- * @param {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
- * @param {string} email - User email.
183
- * @param {string} password - User password hashed using Argon2.
184
- * @param {string} name - User name. Max length: 128 chars.
185
- * @throws {AppwriteException}
186
- * @returns {Promise<Models.User<Preferences>>}
187
- * @deprecated Use the object parameter style method for a better developer experience.
188
- */
189
- createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
190
- createArgon2User<Preferences extends Models.Preferences = Models.DefaultPreferences>(
191
- paramsOrFirst: { userId: string, email: string, password: string, name?: string } | string,
192
- ...rest: [(string)?, (string)?, (string)?]
193
- ): Promise<Models.User<Preferences>> {
194
- let params: { userId: string, email: string, password: string, name?: string };
195
-
196
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
197
- params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, name?: string };
198
- } else {
199
- params = {
200
- userId: paramsOrFirst as string,
201
- email: rest[0] as string,
202
- password: rest[1] as string,
203
- name: rest[2] as string
204
- };
205
- }
206
-
207
- const userId = params.userId;
208
- const email = params.email;
209
- const password = params.password;
210
- const name = params.name;
211
-
212
- if (typeof userId === 'undefined') {
213
- throw new AppwriteException('Missing required parameter: "userId"');
214
- }
215
- if (typeof email === 'undefined') {
216
- throw new AppwriteException('Missing required parameter: "email"');
217
- }
218
- if (typeof password === 'undefined') {
219
- throw new AppwriteException('Missing required parameter: "password"');
220
- }
221
-
222
- const apiPath = '/users/argon2';
223
- const payload: Payload = {};
224
- if (typeof userId !== 'undefined') {
225
- payload['userId'] = userId;
226
- }
227
- if (typeof email !== 'undefined') {
228
- payload['email'] = email;
229
- }
230
- if (typeof password !== 'undefined') {
231
- payload['password'] = password;
232
- }
233
- if (typeof name !== 'undefined') {
234
- payload['name'] = name;
235
- }
236
- const uri = new URL(this.client.config.endpoint + apiPath);
237
-
238
- const apiHeaders: { [header: string]: string } = {
239
- 'content-type': 'application/json',
240
- }
241
-
242
- return this.client.call(
243
- 'post',
244
- uri,
245
- apiHeaders,
246
- payload
247
- );
248
- }
249
-
250
- /**
251
- * 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.
252
- *
253
- * @param {string} params.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.
254
- * @param {string} params.email - User email.
255
- * @param {string} params.password - User password hashed using Bcrypt.
256
- * @param {string} params.name - User name. Max length: 128 chars.
257
- * @throws {AppwriteException}
258
- * @returns {Promise<Models.User<Preferences>>}
259
- */
260
- createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, name?: string }): Promise<Models.User<Preferences>>;
261
- /**
262
- * 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.
263
- *
264
- * @param {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.
265
- * @param {string} email - User email.
266
- * @param {string} password - User password hashed using Bcrypt.
267
- * @param {string} name - User name. Max length: 128 chars.
268
- * @throws {AppwriteException}
269
- * @returns {Promise<Models.User<Preferences>>}
270
- * @deprecated Use the object parameter style method for a better developer experience.
271
- */
272
- createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
273
- createBcryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(
274
- paramsOrFirst: { userId: string, email: string, password: string, name?: string } | string,
275
- ...rest: [(string)?, (string)?, (string)?]
276
- ): Promise<Models.User<Preferences>> {
277
- let params: { userId: string, email: string, password: string, name?: string };
278
-
279
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
280
- params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, name?: string };
281
- } else {
282
- params = {
283
- userId: paramsOrFirst as string,
284
- email: rest[0] as string,
285
- password: rest[1] as string,
286
- name: rest[2] as string
287
- };
288
- }
289
-
290
- const userId = params.userId;
291
- const email = params.email;
292
- const password = params.password;
293
- const name = params.name;
294
-
295
- if (typeof userId === 'undefined') {
296
- throw new AppwriteException('Missing required parameter: "userId"');
297
- }
298
- if (typeof email === 'undefined') {
299
- throw new AppwriteException('Missing required parameter: "email"');
300
- }
301
- if (typeof password === 'undefined') {
302
- throw new AppwriteException('Missing required parameter: "password"');
303
- }
304
-
305
- const apiPath = '/users/bcrypt';
306
- const payload: Payload = {};
307
- if (typeof userId !== 'undefined') {
308
- payload['userId'] = userId;
309
- }
310
- if (typeof email !== 'undefined') {
311
- payload['email'] = email;
312
- }
313
- if (typeof password !== 'undefined') {
314
- payload['password'] = password;
315
- }
316
- if (typeof name !== 'undefined') {
317
- payload['name'] = name;
318
- }
319
- const uri = new URL(this.client.config.endpoint + apiPath);
320
-
321
- const apiHeaders: { [header: string]: string } = {
322
- 'content-type': 'application/json',
323
- }
324
-
325
- return this.client.call(
326
- 'post',
327
- uri,
328
- apiHeaders,
329
- payload
330
- );
331
- }
332
-
333
- /**
334
- * Get identities for all users.
335
- *
336
- * @param {string[]} params.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
337
- * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
338
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
339
- * @throws {AppwriteException}
340
- * @returns {Promise<Models.IdentityList>}
341
- */
342
- listIdentities(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.IdentityList>;
343
- /**
344
- * Get identities for all users.
345
- *
346
- * @param {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
347
- * @param {string} search - Search term to filter your list results. Max length: 256 chars.
348
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
349
- * @throws {AppwriteException}
350
- * @returns {Promise<Models.IdentityList>}
351
- * @deprecated Use the object parameter style method for a better developer experience.
352
- */
353
- listIdentities(queries?: string[], search?: string, total?: boolean): Promise<Models.IdentityList>;
354
- listIdentities(
355
- paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
356
- ...rest: [(string)?, (boolean)?]
357
- ): Promise<Models.IdentityList> {
358
- let params: { queries?: string[], search?: string, total?: boolean };
359
-
360
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
361
- params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
362
- } else {
363
- params = {
364
- queries: paramsOrFirst as string[],
365
- search: rest[0] as string,
366
- total: rest[1] as boolean
367
- };
368
- }
369
-
370
- const queries = params.queries;
371
- const search = params.search;
372
- const total = params.total;
373
-
374
-
375
- const apiPath = '/users/identities';
376
- const payload: Payload = {};
377
- if (typeof queries !== 'undefined') {
378
- payload['queries'] = queries;
379
- }
380
- if (typeof search !== 'undefined') {
381
- payload['search'] = search;
382
- }
383
- if (typeof total !== 'undefined') {
384
- payload['total'] = total;
385
- }
386
- const uri = new URL(this.client.config.endpoint + apiPath);
387
-
388
- const apiHeaders: { [header: string]: string } = {
389
- }
390
-
391
- return this.client.call(
392
- 'get',
393
- uri,
394
- apiHeaders,
395
- payload
396
- );
397
- }
398
-
399
- /**
400
- * Delete an identity by its unique ID.
401
- *
402
- * @param {string} params.identityId - Identity ID.
403
- * @throws {AppwriteException}
404
- * @returns {Promise<{}>}
405
- */
406
- deleteIdentity(params: { identityId: string }): Promise<{}>;
407
- /**
408
- * Delete an identity by its unique ID.
409
- *
410
- * @param {string} identityId - Identity ID.
411
- * @throws {AppwriteException}
412
- * @returns {Promise<{}>}
413
- * @deprecated Use the object parameter style method for a better developer experience.
414
- */
415
- deleteIdentity(identityId: string): Promise<{}>;
416
- deleteIdentity(
417
- paramsOrFirst: { identityId: string } | string
418
- ): Promise<{}> {
419
- let params: { identityId: string };
420
-
421
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
422
- params = (paramsOrFirst || {}) as { identityId: string };
423
- } else {
424
- params = {
425
- identityId: paramsOrFirst as string
426
- };
427
- }
428
-
429
- const identityId = params.identityId;
430
-
431
- if (typeof identityId === 'undefined') {
432
- throw new AppwriteException('Missing required parameter: "identityId"');
433
- }
434
-
435
- const apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId);
436
- const payload: Payload = {};
437
- const uri = new URL(this.client.config.endpoint + apiPath);
438
-
439
- const apiHeaders: { [header: string]: string } = {
440
- 'content-type': 'application/json',
441
- }
442
-
443
- return this.client.call(
444
- 'delete',
445
- uri,
446
- apiHeaders,
447
- payload
448
- );
449
- }
450
-
451
- /**
452
- * 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.
453
- *
454
- * @param {string} params.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.
455
- * @param {string} params.email - User email.
456
- * @param {string} params.password - User password hashed using MD5.
457
- * @param {string} params.name - User name. Max length: 128 chars.
458
- * @throws {AppwriteException}
459
- * @returns {Promise<Models.User<Preferences>>}
460
- */
461
- createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, name?: string }): Promise<Models.User<Preferences>>;
462
- /**
463
- * 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.
464
- *
465
- * @param {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.
466
- * @param {string} email - User email.
467
- * @param {string} password - User password hashed using MD5.
468
- * @param {string} name - User name. Max length: 128 chars.
469
- * @throws {AppwriteException}
470
- * @returns {Promise<Models.User<Preferences>>}
471
- * @deprecated Use the object parameter style method for a better developer experience.
472
- */
473
- createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
474
- createMD5User<Preferences extends Models.Preferences = Models.DefaultPreferences>(
475
- paramsOrFirst: { userId: string, email: string, password: string, name?: string } | string,
476
- ...rest: [(string)?, (string)?, (string)?]
477
- ): Promise<Models.User<Preferences>> {
478
- let params: { userId: string, email: string, password: string, name?: string };
479
-
480
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
481
- params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, name?: string };
482
- } else {
483
- params = {
484
- userId: paramsOrFirst as string,
485
- email: rest[0] as string,
486
- password: rest[1] as string,
487
- name: rest[2] as string
488
- };
489
- }
490
-
491
- const userId = params.userId;
492
- const email = params.email;
493
- const password = params.password;
494
- const name = params.name;
495
-
496
- if (typeof userId === 'undefined') {
497
- throw new AppwriteException('Missing required parameter: "userId"');
498
- }
499
- if (typeof email === 'undefined') {
500
- throw new AppwriteException('Missing required parameter: "email"');
501
- }
502
- if (typeof password === 'undefined') {
503
- throw new AppwriteException('Missing required parameter: "password"');
504
- }
505
-
506
- const apiPath = '/users/md5';
507
- const payload: Payload = {};
508
- if (typeof userId !== 'undefined') {
509
- payload['userId'] = userId;
510
- }
511
- if (typeof email !== 'undefined') {
512
- payload['email'] = email;
513
- }
514
- if (typeof password !== 'undefined') {
515
- payload['password'] = password;
516
- }
517
- if (typeof name !== 'undefined') {
518
- payload['name'] = name;
519
- }
520
- const uri = new URL(this.client.config.endpoint + apiPath);
521
-
522
- const apiHeaders: { [header: string]: string } = {
523
- 'content-type': 'application/json',
524
- }
525
-
526
- return this.client.call(
527
- 'post',
528
- uri,
529
- apiHeaders,
530
- payload
531
- );
532
- }
533
-
534
- /**
535
- * 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.
536
- *
537
- * @param {string} params.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.
538
- * @param {string} params.email - User email.
539
- * @param {string} params.password - User password hashed using PHPass.
540
- * @param {string} params.name - User name. Max length: 128 chars.
541
- * @throws {AppwriteException}
542
- * @returns {Promise<Models.User<Preferences>>}
543
- */
544
- createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, name?: string }): Promise<Models.User<Preferences>>;
545
- /**
546
- * 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.
547
- *
548
- * @param {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.
549
- * @param {string} email - User email.
550
- * @param {string} password - User password hashed using PHPass.
551
- * @param {string} name - User name. Max length: 128 chars.
552
- * @throws {AppwriteException}
553
- * @returns {Promise<Models.User<Preferences>>}
554
- * @deprecated Use the object parameter style method for a better developer experience.
555
- */
556
- createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
557
- createPHPassUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(
558
- paramsOrFirst: { userId: string, email: string, password: string, name?: string } | string,
559
- ...rest: [(string)?, (string)?, (string)?]
560
- ): Promise<Models.User<Preferences>> {
561
- let params: { userId: string, email: string, password: string, name?: string };
562
-
563
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
564
- params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, name?: string };
565
- } else {
566
- params = {
567
- userId: paramsOrFirst as string,
568
- email: rest[0] as string,
569
- password: rest[1] as string,
570
- name: rest[2] as string
571
- };
572
- }
573
-
574
- const userId = params.userId;
575
- const email = params.email;
576
- const password = params.password;
577
- const name = params.name;
578
-
579
- if (typeof userId === 'undefined') {
580
- throw new AppwriteException('Missing required parameter: "userId"');
581
- }
582
- if (typeof email === 'undefined') {
583
- throw new AppwriteException('Missing required parameter: "email"');
584
- }
585
- if (typeof password === 'undefined') {
586
- throw new AppwriteException('Missing required parameter: "password"');
587
- }
588
-
589
- const apiPath = '/users/phpass';
590
- const payload: Payload = {};
591
- if (typeof userId !== 'undefined') {
592
- payload['userId'] = userId;
593
- }
594
- if (typeof email !== 'undefined') {
595
- payload['email'] = email;
596
- }
597
- if (typeof password !== 'undefined') {
598
- payload['password'] = password;
599
- }
600
- if (typeof name !== 'undefined') {
601
- payload['name'] = name;
602
- }
603
- const uri = new URL(this.client.config.endpoint + apiPath);
604
-
605
- const apiHeaders: { [header: string]: string } = {
606
- 'content-type': 'application/json',
607
- }
608
-
609
- return this.client.call(
610
- 'post',
611
- uri,
612
- apiHeaders,
613
- payload
614
- );
615
- }
616
-
617
- /**
618
- * 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.
619
- *
620
- * @param {string} params.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.
621
- * @param {string} params.email - User email.
622
- * @param {string} params.password - User password hashed using Scrypt.
623
- * @param {string} params.passwordSalt - Optional salt used to hash password.
624
- * @param {number} params.passwordCpu - Optional CPU cost used to hash password.
625
- * @param {number} params.passwordMemory - Optional memory cost used to hash password.
626
- * @param {number} params.passwordParallel - Optional parallelization cost used to hash password.
627
- * @param {number} params.passwordLength - Optional hash length used to hash password.
628
- * @param {string} params.name - User name. Max length: 128 chars.
629
- * @throws {AppwriteException}
630
- * @returns {Promise<Models.User<Preferences>>}
631
- */
632
- createScryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string }): Promise<Models.User<Preferences>>;
633
- /**
634
- * 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.
635
- *
636
- * @param {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.
637
- * @param {string} email - User email.
638
- * @param {string} password - User password hashed using Scrypt.
639
- * @param {string} passwordSalt - Optional salt used to hash password.
640
- * @param {number} passwordCpu - Optional CPU cost used to hash password.
641
- * @param {number} passwordMemory - Optional memory cost used to hash password.
642
- * @param {number} passwordParallel - Optional parallelization cost used to hash password.
643
- * @param {number} passwordLength - Optional hash length used to hash password.
644
- * @param {string} name - User name. Max length: 128 chars.
645
- * @throws {AppwriteException}
646
- * @returns {Promise<Models.User<Preferences>>}
647
- * @deprecated Use the object parameter style method for a better developer experience.
648
- */
649
- createScryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>>;
650
- createScryptUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(
651
- paramsOrFirst: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string } | string,
652
- ...rest: [(string)?, (string)?, (string)?, (number)?, (number)?, (number)?, (number)?, (string)?]
653
- ): Promise<Models.User<Preferences>> {
654
- let params: { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string };
655
-
656
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
657
- params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string };
658
- } else {
659
- params = {
660
- userId: paramsOrFirst as string,
661
- email: rest[0] as string,
662
- password: rest[1] as string,
663
- passwordSalt: rest[2] as string,
664
- passwordCpu: rest[3] as number,
665
- passwordMemory: rest[4] as number,
666
- passwordParallel: rest[5] as number,
667
- passwordLength: rest[6] as number,
668
- name: rest[7] as string
669
- };
670
- }
671
-
672
- const userId = params.userId;
673
- const email = params.email;
674
- const password = params.password;
675
- const passwordSalt = params.passwordSalt;
676
- const passwordCpu = params.passwordCpu;
677
- const passwordMemory = params.passwordMemory;
678
- const passwordParallel = params.passwordParallel;
679
- const passwordLength = params.passwordLength;
680
- const name = params.name;
681
-
682
- if (typeof userId === 'undefined') {
683
- throw new AppwriteException('Missing required parameter: "userId"');
684
- }
685
- if (typeof email === 'undefined') {
686
- throw new AppwriteException('Missing required parameter: "email"');
687
- }
688
- if (typeof password === 'undefined') {
689
- throw new AppwriteException('Missing required parameter: "password"');
690
- }
691
- if (typeof passwordSalt === 'undefined') {
692
- throw new AppwriteException('Missing required parameter: "passwordSalt"');
693
- }
694
- if (typeof passwordCpu === 'undefined') {
695
- throw new AppwriteException('Missing required parameter: "passwordCpu"');
696
- }
697
- if (typeof passwordMemory === 'undefined') {
698
- throw new AppwriteException('Missing required parameter: "passwordMemory"');
699
- }
700
- if (typeof passwordParallel === 'undefined') {
701
- throw new AppwriteException('Missing required parameter: "passwordParallel"');
702
- }
703
- if (typeof passwordLength === 'undefined') {
704
- throw new AppwriteException('Missing required parameter: "passwordLength"');
705
- }
706
-
707
- const apiPath = '/users/scrypt';
708
- const payload: Payload = {};
709
- if (typeof userId !== 'undefined') {
710
- payload['userId'] = userId;
711
- }
712
- if (typeof email !== 'undefined') {
713
- payload['email'] = email;
714
- }
715
- if (typeof password !== 'undefined') {
716
- payload['password'] = password;
717
- }
718
- if (typeof passwordSalt !== 'undefined') {
719
- payload['passwordSalt'] = passwordSalt;
720
- }
721
- if (typeof passwordCpu !== 'undefined') {
722
- payload['passwordCpu'] = passwordCpu;
723
- }
724
- if (typeof passwordMemory !== 'undefined') {
725
- payload['passwordMemory'] = passwordMemory;
726
- }
727
- if (typeof passwordParallel !== 'undefined') {
728
- payload['passwordParallel'] = passwordParallel;
729
- }
730
- if (typeof passwordLength !== 'undefined') {
731
- payload['passwordLength'] = passwordLength;
732
- }
733
- if (typeof name !== 'undefined') {
734
- payload['name'] = name;
735
- }
736
- const uri = new URL(this.client.config.endpoint + apiPath);
737
-
738
- const apiHeaders: { [header: string]: string } = {
739
- 'content-type': 'application/json',
740
- }
741
-
742
- return this.client.call(
743
- 'post',
744
- uri,
745
- apiHeaders,
746
- payload
747
- );
748
- }
749
-
750
- /**
751
- * 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.
752
- *
753
- * @param {string} params.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.
754
- * @param {string} params.email - User email.
755
- * @param {string} params.password - User password hashed using Scrypt Modified.
756
- * @param {string} params.passwordSalt - Salt used to hash password.
757
- * @param {string} params.passwordSaltSeparator - Salt separator used to hash password.
758
- * @param {string} params.passwordSignerKey - Signer key used to hash password.
759
- * @param {string} params.name - User name. Max length: 128 chars.
760
- * @throws {AppwriteException}
761
- * @returns {Promise<Models.User<Preferences>>}
762
- */
763
- createScryptModifiedUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string }): Promise<Models.User<Preferences>>;
764
- /**
765
- * 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.
766
- *
767
- * @param {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.
768
- * @param {string} email - User email.
769
- * @param {string} password - User password hashed using Scrypt Modified.
770
- * @param {string} passwordSalt - Salt used to hash password.
771
- * @param {string} passwordSaltSeparator - Salt separator used to hash password.
772
- * @param {string} passwordSignerKey - Signer key used to hash password.
773
- * @param {string} name - User name. Max length: 128 chars.
774
- * @throws {AppwriteException}
775
- * @returns {Promise<Models.User<Preferences>>}
776
- * @deprecated Use the object parameter style method for a better developer experience.
777
- */
778
- createScryptModifiedUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>>;
779
- createScryptModifiedUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(
780
- paramsOrFirst: { userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string } | string,
781
- ...rest: [(string)?, (string)?, (string)?, (string)?, (string)?, (string)?]
782
- ): Promise<Models.User<Preferences>> {
783
- let params: { userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string };
784
-
785
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
786
- params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string };
787
- } else {
788
- params = {
789
- userId: paramsOrFirst as string,
790
- email: rest[0] as string,
791
- password: rest[1] as string,
792
- passwordSalt: rest[2] as string,
793
- passwordSaltSeparator: rest[3] as string,
794
- passwordSignerKey: rest[4] as string,
795
- name: rest[5] as string
796
- };
797
- }
798
-
799
- const userId = params.userId;
800
- const email = params.email;
801
- const password = params.password;
802
- const passwordSalt = params.passwordSalt;
803
- const passwordSaltSeparator = params.passwordSaltSeparator;
804
- const passwordSignerKey = params.passwordSignerKey;
805
- const name = params.name;
806
-
807
- if (typeof userId === 'undefined') {
808
- throw new AppwriteException('Missing required parameter: "userId"');
809
- }
810
- if (typeof email === 'undefined') {
811
- throw new AppwriteException('Missing required parameter: "email"');
812
- }
813
- if (typeof password === 'undefined') {
814
- throw new AppwriteException('Missing required parameter: "password"');
815
- }
816
- if (typeof passwordSalt === 'undefined') {
817
- throw new AppwriteException('Missing required parameter: "passwordSalt"');
818
- }
819
- if (typeof passwordSaltSeparator === 'undefined') {
820
- throw new AppwriteException('Missing required parameter: "passwordSaltSeparator"');
821
- }
822
- if (typeof passwordSignerKey === 'undefined') {
823
- throw new AppwriteException('Missing required parameter: "passwordSignerKey"');
824
- }
825
-
826
- const apiPath = '/users/scrypt-modified';
827
- const payload: Payload = {};
828
- if (typeof userId !== 'undefined') {
829
- payload['userId'] = userId;
830
- }
831
- if (typeof email !== 'undefined') {
832
- payload['email'] = email;
833
- }
834
- if (typeof password !== 'undefined') {
835
- payload['password'] = password;
836
- }
837
- if (typeof passwordSalt !== 'undefined') {
838
- payload['passwordSalt'] = passwordSalt;
839
- }
840
- if (typeof passwordSaltSeparator !== 'undefined') {
841
- payload['passwordSaltSeparator'] = passwordSaltSeparator;
842
- }
843
- if (typeof passwordSignerKey !== 'undefined') {
844
- payload['passwordSignerKey'] = passwordSignerKey;
845
- }
846
- if (typeof name !== 'undefined') {
847
- payload['name'] = name;
848
- }
849
- const uri = new URL(this.client.config.endpoint + apiPath);
850
-
851
- const apiHeaders: { [header: string]: string } = {
852
- 'content-type': 'application/json',
853
- }
854
-
855
- return this.client.call(
856
- 'post',
857
- uri,
858
- apiHeaders,
859
- payload
860
- );
861
- }
862
-
863
- /**
864
- * 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.
865
- *
866
- * @param {string} params.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.
867
- * @param {string} params.email - User email.
868
- * @param {string} params.password - User password hashed using SHA.
869
- * @param {PasswordHash} params.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'
870
- * @param {string} params.name - User name. Max length: 128 chars.
871
- * @throws {AppwriteException}
872
- * @returns {Promise<Models.User<Preferences>>}
873
- */
874
- createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string }): Promise<Models.User<Preferences>>;
875
- /**
876
- * 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.
877
- *
878
- * @param {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.
879
- * @param {string} email - User email.
880
- * @param {string} password - User password hashed using SHA.
881
- * @param {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'
882
- * @param {string} name - User name. Max length: 128 chars.
883
- * @throws {AppwriteException}
884
- * @returns {Promise<Models.User<Preferences>>}
885
- * @deprecated Use the object parameter style method for a better developer experience.
886
- */
887
- createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences>>;
888
- createSHAUser<Preferences extends Models.Preferences = Models.DefaultPreferences>(
889
- paramsOrFirst: { userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string } | string,
890
- ...rest: [(string)?, (string)?, (PasswordHash)?, (string)?]
891
- ): Promise<Models.User<Preferences>> {
892
- let params: { userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string };
893
-
894
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
895
- params = (paramsOrFirst || {}) as { userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string };
896
- } else {
897
- params = {
898
- userId: paramsOrFirst as string,
899
- email: rest[0] as string,
900
- password: rest[1] as string,
901
- passwordVersion: rest[2] as PasswordHash,
902
- name: rest[3] as string
903
- };
904
- }
905
-
906
- const userId = params.userId;
907
- const email = params.email;
908
- const password = params.password;
909
- const passwordVersion = params.passwordVersion;
910
- const name = params.name;
911
-
912
- if (typeof userId === 'undefined') {
913
- throw new AppwriteException('Missing required parameter: "userId"');
914
- }
915
- if (typeof email === 'undefined') {
916
- throw new AppwriteException('Missing required parameter: "email"');
917
- }
918
- if (typeof password === 'undefined') {
919
- throw new AppwriteException('Missing required parameter: "password"');
920
- }
921
-
922
- const apiPath = '/users/sha';
923
- const payload: Payload = {};
924
- if (typeof userId !== 'undefined') {
925
- payload['userId'] = userId;
926
- }
927
- if (typeof email !== 'undefined') {
928
- payload['email'] = email;
929
- }
930
- if (typeof password !== 'undefined') {
931
- payload['password'] = password;
932
- }
933
- if (typeof passwordVersion !== 'undefined') {
934
- payload['passwordVersion'] = passwordVersion;
935
- }
936
- if (typeof name !== 'undefined') {
937
- payload['name'] = name;
938
- }
939
- const uri = new URL(this.client.config.endpoint + apiPath);
940
-
941
- const apiHeaders: { [header: string]: string } = {
942
- 'content-type': 'application/json',
943
- }
944
-
945
- return this.client.call(
946
- 'post',
947
- uri,
948
- apiHeaders,
949
- payload
950
- );
951
- }
952
-
953
- /**
954
- * 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.
955
- *
956
- *
957
- * @param {UsageRange} params.range - Date range.
958
- * @throws {AppwriteException}
959
- * @returns {Promise<Models.UsageUsers>}
960
- */
961
- getUsage(params?: { range?: UsageRange }): Promise<Models.UsageUsers>;
962
- /**
963
- * 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.
964
- *
965
- *
966
- * @param {UsageRange} range - Date range.
967
- * @throws {AppwriteException}
968
- * @returns {Promise<Models.UsageUsers>}
969
- * @deprecated Use the object parameter style method for a better developer experience.
970
- */
971
- getUsage(range?: UsageRange): Promise<Models.UsageUsers>;
972
- getUsage(
973
- paramsOrFirst?: { range?: UsageRange } | UsageRange
974
- ): Promise<Models.UsageUsers> {
975
- let params: { range?: UsageRange };
976
-
977
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
978
- params = (paramsOrFirst || {}) as { range?: UsageRange };
979
- } else {
980
- params = {
981
- range: paramsOrFirst as UsageRange
982
- };
983
- }
984
-
985
- const range = params.range;
986
-
987
-
988
- const apiPath = '/users/usage';
989
- const payload: Payload = {};
990
- if (typeof range !== 'undefined') {
991
- payload['range'] = range;
992
- }
993
- const uri = new URL(this.client.config.endpoint + apiPath);
994
-
995
- const apiHeaders: { [header: string]: string } = {
996
- }
997
-
998
- return this.client.call(
999
- 'get',
1000
- uri,
1001
- apiHeaders,
1002
- payload
1003
- );
1004
- }
1005
-
1006
- /**
1007
- * Get a user by its unique ID.
1008
- *
1009
- * @param {string} params.userId - User ID.
1010
- * @throws {AppwriteException}
1011
- * @returns {Promise<Models.User<Preferences>>}
1012
- */
1013
- get<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string }): Promise<Models.User<Preferences>>;
1014
- /**
1015
- * Get a user by its unique ID.
1016
- *
1017
- * @param {string} userId - User ID.
1018
- * @throws {AppwriteException}
1019
- * @returns {Promise<Models.User<Preferences>>}
1020
- * @deprecated Use the object parameter style method for a better developer experience.
1021
- */
1022
- get<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Models.User<Preferences>>;
1023
- get<Preferences extends Models.Preferences = Models.DefaultPreferences>(
1024
- paramsOrFirst: { userId: string } | string
1025
- ): Promise<Models.User<Preferences>> {
1026
- let params: { userId: string };
1027
-
1028
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1029
- params = (paramsOrFirst || {}) as { userId: string };
1030
- } else {
1031
- params = {
1032
- userId: paramsOrFirst as string
1033
- };
1034
- }
1035
-
1036
- const userId = params.userId;
1037
-
1038
- if (typeof userId === 'undefined') {
1039
- throw new AppwriteException('Missing required parameter: "userId"');
1040
- }
1041
-
1042
- const apiPath = '/users/{userId}'.replace('{userId}', userId);
1043
- const payload: Payload = {};
1044
- const uri = new URL(this.client.config.endpoint + apiPath);
1045
-
1046
- const apiHeaders: { [header: string]: string } = {
1047
- }
1048
-
1049
- return this.client.call(
1050
- 'get',
1051
- uri,
1052
- apiHeaders,
1053
- payload
1054
- );
1055
- }
1056
-
1057
- /**
1058
- * 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.
1059
- *
1060
- * @param {string} params.userId - User ID.
1061
- * @throws {AppwriteException}
1062
- * @returns {Promise<{}>}
1063
- */
1064
- delete(params: { userId: string }): Promise<{}>;
1065
- /**
1066
- * 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.
1067
- *
1068
- * @param {string} userId - User ID.
1069
- * @throws {AppwriteException}
1070
- * @returns {Promise<{}>}
1071
- * @deprecated Use the object parameter style method for a better developer experience.
1072
- */
1073
- delete(userId: string): Promise<{}>;
1074
- delete(
1075
- paramsOrFirst: { userId: string } | string
1076
- ): Promise<{}> {
1077
- let params: { userId: string };
1078
-
1079
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1080
- params = (paramsOrFirst || {}) as { userId: string };
1081
- } else {
1082
- params = {
1083
- userId: paramsOrFirst as string
1084
- };
1085
- }
1086
-
1087
- const userId = params.userId;
1088
-
1089
- if (typeof userId === 'undefined') {
1090
- throw new AppwriteException('Missing required parameter: "userId"');
1091
- }
1092
-
1093
- const apiPath = '/users/{userId}'.replace('{userId}', userId);
1094
- const payload: Payload = {};
1095
- const uri = new URL(this.client.config.endpoint + apiPath);
1096
-
1097
- const apiHeaders: { [header: string]: string } = {
1098
- 'content-type': 'application/json',
1099
- }
1100
-
1101
- return this.client.call(
1102
- 'delete',
1103
- uri,
1104
- apiHeaders,
1105
- payload
1106
- );
1107
- }
1108
-
1109
- /**
1110
- * Update the user email by its unique ID.
1111
- *
1112
- * @param {string} params.userId - User ID.
1113
- * @param {string} params.email - User email.
1114
- * @throws {AppwriteException}
1115
- * @returns {Promise<Models.User<Preferences>>}
1116
- */
1117
- updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, email: string }): Promise<Models.User<Preferences>>;
1118
- /**
1119
- * Update the user email by its unique ID.
1120
- *
1121
- * @param {string} userId - User ID.
1122
- * @param {string} email - User email.
1123
- * @throws {AppwriteException}
1124
- * @returns {Promise<Models.User<Preferences>>}
1125
- * @deprecated Use the object parameter style method for a better developer experience.
1126
- */
1127
- updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string): Promise<Models.User<Preferences>>;
1128
- updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(
1129
- paramsOrFirst: { userId: string, email: string } | string,
1130
- ...rest: [(string)?]
1131
- ): Promise<Models.User<Preferences>> {
1132
- let params: { userId: string, email: string };
1133
-
1134
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1135
- params = (paramsOrFirst || {}) as { userId: string, email: string };
1136
- } else {
1137
- params = {
1138
- userId: paramsOrFirst as string,
1139
- email: rest[0] as string
1140
- };
1141
- }
1142
-
1143
- const userId = params.userId;
1144
- const email = params.email;
1145
-
1146
- if (typeof userId === 'undefined') {
1147
- throw new AppwriteException('Missing required parameter: "userId"');
1148
- }
1149
- if (typeof email === 'undefined') {
1150
- throw new AppwriteException('Missing required parameter: "email"');
1151
- }
1152
-
1153
- const apiPath = '/users/{userId}/email'.replace('{userId}', userId);
1154
- const payload: Payload = {};
1155
- if (typeof email !== 'undefined') {
1156
- payload['email'] = email;
1157
- }
1158
- const uri = new URL(this.client.config.endpoint + apiPath);
1159
-
1160
- const apiHeaders: { [header: string]: string } = {
1161
- 'content-type': 'application/json',
1162
- }
1163
-
1164
- return this.client.call(
1165
- 'patch',
1166
- uri,
1167
- apiHeaders,
1168
- payload
1169
- );
1170
- }
1171
-
1172
- /**
1173
- * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.
1174
- *
1175
- *
1176
- * @param {string} params.userId - User ID.
1177
- * @param {boolean} params.impersonator - Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.
1178
- * @throws {AppwriteException}
1179
- * @returns {Promise<Models.User<Preferences>>}
1180
- */
1181
- updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, impersonator: boolean }): Promise<Models.User<Preferences>>;
1182
- /**
1183
- * Enable or disable whether a user can impersonate other users. When impersonation headers are used, the request runs as the target user for API behavior, while internal audit logs still attribute the action to the original impersonator and store the impersonated target details only in internal audit payload data.
1184
- *
1185
- *
1186
- * @param {string} userId - User ID.
1187
- * @param {boolean} impersonator - Whether the user can impersonate other users. When true, the user can browse project users to choose a target and can pass impersonation headers to act as that user. Internal audit logs still attribute impersonated actions to the original impersonator and store the target user details only in internal audit payload data.
1188
- * @throws {AppwriteException}
1189
- * @returns {Promise<Models.User<Preferences>>}
1190
- * @deprecated Use the object parameter style method for a better developer experience.
1191
- */
1192
- updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, impersonator: boolean): Promise<Models.User<Preferences>>;
1193
- updateImpersonator<Preferences extends Models.Preferences = Models.DefaultPreferences>(
1194
- paramsOrFirst: { userId: string, impersonator: boolean } | string,
1195
- ...rest: [(boolean)?]
1196
- ): Promise<Models.User<Preferences>> {
1197
- let params: { userId: string, impersonator: boolean };
1198
-
1199
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1200
- params = (paramsOrFirst || {}) as { userId: string, impersonator: boolean };
1201
- } else {
1202
- params = {
1203
- userId: paramsOrFirst as string,
1204
- impersonator: rest[0] as boolean
1205
- };
1206
- }
1207
-
1208
- const userId = params.userId;
1209
- const impersonator = params.impersonator;
1210
-
1211
- if (typeof userId === 'undefined') {
1212
- throw new AppwriteException('Missing required parameter: "userId"');
1213
- }
1214
- if (typeof impersonator === 'undefined') {
1215
- throw new AppwriteException('Missing required parameter: "impersonator"');
1216
- }
1217
-
1218
- const apiPath = '/users/{userId}/impersonator'.replace('{userId}', userId);
1219
- const payload: Payload = {};
1220
- if (typeof impersonator !== 'undefined') {
1221
- payload['impersonator'] = impersonator;
1222
- }
1223
- const uri = new URL(this.client.config.endpoint + apiPath);
1224
-
1225
- const apiHeaders: { [header: string]: string } = {
1226
- 'content-type': 'application/json',
1227
- }
1228
-
1229
- return this.client.call(
1230
- 'patch',
1231
- uri,
1232
- apiHeaders,
1233
- payload
1234
- );
1235
- }
1236
-
1237
- /**
1238
- * 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.
1239
- *
1240
- * @param {string} params.userId - User ID.
1241
- * @param {string} params.sessionId - Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.
1242
- * @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
1243
- * @throws {AppwriteException}
1244
- * @returns {Promise<Models.Jwt>}
1245
- */
1246
- createJWT(params: { userId: string, sessionId?: string, duration?: number }): Promise<Models.Jwt>;
1247
- /**
1248
- * 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.
1249
- *
1250
- * @param {string} userId - User ID.
1251
- * @param {string} sessionId - Session ID. Use the string 'recent' to use the most recent session. Defaults to the most recent session.
1252
- * @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
1253
- * @throws {AppwriteException}
1254
- * @returns {Promise<Models.Jwt>}
1255
- * @deprecated Use the object parameter style method for a better developer experience.
1256
- */
1257
- createJWT(userId: string, sessionId?: string, duration?: number): Promise<Models.Jwt>;
1258
- createJWT(
1259
- paramsOrFirst: { userId: string, sessionId?: string, duration?: number } | string,
1260
- ...rest: [(string)?, (number)?]
1261
- ): Promise<Models.Jwt> {
1262
- let params: { userId: string, sessionId?: string, duration?: number };
1263
-
1264
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1265
- params = (paramsOrFirst || {}) as { userId: string, sessionId?: string, duration?: number };
1266
- } else {
1267
- params = {
1268
- userId: paramsOrFirst as string,
1269
- sessionId: rest[0] as string,
1270
- duration: rest[1] as number
1271
- };
1272
- }
1273
-
1274
- const userId = params.userId;
1275
- const sessionId = params.sessionId;
1276
- const duration = params.duration;
1277
-
1278
- if (typeof userId === 'undefined') {
1279
- throw new AppwriteException('Missing required parameter: "userId"');
1280
- }
1281
-
1282
- const apiPath = '/users/{userId}/jwts'.replace('{userId}', userId);
1283
- const payload: Payload = {};
1284
- if (typeof sessionId !== 'undefined') {
1285
- payload['sessionId'] = sessionId;
1286
- }
1287
- if (typeof duration !== 'undefined') {
1288
- payload['duration'] = duration;
1289
- }
1290
- const uri = new URL(this.client.config.endpoint + apiPath);
1291
-
1292
- const apiHeaders: { [header: string]: string } = {
1293
- 'content-type': 'application/json',
1294
- }
1295
-
1296
- return this.client.call(
1297
- 'post',
1298
- uri,
1299
- apiHeaders,
1300
- payload
1301
- );
1302
- }
1303
-
1304
- /**
1305
- * Update the user labels by its unique ID.
1306
- *
1307
- * 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.
1308
- *
1309
- * @param {string} params.userId - User ID.
1310
- * @param {string[]} params.labels - Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
1311
- * @throws {AppwriteException}
1312
- * @returns {Promise<Models.User<Preferences>>}
1313
- */
1314
- updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, labels: string[] }): Promise<Models.User<Preferences>>;
1315
- /**
1316
- * Update the user labels by its unique ID.
1317
- *
1318
- * 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.
1319
- *
1320
- * @param {string} userId - User ID.
1321
- * @param {string[]} labels - Array of user labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
1322
- * @throws {AppwriteException}
1323
- * @returns {Promise<Models.User<Preferences>>}
1324
- * @deprecated Use the object parameter style method for a better developer experience.
1325
- */
1326
- updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, labels: string[]): Promise<Models.User<Preferences>>;
1327
- updateLabels<Preferences extends Models.Preferences = Models.DefaultPreferences>(
1328
- paramsOrFirst: { userId: string, labels: string[] } | string,
1329
- ...rest: [(string[])?]
1330
- ): Promise<Models.User<Preferences>> {
1331
- let params: { userId: string, labels: string[] };
1332
-
1333
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1334
- params = (paramsOrFirst || {}) as { userId: string, labels: string[] };
1335
- } else {
1336
- params = {
1337
- userId: paramsOrFirst as string,
1338
- labels: rest[0] as string[]
1339
- };
1340
- }
1341
-
1342
- const userId = params.userId;
1343
- const labels = params.labels;
1344
-
1345
- if (typeof userId === 'undefined') {
1346
- throw new AppwriteException('Missing required parameter: "userId"');
1347
- }
1348
- if (typeof labels === 'undefined') {
1349
- throw new AppwriteException('Missing required parameter: "labels"');
1350
- }
1351
-
1352
- const apiPath = '/users/{userId}/labels'.replace('{userId}', userId);
1353
- const payload: Payload = {};
1354
- if (typeof labels !== 'undefined') {
1355
- payload['labels'] = labels;
1356
- }
1357
- const uri = new URL(this.client.config.endpoint + apiPath);
1358
-
1359
- const apiHeaders: { [header: string]: string } = {
1360
- 'content-type': 'application/json',
1361
- }
1362
-
1363
- return this.client.call(
1364
- 'put',
1365
- uri,
1366
- apiHeaders,
1367
- payload
1368
- );
1369
- }
1370
-
1371
- /**
1372
- * Get the user activity logs list by its unique ID.
1373
- *
1374
- * @param {string} params.userId - User ID.
1375
- * @param {string[]} params.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
1376
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
1377
- * @throws {AppwriteException}
1378
- * @returns {Promise<Models.LogList>}
1379
- */
1380
- listLogs(params: { userId: string, queries?: string[], total?: boolean }): Promise<Models.LogList>;
1381
- /**
1382
- * Get the user activity logs list by its unique ID.
1383
- *
1384
- * @param {string} userId - User ID.
1385
- * @param {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
1386
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
1387
- * @throws {AppwriteException}
1388
- * @returns {Promise<Models.LogList>}
1389
- * @deprecated Use the object parameter style method for a better developer experience.
1390
- */
1391
- listLogs(userId: string, queries?: string[], total?: boolean): Promise<Models.LogList>;
1392
- listLogs(
1393
- paramsOrFirst: { userId: string, queries?: string[], total?: boolean } | string,
1394
- ...rest: [(string[])?, (boolean)?]
1395
- ): Promise<Models.LogList> {
1396
- let params: { userId: string, queries?: string[], total?: boolean };
1397
-
1398
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1399
- params = (paramsOrFirst || {}) as { userId: string, queries?: string[], total?: boolean };
1400
- } else {
1401
- params = {
1402
- userId: paramsOrFirst as string,
1403
- queries: rest[0] as string[],
1404
- total: rest[1] as boolean
1405
- };
1406
- }
1407
-
1408
- const userId = params.userId;
1409
- const queries = params.queries;
1410
- const total = params.total;
1411
-
1412
- if (typeof userId === 'undefined') {
1413
- throw new AppwriteException('Missing required parameter: "userId"');
1414
- }
1415
-
1416
- const apiPath = '/users/{userId}/logs'.replace('{userId}', userId);
1417
- const payload: Payload = {};
1418
- if (typeof queries !== 'undefined') {
1419
- payload['queries'] = queries;
1420
- }
1421
- if (typeof total !== 'undefined') {
1422
- payload['total'] = total;
1423
- }
1424
- const uri = new URL(this.client.config.endpoint + apiPath);
1425
-
1426
- const apiHeaders: { [header: string]: string } = {
1427
- }
1428
-
1429
- return this.client.call(
1430
- 'get',
1431
- uri,
1432
- apiHeaders,
1433
- payload
1434
- );
1435
- }
1436
-
1437
- /**
1438
- * Get the user membership list by its unique ID.
1439
- *
1440
- * @param {string} params.userId - User ID.
1441
- * @param {string[]} params.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
1442
- * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
1443
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
1444
- * @throws {AppwriteException}
1445
- * @returns {Promise<Models.MembershipList>}
1446
- */
1447
- listMemberships(params: { userId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.MembershipList>;
1448
- /**
1449
- * Get the user membership list by its unique ID.
1450
- *
1451
- * @param {string} userId - User ID.
1452
- * @param {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
1453
- * @param {string} search - Search term to filter your list results. Max length: 256 chars.
1454
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
1455
- * @throws {AppwriteException}
1456
- * @returns {Promise<Models.MembershipList>}
1457
- * @deprecated Use the object parameter style method for a better developer experience.
1458
- */
1459
- listMemberships(userId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.MembershipList>;
1460
- listMemberships(
1461
- paramsOrFirst: { userId: string, queries?: string[], search?: string, total?: boolean } | string,
1462
- ...rest: [(string[])?, (string)?, (boolean)?]
1463
- ): Promise<Models.MembershipList> {
1464
- let params: { userId: string, queries?: string[], search?: string, total?: boolean };
1465
-
1466
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1467
- params = (paramsOrFirst || {}) as { userId: string, queries?: string[], search?: string, total?: boolean };
1468
- } else {
1469
- params = {
1470
- userId: paramsOrFirst as string,
1471
- queries: rest[0] as string[],
1472
- search: rest[1] as string,
1473
- total: rest[2] as boolean
1474
- };
1475
- }
1476
-
1477
- const userId = params.userId;
1478
- const queries = params.queries;
1479
- const search = params.search;
1480
- const total = params.total;
1481
-
1482
- if (typeof userId === 'undefined') {
1483
- throw new AppwriteException('Missing required parameter: "userId"');
1484
- }
1485
-
1486
- const apiPath = '/users/{userId}/memberships'.replace('{userId}', userId);
1487
- const payload: Payload = {};
1488
- if (typeof queries !== 'undefined') {
1489
- payload['queries'] = queries;
1490
- }
1491
- if (typeof search !== 'undefined') {
1492
- payload['search'] = search;
1493
- }
1494
- if (typeof total !== 'undefined') {
1495
- payload['total'] = total;
1496
- }
1497
- const uri = new URL(this.client.config.endpoint + apiPath);
1498
-
1499
- const apiHeaders: { [header: string]: string } = {
1500
- }
1501
-
1502
- return this.client.call(
1503
- 'get',
1504
- uri,
1505
- apiHeaders,
1506
- payload
1507
- );
1508
- }
1509
-
1510
- /**
1511
- * Enable or disable MFA on a user account.
1512
- *
1513
- * @param {string} params.userId - User ID.
1514
- * @param {boolean} params.mfa - Enable or disable MFA.
1515
- * @throws {AppwriteException}
1516
- * @returns {Promise<Models.User<Preferences>>}
1517
- * @deprecated This API has been deprecated since 1.8.0. Please use `Users.updateMFA` instead.
1518
- */
1519
- updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, mfa: boolean }): Promise<Models.User<Preferences>>;
1520
- /**
1521
- * Enable or disable MFA on a user account.
1522
- *
1523
- * @param {string} userId - User ID.
1524
- * @param {boolean} mfa - Enable or disable MFA.
1525
- * @throws {AppwriteException}
1526
- * @returns {Promise<Models.User<Preferences>>}
1527
- * @deprecated Use the object parameter style method for a better developer experience.
1528
- */
1529
- updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>>;
1530
- updateMfa<Preferences extends Models.Preferences = Models.DefaultPreferences>(
1531
- paramsOrFirst: { userId: string, mfa: boolean } | string,
1532
- ...rest: [(boolean)?]
1533
- ): Promise<Models.User<Preferences>> {
1534
- let params: { userId: string, mfa: boolean };
1535
-
1536
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1537
- params = (paramsOrFirst || {}) as { userId: string, mfa: boolean };
1538
- } else {
1539
- params = {
1540
- userId: paramsOrFirst as string,
1541
- mfa: rest[0] as boolean
1542
- };
1543
- }
1544
-
1545
- const userId = params.userId;
1546
- const mfa = params.mfa;
1547
-
1548
- if (typeof userId === 'undefined') {
1549
- throw new AppwriteException('Missing required parameter: "userId"');
1550
- }
1551
- if (typeof mfa === 'undefined') {
1552
- throw new AppwriteException('Missing required parameter: "mfa"');
1553
- }
1554
-
1555
- const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId);
1556
- const payload: Payload = {};
1557
- if (typeof mfa !== 'undefined') {
1558
- payload['mfa'] = mfa;
1559
- }
1560
- const uri = new URL(this.client.config.endpoint + apiPath);
1561
-
1562
- const apiHeaders: { [header: string]: string } = {
1563
- 'content-type': 'application/json',
1564
- }
1565
-
1566
- return this.client.call(
1567
- 'patch',
1568
- uri,
1569
- apiHeaders,
1570
- payload
1571
- );
1572
- }
1573
-
1574
- /**
1575
- * Enable or disable MFA on a user account.
1576
- *
1577
- * @param {string} params.userId - User ID.
1578
- * @param {boolean} params.mfa - Enable or disable MFA.
1579
- * @throws {AppwriteException}
1580
- * @returns {Promise<Models.User<Preferences>>}
1581
- */
1582
- updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, mfa: boolean }): Promise<Models.User<Preferences>>;
1583
- /**
1584
- * Enable or disable MFA on a user account.
1585
- *
1586
- * @param {string} userId - User ID.
1587
- * @param {boolean} mfa - Enable or disable MFA.
1588
- * @throws {AppwriteException}
1589
- * @returns {Promise<Models.User<Preferences>>}
1590
- * @deprecated Use the object parameter style method for a better developer experience.
1591
- */
1592
- updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>>;
1593
- updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(
1594
- paramsOrFirst: { userId: string, mfa: boolean } | string,
1595
- ...rest: [(boolean)?]
1596
- ): Promise<Models.User<Preferences>> {
1597
- let params: { userId: string, mfa: boolean };
1598
-
1599
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1600
- params = (paramsOrFirst || {}) as { userId: string, mfa: boolean };
1601
- } else {
1602
- params = {
1603
- userId: paramsOrFirst as string,
1604
- mfa: rest[0] as boolean
1605
- };
1606
- }
1607
-
1608
- const userId = params.userId;
1609
- const mfa = params.mfa;
1610
-
1611
- if (typeof userId === 'undefined') {
1612
- throw new AppwriteException('Missing required parameter: "userId"');
1613
- }
1614
- if (typeof mfa === 'undefined') {
1615
- throw new AppwriteException('Missing required parameter: "mfa"');
1616
- }
1617
-
1618
- const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId);
1619
- const payload: Payload = {};
1620
- if (typeof mfa !== 'undefined') {
1621
- payload['mfa'] = mfa;
1622
- }
1623
- const uri = new URL(this.client.config.endpoint + apiPath);
1624
-
1625
- const apiHeaders: { [header: string]: string } = {
1626
- 'content-type': 'application/json',
1627
- }
1628
-
1629
- return this.client.call(
1630
- 'patch',
1631
- uri,
1632
- apiHeaders,
1633
- payload
1634
- );
1635
- }
1636
-
1637
- /**
1638
- * Delete an authenticator app.
1639
- *
1640
- * @param {string} params.userId - User ID.
1641
- * @param {AuthenticatorType} params.type - Type of authenticator.
1642
- * @throws {AppwriteException}
1643
- * @returns {Promise<{}>}
1644
- * @deprecated This API has been deprecated since 1.8.0. Please use `Users.deleteMFAAuthenticator` instead.
1645
- */
1646
- deleteMfaAuthenticator(params: { userId: string, type: AuthenticatorType }): Promise<{}>;
1647
- /**
1648
- * Delete an authenticator app.
1649
- *
1650
- * @param {string} userId - User ID.
1651
- * @param {AuthenticatorType} type - Type of authenticator.
1652
- * @throws {AppwriteException}
1653
- * @returns {Promise<{}>}
1654
- * @deprecated Use the object parameter style method for a better developer experience.
1655
- */
1656
- deleteMfaAuthenticator(userId: string, type: AuthenticatorType): Promise<{}>;
1657
- deleteMfaAuthenticator(
1658
- paramsOrFirst: { userId: string, type: AuthenticatorType } | string,
1659
- ...rest: [(AuthenticatorType)?]
1660
- ): Promise<{}> {
1661
- let params: { userId: string, type: AuthenticatorType };
1662
-
1663
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1664
- params = (paramsOrFirst || {}) as { userId: string, type: AuthenticatorType };
1665
- } else {
1666
- params = {
1667
- userId: paramsOrFirst as string,
1668
- type: rest[0] as AuthenticatorType
1669
- };
1670
- }
1671
-
1672
- const userId = params.userId;
1673
- const type = params.type;
1674
-
1675
- if (typeof userId === 'undefined') {
1676
- throw new AppwriteException('Missing required parameter: "userId"');
1677
- }
1678
- if (typeof type === 'undefined') {
1679
- throw new AppwriteException('Missing required parameter: "type"');
1680
- }
1681
-
1682
- const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type);
1683
- const payload: Payload = {};
1684
- const uri = new URL(this.client.config.endpoint + apiPath);
1685
-
1686
- const apiHeaders: { [header: string]: string } = {
1687
- 'content-type': 'application/json',
1688
- }
1689
-
1690
- return this.client.call(
1691
- 'delete',
1692
- uri,
1693
- apiHeaders,
1694
- payload
1695
- );
1696
- }
1697
-
1698
- /**
1699
- * Delete an authenticator app.
1700
- *
1701
- * @param {string} params.userId - User ID.
1702
- * @param {AuthenticatorType} params.type - Type of authenticator.
1703
- * @throws {AppwriteException}
1704
- * @returns {Promise<{}>}
1705
- */
1706
- deleteMFAAuthenticator(params: { userId: string, type: AuthenticatorType }): Promise<{}>;
1707
- /**
1708
- * Delete an authenticator app.
1709
- *
1710
- * @param {string} userId - User ID.
1711
- * @param {AuthenticatorType} type - Type of authenticator.
1712
- * @throws {AppwriteException}
1713
- * @returns {Promise<{}>}
1714
- * @deprecated Use the object parameter style method for a better developer experience.
1715
- */
1716
- deleteMFAAuthenticator(userId: string, type: AuthenticatorType): Promise<{}>;
1717
- deleteMFAAuthenticator(
1718
- paramsOrFirst: { userId: string, type: AuthenticatorType } | string,
1719
- ...rest: [(AuthenticatorType)?]
1720
- ): Promise<{}> {
1721
- let params: { userId: string, type: AuthenticatorType };
1722
-
1723
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1724
- params = (paramsOrFirst || {}) as { userId: string, type: AuthenticatorType };
1725
- } else {
1726
- params = {
1727
- userId: paramsOrFirst as string,
1728
- type: rest[0] as AuthenticatorType
1729
- };
1730
- }
1731
-
1732
- const userId = params.userId;
1733
- const type = params.type;
1734
-
1735
- if (typeof userId === 'undefined') {
1736
- throw new AppwriteException('Missing required parameter: "userId"');
1737
- }
1738
- if (typeof type === 'undefined') {
1739
- throw new AppwriteException('Missing required parameter: "type"');
1740
- }
1741
-
1742
- const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type);
1743
- const payload: Payload = {};
1744
- const uri = new URL(this.client.config.endpoint + apiPath);
1745
-
1746
- const apiHeaders: { [header: string]: string } = {
1747
- 'content-type': 'application/json',
1748
- }
1749
-
1750
- return this.client.call(
1751
- 'delete',
1752
- uri,
1753
- apiHeaders,
1754
- payload
1755
- );
1756
- }
1757
-
1758
- /**
1759
- * List the factors available on the account to be used as a MFA challange.
1760
- *
1761
- * @param {string} params.userId - User ID.
1762
- * @throws {AppwriteException}
1763
- * @returns {Promise<Models.MfaFactors>}
1764
- * @deprecated This API has been deprecated since 1.8.0. Please use `Users.listMFAFactors` instead.
1765
- */
1766
- listMfaFactors(params: { userId: string }): Promise<Models.MfaFactors>;
1767
- /**
1768
- * List the factors available on the account to be used as a MFA challange.
1769
- *
1770
- * @param {string} userId - User ID.
1771
- * @throws {AppwriteException}
1772
- * @returns {Promise<Models.MfaFactors>}
1773
- * @deprecated Use the object parameter style method for a better developer experience.
1774
- */
1775
- listMfaFactors(userId: string): Promise<Models.MfaFactors>;
1776
- listMfaFactors(
1777
- paramsOrFirst: { userId: string } | string
1778
- ): Promise<Models.MfaFactors> {
1779
- let params: { userId: string };
1780
-
1781
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1782
- params = (paramsOrFirst || {}) as { userId: string };
1783
- } else {
1784
- params = {
1785
- userId: paramsOrFirst as string
1786
- };
1787
- }
1788
-
1789
- const userId = params.userId;
1790
-
1791
- if (typeof userId === 'undefined') {
1792
- throw new AppwriteException('Missing required parameter: "userId"');
1793
- }
1794
-
1795
- const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId);
1796
- const payload: Payload = {};
1797
- const uri = new URL(this.client.config.endpoint + apiPath);
1798
-
1799
- const apiHeaders: { [header: string]: string } = {
1800
- }
1801
-
1802
- return this.client.call(
1803
- 'get',
1804
- uri,
1805
- apiHeaders,
1806
- payload
1807
- );
1808
- }
1809
-
1810
- /**
1811
- * List the factors available on the account to be used as a MFA challange.
1812
- *
1813
- * @param {string} params.userId - User ID.
1814
- * @throws {AppwriteException}
1815
- * @returns {Promise<Models.MfaFactors>}
1816
- */
1817
- listMFAFactors(params: { userId: string }): Promise<Models.MfaFactors>;
1818
- /**
1819
- * List the factors available on the account to be used as a MFA challange.
1820
- *
1821
- * @param {string} userId - User ID.
1822
- * @throws {AppwriteException}
1823
- * @returns {Promise<Models.MfaFactors>}
1824
- * @deprecated Use the object parameter style method for a better developer experience.
1825
- */
1826
- listMFAFactors(userId: string): Promise<Models.MfaFactors>;
1827
- listMFAFactors(
1828
- paramsOrFirst: { userId: string } | string
1829
- ): Promise<Models.MfaFactors> {
1830
- let params: { userId: string };
1831
-
1832
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1833
- params = (paramsOrFirst || {}) as { userId: string };
1834
- } else {
1835
- params = {
1836
- userId: paramsOrFirst as string
1837
- };
1838
- }
1839
-
1840
- const userId = params.userId;
1841
-
1842
- if (typeof userId === 'undefined') {
1843
- throw new AppwriteException('Missing required parameter: "userId"');
1844
- }
1845
-
1846
- const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId);
1847
- const payload: Payload = {};
1848
- const uri = new URL(this.client.config.endpoint + apiPath);
1849
-
1850
- const apiHeaders: { [header: string]: string } = {
1851
- }
1852
-
1853
- return this.client.call(
1854
- 'get',
1855
- uri,
1856
- apiHeaders,
1857
- payload
1858
- );
1859
- }
1860
-
1861
- /**
1862
- * 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.
1863
- *
1864
- * @param {string} params.userId - User ID.
1865
- * @throws {AppwriteException}
1866
- * @returns {Promise<Models.MfaRecoveryCodes>}
1867
- * @deprecated This API has been deprecated since 1.8.0. Please use `Users.getMFARecoveryCodes` instead.
1868
- */
1869
- getMfaRecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
1870
- /**
1871
- * 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.
1872
- *
1873
- * @param {string} userId - User ID.
1874
- * @throws {AppwriteException}
1875
- * @returns {Promise<Models.MfaRecoveryCodes>}
1876
- * @deprecated Use the object parameter style method for a better developer experience.
1877
- */
1878
- getMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
1879
- getMfaRecoveryCodes(
1880
- paramsOrFirst: { userId: string } | string
1881
- ): Promise<Models.MfaRecoveryCodes> {
1882
- let params: { userId: string };
1883
-
1884
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1885
- params = (paramsOrFirst || {}) as { userId: string };
1886
- } else {
1887
- params = {
1888
- userId: paramsOrFirst as string
1889
- };
1890
- }
1891
-
1892
- const userId = params.userId;
1893
-
1894
- if (typeof userId === 'undefined') {
1895
- throw new AppwriteException('Missing required parameter: "userId"');
1896
- }
1897
-
1898
- const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
1899
- const payload: Payload = {};
1900
- const uri = new URL(this.client.config.endpoint + apiPath);
1901
-
1902
- const apiHeaders: { [header: string]: string } = {
1903
- }
1904
-
1905
- return this.client.call(
1906
- 'get',
1907
- uri,
1908
- apiHeaders,
1909
- payload
1910
- );
1911
- }
1912
-
1913
- /**
1914
- * 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.
1915
- *
1916
- * @param {string} params.userId - User ID.
1917
- * @throws {AppwriteException}
1918
- * @returns {Promise<Models.MfaRecoveryCodes>}
1919
- */
1920
- getMFARecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
1921
- /**
1922
- * 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.
1923
- *
1924
- * @param {string} userId - User ID.
1925
- * @throws {AppwriteException}
1926
- * @returns {Promise<Models.MfaRecoveryCodes>}
1927
- * @deprecated Use the object parameter style method for a better developer experience.
1928
- */
1929
- getMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
1930
- getMFARecoveryCodes(
1931
- paramsOrFirst: { userId: string } | string
1932
- ): Promise<Models.MfaRecoveryCodes> {
1933
- let params: { userId: string };
1934
-
1935
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1936
- params = (paramsOrFirst || {}) as { userId: string };
1937
- } else {
1938
- params = {
1939
- userId: paramsOrFirst as string
1940
- };
1941
- }
1942
-
1943
- const userId = params.userId;
1944
-
1945
- if (typeof userId === 'undefined') {
1946
- throw new AppwriteException('Missing required parameter: "userId"');
1947
- }
1948
-
1949
- const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
1950
- const payload: Payload = {};
1951
- const uri = new URL(this.client.config.endpoint + apiPath);
1952
-
1953
- const apiHeaders: { [header: string]: string } = {
1954
- }
1955
-
1956
- return this.client.call(
1957
- 'get',
1958
- uri,
1959
- apiHeaders,
1960
- payload
1961
- );
1962
- }
1963
-
1964
- /**
1965
- * 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.
1966
- *
1967
- * @param {string} params.userId - User ID.
1968
- * @throws {AppwriteException}
1969
- * @returns {Promise<Models.MfaRecoveryCodes>}
1970
- * @deprecated This API has been deprecated since 1.8.0. Please use `Users.updateMFARecoveryCodes` instead.
1971
- */
1972
- updateMfaRecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
1973
- /**
1974
- * 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.
1975
- *
1976
- * @param {string} userId - User ID.
1977
- * @throws {AppwriteException}
1978
- * @returns {Promise<Models.MfaRecoveryCodes>}
1979
- * @deprecated Use the object parameter style method for a better developer experience.
1980
- */
1981
- updateMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
1982
- updateMfaRecoveryCodes(
1983
- paramsOrFirst: { userId: string } | string
1984
- ): Promise<Models.MfaRecoveryCodes> {
1985
- let params: { userId: string };
1986
-
1987
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1988
- params = (paramsOrFirst || {}) as { userId: string };
1989
- } else {
1990
- params = {
1991
- userId: paramsOrFirst as string
1992
- };
1993
- }
1994
-
1995
- const userId = params.userId;
1996
-
1997
- if (typeof userId === 'undefined') {
1998
- throw new AppwriteException('Missing required parameter: "userId"');
1999
- }
2000
-
2001
- const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
2002
- const payload: Payload = {};
2003
- const uri = new URL(this.client.config.endpoint + apiPath);
2004
-
2005
- const apiHeaders: { [header: string]: string } = {
2006
- 'content-type': 'application/json',
2007
- }
2008
-
2009
- return this.client.call(
2010
- 'put',
2011
- uri,
2012
- apiHeaders,
2013
- payload
2014
- );
2015
- }
2016
-
2017
- /**
2018
- * 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.
2019
- *
2020
- * @param {string} params.userId - User ID.
2021
- * @throws {AppwriteException}
2022
- * @returns {Promise<Models.MfaRecoveryCodes>}
2023
- */
2024
- updateMFARecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
2025
- /**
2026
- * 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.
2027
- *
2028
- * @param {string} userId - User ID.
2029
- * @throws {AppwriteException}
2030
- * @returns {Promise<Models.MfaRecoveryCodes>}
2031
- * @deprecated Use the object parameter style method for a better developer experience.
2032
- */
2033
- updateMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
2034
- updateMFARecoveryCodes(
2035
- paramsOrFirst: { userId: string } | string
2036
- ): Promise<Models.MfaRecoveryCodes> {
2037
- let params: { userId: string };
2038
-
2039
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2040
- params = (paramsOrFirst || {}) as { userId: string };
2041
- } else {
2042
- params = {
2043
- userId: paramsOrFirst as string
2044
- };
2045
- }
2046
-
2047
- const userId = params.userId;
2048
-
2049
- if (typeof userId === 'undefined') {
2050
- throw new AppwriteException('Missing required parameter: "userId"');
2051
- }
2052
-
2053
- const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
2054
- const payload: Payload = {};
2055
- const uri = new URL(this.client.config.endpoint + apiPath);
2056
-
2057
- const apiHeaders: { [header: string]: string } = {
2058
- 'content-type': 'application/json',
2059
- }
2060
-
2061
- return this.client.call(
2062
- 'put',
2063
- uri,
2064
- apiHeaders,
2065
- payload
2066
- );
2067
- }
2068
-
2069
- /**
2070
- * 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.
2071
- *
2072
- * @param {string} params.userId - User ID.
2073
- * @throws {AppwriteException}
2074
- * @returns {Promise<Models.MfaRecoveryCodes>}
2075
- * @deprecated This API has been deprecated since 1.8.0. Please use `Users.createMFARecoveryCodes` instead.
2076
- */
2077
- createMfaRecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
2078
- /**
2079
- * 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.
2080
- *
2081
- * @param {string} userId - User ID.
2082
- * @throws {AppwriteException}
2083
- * @returns {Promise<Models.MfaRecoveryCodes>}
2084
- * @deprecated Use the object parameter style method for a better developer experience.
2085
- */
2086
- createMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
2087
- createMfaRecoveryCodes(
2088
- paramsOrFirst: { userId: string } | string
2089
- ): Promise<Models.MfaRecoveryCodes> {
2090
- let params: { userId: string };
2091
-
2092
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2093
- params = (paramsOrFirst || {}) as { userId: string };
2094
- } else {
2095
- params = {
2096
- userId: paramsOrFirst as string
2097
- };
2098
- }
2099
-
2100
- const userId = params.userId;
2101
-
2102
- if (typeof userId === 'undefined') {
2103
- throw new AppwriteException('Missing required parameter: "userId"');
2104
- }
2105
-
2106
- const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
2107
- const payload: Payload = {};
2108
- const uri = new URL(this.client.config.endpoint + apiPath);
2109
-
2110
- const apiHeaders: { [header: string]: string } = {
2111
- 'content-type': 'application/json',
2112
- }
2113
-
2114
- return this.client.call(
2115
- 'patch',
2116
- uri,
2117
- apiHeaders,
2118
- payload
2119
- );
2120
- }
2121
-
2122
- /**
2123
- * 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.
2124
- *
2125
- * @param {string} params.userId - User ID.
2126
- * @throws {AppwriteException}
2127
- * @returns {Promise<Models.MfaRecoveryCodes>}
2128
- */
2129
- createMFARecoveryCodes(params: { userId: string }): Promise<Models.MfaRecoveryCodes>;
2130
- /**
2131
- * 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.
2132
- *
2133
- * @param {string} userId - User ID.
2134
- * @throws {AppwriteException}
2135
- * @returns {Promise<Models.MfaRecoveryCodes>}
2136
- * @deprecated Use the object parameter style method for a better developer experience.
2137
- */
2138
- createMFARecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes>;
2139
- createMFARecoveryCodes(
2140
- paramsOrFirst: { userId: string } | string
2141
- ): Promise<Models.MfaRecoveryCodes> {
2142
- let params: { userId: string };
2143
-
2144
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2145
- params = (paramsOrFirst || {}) as { userId: string };
2146
- } else {
2147
- params = {
2148
- userId: paramsOrFirst as string
2149
- };
2150
- }
2151
-
2152
- const userId = params.userId;
2153
-
2154
- if (typeof userId === 'undefined') {
2155
- throw new AppwriteException('Missing required parameter: "userId"');
2156
- }
2157
-
2158
- const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
2159
- const payload: Payload = {};
2160
- const uri = new URL(this.client.config.endpoint + apiPath);
2161
-
2162
- const apiHeaders: { [header: string]: string } = {
2163
- 'content-type': 'application/json',
2164
- }
2165
-
2166
- return this.client.call(
2167
- 'patch',
2168
- uri,
2169
- apiHeaders,
2170
- payload
2171
- );
2172
- }
2173
-
2174
- /**
2175
- * Update the user name by its unique ID.
2176
- *
2177
- * @param {string} params.userId - User ID.
2178
- * @param {string} params.name - User name. Max length: 128 chars.
2179
- * @throws {AppwriteException}
2180
- * @returns {Promise<Models.User<Preferences>>}
2181
- */
2182
- updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, name: string }): Promise<Models.User<Preferences>>;
2183
- /**
2184
- * Update the user name by its unique ID.
2185
- *
2186
- * @param {string} userId - User ID.
2187
- * @param {string} name - User name. Max length: 128 chars.
2188
- * @throws {AppwriteException}
2189
- * @returns {Promise<Models.User<Preferences>>}
2190
- * @deprecated Use the object parameter style method for a better developer experience.
2191
- */
2192
- updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, name: string): Promise<Models.User<Preferences>>;
2193
- updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(
2194
- paramsOrFirst: { userId: string, name: string } | string,
2195
- ...rest: [(string)?]
2196
- ): Promise<Models.User<Preferences>> {
2197
- let params: { userId: string, name: string };
2198
-
2199
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2200
- params = (paramsOrFirst || {}) as { userId: string, name: string };
2201
- } else {
2202
- params = {
2203
- userId: paramsOrFirst as string,
2204
- name: rest[0] as string
2205
- };
2206
- }
2207
-
2208
- const userId = params.userId;
2209
- const name = params.name;
2210
-
2211
- if (typeof userId === 'undefined') {
2212
- throw new AppwriteException('Missing required parameter: "userId"');
2213
- }
2214
- if (typeof name === 'undefined') {
2215
- throw new AppwriteException('Missing required parameter: "name"');
2216
- }
2217
-
2218
- const apiPath = '/users/{userId}/name'.replace('{userId}', userId);
2219
- const payload: Payload = {};
2220
- if (typeof name !== 'undefined') {
2221
- payload['name'] = name;
2222
- }
2223
- const uri = new URL(this.client.config.endpoint + apiPath);
2224
-
2225
- const apiHeaders: { [header: string]: string } = {
2226
- 'content-type': 'application/json',
2227
- }
2228
-
2229
- return this.client.call(
2230
- 'patch',
2231
- uri,
2232
- apiHeaders,
2233
- payload
2234
- );
2235
- }
2236
-
2237
- /**
2238
- * Update the user password by its unique ID.
2239
- *
2240
- * @param {string} params.userId - User ID.
2241
- * @param {string} params.password - New user password. Must be at least 8 chars.
2242
- * @throws {AppwriteException}
2243
- * @returns {Promise<Models.User<Preferences>>}
2244
- */
2245
- updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, password: string }): Promise<Models.User<Preferences>>;
2246
- /**
2247
- * Update the user password by its unique ID.
2248
- *
2249
- * @param {string} userId - User ID.
2250
- * @param {string} password - New user password. Must be at least 8 chars.
2251
- * @throws {AppwriteException}
2252
- * @returns {Promise<Models.User<Preferences>>}
2253
- * @deprecated Use the object parameter style method for a better developer experience.
2254
- */
2255
- updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, password: string): Promise<Models.User<Preferences>>;
2256
- updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(
2257
- paramsOrFirst: { userId: string, password: string } | string,
2258
- ...rest: [(string)?]
2259
- ): Promise<Models.User<Preferences>> {
2260
- let params: { userId: string, password: string };
2261
-
2262
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2263
- params = (paramsOrFirst || {}) as { userId: string, password: string };
2264
- } else {
2265
- params = {
2266
- userId: paramsOrFirst as string,
2267
- password: rest[0] as string
2268
- };
2269
- }
2270
-
2271
- const userId = params.userId;
2272
- const password = params.password;
2273
-
2274
- if (typeof userId === 'undefined') {
2275
- throw new AppwriteException('Missing required parameter: "userId"');
2276
- }
2277
- if (typeof password === 'undefined') {
2278
- throw new AppwriteException('Missing required parameter: "password"');
2279
- }
2280
-
2281
- const apiPath = '/users/{userId}/password'.replace('{userId}', userId);
2282
- const payload: Payload = {};
2283
- if (typeof password !== 'undefined') {
2284
- payload['password'] = password;
2285
- }
2286
- const uri = new URL(this.client.config.endpoint + apiPath);
2287
-
2288
- const apiHeaders: { [header: string]: string } = {
2289
- 'content-type': 'application/json',
2290
- }
2291
-
2292
- return this.client.call(
2293
- 'patch',
2294
- uri,
2295
- apiHeaders,
2296
- payload
2297
- );
2298
- }
2299
-
2300
- /**
2301
- * Update the user phone by its unique ID.
2302
- *
2303
- * @param {string} params.userId - User ID.
2304
- * @param {string} params.number - User phone number.
2305
- * @throws {AppwriteException}
2306
- * @returns {Promise<Models.User<Preferences>>}
2307
- */
2308
- updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, number: string }): Promise<Models.User<Preferences>>;
2309
- /**
2310
- * Update the user phone by its unique ID.
2311
- *
2312
- * @param {string} userId - User ID.
2313
- * @param {string} number - User phone number.
2314
- * @throws {AppwriteException}
2315
- * @returns {Promise<Models.User<Preferences>>}
2316
- * @deprecated Use the object parameter style method for a better developer experience.
2317
- */
2318
- updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, number: string): Promise<Models.User<Preferences>>;
2319
- updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(
2320
- paramsOrFirst: { userId: string, number: string } | string,
2321
- ...rest: [(string)?]
2322
- ): Promise<Models.User<Preferences>> {
2323
- let params: { userId: string, number: string };
2324
-
2325
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2326
- params = (paramsOrFirst || {}) as { userId: string, number: string };
2327
- } else {
2328
- params = {
2329
- userId: paramsOrFirst as string,
2330
- number: rest[0] as string
2331
- };
2332
- }
2333
-
2334
- const userId = params.userId;
2335
- const number = params.number;
2336
-
2337
- if (typeof userId === 'undefined') {
2338
- throw new AppwriteException('Missing required parameter: "userId"');
2339
- }
2340
- if (typeof number === 'undefined') {
2341
- throw new AppwriteException('Missing required parameter: "number"');
2342
- }
2343
-
2344
- const apiPath = '/users/{userId}/phone'.replace('{userId}', userId);
2345
- const payload: Payload = {};
2346
- if (typeof number !== 'undefined') {
2347
- payload['number'] = number;
2348
- }
2349
- const uri = new URL(this.client.config.endpoint + apiPath);
2350
-
2351
- const apiHeaders: { [header: string]: string } = {
2352
- 'content-type': 'application/json',
2353
- }
2354
-
2355
- return this.client.call(
2356
- 'patch',
2357
- uri,
2358
- apiHeaders,
2359
- payload
2360
- );
2361
- }
2362
-
2363
- /**
2364
- * Get the user preferences by its unique ID.
2365
- *
2366
- * @param {string} params.userId - User ID.
2367
- * @throws {AppwriteException}
2368
- * @returns {Promise<Preferences>}
2369
- */
2370
- getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string }): Promise<Preferences>;
2371
- /**
2372
- * Get the user preferences by its unique ID.
2373
- *
2374
- * @param {string} userId - User ID.
2375
- * @throws {AppwriteException}
2376
- * @returns {Promise<Preferences>}
2377
- * @deprecated Use the object parameter style method for a better developer experience.
2378
- */
2379
- getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string): Promise<Preferences>;
2380
- getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(
2381
- paramsOrFirst: { userId: string } | string
2382
- ): Promise<Preferences> {
2383
- let params: { userId: string };
2384
-
2385
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2386
- params = (paramsOrFirst || {}) as { userId: string };
2387
- } else {
2388
- params = {
2389
- userId: paramsOrFirst as string
2390
- };
2391
- }
2392
-
2393
- const userId = params.userId;
2394
-
2395
- if (typeof userId === 'undefined') {
2396
- throw new AppwriteException('Missing required parameter: "userId"');
2397
- }
2398
-
2399
- const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
2400
- const payload: Payload = {};
2401
- const uri = new URL(this.client.config.endpoint + apiPath);
2402
-
2403
- const apiHeaders: { [header: string]: string } = {
2404
- }
2405
-
2406
- return this.client.call(
2407
- 'get',
2408
- uri,
2409
- apiHeaders,
2410
- payload
2411
- );
2412
- }
2413
-
2414
- /**
2415
- * 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.
2416
- *
2417
- * @param {string} params.userId - User ID.
2418
- * @param {object} params.prefs - Prefs key-value JSON object.
2419
- * @throws {AppwriteException}
2420
- * @returns {Promise<Preferences>}
2421
- */
2422
- updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, prefs: object }): Promise<Preferences>;
2423
- /**
2424
- * 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.
2425
- *
2426
- * @param {string} userId - User ID.
2427
- * @param {object} prefs - Prefs key-value JSON object.
2428
- * @throws {AppwriteException}
2429
- * @returns {Promise<Preferences>}
2430
- * @deprecated Use the object parameter style method for a better developer experience.
2431
- */
2432
- updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, prefs: object): Promise<Preferences>;
2433
- updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(
2434
- paramsOrFirst: { userId: string, prefs: object } | string,
2435
- ...rest: [(object)?]
2436
- ): Promise<Preferences> {
2437
- let params: { userId: string, prefs: object };
2438
-
2439
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2440
- params = (paramsOrFirst || {}) as { userId: string, prefs: object };
2441
- } else {
2442
- params = {
2443
- userId: paramsOrFirst as string,
2444
- prefs: rest[0] as object
2445
- };
2446
- }
2447
-
2448
- const userId = params.userId;
2449
- const prefs = params.prefs;
2450
-
2451
- if (typeof userId === 'undefined') {
2452
- throw new AppwriteException('Missing required parameter: "userId"');
2453
- }
2454
- if (typeof prefs === 'undefined') {
2455
- throw new AppwriteException('Missing required parameter: "prefs"');
2456
- }
2457
-
2458
- const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
2459
- const payload: Payload = {};
2460
- if (typeof prefs !== 'undefined') {
2461
- payload['prefs'] = prefs;
2462
- }
2463
- const uri = new URL(this.client.config.endpoint + apiPath);
2464
-
2465
- const apiHeaders: { [header: string]: string } = {
2466
- 'content-type': 'application/json',
2467
- }
2468
-
2469
- return this.client.call(
2470
- 'patch',
2471
- uri,
2472
- apiHeaders,
2473
- payload
2474
- );
2475
- }
2476
-
2477
- /**
2478
- * Get the user sessions list by its unique ID.
2479
- *
2480
- * @param {string} params.userId - User ID.
2481
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
2482
- * @throws {AppwriteException}
2483
- * @returns {Promise<Models.SessionList>}
2484
- */
2485
- listSessions(params: { userId: string, total?: boolean }): Promise<Models.SessionList>;
2486
- /**
2487
- * Get the user sessions list by its unique ID.
2488
- *
2489
- * @param {string} userId - User ID.
2490
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
2491
- * @throws {AppwriteException}
2492
- * @returns {Promise<Models.SessionList>}
2493
- * @deprecated Use the object parameter style method for a better developer experience.
2494
- */
2495
- listSessions(userId: string, total?: boolean): Promise<Models.SessionList>;
2496
- listSessions(
2497
- paramsOrFirst: { userId: string, total?: boolean } | string,
2498
- ...rest: [(boolean)?]
2499
- ): Promise<Models.SessionList> {
2500
- let params: { userId: string, total?: boolean };
2501
-
2502
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2503
- params = (paramsOrFirst || {}) as { userId: string, total?: boolean };
2504
- } else {
2505
- params = {
2506
- userId: paramsOrFirst as string,
2507
- total: rest[0] as boolean
2508
- };
2509
- }
2510
-
2511
- const userId = params.userId;
2512
- const total = params.total;
2513
-
2514
- if (typeof userId === 'undefined') {
2515
- throw new AppwriteException('Missing required parameter: "userId"');
2516
- }
2517
-
2518
- const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
2519
- const payload: Payload = {};
2520
- if (typeof total !== 'undefined') {
2521
- payload['total'] = total;
2522
- }
2523
- const uri = new URL(this.client.config.endpoint + apiPath);
2524
-
2525
- const apiHeaders: { [header: string]: string } = {
2526
- }
2527
-
2528
- return this.client.call(
2529
- 'get',
2530
- uri,
2531
- apiHeaders,
2532
- payload
2533
- );
2534
- }
2535
-
2536
- /**
2537
- * Creates a session for a user. Returns an immediately usable session object.
2538
- *
2539
- * 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.
2540
- *
2541
- * @param {string} params.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.
2542
- * @throws {AppwriteException}
2543
- * @returns {Promise<Models.Session>}
2544
- */
2545
- createSession(params: { userId: string }): Promise<Models.Session>;
2546
- /**
2547
- * Creates a session for a user. Returns an immediately usable session object.
2548
- *
2549
- * 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.
2550
- *
2551
- * @param {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.
2552
- * @throws {AppwriteException}
2553
- * @returns {Promise<Models.Session>}
2554
- * @deprecated Use the object parameter style method for a better developer experience.
2555
- */
2556
- createSession(userId: string): Promise<Models.Session>;
2557
- createSession(
2558
- paramsOrFirst: { userId: string } | string
2559
- ): Promise<Models.Session> {
2560
- let params: { userId: string };
2561
-
2562
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2563
- params = (paramsOrFirst || {}) as { userId: string };
2564
- } else {
2565
- params = {
2566
- userId: paramsOrFirst as string
2567
- };
2568
- }
2569
-
2570
- const userId = params.userId;
2571
-
2572
- if (typeof userId === 'undefined') {
2573
- throw new AppwriteException('Missing required parameter: "userId"');
2574
- }
2575
-
2576
- const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
2577
- const payload: Payload = {};
2578
- const uri = new URL(this.client.config.endpoint + apiPath);
2579
-
2580
- const apiHeaders: { [header: string]: string } = {
2581
- 'content-type': 'application/json',
2582
- }
2583
-
2584
- return this.client.call(
2585
- 'post',
2586
- uri,
2587
- apiHeaders,
2588
- payload
2589
- );
2590
- }
2591
-
2592
- /**
2593
- * Delete all user's sessions by using the user's unique ID.
2594
- *
2595
- * @param {string} params.userId - User ID.
2596
- * @throws {AppwriteException}
2597
- * @returns {Promise<{}>}
2598
- */
2599
- deleteSessions(params: { userId: string }): Promise<{}>;
2600
- /**
2601
- * Delete all user's sessions by using the user's unique ID.
2602
- *
2603
- * @param {string} userId - User ID.
2604
- * @throws {AppwriteException}
2605
- * @returns {Promise<{}>}
2606
- * @deprecated Use the object parameter style method for a better developer experience.
2607
- */
2608
- deleteSessions(userId: string): Promise<{}>;
2609
- deleteSessions(
2610
- paramsOrFirst: { userId: string } | string
2611
- ): Promise<{}> {
2612
- let params: { userId: string };
2613
-
2614
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2615
- params = (paramsOrFirst || {}) as { userId: string };
2616
- } else {
2617
- params = {
2618
- userId: paramsOrFirst as string
2619
- };
2620
- }
2621
-
2622
- const userId = params.userId;
2623
-
2624
- if (typeof userId === 'undefined') {
2625
- throw new AppwriteException('Missing required parameter: "userId"');
2626
- }
2627
-
2628
- const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
2629
- const payload: Payload = {};
2630
- const uri = new URL(this.client.config.endpoint + apiPath);
2631
-
2632
- const apiHeaders: { [header: string]: string } = {
2633
- 'content-type': 'application/json',
2634
- }
2635
-
2636
- return this.client.call(
2637
- 'delete',
2638
- uri,
2639
- apiHeaders,
2640
- payload
2641
- );
2642
- }
2643
-
2644
- /**
2645
- * Delete a user sessions by its unique ID.
2646
- *
2647
- * @param {string} params.userId - User ID.
2648
- * @param {string} params.sessionId - Session ID.
2649
- * @throws {AppwriteException}
2650
- * @returns {Promise<{}>}
2651
- */
2652
- deleteSession(params: { userId: string, sessionId: string }): Promise<{}>;
2653
- /**
2654
- * Delete a user sessions by its unique ID.
2655
- *
2656
- * @param {string} userId - User ID.
2657
- * @param {string} sessionId - Session ID.
2658
- * @throws {AppwriteException}
2659
- * @returns {Promise<{}>}
2660
- * @deprecated Use the object parameter style method for a better developer experience.
2661
- */
2662
- deleteSession(userId: string, sessionId: string): Promise<{}>;
2663
- deleteSession(
2664
- paramsOrFirst: { userId: string, sessionId: string } | string,
2665
- ...rest: [(string)?]
2666
- ): Promise<{}> {
2667
- let params: { userId: string, sessionId: string };
2668
-
2669
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2670
- params = (paramsOrFirst || {}) as { userId: string, sessionId: string };
2671
- } else {
2672
- params = {
2673
- userId: paramsOrFirst as string,
2674
- sessionId: rest[0] as string
2675
- };
2676
- }
2677
-
2678
- const userId = params.userId;
2679
- const sessionId = params.sessionId;
2680
-
2681
- if (typeof userId === 'undefined') {
2682
- throw new AppwriteException('Missing required parameter: "userId"');
2683
- }
2684
- if (typeof sessionId === 'undefined') {
2685
- throw new AppwriteException('Missing required parameter: "sessionId"');
2686
- }
2687
-
2688
- const apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId);
2689
- const payload: Payload = {};
2690
- const uri = new URL(this.client.config.endpoint + apiPath);
2691
-
2692
- const apiHeaders: { [header: string]: string } = {
2693
- 'content-type': 'application/json',
2694
- }
2695
-
2696
- return this.client.call(
2697
- 'delete',
2698
- uri,
2699
- apiHeaders,
2700
- payload
2701
- );
2702
- }
2703
-
2704
- /**
2705
- * 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.
2706
- *
2707
- * @param {string} params.userId - User ID.
2708
- * @param {boolean} params.status - User Status. To activate the user pass `true` and to block the user pass `false`.
2709
- * @throws {AppwriteException}
2710
- * @returns {Promise<Models.User<Preferences>>}
2711
- */
2712
- updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, status: boolean }): Promise<Models.User<Preferences>>;
2713
- /**
2714
- * 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.
2715
- *
2716
- * @param {string} userId - User ID.
2717
- * @param {boolean} status - User Status. To activate the user pass `true` and to block the user pass `false`.
2718
- * @throws {AppwriteException}
2719
- * @returns {Promise<Models.User<Preferences>>}
2720
- * @deprecated Use the object parameter style method for a better developer experience.
2721
- */
2722
- updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, status: boolean): Promise<Models.User<Preferences>>;
2723
- updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(
2724
- paramsOrFirst: { userId: string, status: boolean } | string,
2725
- ...rest: [(boolean)?]
2726
- ): Promise<Models.User<Preferences>> {
2727
- let params: { userId: string, status: boolean };
2728
-
2729
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2730
- params = (paramsOrFirst || {}) as { userId: string, status: boolean };
2731
- } else {
2732
- params = {
2733
- userId: paramsOrFirst as string,
2734
- status: rest[0] as boolean
2735
- };
2736
- }
2737
-
2738
- const userId = params.userId;
2739
- const status = params.status;
2740
-
2741
- if (typeof userId === 'undefined') {
2742
- throw new AppwriteException('Missing required parameter: "userId"');
2743
- }
2744
- if (typeof status === 'undefined') {
2745
- throw new AppwriteException('Missing required parameter: "status"');
2746
- }
2747
-
2748
- const apiPath = '/users/{userId}/status'.replace('{userId}', userId);
2749
- const payload: Payload = {};
2750
- if (typeof status !== 'undefined') {
2751
- payload['status'] = status;
2752
- }
2753
- const uri = new URL(this.client.config.endpoint + apiPath);
2754
-
2755
- const apiHeaders: { [header: string]: string } = {
2756
- 'content-type': 'application/json',
2757
- }
2758
-
2759
- return this.client.call(
2760
- 'patch',
2761
- uri,
2762
- apiHeaders,
2763
- payload
2764
- );
2765
- }
2766
-
2767
- /**
2768
- * List the messaging targets that are associated with a user.
2769
- *
2770
- * @param {string} params.userId - User ID.
2771
- * @param {string[]} params.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
2772
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
2773
- * @throws {AppwriteException}
2774
- * @returns {Promise<Models.TargetList>}
2775
- */
2776
- listTargets(params: { userId: string, queries?: string[], total?: boolean }): Promise<Models.TargetList>;
2777
- /**
2778
- * List the messaging targets that are associated with a user.
2779
- *
2780
- * @param {string} userId - User ID.
2781
- * @param {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
2782
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
2783
- * @throws {AppwriteException}
2784
- * @returns {Promise<Models.TargetList>}
2785
- * @deprecated Use the object parameter style method for a better developer experience.
2786
- */
2787
- listTargets(userId: string, queries?: string[], total?: boolean): Promise<Models.TargetList>;
2788
- listTargets(
2789
- paramsOrFirst: { userId: string, queries?: string[], total?: boolean } | string,
2790
- ...rest: [(string[])?, (boolean)?]
2791
- ): Promise<Models.TargetList> {
2792
- let params: { userId: string, queries?: string[], total?: boolean };
2793
-
2794
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2795
- params = (paramsOrFirst || {}) as { userId: string, queries?: string[], total?: boolean };
2796
- } else {
2797
- params = {
2798
- userId: paramsOrFirst as string,
2799
- queries: rest[0] as string[],
2800
- total: rest[1] as boolean
2801
- };
2802
- }
2803
-
2804
- const userId = params.userId;
2805
- const queries = params.queries;
2806
- const total = params.total;
2807
-
2808
- if (typeof userId === 'undefined') {
2809
- throw new AppwriteException('Missing required parameter: "userId"');
2810
- }
2811
-
2812
- const apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
2813
- const payload: Payload = {};
2814
- if (typeof queries !== 'undefined') {
2815
- payload['queries'] = queries;
2816
- }
2817
- if (typeof total !== 'undefined') {
2818
- payload['total'] = total;
2819
- }
2820
- const uri = new URL(this.client.config.endpoint + apiPath);
2821
-
2822
- const apiHeaders: { [header: string]: string } = {
2823
- }
2824
-
2825
- return this.client.call(
2826
- 'get',
2827
- uri,
2828
- apiHeaders,
2829
- payload
2830
- );
2831
- }
2832
-
2833
- /**
2834
- * Create a messaging target.
2835
- *
2836
- * @param {string} params.userId - User ID.
2837
- * @param {string} params.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.
2838
- * @param {MessagingProviderType} params.providerType - The target provider type. Can be one of the following: `email`, `sms` or `push`.
2839
- * @param {string} params.identifier - The target identifier (token, email, phone etc.)
2840
- * @param {string} params.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.
2841
- * @param {string} params.name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
2842
- * @throws {AppwriteException}
2843
- * @returns {Promise<Models.Target>}
2844
- */
2845
- createTarget(params: { userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string }): Promise<Models.Target>;
2846
- /**
2847
- * Create a messaging target.
2848
- *
2849
- * @param {string} userId - User ID.
2850
- * @param {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.
2851
- * @param {MessagingProviderType} providerType - The target provider type. Can be one of the following: `email`, `sms` or `push`.
2852
- * @param {string} identifier - The target identifier (token, email, phone etc.)
2853
- * @param {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.
2854
- * @param {string} name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
2855
- * @throws {AppwriteException}
2856
- * @returns {Promise<Models.Target>}
2857
- * @deprecated Use the object parameter style method for a better developer experience.
2858
- */
2859
- createTarget(userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string): Promise<Models.Target>;
2860
- createTarget(
2861
- paramsOrFirst: { userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string } | string,
2862
- ...rest: [(string)?, (MessagingProviderType)?, (string)?, (string)?, (string)?]
2863
- ): Promise<Models.Target> {
2864
- let params: { userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string };
2865
-
2866
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2867
- params = (paramsOrFirst || {}) as { userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string };
2868
- } else {
2869
- params = {
2870
- userId: paramsOrFirst as string,
2871
- targetId: rest[0] as string,
2872
- providerType: rest[1] as MessagingProviderType,
2873
- identifier: rest[2] as string,
2874
- providerId: rest[3] as string,
2875
- name: rest[4] as string
2876
- };
2877
- }
2878
-
2879
- const userId = params.userId;
2880
- const targetId = params.targetId;
2881
- const providerType = params.providerType;
2882
- const identifier = params.identifier;
2883
- const providerId = params.providerId;
2884
- const name = params.name;
2885
-
2886
- if (typeof userId === 'undefined') {
2887
- throw new AppwriteException('Missing required parameter: "userId"');
2888
- }
2889
- if (typeof targetId === 'undefined') {
2890
- throw new AppwriteException('Missing required parameter: "targetId"');
2891
- }
2892
- if (typeof providerType === 'undefined') {
2893
- throw new AppwriteException('Missing required parameter: "providerType"');
2894
- }
2895
- if (typeof identifier === 'undefined') {
2896
- throw new AppwriteException('Missing required parameter: "identifier"');
2897
- }
2898
-
2899
- const apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
2900
- const payload: Payload = {};
2901
- if (typeof targetId !== 'undefined') {
2902
- payload['targetId'] = targetId;
2903
- }
2904
- if (typeof providerType !== 'undefined') {
2905
- payload['providerType'] = providerType;
2906
- }
2907
- if (typeof identifier !== 'undefined') {
2908
- payload['identifier'] = identifier;
2909
- }
2910
- if (typeof providerId !== 'undefined') {
2911
- payload['providerId'] = providerId;
2912
- }
2913
- if (typeof name !== 'undefined') {
2914
- payload['name'] = name;
2915
- }
2916
- const uri = new URL(this.client.config.endpoint + apiPath);
2917
-
2918
- const apiHeaders: { [header: string]: string } = {
2919
- 'content-type': 'application/json',
2920
- }
2921
-
2922
- return this.client.call(
2923
- 'post',
2924
- uri,
2925
- apiHeaders,
2926
- payload
2927
- );
2928
- }
2929
-
2930
- /**
2931
- * Get a user's push notification target by ID.
2932
- *
2933
- * @param {string} params.userId - User ID.
2934
- * @param {string} params.targetId - Target ID.
2935
- * @throws {AppwriteException}
2936
- * @returns {Promise<Models.Target>}
2937
- */
2938
- getTarget(params: { userId: string, targetId: string }): Promise<Models.Target>;
2939
- /**
2940
- * Get a user's push notification target by ID.
2941
- *
2942
- * @param {string} userId - User ID.
2943
- * @param {string} targetId - Target ID.
2944
- * @throws {AppwriteException}
2945
- * @returns {Promise<Models.Target>}
2946
- * @deprecated Use the object parameter style method for a better developer experience.
2947
- */
2948
- getTarget(userId: string, targetId: string): Promise<Models.Target>;
2949
- getTarget(
2950
- paramsOrFirst: { userId: string, targetId: string } | string,
2951
- ...rest: [(string)?]
2952
- ): Promise<Models.Target> {
2953
- let params: { userId: string, targetId: string };
2954
-
2955
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2956
- params = (paramsOrFirst || {}) as { userId: string, targetId: string };
2957
- } else {
2958
- params = {
2959
- userId: paramsOrFirst as string,
2960
- targetId: rest[0] as string
2961
- };
2962
- }
2963
-
2964
- const userId = params.userId;
2965
- const targetId = params.targetId;
2966
-
2967
- if (typeof userId === 'undefined') {
2968
- throw new AppwriteException('Missing required parameter: "userId"');
2969
- }
2970
- if (typeof targetId === 'undefined') {
2971
- throw new AppwriteException('Missing required parameter: "targetId"');
2972
- }
2973
-
2974
- const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
2975
- const payload: Payload = {};
2976
- const uri = new URL(this.client.config.endpoint + apiPath);
2977
-
2978
- const apiHeaders: { [header: string]: string } = {
2979
- }
2980
-
2981
- return this.client.call(
2982
- 'get',
2983
- uri,
2984
- apiHeaders,
2985
- payload
2986
- );
2987
- }
2988
-
2989
- /**
2990
- * Update a messaging target.
2991
- *
2992
- * @param {string} params.userId - User ID.
2993
- * @param {string} params.targetId - Target ID.
2994
- * @param {string} params.identifier - The target identifier (token, email, phone etc.)
2995
- * @param {string} params.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.
2996
- * @param {string} params.name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
2997
- * @throws {AppwriteException}
2998
- * @returns {Promise<Models.Target>}
2999
- */
3000
- updateTarget(params: { userId: string, targetId: string, identifier?: string, providerId?: string, name?: string }): Promise<Models.Target>;
3001
- /**
3002
- * Update a messaging target.
3003
- *
3004
- * @param {string} userId - User ID.
3005
- * @param {string} targetId - Target ID.
3006
- * @param {string} identifier - The target identifier (token, email, phone etc.)
3007
- * @param {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.
3008
- * @param {string} name - Target name. Max length: 128 chars. For example: My Awesome App Galaxy S23.
3009
- * @throws {AppwriteException}
3010
- * @returns {Promise<Models.Target>}
3011
- * @deprecated Use the object parameter style method for a better developer experience.
3012
- */
3013
- updateTarget(userId: string, targetId: string, identifier?: string, providerId?: string, name?: string): Promise<Models.Target>;
3014
- updateTarget(
3015
- paramsOrFirst: { userId: string, targetId: string, identifier?: string, providerId?: string, name?: string } | string,
3016
- ...rest: [(string)?, (string)?, (string)?, (string)?]
3017
- ): Promise<Models.Target> {
3018
- let params: { userId: string, targetId: string, identifier?: string, providerId?: string, name?: string };
3019
-
3020
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3021
- params = (paramsOrFirst || {}) as { userId: string, targetId: string, identifier?: string, providerId?: string, name?: string };
3022
- } else {
3023
- params = {
3024
- userId: paramsOrFirst as string,
3025
- targetId: rest[0] as string,
3026
- identifier: rest[1] as string,
3027
- providerId: rest[2] as string,
3028
- name: rest[3] as string
3029
- };
3030
- }
3031
-
3032
- const userId = params.userId;
3033
- const targetId = params.targetId;
3034
- const identifier = params.identifier;
3035
- const providerId = params.providerId;
3036
- const name = params.name;
3037
-
3038
- if (typeof userId === 'undefined') {
3039
- throw new AppwriteException('Missing required parameter: "userId"');
3040
- }
3041
- if (typeof targetId === 'undefined') {
3042
- throw new AppwriteException('Missing required parameter: "targetId"');
3043
- }
3044
-
3045
- const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
3046
- const payload: Payload = {};
3047
- if (typeof identifier !== 'undefined') {
3048
- payload['identifier'] = identifier;
3049
- }
3050
- if (typeof providerId !== 'undefined') {
3051
- payload['providerId'] = providerId;
3052
- }
3053
- if (typeof name !== 'undefined') {
3054
- payload['name'] = name;
3055
- }
3056
- const uri = new URL(this.client.config.endpoint + apiPath);
3057
-
3058
- const apiHeaders: { [header: string]: string } = {
3059
- 'content-type': 'application/json',
3060
- }
3061
-
3062
- return this.client.call(
3063
- 'patch',
3064
- uri,
3065
- apiHeaders,
3066
- payload
3067
- );
3068
- }
3069
-
3070
- /**
3071
- * Delete a messaging target.
3072
- *
3073
- * @param {string} params.userId - User ID.
3074
- * @param {string} params.targetId - Target ID.
3075
- * @throws {AppwriteException}
3076
- * @returns {Promise<{}>}
3077
- */
3078
- deleteTarget(params: { userId: string, targetId: string }): Promise<{}>;
3079
- /**
3080
- * Delete a messaging target.
3081
- *
3082
- * @param {string} userId - User ID.
3083
- * @param {string} targetId - Target ID.
3084
- * @throws {AppwriteException}
3085
- * @returns {Promise<{}>}
3086
- * @deprecated Use the object parameter style method for a better developer experience.
3087
- */
3088
- deleteTarget(userId: string, targetId: string): Promise<{}>;
3089
- deleteTarget(
3090
- paramsOrFirst: { userId: string, targetId: string } | string,
3091
- ...rest: [(string)?]
3092
- ): Promise<{}> {
3093
- let params: { userId: string, targetId: string };
3094
-
3095
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3096
- params = (paramsOrFirst || {}) as { userId: string, targetId: string };
3097
- } else {
3098
- params = {
3099
- userId: paramsOrFirst as string,
3100
- targetId: rest[0] as string
3101
- };
3102
- }
3103
-
3104
- const userId = params.userId;
3105
- const targetId = params.targetId;
3106
-
3107
- if (typeof userId === 'undefined') {
3108
- throw new AppwriteException('Missing required parameter: "userId"');
3109
- }
3110
- if (typeof targetId === 'undefined') {
3111
- throw new AppwriteException('Missing required parameter: "targetId"');
3112
- }
3113
-
3114
- const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
3115
- const payload: Payload = {};
3116
- const uri = new URL(this.client.config.endpoint + apiPath);
3117
-
3118
- const apiHeaders: { [header: string]: string } = {
3119
- 'content-type': 'application/json',
3120
- }
3121
-
3122
- return this.client.call(
3123
- 'delete',
3124
- uri,
3125
- apiHeaders,
3126
- payload
3127
- );
3128
- }
3129
-
3130
- /**
3131
- * 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.
3132
- *
3133
- *
3134
- * @param {string} params.userId - User ID.
3135
- * @param {number} params.length - Token length in characters. The default length is 6 characters
3136
- * @param {number} params.expire - Token expiration period in seconds. The default expiration is 15 minutes.
3137
- * @throws {AppwriteException}
3138
- * @returns {Promise<Models.Token>}
3139
- */
3140
- createToken(params: { userId: string, length?: number, expire?: number }): Promise<Models.Token>;
3141
- /**
3142
- * 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.
3143
- *
3144
- *
3145
- * @param {string} userId - User ID.
3146
- * @param {number} length - Token length in characters. The default length is 6 characters
3147
- * @param {number} expire - Token expiration period in seconds. The default expiration is 15 minutes.
3148
- * @throws {AppwriteException}
3149
- * @returns {Promise<Models.Token>}
3150
- * @deprecated Use the object parameter style method for a better developer experience.
3151
- */
3152
- createToken(userId: string, length?: number, expire?: number): Promise<Models.Token>;
3153
- createToken(
3154
- paramsOrFirst: { userId: string, length?: number, expire?: number } | string,
3155
- ...rest: [(number)?, (number)?]
3156
- ): Promise<Models.Token> {
3157
- let params: { userId: string, length?: number, expire?: number };
3158
-
3159
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3160
- params = (paramsOrFirst || {}) as { userId: string, length?: number, expire?: number };
3161
- } else {
3162
- params = {
3163
- userId: paramsOrFirst as string,
3164
- length: rest[0] as number,
3165
- expire: rest[1] as number
3166
- };
3167
- }
3168
-
3169
- const userId = params.userId;
3170
- const length = params.length;
3171
- const expire = params.expire;
3172
-
3173
- if (typeof userId === 'undefined') {
3174
- throw new AppwriteException('Missing required parameter: "userId"');
3175
- }
3176
-
3177
- const apiPath = '/users/{userId}/tokens'.replace('{userId}', userId);
3178
- const payload: Payload = {};
3179
- if (typeof length !== 'undefined') {
3180
- payload['length'] = length;
3181
- }
3182
- if (typeof expire !== 'undefined') {
3183
- payload['expire'] = expire;
3184
- }
3185
- const uri = new URL(this.client.config.endpoint + apiPath);
3186
-
3187
- const apiHeaders: { [header: string]: string } = {
3188
- 'content-type': 'application/json',
3189
- }
3190
-
3191
- return this.client.call(
3192
- 'post',
3193
- uri,
3194
- apiHeaders,
3195
- payload
3196
- );
3197
- }
3198
-
3199
- /**
3200
- * Update the user email verification status by its unique ID.
3201
- *
3202
- * @param {string} params.userId - User ID.
3203
- * @param {boolean} params.emailVerification - User email verification status.
3204
- * @throws {AppwriteException}
3205
- * @returns {Promise<Models.User<Preferences>>}
3206
- */
3207
- updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, emailVerification: boolean }): Promise<Models.User<Preferences>>;
3208
- /**
3209
- * Update the user email verification status by its unique ID.
3210
- *
3211
- * @param {string} userId - User ID.
3212
- * @param {boolean} emailVerification - User email verification status.
3213
- * @throws {AppwriteException}
3214
- * @returns {Promise<Models.User<Preferences>>}
3215
- * @deprecated Use the object parameter style method for a better developer experience.
3216
- */
3217
- updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>>;
3218
- updateEmailVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(
3219
- paramsOrFirst: { userId: string, emailVerification: boolean } | string,
3220
- ...rest: [(boolean)?]
3221
- ): Promise<Models.User<Preferences>> {
3222
- let params: { userId: string, emailVerification: boolean };
3223
-
3224
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3225
- params = (paramsOrFirst || {}) as { userId: string, emailVerification: boolean };
3226
- } else {
3227
- params = {
3228
- userId: paramsOrFirst as string,
3229
- emailVerification: rest[0] as boolean
3230
- };
3231
- }
3232
-
3233
- const userId = params.userId;
3234
- const emailVerification = params.emailVerification;
3235
-
3236
- if (typeof userId === 'undefined') {
3237
- throw new AppwriteException('Missing required parameter: "userId"');
3238
- }
3239
- if (typeof emailVerification === 'undefined') {
3240
- throw new AppwriteException('Missing required parameter: "emailVerification"');
3241
- }
3242
-
3243
- const apiPath = '/users/{userId}/verification'.replace('{userId}', userId);
3244
- const payload: Payload = {};
3245
- if (typeof emailVerification !== 'undefined') {
3246
- payload['emailVerification'] = emailVerification;
3247
- }
3248
- const uri = new URL(this.client.config.endpoint + apiPath);
3249
-
3250
- const apiHeaders: { [header: string]: string } = {
3251
- 'content-type': 'application/json',
3252
- }
3253
-
3254
- return this.client.call(
3255
- 'patch',
3256
- uri,
3257
- apiHeaders,
3258
- payload
3259
- );
3260
- }
3261
-
3262
- /**
3263
- * Update the user phone verification status by its unique ID.
3264
- *
3265
- * @param {string} params.userId - User ID.
3266
- * @param {boolean} params.phoneVerification - User phone verification status.
3267
- * @throws {AppwriteException}
3268
- * @returns {Promise<Models.User<Preferences>>}
3269
- */
3270
- updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: { userId: string, phoneVerification: boolean }): Promise<Models.User<Preferences>>;
3271
- /**
3272
- * Update the user phone verification status by its unique ID.
3273
- *
3274
- * @param {string} userId - User ID.
3275
- * @param {boolean} phoneVerification - User phone verification status.
3276
- * @throws {AppwriteException}
3277
- * @returns {Promise<Models.User<Preferences>>}
3278
- * @deprecated Use the object parameter style method for a better developer experience.
3279
- */
3280
- updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>>;
3281
- updatePhoneVerification<Preferences extends Models.Preferences = Models.DefaultPreferences>(
3282
- paramsOrFirst: { userId: string, phoneVerification: boolean } | string,
3283
- ...rest: [(boolean)?]
3284
- ): Promise<Models.User<Preferences>> {
3285
- let params: { userId: string, phoneVerification: boolean };
3286
-
3287
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3288
- params = (paramsOrFirst || {}) as { userId: string, phoneVerification: boolean };
3289
- } else {
3290
- params = {
3291
- userId: paramsOrFirst as string,
3292
- phoneVerification: rest[0] as boolean
3293
- };
3294
- }
3295
-
3296
- const userId = params.userId;
3297
- const phoneVerification = params.phoneVerification;
3298
-
3299
- if (typeof userId === 'undefined') {
3300
- throw new AppwriteException('Missing required parameter: "userId"');
3301
- }
3302
- if (typeof phoneVerification === 'undefined') {
3303
- throw new AppwriteException('Missing required parameter: "phoneVerification"');
3304
- }
3305
-
3306
- const apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId);
3307
- const payload: Payload = {};
3308
- if (typeof phoneVerification !== 'undefined') {
3309
- payload['phoneVerification'] = phoneVerification;
3310
- }
3311
- const uri = new URL(this.client.config.endpoint + apiPath);
3312
-
3313
- const apiHeaders: { [header: string]: string } = {
3314
- 'content-type': 'application/json',
3315
- }
3316
-
3317
- return this.client.call(
3318
- 'patch',
3319
- uri,
3320
- apiHeaders,
3321
- payload
3322
- );
3323
- }
3324
- }