@appwrite.io/console 0.6.2 → 0.7.0-rc.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 (434) hide show
  1. package/.github/workflows/autoclose.yml +11 -0
  2. package/.github/workflows/publish.yml +40 -16
  3. package/README.md +3 -3
  4. package/dist/cjs/sdk.js +2749 -2318
  5. package/dist/cjs/sdk.js.map +1 -1
  6. package/dist/esm/sdk.js +2749 -2318
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +2749 -2318
  9. package/docs/examples/account/create-anonymous-session.md +2 -2
  10. package/docs/examples/account/create-email-password-session.md +2 -2
  11. package/docs/examples/account/create-email-token.md +2 -2
  12. package/docs/examples/account/create-j-w-t.md +2 -2
  13. package/docs/examples/account/create-magic-u-r-l-token.md +2 -2
  14. package/docs/examples/account/create-mfa-authenticator.md +2 -2
  15. package/docs/examples/account/create-mfa-challenge.md +2 -2
  16. package/docs/examples/account/create-mfa-recovery-codes.md +2 -2
  17. package/docs/examples/account/create-o-auth2session.md +1 -1
  18. package/docs/examples/account/create-o-auth2token.md +1 -1
  19. package/docs/examples/account/create-phone-token.md +2 -2
  20. package/docs/examples/account/create-phone-verification.md +2 -2
  21. package/docs/examples/account/create-push-target.md +2 -2
  22. package/docs/examples/account/create-recovery.md +2 -2
  23. package/docs/examples/account/create-session.md +2 -2
  24. package/docs/examples/account/create-verification.md +2 -2
  25. package/docs/examples/account/create.md +2 -2
  26. package/docs/examples/account/delete-identity.md +2 -2
  27. package/docs/examples/account/delete-mfa-authenticator.md +3 -4
  28. package/docs/examples/account/delete-push-target.md +2 -2
  29. package/docs/examples/account/delete-session.md +2 -2
  30. package/docs/examples/account/delete-sessions.md +2 -2
  31. package/docs/examples/account/delete.md +2 -2
  32. package/docs/examples/account/get-mfa-recovery-codes.md +2 -2
  33. package/docs/examples/account/get-prefs.md +2 -2
  34. package/docs/examples/account/get-session.md +2 -2
  35. package/docs/examples/account/get.md +2 -2
  36. package/docs/examples/account/list-identities.md +2 -2
  37. package/docs/examples/account/list-logs.md +2 -2
  38. package/docs/examples/account/list-mfa-factors.md +2 -2
  39. package/docs/examples/account/list-sessions.md +2 -2
  40. package/docs/examples/account/update-email.md +2 -2
  41. package/docs/examples/account/update-m-f-a.md +2 -2
  42. package/docs/examples/account/update-magic-u-r-l-session.md +2 -2
  43. package/docs/examples/account/update-mfa-authenticator.md +2 -2
  44. package/docs/examples/account/update-mfa-challenge.md +2 -2
  45. package/docs/examples/account/update-mfa-recovery-codes.md +2 -2
  46. package/docs/examples/account/update-name.md +2 -2
  47. package/docs/examples/account/update-password.md +2 -2
  48. package/docs/examples/account/update-phone-session.md +2 -2
  49. package/docs/examples/account/update-phone-verification.md +2 -2
  50. package/docs/examples/account/update-phone.md +2 -2
  51. package/docs/examples/account/update-prefs.md +2 -2
  52. package/docs/examples/account/update-push-target.md +2 -2
  53. package/docs/examples/account/update-recovery.md +2 -2
  54. package/docs/examples/account/update-session.md +2 -2
  55. package/docs/examples/account/update-status.md +2 -2
  56. package/docs/examples/account/update-verification.md +2 -2
  57. package/docs/examples/assistant/chat.md +2 -2
  58. package/docs/examples/avatars/get-browser.md +1 -1
  59. package/docs/examples/avatars/get-credit-card.md +1 -1
  60. package/docs/examples/avatars/get-favicon.md +1 -1
  61. package/docs/examples/avatars/get-flag.md +1 -1
  62. package/docs/examples/avatars/get-image.md +1 -1
  63. package/docs/examples/avatars/get-initials.md +1 -1
  64. package/docs/examples/avatars/get-q-r.md +1 -1
  65. package/docs/examples/console/variables.md +2 -2
  66. package/docs/examples/databases/create-boolean-attribute.md +2 -2
  67. package/docs/examples/databases/create-collection.md +2 -2
  68. package/docs/examples/databases/create-datetime-attribute.md +2 -2
  69. package/docs/examples/databases/create-document.md +2 -2
  70. package/docs/examples/databases/create-email-attribute.md +2 -2
  71. package/docs/examples/databases/create-enum-attribute.md +2 -2
  72. package/docs/examples/databases/create-float-attribute.md +2 -2
  73. package/docs/examples/databases/create-index.md +2 -2
  74. package/docs/examples/databases/create-integer-attribute.md +2 -2
  75. package/docs/examples/databases/create-ip-attribute.md +2 -2
  76. package/docs/examples/databases/create-relationship-attribute.md +2 -2
  77. package/docs/examples/databases/create-string-attribute.md +2 -2
  78. package/docs/examples/databases/create-url-attribute.md +2 -2
  79. package/docs/examples/databases/create.md +2 -2
  80. package/docs/examples/databases/delete-attribute.md +2 -2
  81. package/docs/examples/databases/delete-collection.md +2 -2
  82. package/docs/examples/databases/delete-document.md +2 -2
  83. package/docs/examples/databases/delete-index.md +2 -2
  84. package/docs/examples/databases/delete.md +2 -2
  85. package/docs/examples/databases/get-attribute.md +2 -2
  86. package/docs/examples/databases/get-collection-usage.md +2 -2
  87. package/docs/examples/databases/get-collection.md +2 -2
  88. package/docs/examples/databases/get-database-usage.md +2 -2
  89. package/docs/examples/databases/get-document.md +2 -2
  90. package/docs/examples/databases/get-index.md +2 -2
  91. package/docs/examples/databases/get-usage.md +2 -2
  92. package/docs/examples/databases/get.md +2 -2
  93. package/docs/examples/databases/list-attributes.md +2 -2
  94. package/docs/examples/databases/list-collection-logs.md +2 -2
  95. package/docs/examples/databases/list-collections.md +2 -2
  96. package/docs/examples/databases/list-document-logs.md +2 -2
  97. package/docs/examples/databases/list-documents.md +2 -2
  98. package/docs/examples/databases/list-indexes.md +2 -2
  99. package/docs/examples/databases/list-logs.md +2 -2
  100. package/docs/examples/databases/list.md +2 -2
  101. package/docs/examples/databases/update-boolean-attribute.md +2 -2
  102. package/docs/examples/databases/update-collection.md +2 -2
  103. package/docs/examples/databases/update-datetime-attribute.md +2 -2
  104. package/docs/examples/databases/update-document.md +2 -2
  105. package/docs/examples/databases/update-email-attribute.md +2 -2
  106. package/docs/examples/databases/update-enum-attribute.md +2 -2
  107. package/docs/examples/databases/update-float-attribute.md +2 -2
  108. package/docs/examples/databases/update-integer-attribute.md +2 -2
  109. package/docs/examples/databases/update-ip-attribute.md +2 -2
  110. package/docs/examples/databases/update-relationship-attribute.md +2 -2
  111. package/docs/examples/databases/update-string-attribute.md +2 -2
  112. package/docs/examples/databases/update-url-attribute.md +2 -2
  113. package/docs/examples/databases/update.md +2 -2
  114. package/docs/examples/functions/create-build.md +3 -3
  115. package/docs/examples/functions/create-deployment.md +2 -2
  116. package/docs/examples/functions/create-execution.md +4 -3
  117. package/docs/examples/functions/create-variable.md +2 -2
  118. package/docs/examples/functions/create.md +4 -3
  119. package/docs/examples/functions/delete-deployment.md +2 -2
  120. package/docs/examples/functions/delete-execution.md +14 -0
  121. package/docs/examples/functions/delete-variable.md +2 -2
  122. package/docs/examples/functions/delete.md +2 -2
  123. package/docs/examples/functions/{download-deployment.md → get-deployment-download.md} +2 -2
  124. package/docs/examples/functions/get-deployment.md +2 -2
  125. package/docs/examples/functions/get-execution.md +2 -2
  126. package/docs/examples/functions/get-function-usage.md +2 -2
  127. package/docs/examples/functions/get-template.md +13 -0
  128. package/docs/examples/functions/get-usage.md +2 -2
  129. package/docs/examples/functions/get-variable.md +2 -2
  130. package/docs/examples/functions/get.md +2 -2
  131. package/docs/examples/functions/list-deployments.md +2 -2
  132. package/docs/examples/functions/list-executions.md +2 -2
  133. package/docs/examples/functions/list-runtimes.md +2 -2
  134. package/docs/examples/functions/list-templates.md +16 -0
  135. package/docs/examples/functions/list-variables.md +2 -2
  136. package/docs/examples/functions/list.md +2 -2
  137. package/docs/examples/functions/update-deployment-build.md +14 -0
  138. package/docs/examples/functions/update-deployment.md +2 -2
  139. package/docs/examples/functions/update-variable.md +2 -2
  140. package/docs/examples/functions/update.md +3 -2
  141. package/docs/examples/graphql/mutation.md +2 -2
  142. package/docs/examples/graphql/query.md +2 -2
  143. package/docs/examples/health/get-antivirus.md +2 -2
  144. package/docs/examples/health/get-cache.md +2 -2
  145. package/docs/examples/health/get-certificate.md +2 -2
  146. package/docs/examples/health/get-d-b.md +2 -2
  147. package/docs/examples/health/get-failed-jobs.md +2 -2
  148. package/docs/examples/health/get-pub-sub.md +2 -2
  149. package/docs/examples/health/get-queue-builds.md +2 -2
  150. package/docs/examples/health/get-queue-certificates.md +2 -2
  151. package/docs/examples/health/get-queue-databases.md +2 -2
  152. package/docs/examples/health/get-queue-deletes.md +2 -2
  153. package/docs/examples/health/get-queue-functions.md +2 -2
  154. package/docs/examples/health/get-queue-logs.md +2 -2
  155. package/docs/examples/health/get-queue-mails.md +2 -2
  156. package/docs/examples/health/get-queue-messaging.md +2 -2
  157. package/docs/examples/health/get-queue-migrations.md +2 -2
  158. package/docs/examples/health/get-queue-usage-dump.md +2 -2
  159. package/docs/examples/health/get-queue-usage.md +2 -2
  160. package/docs/examples/health/get-queue-webhooks.md +2 -2
  161. package/docs/examples/health/get-queue.md +2 -2
  162. package/docs/examples/health/get-storage-local.md +2 -2
  163. package/docs/examples/health/get-storage.md +2 -2
  164. package/docs/examples/health/get-time.md +2 -2
  165. package/docs/examples/health/get.md +2 -2
  166. package/docs/examples/locale/get.md +2 -2
  167. package/docs/examples/locale/list-codes.md +2 -2
  168. package/docs/examples/locale/list-continents.md +2 -2
  169. package/docs/examples/locale/list-countries-e-u.md +2 -2
  170. package/docs/examples/locale/list-countries-phones.md +2 -2
  171. package/docs/examples/locale/list-countries.md +2 -2
  172. package/docs/examples/locale/list-currencies.md +2 -2
  173. package/docs/examples/locale/list-languages.md +2 -2
  174. package/docs/examples/messaging/create-apns-provider.md +2 -2
  175. package/docs/examples/messaging/create-email.md +2 -2
  176. package/docs/examples/messaging/create-fcm-provider.md +2 -2
  177. package/docs/examples/messaging/create-mailgun-provider.md +2 -2
  178. package/docs/examples/messaging/create-msg91provider.md +2 -2
  179. package/docs/examples/messaging/create-push.md +2 -2
  180. package/docs/examples/messaging/create-sendgrid-provider.md +2 -2
  181. package/docs/examples/messaging/create-sms.md +2 -2
  182. package/docs/examples/messaging/create-smtp-provider.md +2 -2
  183. package/docs/examples/messaging/create-subscriber.md +2 -2
  184. package/docs/examples/messaging/create-telesign-provider.md +2 -2
  185. package/docs/examples/messaging/create-textmagic-provider.md +2 -2
  186. package/docs/examples/messaging/create-topic.md +2 -2
  187. package/docs/examples/messaging/create-twilio-provider.md +2 -2
  188. package/docs/examples/messaging/create-vonage-provider.md +2 -2
  189. package/docs/examples/messaging/delete-provider.md +2 -2
  190. package/docs/examples/messaging/delete-subscriber.md +2 -2
  191. package/docs/examples/messaging/delete-topic.md +2 -2
  192. package/docs/examples/messaging/delete.md +2 -2
  193. package/docs/examples/messaging/get-message.md +2 -2
  194. package/docs/examples/messaging/get-provider.md +2 -2
  195. package/docs/examples/messaging/get-subscriber.md +2 -2
  196. package/docs/examples/messaging/get-topic.md +2 -2
  197. package/docs/examples/messaging/list-message-logs.md +2 -2
  198. package/docs/examples/messaging/list-messages.md +2 -2
  199. package/docs/examples/messaging/list-provider-logs.md +2 -2
  200. package/docs/examples/messaging/list-providers.md +2 -2
  201. package/docs/examples/messaging/list-subscriber-logs.md +2 -2
  202. package/docs/examples/messaging/list-subscribers.md +2 -2
  203. package/docs/examples/messaging/list-targets.md +2 -2
  204. package/docs/examples/messaging/list-topic-logs.md +2 -2
  205. package/docs/examples/messaging/list-topics.md +2 -2
  206. package/docs/examples/messaging/update-apns-provider.md +2 -2
  207. package/docs/examples/messaging/update-email.md +2 -2
  208. package/docs/examples/messaging/update-fcm-provider.md +2 -2
  209. package/docs/examples/messaging/update-mailgun-provider.md +2 -2
  210. package/docs/examples/messaging/update-msg91provider.md +2 -2
  211. package/docs/examples/messaging/update-push.md +2 -2
  212. package/docs/examples/messaging/update-sendgrid-provider.md +2 -2
  213. package/docs/examples/messaging/update-sms.md +2 -2
  214. package/docs/examples/messaging/update-smtp-provider.md +2 -2
  215. package/docs/examples/messaging/update-telesign-provider.md +2 -2
  216. package/docs/examples/messaging/update-textmagic-provider.md +2 -2
  217. package/docs/examples/messaging/update-topic.md +2 -2
  218. package/docs/examples/messaging/update-twilio-provider.md +2 -2
  219. package/docs/examples/messaging/update-vonage-provider.md +2 -2
  220. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  221. package/docs/examples/migrations/create-firebase-migration.md +2 -2
  222. package/docs/examples/migrations/create-firebase-o-auth-migration.md +2 -2
  223. package/docs/examples/migrations/create-n-host-migration.md +2 -2
  224. package/docs/examples/migrations/create-supabase-migration.md +2 -2
  225. package/docs/examples/migrations/delete-firebase-auth.md +2 -2
  226. package/docs/examples/migrations/delete.md +2 -2
  227. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  228. package/docs/examples/migrations/get-firebase-report-o-auth.md +2 -2
  229. package/docs/examples/migrations/get-firebase-report.md +2 -2
  230. package/docs/examples/migrations/get-n-host-report.md +2 -2
  231. package/docs/examples/migrations/get-supabase-report.md +2 -2
  232. package/docs/examples/migrations/get.md +2 -2
  233. package/docs/examples/migrations/list-firebase-projects.md +2 -2
  234. package/docs/examples/migrations/list.md +2 -2
  235. package/docs/examples/migrations/retry.md +2 -2
  236. package/docs/examples/project/create-variable.md +2 -2
  237. package/docs/examples/project/delete-variable.md +2 -2
  238. package/docs/examples/project/get-usage.md +2 -2
  239. package/docs/examples/project/get-variable.md +2 -2
  240. package/docs/examples/project/list-variables.md +2 -2
  241. package/docs/examples/project/update-variable.md +2 -2
  242. package/docs/examples/projects/create-j-w-t.md +15 -0
  243. package/docs/examples/projects/create-key.md +2 -2
  244. package/docs/examples/projects/create-platform.md +2 -2
  245. package/docs/examples/projects/create-smtp-test.md +2 -2
  246. package/docs/examples/projects/create-webhook.md +2 -2
  247. package/docs/examples/projects/create.md +2 -2
  248. package/docs/examples/projects/delete-email-template.md +2 -2
  249. package/docs/examples/projects/delete-key.md +2 -2
  250. package/docs/examples/projects/delete-platform.md +2 -2
  251. package/docs/examples/projects/delete-sms-template.md +2 -2
  252. package/docs/examples/projects/delete-webhook.md +2 -2
  253. package/docs/examples/projects/delete.md +2 -2
  254. package/docs/examples/projects/get-email-template.md +2 -2
  255. package/docs/examples/projects/get-key.md +2 -2
  256. package/docs/examples/projects/get-platform.md +2 -2
  257. package/docs/examples/projects/get-sms-template.md +2 -2
  258. package/docs/examples/projects/get-webhook.md +2 -2
  259. package/docs/examples/projects/get.md +2 -2
  260. package/docs/examples/projects/list-keys.md +2 -2
  261. package/docs/examples/projects/list-platforms.md +2 -2
  262. package/docs/examples/projects/list-webhooks.md +2 -2
  263. package/docs/examples/projects/list.md +2 -2
  264. package/docs/examples/projects/update-api-status-all.md +2 -2
  265. package/docs/examples/projects/update-api-status.md +2 -2
  266. package/docs/examples/projects/update-auth-duration.md +2 -2
  267. package/docs/examples/projects/update-auth-limit.md +2 -2
  268. package/docs/examples/projects/update-auth-password-dictionary.md +2 -2
  269. package/docs/examples/projects/update-auth-password-history.md +2 -2
  270. package/docs/examples/projects/update-auth-sessions-limit.md +2 -2
  271. package/docs/examples/projects/update-auth-status.md +2 -2
  272. package/docs/examples/projects/update-email-template.md +2 -2
  273. package/docs/examples/projects/update-key.md +2 -2
  274. package/docs/examples/projects/update-mock-numbers.md +14 -0
  275. package/docs/examples/projects/update-o-auth2.md +2 -2
  276. package/docs/examples/projects/update-personal-data-check.md +2 -2
  277. package/docs/examples/projects/update-platform.md +2 -2
  278. package/docs/examples/projects/update-service-status-all.md +2 -2
  279. package/docs/examples/projects/update-service-status.md +2 -2
  280. package/docs/examples/projects/update-session-alerts.md +14 -0
  281. package/docs/examples/projects/update-sms-template.md +2 -2
  282. package/docs/examples/projects/update-smtp.md +2 -2
  283. package/docs/examples/projects/update-team.md +2 -2
  284. package/docs/examples/projects/update-webhook-signature.md +2 -2
  285. package/docs/examples/projects/update-webhook.md +2 -2
  286. package/docs/examples/projects/update.md +2 -2
  287. package/docs/examples/proxy/create-rule.md +2 -2
  288. package/docs/examples/proxy/delete-rule.md +2 -2
  289. package/docs/examples/proxy/get-rule.md +2 -2
  290. package/docs/examples/proxy/list-rules.md +2 -2
  291. package/docs/examples/proxy/update-rule-verification.md +2 -2
  292. package/docs/examples/storage/create-bucket.md +2 -2
  293. package/docs/examples/storage/create-file.md +2 -2
  294. package/docs/examples/storage/delete-bucket.md +2 -2
  295. package/docs/examples/storage/delete-file.md +2 -2
  296. package/docs/examples/storage/get-bucket-usage.md +2 -2
  297. package/docs/examples/storage/get-bucket.md +2 -2
  298. package/docs/examples/storage/get-file-download.md +1 -1
  299. package/docs/examples/storage/get-file-preview.md +1 -1
  300. package/docs/examples/storage/get-file-view.md +1 -1
  301. package/docs/examples/storage/get-file.md +2 -2
  302. package/docs/examples/storage/get-usage.md +2 -2
  303. package/docs/examples/storage/list-buckets.md +2 -2
  304. package/docs/examples/storage/list-files.md +2 -2
  305. package/docs/examples/storage/update-bucket.md +2 -2
  306. package/docs/examples/storage/update-file.md +2 -2
  307. package/docs/examples/teams/create-membership.md +2 -2
  308. package/docs/examples/teams/create.md +2 -2
  309. package/docs/examples/teams/delete-membership.md +2 -2
  310. package/docs/examples/teams/delete.md +2 -2
  311. package/docs/examples/teams/get-membership.md +2 -2
  312. package/docs/examples/teams/get-prefs.md +2 -2
  313. package/docs/examples/teams/get.md +2 -2
  314. package/docs/examples/teams/list-logs.md +2 -2
  315. package/docs/examples/teams/list-memberships.md +2 -2
  316. package/docs/examples/teams/list.md +2 -2
  317. package/docs/examples/teams/update-membership-status.md +2 -2
  318. package/docs/examples/teams/update-membership.md +2 -2
  319. package/docs/examples/teams/update-name.md +2 -2
  320. package/docs/examples/teams/update-prefs.md +2 -2
  321. package/docs/examples/users/create-argon2user.md +2 -2
  322. package/docs/examples/users/create-bcrypt-user.md +2 -2
  323. package/docs/examples/users/create-j-w-t.md +15 -0
  324. package/docs/examples/users/create-m-d5user.md +2 -2
  325. package/docs/examples/users/create-mfa-recovery-codes.md +2 -2
  326. package/docs/examples/users/create-p-h-pass-user.md +2 -2
  327. package/docs/examples/users/create-s-h-a-user.md +2 -2
  328. package/docs/examples/users/create-scrypt-modified-user.md +2 -2
  329. package/docs/examples/users/create-scrypt-user.md +2 -2
  330. package/docs/examples/users/create-session.md +2 -2
  331. package/docs/examples/users/create-target.md +2 -2
  332. package/docs/examples/users/create-token.md +2 -2
  333. package/docs/examples/users/create.md +2 -2
  334. package/docs/examples/users/delete-identity.md +2 -2
  335. package/docs/examples/users/delete-mfa-authenticator.md +2 -2
  336. package/docs/examples/users/delete-session.md +2 -2
  337. package/docs/examples/users/delete-sessions.md +2 -2
  338. package/docs/examples/users/delete-target.md +2 -2
  339. package/docs/examples/users/delete.md +2 -2
  340. package/docs/examples/users/get-mfa-recovery-codes.md +2 -2
  341. package/docs/examples/users/get-prefs.md +2 -2
  342. package/docs/examples/users/get-target.md +2 -2
  343. package/docs/examples/users/get-usage.md +2 -2
  344. package/docs/examples/users/get.md +2 -2
  345. package/docs/examples/users/list-identities.md +2 -2
  346. package/docs/examples/users/list-logs.md +2 -2
  347. package/docs/examples/users/list-memberships.md +2 -2
  348. package/docs/examples/users/list-mfa-factors.md +2 -2
  349. package/docs/examples/users/list-sessions.md +2 -2
  350. package/docs/examples/users/list-targets.md +2 -2
  351. package/docs/examples/users/list.md +2 -2
  352. package/docs/examples/users/update-email-verification.md +2 -2
  353. package/docs/examples/users/update-email.md +2 -2
  354. package/docs/examples/users/update-labels.md +2 -2
  355. package/docs/examples/users/update-mfa-recovery-codes.md +2 -2
  356. package/docs/examples/users/update-mfa.md +2 -2
  357. package/docs/examples/users/update-name.md +2 -2
  358. package/docs/examples/users/update-password.md +2 -2
  359. package/docs/examples/users/update-phone-verification.md +2 -2
  360. package/docs/examples/users/update-phone.md +2 -2
  361. package/docs/examples/users/update-prefs.md +2 -2
  362. package/docs/examples/users/update-status.md +2 -2
  363. package/docs/examples/users/update-target.md +2 -2
  364. package/docs/examples/vcs/create-repository-detection.md +2 -2
  365. package/docs/examples/vcs/create-repository.md +2 -2
  366. package/docs/examples/vcs/delete-installation.md +2 -2
  367. package/docs/examples/vcs/get-installation.md +2 -2
  368. package/docs/examples/vcs/get-repository-contents.md +15 -0
  369. package/docs/examples/vcs/get-repository.md +2 -2
  370. package/docs/examples/vcs/list-installations.md +2 -2
  371. package/docs/examples/vcs/list-repositories.md +2 -2
  372. package/docs/examples/vcs/list-repository-branches.md +2 -2
  373. package/docs/examples/vcs/update-external-deployments.md +2 -2
  374. package/package.json +1 -1
  375. package/src/client.ts +322 -51
  376. package/src/enums/credit-card.ts +1 -1
  377. package/src/enums/email-template-type.ts +2 -0
  378. package/src/enums/name.ts +1 -2
  379. package/src/enums/platform-type.ts +2 -0
  380. package/src/enums/runtime.ts +1 -3
  381. package/src/id.ts +21 -2
  382. package/src/index.ts +7 -0
  383. package/src/models.ts +299 -0
  384. package/src/permission.ts +41 -6
  385. package/src/query.ts +161 -1
  386. package/src/service.ts +3 -0
  387. package/src/services/account.ts +654 -647
  388. package/src/services/assistant.ts +19 -16
  389. package/src/services/avatars.ts +111 -152
  390. package/src/services/console.ts +19 -14
  391. package/src/services/databases.ts +628 -638
  392. package/src/services/functions.ts +446 -321
  393. package/src/services/graphql.ts +31 -24
  394. package/src/services/health.ts +299 -199
  395. package/src/services/locale.ts +113 -77
  396. package/src/services/messaging.ts +568 -583
  397. package/src/services/migrations.ts +199 -197
  398. package/src/services/project.ts +82 -65
  399. package/src/services/projects.ts +615 -459
  400. package/src/services/proxy.ts +68 -50
  401. package/src/services/storage.ts +198 -253
  402. package/src/services/teams.ts +198 -188
  403. package/src/services/users.ts +568 -478
  404. package/src/services/vcs.ts +149 -83
  405. package/types/client.d.ts +82 -4
  406. package/types/enums/credit-card.d.ts +1 -1
  407. package/types/enums/email-template-type.d.ts +3 -1
  408. package/types/enums/name.d.ts +2 -3
  409. package/types/enums/platform-type.d.ts +3 -1
  410. package/types/enums/runtime.d.ts +2 -4
  411. package/types/id.d.ts +15 -0
  412. package/types/index.d.ts +7 -0
  413. package/types/models.d.ts +299 -0
  414. package/types/permission.d.ts +36 -0
  415. package/types/query.d.ts +160 -0
  416. package/types/service.d.ts +3 -0
  417. package/types/services/account.d.ts +165 -320
  418. package/types/services/assistant.d.ts +4 -4
  419. package/types/services/avatars.d.ts +50 -84
  420. package/types/services/console.d.ts +4 -4
  421. package/types/services/databases.d.ts +143 -173
  422. package/types/services/functions.d.ts +119 -92
  423. package/types/services/graphql.d.ts +6 -6
  424. package/types/services/health.d.ts +64 -85
  425. package/types/services/locale.d.ts +28 -39
  426. package/types/services/messaging.d.ts +103 -104
  427. package/types/services/migrations.d.ts +34 -34
  428. package/types/services/project.d.ts +17 -20
  429. package/types/services/projects.d.ts +118 -87
  430. package/types/services/proxy.d.ts +13 -14
  431. package/types/services/storage.d.ts +53 -78
  432. package/types/services/teams.d.ts +53 -83
  433. package/types/services/users.d.ts +120 -157
  434. package/types/services/vcs.d.ts +31 -20
@@ -1,10 +1,10 @@
1
- import { Service } from '../service';
2
1
  import { Client } from '../client';
3
2
  import type { Models } from '../models';
4
3
  import { AuthenticatorType } from '../enums/authenticator-type';
5
4
  import { AuthenticationFactor } from '../enums/authentication-factor';
6
5
  import { OAuthProvider } from '../enums/o-auth-provider';
7
- export declare class Account extends Service {
6
+ export declare class Account {
7
+ client: Client;
8
8
  constructor(client: Client);
9
9
  /**
10
10
  * Get account
@@ -12,27 +12,21 @@ export declare class Account extends Service {
12
12
  * Get the currently logged in user.
13
13
  *
14
14
  * @throws {AppwriteException}
15
- * @returns {Promise}
16
- */
15
+ * @returns {Promise<Models.User<Preferences>>}
16
+ */
17
17
  get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
18
18
  /**
19
19
  * Create account
20
20
  *
21
- * Use this endpoint to allow a new user to register a new account in your
22
- * project. After the user registration completes successfully, you can use
23
- * the
24
- * [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification)
25
- * route to start verifying the user email address. To allow the new user to
26
- * login to their new account, you need to create a new [account
27
- * session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).
21
+ * Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).
28
22
  *
29
23
  * @param {string} userId
30
24
  * @param {string} email
31
25
  * @param {string} password
32
26
  * @param {string} name
33
27
  * @throws {AppwriteException}
34
- * @returns {Promise}
35
- */
28
+ * @returns {Promise<Models.User<Preferences>>}
29
+ */
36
30
  create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
37
31
  /**
38
32
  * Delete account
@@ -40,26 +34,21 @@ export declare class Account extends Service {
40
34
  * Delete the currently logged in user.
41
35
  *
42
36
  * @throws {AppwriteException}
43
- * @returns {Promise}
44
- */
37
+ * @returns {Promise<{}>}
38
+ */
45
39
  delete(): Promise<{}>;
46
40
  /**
47
41
  * Update email
48
42
  *
49
- * Update currently logged in user account email address. After changing user
50
- * address, the user confirmation status will get reset. A new confirmation
51
- * email is not sent automatically however you can use the send confirmation
52
- * email endpoint again to send the confirmation email. For security measures,
53
- * user password is required to complete this request.
54
- * This endpoint can also be used to convert an anonymous account to a normal
55
- * one, by passing an email address and a new password.
56
- *
43
+ * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
44
+ This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
45
+
57
46
  *
58
47
  * @param {string} email
59
48
  * @param {string} password
60
49
  * @throws {AppwriteException}
61
- * @returns {Promise}
62
- */
50
+ * @returns {Promise<Models.User<Preferences>>}
51
+ */
63
52
  updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>;
64
53
  /**
65
54
  * List Identities
@@ -68,8 +57,8 @@ export declare class Account extends Service {
68
57
  *
69
58
  * @param {string[]} queries
70
59
  * @throws {AppwriteException}
71
- * @returns {Promise}
72
- */
60
+ * @returns {Promise<Models.IdentityList>}
61
+ */
73
62
  listIdentities(queries?: string[]): Promise<Models.IdentityList>;
74
63
  /**
75
64
  * Delete identity
@@ -78,32 +67,27 @@ export declare class Account extends Service {
78
67
  *
79
68
  * @param {string} identityId
80
69
  * @throws {AppwriteException}
81
- * @returns {Promise}
82
- */
70
+ * @returns {Promise<{}>}
71
+ */
83
72
  deleteIdentity(identityId: string): Promise<{}>;
84
73
  /**
85
74
  * Create JWT
86
75
  *
87
- * Use this endpoint to create a JSON Web Token. You can use the resulting JWT
88
- * to authenticate on behalf of the current user when working with the
89
- * Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes
90
- * from its creation and will be invalid if the user will logout in that time
91
- * frame.
76
+ * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
92
77
  *
93
78
  * @throws {AppwriteException}
94
- * @returns {Promise}
95
- */
79
+ * @returns {Promise<Models.Jwt>}
80
+ */
96
81
  createJWT(): Promise<Models.Jwt>;
97
82
  /**
98
83
  * List logs
99
84
  *
100
- * Get the list of latest security activity logs for the currently logged in
101
- * user. Each log returns user IP address, location and date and time of log.
85
+ * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
102
86
  *
103
87
  * @param {string[]} queries
104
88
  * @throws {AppwriteException}
105
- * @returns {Promise}
106
- */
89
+ * @returns {Promise<Models.LogList>}
90
+ */
107
91
  listLogs(queries?: string[]): Promise<Models.LogList>;
108
92
  /**
109
93
  * Update MFA
@@ -112,34 +96,29 @@ export declare class Account extends Service {
112
96
  *
113
97
  * @param {boolean} mfa
114
98
  * @throws {AppwriteException}
115
- * @returns {Promise}
116
- */
99
+ * @returns {Promise<Models.User<Preferences>>}
100
+ */
117
101
  updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>>;
118
102
  /**
119
- * Add Authenticator
103
+ * Create Authenticator
120
104
  *
121
- * Add an authenticator app to be used as an MFA factor. Verify the
122
- * authenticator using the [verify
123
- * authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator)
124
- * method.
105
+ * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.
125
106
  *
126
107
  * @param {AuthenticatorType} type
127
108
  * @throws {AppwriteException}
128
- * @returns {Promise}
129
- */
109
+ * @returns {Promise<Models.MfaType>}
110
+ */
130
111
  createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType>;
131
112
  /**
132
113
  * Verify Authenticator
133
114
  *
134
- * Verify an authenticator app after adding it using the [add
135
- * authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator)
136
- * method. add
115
+ * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
137
116
  *
138
117
  * @param {AuthenticatorType} type
139
118
  * @param {string} otp
140
119
  * @throws {AppwriteException}
141
- * @returns {Promise}
142
- */
120
+ * @returns {Promise<Models.User<Preferences>>}
121
+ */
143
122
  updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
144
123
  /**
145
124
  * Delete Authenticator
@@ -147,37 +126,30 @@ export declare class Account extends Service {
147
126
  * Delete an authenticator for a user by ID.
148
127
  *
149
128
  * @param {AuthenticatorType} type
150
- * @param {string} otp
151
129
  * @throws {AppwriteException}
152
- * @returns {Promise}
153
- */
154
- deleteMfaAuthenticator(type: AuthenticatorType, otp: string): Promise<{}>;
130
+ * @returns {Promise<{}>}
131
+ */
132
+ deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}>;
155
133
  /**
156
- * Create 2FA Challenge
134
+ * Create MFA Challenge
157
135
  *
158
- * Begin the process of MFA verification after sign-in. Finish the flow with
159
- * [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge)
160
- * method.
136
+ * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
161
137
  *
162
138
  * @param {AuthenticationFactor} factor
163
139
  * @throws {AppwriteException}
164
- * @returns {Promise}
165
- */
140
+ * @returns {Promise<Models.MfaChallenge>}
141
+ */
166
142
  createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge>;
167
143
  /**
168
144
  * Create MFA Challenge (confirmation)
169
145
  *
170
- * Complete the MFA challenge by providing the one-time password. Finish the
171
- * process of MFA verification by providing the one-time password. To begin
172
- * the flow, use
173
- * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
174
- * method.
146
+ * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
175
147
  *
176
148
  * @param {string} challengeId
177
149
  * @param {string} otp
178
150
  * @throws {AppwriteException}
179
- * @returns {Promise}
180
- */
151
+ * @returns {Promise<{}>}
152
+ */
181
153
  updateMfaChallenge(challengeId: string, otp: string): Promise<{}>;
182
154
  /**
183
155
  * List Factors
@@ -185,45 +157,35 @@ export declare class Account extends Service {
185
157
  * List the factors available on the account to be used as a MFA challange.
186
158
  *
187
159
  * @throws {AppwriteException}
188
- * @returns {Promise}
189
- */
160
+ * @returns {Promise<Models.MfaFactors>}
161
+ */
190
162
  listMfaFactors(): Promise<Models.MfaFactors>;
191
163
  /**
192
164
  * Get MFA Recovery Codes
193
165
  *
194
- * Get recovery codes that can be used as backup for MFA flow. Before getting
195
- * codes, they must be generated using
196
- * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
197
- * method. An OTP challenge is required to read recovery codes.
166
+ * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.
198
167
  *
199
168
  * @throws {AppwriteException}
200
- * @returns {Promise}
201
- */
169
+ * @returns {Promise<Models.MfaRecoveryCodes>}
170
+ */
202
171
  getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
203
172
  /**
204
173
  * Create MFA Recovery Codes
205
174
  *
206
- * Generate recovery codes as backup for MFA flow. It's recommended to
207
- * generate and show then immediately after user successfully adds their
208
- * authehticator. Recovery codes can be used as a MFA verification type in
209
- * [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge)
210
- * method.
175
+ * Generate recovery codes as backup for MFA flow. It&#039;s recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
211
176
  *
212
177
  * @throws {AppwriteException}
213
- * @returns {Promise}
214
- */
178
+ * @returns {Promise<Models.MfaRecoveryCodes>}
179
+ */
215
180
  createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
216
181
  /**
217
182
  * Regenerate MFA Recovery Codes
218
183
  *
219
- * Regenerate recovery codes that can be used as backup for MFA flow. Before
220
- * regenerating codes, they must be first generated using
221
- * [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes)
222
- * method. An OTP challenge is required to regenreate recovery codes.
184
+ * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.
223
185
  *
224
186
  * @throws {AppwriteException}
225
- * @returns {Promise}
226
- */
187
+ * @returns {Promise<Models.MfaRecoveryCodes>}
188
+ */
227
189
  updateMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
228
190
  /**
229
191
  * Update name
@@ -232,36 +194,30 @@ export declare class Account extends Service {
232
194
  *
233
195
  * @param {string} name
234
196
  * @throws {AppwriteException}
235
- * @returns {Promise}
236
- */
197
+ * @returns {Promise<Models.User<Preferences>>}
198
+ */
237
199
  updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>>;
238
200
  /**
239
201
  * Update password
240
202
  *
241
- * Update currently logged in user password. For validation, user is required
242
- * to pass in the new password, and the old password. For users created with
243
- * OAuth, Team Invites and Magic URL, oldPassword is optional.
203
+ * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.
244
204
  *
245
205
  * @param {string} password
246
206
  * @param {string} oldPassword
247
207
  * @throws {AppwriteException}
248
- * @returns {Promise}
249
- */
208
+ * @returns {Promise<Models.User<Preferences>>}
209
+ */
250
210
  updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
251
211
  /**
252
212
  * Update phone
253
213
  *
254
- * Update the currently logged in user's phone number. After updating the
255
- * phone number, the phone verification status will be reset. A confirmation
256
- * SMS is not sent automatically, however you can use the [POST
257
- * /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification)
258
- * endpoint to send a confirmation SMS.
214
+ * Update the currently logged in user&#039;s phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.
259
215
  *
260
216
  * @param {string} phone
261
217
  * @param {string} password
262
218
  * @throws {AppwriteException}
263
- * @returns {Promise}
264
- */
219
+ * @returns {Promise<Models.User<Preferences>>}
220
+ */
265
221
  updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
266
222
  /**
267
223
  * Get account preferences
@@ -269,225 +225,173 @@ export declare class Account extends Service {
269
225
  * Get the preferences as a key-value object for the currently logged in user.
270
226
  *
271
227
  * @throws {AppwriteException}
272
- * @returns {Promise}
273
- */
228
+ * @returns {Promise<Preferences>}
229
+ */
274
230
  getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences>;
275
231
  /**
276
232
  * Update preferences
277
233
  *
278
- * Update currently logged in user account preferences. The object you pass is
279
- * stored as is, and replaces any previous value. The maximum allowed prefs
280
- * size is 64kB and throws error if exceeded.
234
+ * Update currently logged in user account preferences. 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.
281
235
  *
282
236
  * @param {Partial<Preferences>} prefs
283
237
  * @throws {AppwriteException}
284
- * @returns {Promise}
285
- */
238
+ * @returns {Promise<Models.User<Preferences>>}
239
+ */
286
240
  updatePrefs<Preferences extends Models.Preferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>>;
287
241
  /**
288
242
  * Create password recovery
289
243
  *
290
- * Sends the user an email with a temporary secret key for password reset.
291
- * When the user clicks the confirmation link he is redirected back to your
292
- * app password reset URL with the secret key and email address values
293
- * attached to the URL query string. Use the query string params to submit a
294
- * request to the [PUT
295
- * /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery)
296
- * endpoint to complete the process. The verification link sent to the user's
297
- * email address is valid for 1 hour.
244
+ * Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user&#039;s email address is valid for 1 hour.
298
245
  *
299
246
  * @param {string} email
300
247
  * @param {string} url
301
248
  * @throws {AppwriteException}
302
- * @returns {Promise}
303
- */
249
+ * @returns {Promise<Models.Token>}
250
+ */
304
251
  createRecovery(email: string, url: string): Promise<Models.Token>;
305
252
  /**
306
253
  * Create password recovery (confirmation)
307
254
  *
308
- * Use this endpoint to complete the user account password reset. Both the
309
- * **userId** and **secret** arguments will be passed as query parameters to
310
- * the redirect URL you have provided when sending your request to the [POST
311
- * /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery)
312
- * endpoint.
313
- *
314
- * Please note that in order to avoid a [Redirect
315
- * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
316
- * the only valid redirect URLs are the ones from domains you have set when
317
- * adding your platforms in the console interface.
255
+ * Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint.
256
+
257
+ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
318
258
  *
319
259
  * @param {string} userId
320
260
  * @param {string} secret
321
261
  * @param {string} password
322
262
  * @throws {AppwriteException}
323
- * @returns {Promise}
324
- */
263
+ * @returns {Promise<Models.Token>}
264
+ */
325
265
  updateRecovery(userId: string, secret: string, password: string): Promise<Models.Token>;
326
266
  /**
327
267
  * List sessions
328
268
  *
329
- * Get the list of active sessions across different devices for the currently
330
- * logged in user.
269
+ * Get the list of active sessions across different devices for the currently logged in user.
331
270
  *
332
271
  * @throws {AppwriteException}
333
- * @returns {Promise}
334
- */
272
+ * @returns {Promise<Models.SessionList>}
273
+ */
335
274
  listSessions(): Promise<Models.SessionList>;
336
275
  /**
337
276
  * Delete sessions
338
277
  *
339
- * Delete all sessions from the user account and remove any sessions cookies
340
- * from the end client.
278
+ * Delete all sessions from the user account and remove any sessions cookies from the end client.
341
279
  *
342
280
  * @throws {AppwriteException}
343
- * @returns {Promise}
344
- */
281
+ * @returns {Promise<{}>}
282
+ */
345
283
  deleteSessions(): Promise<{}>;
346
284
  /**
347
285
  * Create anonymous session
348
286
  *
349
- * Use this endpoint to allow a new user to register an anonymous account in
350
- * your project. This route will also create a new session for the user. To
351
- * allow the new user to convert an anonymous account to a normal account, you
352
- * need to update its [email and
353
- * password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail)
354
- * or create an [OAuth2
355
- * session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).
287
+ * Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).
356
288
  *
357
289
  * @throws {AppwriteException}
358
- * @returns {Promise}
359
- */
290
+ * @returns {Promise<Models.Session>}
291
+ */
360
292
  createAnonymousSession(): Promise<Models.Session>;
361
293
  /**
362
294
  * Create email password session
363
295
  *
364
- * Allow the user to login into their account by providing a valid email and
365
- * password combination. This route will create a new session for the user.
366
- *
367
- * A user is limited to 10 active sessions at a time by default. [Learn more
368
- * about session
369
- * limits](https://appwrite.io/docs/authentication-security#limits).
296
+ * Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.
297
+
298
+ A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
370
299
  *
371
300
  * @param {string} email
372
301
  * @param {string} password
373
302
  * @throws {AppwriteException}
374
- * @returns {Promise}
375
- */
303
+ * @returns {Promise<Models.Session>}
304
+ */
376
305
  createEmailPasswordSession(email: string, password: string): Promise<Models.Session>;
377
306
  /**
378
307
  * Update magic URL session
379
308
  *
380
- * Use this endpoint to create a session from token. Provide the **userId**
381
- * and **secret** parameters from the successful response of authentication
382
- * flows initiated by token creation. For example, magic URL and phone login.
309
+ * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
383
310
  *
384
311
  * @param {string} userId
385
312
  * @param {string} secret
386
313
  * @throws {AppwriteException}
387
- * @returns {Promise}
388
- */
314
+ * @returns {Promise<Models.Session>}
315
+ */
389
316
  updateMagicURLSession(userId: string, secret: string): Promise<Models.Session>;
390
317
  /**
391
318
  * Create OAuth2 session
392
319
  *
393
- * Allow the user to login to their account using the OAuth2 provider of their
394
- * choice. Each OAuth2 provider should be enabled from the Appwrite console
395
- * first. Use the success and failure arguments to provide a redirect URL's
396
- * back to your app when login is completed.
397
- *
398
- * If there is already an active session, the new session will be attached to
399
- * the logged-in account. If there are no active sessions, the server will
400
- * attempt to look for a user with the same email address as the email
401
- * received from the OAuth2 provider and attach the new session to the
402
- * existing user. If no matching user is found - the server will create a new
403
- * user.
404
- *
405
- * A user is limited to 10 active sessions at a time by default. [Learn more
406
- * about session
407
- * limits](https://appwrite.io/docs/authentication-security#limits).
408
- *
320
+ * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL&#039;s back to your app when login is completed.
321
+
322
+ If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
323
+
324
+ A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
325
+
409
326
  *
410
327
  * @param {OAuthProvider} provider
411
328
  * @param {string} success
412
329
  * @param {string} failure
413
330
  * @param {string[]} scopes
414
331
  * @throws {AppwriteException}
415
- * @returns {void|string}
416
- */
417
- createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL;
332
+ * @returns {Promise<void | string>}
333
+ */
334
+ createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): Promise<void | string>;
418
335
  /**
419
336
  * Update phone session
420
337
  *
421
- * Use this endpoint to create a session from token. Provide the **userId**
422
- * and **secret** parameters from the successful response of authentication
423
- * flows initiated by token creation. For example, magic URL and phone login.
338
+ * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
424
339
  *
425
340
  * @param {string} userId
426
341
  * @param {string} secret
427
342
  * @throws {AppwriteException}
428
- * @returns {Promise}
429
- */
343
+ * @returns {Promise<Models.Session>}
344
+ */
430
345
  updatePhoneSession(userId: string, secret: string): Promise<Models.Session>;
431
346
  /**
432
347
  * Create session
433
348
  *
434
- * Use this endpoint to create a session from token. Provide the **userId**
435
- * and **secret** parameters from the successful response of authentication
436
- * flows initiated by token creation. For example, magic URL and phone login.
349
+ * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
437
350
  *
438
351
  * @param {string} userId
439
352
  * @param {string} secret
440
353
  * @throws {AppwriteException}
441
- * @returns {Promise}
442
- */
354
+ * @returns {Promise<Models.Session>}
355
+ */
443
356
  createSession(userId: string, secret: string): Promise<Models.Session>;
444
357
  /**
445
358
  * Get session
446
359
  *
447
- * Use this endpoint to get a logged in user's session using a Session ID.
448
- * Inputting 'current' will return the current session being used.
360
+ * Use this endpoint to get a logged in user&#039;s session using a Session ID. Inputting &#039;current&#039; will return the current session being used.
449
361
  *
450
362
  * @param {string} sessionId
451
363
  * @throws {AppwriteException}
452
- * @returns {Promise}
453
- */
364
+ * @returns {Promise<Models.Session>}
365
+ */
454
366
  getSession(sessionId: string): Promise<Models.Session>;
455
367
  /**
456
368
  * Update session
457
369
  *
458
- * Use this endpoint to extend a session's length. Extending a session is
459
- * useful when session expiry is short. If the session was created using an
460
- * OAuth provider, this endpoint refreshes the access token from the provider.
370
+ * Use this endpoint to extend a session&#039;s length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.
461
371
  *
462
372
  * @param {string} sessionId
463
373
  * @throws {AppwriteException}
464
- * @returns {Promise}
465
- */
374
+ * @returns {Promise<Models.Session>}
375
+ */
466
376
  updateSession(sessionId: string): Promise<Models.Session>;
467
377
  /**
468
378
  * Delete session
469
379
  *
470
- * Logout the user. Use 'current' as the session ID to logout on this device,
471
- * use a session ID to logout on another device. If you're looking to logout
472
- * the user on all devices, use [Delete
473
- * Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions)
474
- * instead.
380
+ * Logout the user. Use &#039;current&#039; as the session ID to logout on this device, use a session ID to logout on another device. If you&#039;re looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.
475
381
  *
476
382
  * @param {string} sessionId
477
383
  * @throws {AppwriteException}
478
- * @returns {Promise}
479
- */
384
+ * @returns {Promise<{}>}
385
+ */
480
386
  deleteSession(sessionId: string): Promise<{}>;
481
387
  /**
482
388
  * Update status
483
389
  *
484
- * Block the currently logged in user account. Behind the scene, the user
485
- * record is not deleted but permanently blocked from any access. To
486
- * completely delete a user, use the Users API instead.
390
+ * Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.
487
391
  *
488
392
  * @throws {AppwriteException}
489
- * @returns {Promise}
490
- */
393
+ * @returns {Promise<Models.User<Preferences>>}
394
+ */
491
395
  updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
492
396
  /**
493
397
  * Create push target
@@ -497,8 +401,8 @@ export declare class Account extends Service {
497
401
  * @param {string} identifier
498
402
  * @param {string} providerId
499
403
  * @throws {AppwriteException}
500
- * @returns {Promise}
501
- */
404
+ * @returns {Promise<Models.Target>}
405
+ */
502
406
  createPushTarget(targetId: string, identifier: string, providerId?: string): Promise<Models.Target>;
503
407
  /**
504
408
  * Update push target
@@ -507,8 +411,8 @@ export declare class Account extends Service {
507
411
  * @param {string} targetId
508
412
  * @param {string} identifier
509
413
  * @throws {AppwriteException}
510
- * @returns {Promise}
511
- */
414
+ * @returns {Promise<Models.Target>}
415
+ */
512
416
  updatePushTarget(targetId: string, identifier: string): Promise<Models.Target>;
513
417
  /**
514
418
  * Delete push target
@@ -516,170 +420,111 @@ export declare class Account extends Service {
516
420
  *
517
421
  * @param {string} targetId
518
422
  * @throws {AppwriteException}
519
- * @returns {Promise}
520
- */
423
+ * @returns {Promise<{}>}
424
+ */
521
425
  deletePushTarget(targetId: string): Promise<{}>;
522
426
  /**
523
427
  * Create email token (OTP)
524
428
  *
525
- * Sends the user an email with a secret key for creating a session. If the
526
- * provided user ID has not be registered, a new user will be created. Use the
527
- * returned user ID and secret and submit a request to the [POST
528
- * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
529
- * endpoint to complete the login process. The secret sent to the user's email
530
- * is valid for 15 minutes.
531
- *
532
- * A user is limited to 10 active sessions at a time by default. [Learn more
533
- * about session
534
- * limits](https://appwrite.io/docs/authentication-security#limits).
429
+ * Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user&#039;s email is valid for 15 minutes.
430
+
431
+ A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
535
432
  *
536
433
  * @param {string} userId
537
434
  * @param {string} email
538
435
  * @param {boolean} phrase
539
436
  * @throws {AppwriteException}
540
- * @returns {Promise}
541
- */
437
+ * @returns {Promise<Models.Token>}
438
+ */
542
439
  createEmailToken(userId: string, email: string, phrase?: boolean): Promise<Models.Token>;
543
440
  /**
544
441
  * Create magic URL token
545
442
  *
546
- * Sends the user an email with a secret key for creating a session. If the
547
- * provided user ID has not been registered, a new user will be created. When
548
- * the user clicks the link in the email, the user is redirected back to the
549
- * URL you provided with the secret key and userId values attached to the URL
550
- * query string. Use the query string parameters to submit a request to the
551
- * [POST
552
- * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
553
- * endpoint to complete the login process. The link sent to the user's email
554
- * address is valid for 1 hour. If you are on a mobile device you can leave
555
- * the URL parameter empty, so that the login completion will be handled by
556
- * your Appwrite instance by default.
557
- *
558
- * A user is limited to 10 active sessions at a time by default. [Learn more
559
- * about session
560
- * limits](https://appwrite.io/docs/authentication-security#limits).
561
- *
443
+ * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user&#039;s email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.
444
+
445
+ A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
446
+
562
447
  *
563
448
  * @param {string} userId
564
449
  * @param {string} email
565
450
  * @param {string} url
566
451
  * @param {boolean} phrase
567
452
  * @throws {AppwriteException}
568
- * @returns {Promise}
569
- */
453
+ * @returns {Promise<Models.Token>}
454
+ */
570
455
  createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise<Models.Token>;
571
456
  /**
572
457
  * Create OAuth2 token
573
458
  *
574
- * Allow the user to login to their account using the OAuth2 provider of their
575
- * choice. Each OAuth2 provider should be enabled from the Appwrite console
576
- * first. Use the success and failure arguments to provide a redirect URL's
577
- * back to your app when login is completed.
578
- *
579
- * If authentication succeeds, `userId` and `secret` of a token will be
580
- * appended to the success URL as query parameters. These can be used to
581
- * create a new session using the [Create
582
- * session](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
583
- * endpoint.
584
- *
585
- * A user is limited to 10 active sessions at a time by default. [Learn more
586
- * about session
587
- * limits](https://appwrite.io/docs/authentication-security#limits).
459
+ * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL&#039;s back to your app when login is completed.
460
+
461
+ If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint.
462
+
463
+ A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
588
464
  *
589
465
  * @param {OAuthProvider} provider
590
466
  * @param {string} success
591
467
  * @param {string} failure
592
468
  * @param {string[]} scopes
593
469
  * @throws {AppwriteException}
594
- * @returns {void|string}
595
- */
596
- createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | URL;
470
+ * @returns {Promise<void | string>}
471
+ */
472
+ createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): Promise<void | string>;
597
473
  /**
598
474
  * Create phone token
599
475
  *
600
- * Sends the user an SMS with a secret key for creating a session. If the
601
- * provided user ID has not be registered, a new user will be created. Use the
602
- * returned user ID and secret and submit a request to the [POST
603
- * /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession)
604
- * endpoint to complete the login process. The secret sent to the user's phone
605
- * is valid for 15 minutes.
606
- *
607
- * A user is limited to 10 active sessions at a time by default. [Learn more
608
- * about session
609
- * limits](https://appwrite.io/docs/authentication-security#limits).
476
+ * Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user&#039;s phone is valid for 15 minutes.
477
+
478
+ A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
610
479
  *
611
480
  * @param {string} userId
612
481
  * @param {string} phone
613
482
  * @throws {AppwriteException}
614
- * @returns {Promise}
615
- */
483
+ * @returns {Promise<Models.Token>}
484
+ */
616
485
  createPhoneToken(userId: string, phone: string): Promise<Models.Token>;
617
486
  /**
618
487
  * Create email verification
619
488
  *
620
- * Use this endpoint to send a verification message to your user email address
621
- * to confirm they are the valid owners of that address. Both the **userId**
622
- * and **secret** arguments will be passed as query parameters to the URL you
623
- * have provided to be attached to the verification email. The provided URL
624
- * should redirect the user back to your app and allow you to complete the
625
- * verification process by verifying both the **userId** and **secret**
626
- * parameters. Learn more about how to [complete the verification
627
- * process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification).
628
- * The verification link sent to the user's email address is valid for 7 days.
629
- *
630
- * Please note that in order to avoid a [Redirect
631
- * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
632
- * the only valid redirect URLs are the ones from domains you have set when
633
- * adding your platforms in the console interface.
634
- *
489
+ * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user&#039;s email address is valid for 7 days.
490
+
491
+ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
492
+
635
493
  *
636
494
  * @param {string} url
637
495
  * @throws {AppwriteException}
638
- * @returns {Promise}
639
- */
496
+ * @returns {Promise<Models.Token>}
497
+ */
640
498
  createVerification(url: string): Promise<Models.Token>;
641
499
  /**
642
500
  * Create email verification (confirmation)
643
501
  *
644
- * Use this endpoint to complete the user email verification process. Use both
645
- * the **userId** and **secret** parameters that were attached to your app URL
646
- * to verify the user email ownership. If confirmed this route will return a
647
- * 200 status code.
502
+ * Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
648
503
  *
649
504
  * @param {string} userId
650
505
  * @param {string} secret
651
506
  * @throws {AppwriteException}
652
- * @returns {Promise}
653
- */
507
+ * @returns {Promise<Models.Token>}
508
+ */
654
509
  updateVerification(userId: string, secret: string): Promise<Models.Token>;
655
510
  /**
656
511
  * Create phone verification
657
512
  *
658
- * Use this endpoint to send a verification SMS to the currently logged in
659
- * user. This endpoint is meant for use after updating a user's phone number
660
- * using the
661
- * [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone)
662
- * endpoint. Learn more about how to [complete the verification
663
- * process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification).
664
- * The verification code sent to the user's phone number is valid for 15
665
- * minutes.
513
+ * Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user&#039;s phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user&#039;s phone number is valid for 15 minutes.
666
514
  *
667
515
  * @throws {AppwriteException}
668
- * @returns {Promise}
669
- */
516
+ * @returns {Promise<Models.Token>}
517
+ */
670
518
  createPhoneVerification(): Promise<Models.Token>;
671
519
  /**
672
- * Create phone verification (confirmation)
520
+ * Update phone verification (confirmation)
673
521
  *
674
- * Use this endpoint to complete the user phone verification process. Use the
675
- * **userId** and **secret** that were sent to your user's phone number to
676
- * verify the user email ownership. If confirmed this route will return a 200
677
- * status code.
522
+ * Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user&#039;s phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
678
523
  *
679
524
  * @param {string} userId
680
525
  * @param {string} secret
681
526
  * @throws {AppwriteException}
682
- * @returns {Promise}
683
- */
527
+ * @returns {Promise<Models.Token>}
528
+ */
684
529
  updatePhoneVerification(userId: string, secret: string): Promise<Models.Token>;
685
530
  }