@appwrite.io/console 0.6.4 → 0.7.0-rc.2

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 (408) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/sdk.js +2513 -2350
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +2513 -2350
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +2513 -2350
  7. package/docs/examples/account/create-anonymous-session.md +1 -1
  8. package/docs/examples/account/create-email-password-session.md +1 -1
  9. package/docs/examples/account/create-email-token.md +1 -1
  10. package/docs/examples/account/create-j-w-t.md +1 -1
  11. package/docs/examples/account/create-magic-u-r-l-token.md +1 -1
  12. package/docs/examples/account/create-mfa-authenticator.md +1 -1
  13. package/docs/examples/account/create-mfa-challenge.md +1 -1
  14. package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
  15. package/docs/examples/account/create-phone-token.md +1 -1
  16. package/docs/examples/account/create-phone-verification.md +1 -1
  17. package/docs/examples/account/create-push-target.md +1 -1
  18. package/docs/examples/account/create-recovery.md +1 -1
  19. package/docs/examples/account/create-session.md +1 -1
  20. package/docs/examples/account/create-verification.md +1 -1
  21. package/docs/examples/account/create.md +1 -1
  22. package/docs/examples/account/delete-identity.md +1 -1
  23. package/docs/examples/account/delete-mfa-authenticator.md +2 -3
  24. package/docs/examples/account/delete-push-target.md +1 -1
  25. package/docs/examples/account/delete-session.md +1 -1
  26. package/docs/examples/account/delete-sessions.md +1 -1
  27. package/docs/examples/account/delete.md +1 -1
  28. package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
  29. package/docs/examples/account/get-prefs.md +1 -1
  30. package/docs/examples/account/get-session.md +1 -1
  31. package/docs/examples/account/get.md +1 -1
  32. package/docs/examples/account/list-identities.md +1 -1
  33. package/docs/examples/account/list-logs.md +1 -1
  34. package/docs/examples/account/list-mfa-factors.md +1 -1
  35. package/docs/examples/account/list-sessions.md +1 -1
  36. package/docs/examples/account/update-email.md +1 -1
  37. package/docs/examples/account/update-m-f-a.md +1 -1
  38. package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
  39. package/docs/examples/account/update-mfa-authenticator.md +1 -1
  40. package/docs/examples/account/update-mfa-challenge.md +1 -1
  41. package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
  42. package/docs/examples/account/update-name.md +1 -1
  43. package/docs/examples/account/update-password.md +1 -1
  44. package/docs/examples/account/update-phone-session.md +1 -1
  45. package/docs/examples/account/update-phone-verification.md +1 -1
  46. package/docs/examples/account/update-phone.md +1 -1
  47. package/docs/examples/account/update-prefs.md +1 -1
  48. package/docs/examples/account/update-push-target.md +1 -1
  49. package/docs/examples/account/update-recovery.md +1 -1
  50. package/docs/examples/account/update-session.md +1 -1
  51. package/docs/examples/account/update-status.md +1 -1
  52. package/docs/examples/account/update-verification.md +1 -1
  53. package/docs/examples/assistant/chat.md +1 -1
  54. package/docs/examples/console/variables.md +1 -1
  55. package/docs/examples/databases/create-boolean-attribute.md +1 -1
  56. package/docs/examples/databases/create-collection.md +1 -1
  57. package/docs/examples/databases/create-datetime-attribute.md +1 -1
  58. package/docs/examples/databases/create-document.md +1 -1
  59. package/docs/examples/databases/create-email-attribute.md +1 -1
  60. package/docs/examples/databases/create-enum-attribute.md +1 -1
  61. package/docs/examples/databases/create-float-attribute.md +1 -1
  62. package/docs/examples/databases/create-index.md +1 -1
  63. package/docs/examples/databases/create-integer-attribute.md +1 -1
  64. package/docs/examples/databases/create-ip-attribute.md +1 -1
  65. package/docs/examples/databases/create-relationship-attribute.md +1 -1
  66. package/docs/examples/databases/create-string-attribute.md +1 -1
  67. package/docs/examples/databases/create-url-attribute.md +1 -1
  68. package/docs/examples/databases/create.md +1 -1
  69. package/docs/examples/databases/delete-attribute.md +1 -1
  70. package/docs/examples/databases/delete-collection.md +1 -1
  71. package/docs/examples/databases/delete-document.md +1 -1
  72. package/docs/examples/databases/delete-index.md +1 -1
  73. package/docs/examples/databases/delete.md +1 -1
  74. package/docs/examples/databases/get-attribute.md +1 -1
  75. package/docs/examples/databases/get-collection-usage.md +1 -1
  76. package/docs/examples/databases/get-collection.md +1 -1
  77. package/docs/examples/databases/get-database-usage.md +1 -1
  78. package/docs/examples/databases/get-document.md +1 -1
  79. package/docs/examples/databases/get-index.md +1 -1
  80. package/docs/examples/databases/get-usage.md +1 -1
  81. package/docs/examples/databases/get.md +1 -1
  82. package/docs/examples/databases/list-attributes.md +1 -1
  83. package/docs/examples/databases/list-collection-logs.md +1 -1
  84. package/docs/examples/databases/list-collections.md +1 -1
  85. package/docs/examples/databases/list-document-logs.md +1 -1
  86. package/docs/examples/databases/list-documents.md +1 -1
  87. package/docs/examples/databases/list-indexes.md +1 -1
  88. package/docs/examples/databases/list-logs.md +1 -1
  89. package/docs/examples/databases/list.md +1 -1
  90. package/docs/examples/databases/update-boolean-attribute.md +1 -1
  91. package/docs/examples/databases/update-collection.md +1 -1
  92. package/docs/examples/databases/update-datetime-attribute.md +1 -1
  93. package/docs/examples/databases/update-document.md +1 -1
  94. package/docs/examples/databases/update-email-attribute.md +1 -1
  95. package/docs/examples/databases/update-enum-attribute.md +1 -1
  96. package/docs/examples/databases/update-float-attribute.md +1 -1
  97. package/docs/examples/databases/update-integer-attribute.md +1 -1
  98. package/docs/examples/databases/update-ip-attribute.md +1 -1
  99. package/docs/examples/databases/update-relationship-attribute.md +1 -1
  100. package/docs/examples/databases/update-string-attribute.md +1 -1
  101. package/docs/examples/databases/update-url-attribute.md +1 -1
  102. package/docs/examples/databases/update.md +1 -1
  103. package/docs/examples/functions/create-build.md +2 -2
  104. package/docs/examples/functions/create-deployment.md +1 -1
  105. package/docs/examples/functions/create-execution.md +3 -2
  106. package/docs/examples/functions/create-variable.md +1 -1
  107. package/docs/examples/functions/create.md +3 -3
  108. package/docs/examples/functions/delete-deployment.md +1 -1
  109. package/docs/examples/functions/delete-execution.md +14 -0
  110. package/docs/examples/functions/delete-variable.md +1 -1
  111. package/docs/examples/functions/delete.md +1 -1
  112. package/docs/examples/functions/{download-deployment.md → get-deployment-download.md} +1 -1
  113. package/docs/examples/functions/get-deployment.md +1 -1
  114. package/docs/examples/functions/get-execution.md +1 -1
  115. package/docs/examples/functions/get-function-usage.md +1 -1
  116. package/docs/examples/functions/{get-specifications.md → get-template.md} +4 -2
  117. package/docs/examples/functions/get-usage.md +1 -1
  118. package/docs/examples/functions/get-variable.md +1 -1
  119. package/docs/examples/functions/get.md +1 -1
  120. package/docs/examples/functions/list-deployments.md +1 -1
  121. package/docs/examples/functions/list-executions.md +1 -1
  122. package/docs/examples/functions/list-runtimes.md +1 -1
  123. package/docs/examples/functions/list-templates.md +16 -0
  124. package/docs/examples/functions/list-variables.md +1 -1
  125. package/docs/examples/functions/list.md +1 -1
  126. package/docs/examples/functions/update-deployment-build.md +14 -0
  127. package/docs/examples/functions/update-deployment.md +1 -1
  128. package/docs/examples/functions/update-variable.md +1 -1
  129. package/docs/examples/functions/update.md +3 -3
  130. package/docs/examples/graphql/mutation.md +1 -1
  131. package/docs/examples/graphql/query.md +1 -1
  132. package/docs/examples/health/get-antivirus.md +1 -1
  133. package/docs/examples/health/get-cache.md +1 -1
  134. package/docs/examples/health/get-certificate.md +1 -1
  135. package/docs/examples/health/get-d-b.md +1 -1
  136. package/docs/examples/health/get-failed-jobs.md +1 -1
  137. package/docs/examples/health/get-pub-sub.md +1 -1
  138. package/docs/examples/health/get-queue-builds.md +1 -1
  139. package/docs/examples/health/get-queue-certificates.md +1 -1
  140. package/docs/examples/health/get-queue-databases.md +1 -1
  141. package/docs/examples/health/get-queue-deletes.md +1 -1
  142. package/docs/examples/health/get-queue-functions.md +1 -1
  143. package/docs/examples/health/get-queue-logs.md +1 -1
  144. package/docs/examples/health/get-queue-mails.md +1 -1
  145. package/docs/examples/health/get-queue-messaging.md +1 -1
  146. package/docs/examples/health/get-queue-migrations.md +1 -1
  147. package/docs/examples/health/get-queue-usage-dump.md +1 -1
  148. package/docs/examples/health/get-queue-usage.md +1 -1
  149. package/docs/examples/health/get-queue-webhooks.md +1 -1
  150. package/docs/examples/health/get-queue.md +1 -1
  151. package/docs/examples/health/get-storage-local.md +1 -1
  152. package/docs/examples/health/get-storage.md +1 -1
  153. package/docs/examples/health/get-time.md +1 -1
  154. package/docs/examples/health/get.md +1 -1
  155. package/docs/examples/locale/get.md +1 -1
  156. package/docs/examples/locale/list-codes.md +1 -1
  157. package/docs/examples/locale/list-continents.md +1 -1
  158. package/docs/examples/locale/list-countries-e-u.md +1 -1
  159. package/docs/examples/locale/list-countries-phones.md +1 -1
  160. package/docs/examples/locale/list-countries.md +1 -1
  161. package/docs/examples/locale/list-currencies.md +1 -1
  162. package/docs/examples/locale/list-languages.md +1 -1
  163. package/docs/examples/messaging/create-apns-provider.md +1 -1
  164. package/docs/examples/messaging/create-email.md +1 -1
  165. package/docs/examples/messaging/create-fcm-provider.md +1 -1
  166. package/docs/examples/messaging/create-mailgun-provider.md +1 -1
  167. package/docs/examples/messaging/create-msg91provider.md +1 -1
  168. package/docs/examples/messaging/create-push.md +1 -1
  169. package/docs/examples/messaging/create-sendgrid-provider.md +1 -1
  170. package/docs/examples/messaging/create-sms.md +1 -1
  171. package/docs/examples/messaging/create-smtp-provider.md +1 -1
  172. package/docs/examples/messaging/create-subscriber.md +1 -1
  173. package/docs/examples/messaging/create-telesign-provider.md +1 -1
  174. package/docs/examples/messaging/create-textmagic-provider.md +1 -1
  175. package/docs/examples/messaging/create-topic.md +1 -1
  176. package/docs/examples/messaging/create-twilio-provider.md +1 -1
  177. package/docs/examples/messaging/create-vonage-provider.md +1 -1
  178. package/docs/examples/messaging/delete-provider.md +1 -1
  179. package/docs/examples/messaging/delete-subscriber.md +1 -1
  180. package/docs/examples/messaging/delete-topic.md +1 -1
  181. package/docs/examples/messaging/delete.md +1 -1
  182. package/docs/examples/messaging/get-message.md +1 -1
  183. package/docs/examples/messaging/get-provider.md +1 -1
  184. package/docs/examples/messaging/get-subscriber.md +1 -1
  185. package/docs/examples/messaging/get-topic.md +1 -1
  186. package/docs/examples/messaging/list-message-logs.md +1 -1
  187. package/docs/examples/messaging/list-messages.md +1 -1
  188. package/docs/examples/messaging/list-provider-logs.md +1 -1
  189. package/docs/examples/messaging/list-providers.md +1 -1
  190. package/docs/examples/messaging/list-subscriber-logs.md +1 -1
  191. package/docs/examples/messaging/list-subscribers.md +1 -1
  192. package/docs/examples/messaging/list-targets.md +1 -1
  193. package/docs/examples/messaging/list-topic-logs.md +1 -1
  194. package/docs/examples/messaging/list-topics.md +1 -1
  195. package/docs/examples/messaging/update-apns-provider.md +1 -1
  196. package/docs/examples/messaging/update-email.md +1 -1
  197. package/docs/examples/messaging/update-fcm-provider.md +1 -1
  198. package/docs/examples/messaging/update-mailgun-provider.md +1 -1
  199. package/docs/examples/messaging/update-msg91provider.md +1 -1
  200. package/docs/examples/messaging/update-push.md +1 -1
  201. package/docs/examples/messaging/update-sendgrid-provider.md +1 -1
  202. package/docs/examples/messaging/update-sms.md +1 -1
  203. package/docs/examples/messaging/update-smtp-provider.md +1 -1
  204. package/docs/examples/messaging/update-telesign-provider.md +1 -1
  205. package/docs/examples/messaging/update-textmagic-provider.md +1 -1
  206. package/docs/examples/messaging/update-topic.md +1 -1
  207. package/docs/examples/messaging/update-twilio-provider.md +1 -1
  208. package/docs/examples/messaging/update-vonage-provider.md +1 -1
  209. package/docs/examples/migrations/create-appwrite-migration.md +1 -1
  210. package/docs/examples/migrations/create-firebase-migration.md +1 -1
  211. package/docs/examples/migrations/create-firebase-o-auth-migration.md +1 -1
  212. package/docs/examples/migrations/create-n-host-migration.md +1 -1
  213. package/docs/examples/migrations/create-supabase-migration.md +1 -1
  214. package/docs/examples/migrations/delete-firebase-auth.md +1 -1
  215. package/docs/examples/migrations/delete.md +1 -1
  216. package/docs/examples/migrations/get-appwrite-report.md +1 -1
  217. package/docs/examples/migrations/get-firebase-report-o-auth.md +1 -1
  218. package/docs/examples/migrations/get-firebase-report.md +1 -1
  219. package/docs/examples/migrations/get-n-host-report.md +1 -1
  220. package/docs/examples/migrations/get-supabase-report.md +1 -1
  221. package/docs/examples/migrations/get.md +1 -1
  222. package/docs/examples/migrations/list-firebase-projects.md +1 -1
  223. package/docs/examples/migrations/list.md +1 -1
  224. package/docs/examples/migrations/retry.md +1 -1
  225. package/docs/examples/project/create-variable.md +1 -1
  226. package/docs/examples/project/delete-variable.md +1 -1
  227. package/docs/examples/project/get-usage.md +1 -1
  228. package/docs/examples/project/get-variable.md +1 -1
  229. package/docs/examples/project/list-variables.md +1 -1
  230. package/docs/examples/project/update-variable.md +1 -1
  231. package/docs/examples/projects/create-j-w-t.md +15 -0
  232. package/docs/examples/projects/create-key.md +1 -1
  233. package/docs/examples/projects/create-platform.md +1 -1
  234. package/docs/examples/projects/create-smtp-test.md +1 -1
  235. package/docs/examples/projects/create-webhook.md +1 -1
  236. package/docs/examples/projects/create.md +1 -1
  237. package/docs/examples/projects/delete-email-template.md +1 -1
  238. package/docs/examples/projects/delete-key.md +1 -1
  239. package/docs/examples/projects/delete-platform.md +1 -1
  240. package/docs/examples/projects/delete-sms-template.md +1 -1
  241. package/docs/examples/projects/delete-webhook.md +1 -1
  242. package/docs/examples/projects/delete.md +1 -1
  243. package/docs/examples/projects/get-email-template.md +1 -1
  244. package/docs/examples/projects/get-key.md +1 -1
  245. package/docs/examples/projects/get-platform.md +1 -1
  246. package/docs/examples/projects/get-sms-template.md +1 -1
  247. package/docs/examples/projects/get-webhook.md +1 -1
  248. package/docs/examples/projects/get.md +1 -1
  249. package/docs/examples/projects/list-keys.md +1 -1
  250. package/docs/examples/projects/list-platforms.md +1 -1
  251. package/docs/examples/projects/list-webhooks.md +1 -1
  252. package/docs/examples/projects/list.md +1 -1
  253. package/docs/examples/projects/update-api-status-all.md +1 -1
  254. package/docs/examples/projects/update-api-status.md +1 -1
  255. package/docs/examples/projects/update-auth-duration.md +1 -1
  256. package/docs/examples/projects/update-auth-limit.md +1 -1
  257. package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
  258. package/docs/examples/projects/update-auth-password-history.md +1 -1
  259. package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
  260. package/docs/examples/projects/update-auth-status.md +1 -1
  261. package/docs/examples/projects/update-email-template.md +1 -1
  262. package/docs/examples/projects/update-key.md +1 -1
  263. package/docs/examples/projects/update-mock-numbers.md +14 -0
  264. package/docs/examples/projects/update-o-auth2.md +1 -1
  265. package/docs/examples/projects/update-personal-data-check.md +1 -1
  266. package/docs/examples/projects/update-platform.md +1 -1
  267. package/docs/examples/projects/update-service-status-all.md +1 -1
  268. package/docs/examples/projects/update-service-status.md +1 -1
  269. package/docs/examples/projects/update-session-alerts.md +14 -0
  270. package/docs/examples/projects/update-sms-template.md +1 -1
  271. package/docs/examples/projects/update-smtp.md +1 -1
  272. package/docs/examples/projects/update-team.md +1 -1
  273. package/docs/examples/projects/update-webhook-signature.md +1 -1
  274. package/docs/examples/projects/update-webhook.md +1 -1
  275. package/docs/examples/projects/update.md +1 -1
  276. package/docs/examples/proxy/create-rule.md +1 -1
  277. package/docs/examples/proxy/delete-rule.md +1 -1
  278. package/docs/examples/proxy/get-rule.md +1 -1
  279. package/docs/examples/proxy/list-rules.md +1 -1
  280. package/docs/examples/proxy/update-rule-verification.md +1 -1
  281. package/docs/examples/storage/create-bucket.md +1 -1
  282. package/docs/examples/storage/create-file.md +1 -1
  283. package/docs/examples/storage/delete-bucket.md +1 -1
  284. package/docs/examples/storage/delete-file.md +1 -1
  285. package/docs/examples/storage/get-bucket-usage.md +1 -1
  286. package/docs/examples/storage/get-bucket.md +1 -1
  287. package/docs/examples/storage/get-file.md +1 -1
  288. package/docs/examples/storage/get-usage.md +1 -1
  289. package/docs/examples/storage/list-buckets.md +1 -1
  290. package/docs/examples/storage/list-files.md +1 -1
  291. package/docs/examples/storage/update-bucket.md +1 -1
  292. package/docs/examples/storage/update-file.md +1 -1
  293. package/docs/examples/teams/create-membership.md +1 -1
  294. package/docs/examples/teams/create.md +1 -1
  295. package/docs/examples/teams/delete-membership.md +1 -1
  296. package/docs/examples/teams/delete.md +1 -1
  297. package/docs/examples/teams/get-membership.md +1 -1
  298. package/docs/examples/teams/get-prefs.md +1 -1
  299. package/docs/examples/teams/get.md +1 -1
  300. package/docs/examples/teams/list-logs.md +1 -1
  301. package/docs/examples/teams/list-memberships.md +1 -1
  302. package/docs/examples/teams/list.md +1 -1
  303. package/docs/examples/teams/update-membership-status.md +1 -1
  304. package/docs/examples/teams/update-membership.md +1 -1
  305. package/docs/examples/teams/update-name.md +1 -1
  306. package/docs/examples/teams/update-prefs.md +1 -1
  307. package/docs/examples/users/create-argon2user.md +1 -1
  308. package/docs/examples/users/create-bcrypt-user.md +1 -1
  309. package/docs/examples/users/create-j-w-t.md +15 -0
  310. package/docs/examples/users/create-m-d5user.md +1 -1
  311. package/docs/examples/users/create-mfa-recovery-codes.md +1 -1
  312. package/docs/examples/users/create-p-h-pass-user.md +1 -1
  313. package/docs/examples/users/create-s-h-a-user.md +1 -1
  314. package/docs/examples/users/create-scrypt-modified-user.md +1 -1
  315. package/docs/examples/users/create-scrypt-user.md +1 -1
  316. package/docs/examples/users/create-session.md +1 -1
  317. package/docs/examples/users/create-target.md +1 -1
  318. package/docs/examples/users/create-token.md +1 -1
  319. package/docs/examples/users/create.md +1 -1
  320. package/docs/examples/users/delete-identity.md +1 -1
  321. package/docs/examples/users/delete-mfa-authenticator.md +1 -1
  322. package/docs/examples/users/delete-session.md +1 -1
  323. package/docs/examples/users/delete-sessions.md +1 -1
  324. package/docs/examples/users/delete-target.md +1 -1
  325. package/docs/examples/users/delete.md +1 -1
  326. package/docs/examples/users/get-mfa-recovery-codes.md +1 -1
  327. package/docs/examples/users/get-prefs.md +1 -1
  328. package/docs/examples/users/get-target.md +1 -1
  329. package/docs/examples/users/get-usage.md +1 -1
  330. package/docs/examples/users/get.md +1 -1
  331. package/docs/examples/users/list-identities.md +1 -1
  332. package/docs/examples/users/list-logs.md +1 -1
  333. package/docs/examples/users/list-memberships.md +1 -1
  334. package/docs/examples/users/list-mfa-factors.md +1 -1
  335. package/docs/examples/users/list-sessions.md +1 -1
  336. package/docs/examples/users/list-targets.md +1 -1
  337. package/docs/examples/users/list.md +1 -1
  338. package/docs/examples/users/update-email-verification.md +1 -1
  339. package/docs/examples/users/update-email.md +1 -1
  340. package/docs/examples/users/update-labels.md +1 -1
  341. package/docs/examples/users/update-mfa-recovery-codes.md +1 -1
  342. package/docs/examples/users/update-mfa.md +1 -1
  343. package/docs/examples/users/update-name.md +1 -1
  344. package/docs/examples/users/update-password.md +1 -1
  345. package/docs/examples/users/update-phone-verification.md +1 -1
  346. package/docs/examples/users/update-phone.md +1 -1
  347. package/docs/examples/users/update-prefs.md +1 -1
  348. package/docs/examples/users/update-status.md +1 -1
  349. package/docs/examples/users/update-target.md +1 -1
  350. package/docs/examples/vcs/create-repository-detection.md +1 -1
  351. package/docs/examples/vcs/create-repository.md +1 -1
  352. package/docs/examples/vcs/delete-installation.md +1 -1
  353. package/docs/examples/vcs/get-installation.md +1 -1
  354. package/docs/examples/vcs/get-repository-contents.md +15 -0
  355. package/docs/examples/vcs/get-repository.md +1 -1
  356. package/docs/examples/vcs/list-installations.md +1 -1
  357. package/docs/examples/vcs/list-repositories.md +1 -1
  358. package/docs/examples/vcs/list-repository-branches.md +1 -1
  359. package/docs/examples/vcs/update-external-deployments.md +1 -1
  360. package/package.json +1 -1
  361. package/src/client.ts +124 -66
  362. package/src/enums/email-template-type.ts +2 -0
  363. package/src/enums/platform-type.ts +2 -0
  364. package/src/enums/runtime.ts +1 -0
  365. package/src/index.ts +1 -1
  366. package/src/models.ts +230 -28
  367. package/src/services/account.ts +651 -644
  368. package/src/services/assistant.ts +19 -16
  369. package/src/services/avatars.ts +111 -152
  370. package/src/services/console.ts +19 -14
  371. package/src/services/databases.ts +628 -638
  372. package/src/services/functions.ts +435 -339
  373. package/src/services/graphql.ts +31 -24
  374. package/src/services/health.ts +299 -199
  375. package/src/services/locale.ts +113 -77
  376. package/src/services/messaging.ts +568 -583
  377. package/src/services/migrations.ts +199 -197
  378. package/src/services/project.ts +82 -65
  379. package/src/services/projects.ts +615 -459
  380. package/src/services/proxy.ts +68 -50
  381. package/src/services/storage.ts +198 -253
  382. package/src/services/teams.ts +198 -188
  383. package/src/services/users.ts +568 -478
  384. package/src/services/vcs.ts +149 -83
  385. package/types/client.d.ts +13 -17
  386. package/types/enums/email-template-type.d.ts +3 -1
  387. package/types/enums/platform-type.d.ts +3 -1
  388. package/types/enums/runtime.d.ts +2 -1
  389. package/types/index.d.ts +1 -1
  390. package/types/models.d.ts +230 -28
  391. package/types/services/account.d.ts +162 -317
  392. package/types/services/assistant.d.ts +4 -4
  393. package/types/services/avatars.d.ts +50 -84
  394. package/types/services/console.d.ts +4 -4
  395. package/types/services/databases.d.ts +143 -173
  396. package/types/services/functions.d.ts +112 -97
  397. package/types/services/graphql.d.ts +6 -6
  398. package/types/services/health.d.ts +64 -85
  399. package/types/services/locale.d.ts +28 -39
  400. package/types/services/messaging.d.ts +103 -104
  401. package/types/services/migrations.d.ts +34 -34
  402. package/types/services/project.d.ts +17 -20
  403. package/types/services/projects.d.ts +118 -87
  404. package/types/services/proxy.d.ts +13 -14
  405. package/types/services/storage.d.ts +53 -78
  406. package/types/services/teams.d.ts +53 -83
  407. package/types/services/users.d.ts +120 -157
  408. package/types/services/vcs.d.ts +31 -20
@@ -1,87 +1,87 @@
1
- import { Service } from '../service';
2
- import { AppwriteException, Client } from '../client';
1
+ import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
3
2
  import type { Models } from '../models';
4
- import type { UploadProgress, Payload } from '../client';
5
3
 
6
- export class Teams extends Service {
4
+ export class Teams {
5
+ client: Client;
7
6
 
8
- constructor(client: Client)
9
- {
10
- super(client);
11
- }
7
+ constructor(client: Client) {
8
+ this.client = client;
9
+ }
12
10
 
13
11
  /**
14
12
  * List teams
15
13
  *
16
- * Get a list of all the teams in which the current user is a member. You can
17
- * use the parameters to filter your results.
14
+ * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
18
15
  *
19
16
  * @param {string[]} queries
20
17
  * @param {string} search
21
18
  * @throws {AppwriteException}
22
- * @returns {Promise}
23
- */
19
+ * @returns {Promise<Models.TeamList<Preferences>>}
20
+ */
24
21
  async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {
25
22
  const apiPath = '/teams';
26
23
  const payload: Payload = {};
27
-
28
24
  if (typeof queries !== 'undefined') {
29
25
  payload['queries'] = queries;
30
26
  }
31
-
32
27
  if (typeof search !== 'undefined') {
33
28
  payload['search'] = search;
34
29
  }
35
-
36
30
  const uri = new URL(this.client.config.endpoint + apiPath);
37
- return await this.client.call('get', uri, {
31
+
32
+ const apiHeaders: { [header: string]: string } = {
38
33
  'content-type': 'application/json',
39
- }, payload);
40
- }
34
+ }
41
35
 
36
+ return await this.client.call(
37
+ 'get',
38
+ uri,
39
+ apiHeaders,
40
+ payload
41
+ );
42
+ }
42
43
  /**
43
44
  * Create team
44
45
  *
45
- * Create a new team. The user who creates the team will automatically be
46
- * assigned as the owner of the team. Only the users with the owner role can
47
- * invite new members, add new owners and delete or update the team.
46
+ * Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
48
47
  *
49
48
  * @param {string} teamId
50
49
  * @param {string} name
51
50
  * @param {string[]} roles
52
51
  * @throws {AppwriteException}
53
- * @returns {Promise}
54
- */
52
+ * @returns {Promise<Models.Team<Preferences>>}
53
+ */
55
54
  async create<Preferences extends Models.Preferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>> {
56
55
  if (typeof teamId === 'undefined') {
57
56
  throw new AppwriteException('Missing required parameter: "teamId"');
58
57
  }
59
-
60
58
  if (typeof name === 'undefined') {
61
59
  throw new AppwriteException('Missing required parameter: "name"');
62
60
  }
63
-
64
61
  const apiPath = '/teams';
65
62
  const payload: Payload = {};
66
-
67
63
  if (typeof teamId !== 'undefined') {
68
64
  payload['teamId'] = teamId;
69
65
  }
70
-
71
66
  if (typeof name !== 'undefined') {
72
67
  payload['name'] = name;
73
68
  }
74
-
75
69
  if (typeof roles !== 'undefined') {
76
70
  payload['roles'] = roles;
77
71
  }
78
-
79
72
  const uri = new URL(this.client.config.endpoint + apiPath);
80
- return await this.client.call('post', uri, {
73
+
74
+ const apiHeaders: { [header: string]: string } = {
81
75
  'content-type': 'application/json',
82
- }, payload);
83
- }
76
+ }
84
77
 
78
+ return await this.client.call(
79
+ 'post',
80
+ uri,
81
+ apiHeaders,
82
+ payload
83
+ );
84
+ }
85
85
  /**
86
86
  * Get team
87
87
  *
@@ -89,78 +89,90 @@ export class Teams extends Service {
89
89
  *
90
90
  * @param {string} teamId
91
91
  * @throws {AppwriteException}
92
- * @returns {Promise}
93
- */
92
+ * @returns {Promise<Models.Team<Preferences>>}
93
+ */
94
94
  async get<Preferences extends Models.Preferences>(teamId: string): Promise<Models.Team<Preferences>> {
95
95
  if (typeof teamId === 'undefined') {
96
96
  throw new AppwriteException('Missing required parameter: "teamId"');
97
97
  }
98
-
99
98
  const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
100
99
  const payload: Payload = {};
101
-
102
100
  const uri = new URL(this.client.config.endpoint + apiPath);
103
- return await this.client.call('get', uri, {
101
+
102
+ const apiHeaders: { [header: string]: string } = {
104
103
  'content-type': 'application/json',
105
- }, payload);
106
- }
104
+ }
107
105
 
106
+ return await this.client.call(
107
+ 'get',
108
+ uri,
109
+ apiHeaders,
110
+ payload
111
+ );
112
+ }
108
113
  /**
109
114
  * Update name
110
115
  *
111
- * Update the team's name by its unique ID.
116
+ * Update the team&#039;s name by its unique ID.
112
117
  *
113
118
  * @param {string} teamId
114
119
  * @param {string} name
115
120
  * @throws {AppwriteException}
116
- * @returns {Promise}
117
- */
121
+ * @returns {Promise<Models.Team<Preferences>>}
122
+ */
118
123
  async updateName<Preferences extends Models.Preferences>(teamId: string, name: string): Promise<Models.Team<Preferences>> {
119
124
  if (typeof teamId === 'undefined') {
120
125
  throw new AppwriteException('Missing required parameter: "teamId"');
121
126
  }
122
-
123
127
  if (typeof name === 'undefined') {
124
128
  throw new AppwriteException('Missing required parameter: "name"');
125
129
  }
126
-
127
130
  const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
128
131
  const payload: Payload = {};
129
-
130
132
  if (typeof name !== 'undefined') {
131
133
  payload['name'] = name;
132
134
  }
133
-
134
135
  const uri = new URL(this.client.config.endpoint + apiPath);
135
- return await this.client.call('put', uri, {
136
+
137
+ const apiHeaders: { [header: string]: string } = {
136
138
  'content-type': 'application/json',
137
- }, payload);
138
- }
139
+ }
139
140
 
141
+ return await this.client.call(
142
+ 'put',
143
+ uri,
144
+ apiHeaders,
145
+ payload
146
+ );
147
+ }
140
148
  /**
141
149
  * Delete team
142
150
  *
143
- * Delete a team using its ID. Only team members with the owner role can
144
- * delete the team.
151
+ * Delete a team using its ID. Only team members with the owner role can delete the team.
145
152
  *
146
153
  * @param {string} teamId
147
154
  * @throws {AppwriteException}
148
- * @returns {Promise}
149
- */
155
+ * @returns {Promise<{}>}
156
+ */
150
157
  async delete(teamId: string): Promise<{}> {
151
158
  if (typeof teamId === 'undefined') {
152
159
  throw new AppwriteException('Missing required parameter: "teamId"');
153
160
  }
154
-
155
161
  const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
156
162
  const payload: Payload = {};
157
-
158
163
  const uri = new URL(this.client.config.endpoint + apiPath);
159
- return await this.client.call('delete', uri, {
164
+
165
+ const apiHeaders: { [header: string]: string } = {
160
166
  'content-type': 'application/json',
161
- }, payload);
162
- }
167
+ }
163
168
 
169
+ return await this.client.call(
170
+ 'delete',
171
+ uri,
172
+ apiHeaders,
173
+ payload
174
+ );
175
+ }
164
176
  /**
165
177
  * List team logs
166
178
  *
@@ -169,84 +181,77 @@ export class Teams extends Service {
169
181
  * @param {string} teamId
170
182
  * @param {string[]} queries
171
183
  * @throws {AppwriteException}
172
- * @returns {Promise}
173
- */
184
+ * @returns {Promise<Models.LogList>}
185
+ */
174
186
  async listLogs(teamId: string, queries?: string[]): Promise<Models.LogList> {
175
187
  if (typeof teamId === 'undefined') {
176
188
  throw new AppwriteException('Missing required parameter: "teamId"');
177
189
  }
178
-
179
190
  const apiPath = '/teams/{teamId}/logs'.replace('{teamId}', teamId);
180
191
  const payload: Payload = {};
181
-
182
192
  if (typeof queries !== 'undefined') {
183
193
  payload['queries'] = queries;
184
194
  }
185
-
186
195
  const uri = new URL(this.client.config.endpoint + apiPath);
187
- return await this.client.call('get', uri, {
196
+
197
+ const apiHeaders: { [header: string]: string } = {
188
198
  'content-type': 'application/json',
189
- }, payload);
190
- }
199
+ }
191
200
 
201
+ return await this.client.call(
202
+ 'get',
203
+ uri,
204
+ apiHeaders,
205
+ payload
206
+ );
207
+ }
192
208
  /**
193
209
  * List team memberships
194
210
  *
195
- * Use this endpoint to list a team's members using the team's ID. All team
196
- * members have read access to this endpoint.
211
+ * Use this endpoint to list a team&#039;s members using the team&#039;s ID. All team members have read access to this endpoint.
197
212
  *
198
213
  * @param {string} teamId
199
214
  * @param {string[]} queries
200
215
  * @param {string} search
201
216
  * @throws {AppwriteException}
202
- * @returns {Promise}
203
- */
217
+ * @returns {Promise<Models.MembershipList>}
218
+ */
204
219
  async listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList> {
205
220
  if (typeof teamId === 'undefined') {
206
221
  throw new AppwriteException('Missing required parameter: "teamId"');
207
222
  }
208
-
209
223
  const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
210
224
  const payload: Payload = {};
211
-
212
225
  if (typeof queries !== 'undefined') {
213
226
  payload['queries'] = queries;
214
227
  }
215
-
216
228
  if (typeof search !== 'undefined') {
217
229
  payload['search'] = search;
218
230
  }
219
-
220
231
  const uri = new URL(this.client.config.endpoint + apiPath);
221
- return await this.client.call('get', uri, {
232
+
233
+ const apiHeaders: { [header: string]: string } = {
222
234
  'content-type': 'application/json',
223
- }, payload);
224
- }
235
+ }
225
236
 
237
+ return await this.client.call(
238
+ 'get',
239
+ uri,
240
+ apiHeaders,
241
+ payload
242
+ );
243
+ }
226
244
  /**
227
245
  * Create team membership
228
246
  *
229
- * Invite a new member to join your team. Provide an ID for existing users, or
230
- * invite unregistered users using an email or phone number. If initiated from
231
- * a Client SDK, Appwrite will send an email or sms with a link to join the
232
- * team to the invited user, and an account will be created for them if one
233
- * doesn't exist. If initiated from a Server SDK, the new member will be added
234
- * automatically to the team.
235
- *
236
- * You only need to provide one of a user ID, email, or phone number. Appwrite
237
- * will prioritize accepting the user ID > email > phone number if you provide
238
- * more than one of these parameters.
239
- *
240
- * Use the `url` parameter to redirect the user from the invitation email to
241
- * your app. After the user is redirected, use the [Update Team Membership
242
- * Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus)
243
- * endpoint to allow the user to accept the invitation to the team.
244
- *
245
- * Please note that to avoid a [Redirect
246
- * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
247
- * Appwrite will accept the only redirect URLs under the domains you have
248
- * added as a platform on the Appwrite Console.
249
- *
247
+ * Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn&#039;t exist. If initiated from a Server SDK, the new member will be added automatically to the team.
248
+
249
+ You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID &gt; email &gt; phone number if you provide more than one of these parameters.
250
+
251
+ Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
252
+
253
+ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
254
+
250
255
  *
251
256
  * @param {string} teamId
252
257
  * @param {string[]} roles
@@ -256,257 +261,262 @@ export class Teams extends Service {
256
261
  * @param {string} url
257
262
  * @param {string} name
258
263
  * @throws {AppwriteException}
259
- * @returns {Promise}
260
- */
264
+ * @returns {Promise<Models.Membership>}
265
+ */
261
266
  async createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership> {
262
267
  if (typeof teamId === 'undefined') {
263
268
  throw new AppwriteException('Missing required parameter: "teamId"');
264
269
  }
265
-
266
270
  if (typeof roles === 'undefined') {
267
271
  throw new AppwriteException('Missing required parameter: "roles"');
268
272
  }
269
-
270
273
  const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
271
274
  const payload: Payload = {};
272
-
273
275
  if (typeof email !== 'undefined') {
274
276
  payload['email'] = email;
275
277
  }
276
-
277
278
  if (typeof userId !== 'undefined') {
278
279
  payload['userId'] = userId;
279
280
  }
280
-
281
281
  if (typeof phone !== 'undefined') {
282
282
  payload['phone'] = phone;
283
283
  }
284
-
285
284
  if (typeof roles !== 'undefined') {
286
285
  payload['roles'] = roles;
287
286
  }
288
-
289
287
  if (typeof url !== 'undefined') {
290
288
  payload['url'] = url;
291
289
  }
292
-
293
290
  if (typeof name !== 'undefined') {
294
291
  payload['name'] = name;
295
292
  }
296
-
297
293
  const uri = new URL(this.client.config.endpoint + apiPath);
298
- return await this.client.call('post', uri, {
294
+
295
+ const apiHeaders: { [header: string]: string } = {
299
296
  'content-type': 'application/json',
300
- }, payload);
301
- }
297
+ }
302
298
 
299
+ return await this.client.call(
300
+ 'post',
301
+ uri,
302
+ apiHeaders,
303
+ payload
304
+ );
305
+ }
303
306
  /**
304
307
  * Get team membership
305
308
  *
306
- * Get a team member by the membership unique id. All team members have read
307
- * access for this resource.
309
+ * Get a team member by the membership unique id. All team members have read access for this resource.
308
310
  *
309
311
  * @param {string} teamId
310
312
  * @param {string} membershipId
311
313
  * @throws {AppwriteException}
312
- * @returns {Promise}
313
- */
314
+ * @returns {Promise<Models.Membership>}
315
+ */
314
316
  async getMembership(teamId: string, membershipId: string): Promise<Models.Membership> {
315
317
  if (typeof teamId === 'undefined') {
316
318
  throw new AppwriteException('Missing required parameter: "teamId"');
317
319
  }
318
-
319
320
  if (typeof membershipId === 'undefined') {
320
321
  throw new AppwriteException('Missing required parameter: "membershipId"');
321
322
  }
322
-
323
323
  const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
324
324
  const payload: Payload = {};
325
-
326
325
  const uri = new URL(this.client.config.endpoint + apiPath);
327
- return await this.client.call('get', uri, {
326
+
327
+ const apiHeaders: { [header: string]: string } = {
328
328
  'content-type': 'application/json',
329
- }, payload);
330
- }
329
+ }
331
330
 
331
+ return await this.client.call(
332
+ 'get',
333
+ uri,
334
+ apiHeaders,
335
+ payload
336
+ );
337
+ }
332
338
  /**
333
339
  * Update membership
334
340
  *
335
- * Modify the roles of a team member. Only team members with the owner role
336
- * have access to this endpoint. Learn more about [roles and
337
- * permissions](https://appwrite.io/docs/permissions).
338
- *
341
+ * Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
342
+
339
343
  *
340
344
  * @param {string} teamId
341
345
  * @param {string} membershipId
342
346
  * @param {string[]} roles
343
347
  * @throws {AppwriteException}
344
- * @returns {Promise}
345
- */
348
+ * @returns {Promise<Models.Membership>}
349
+ */
346
350
  async updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership> {
347
351
  if (typeof teamId === 'undefined') {
348
352
  throw new AppwriteException('Missing required parameter: "teamId"');
349
353
  }
350
-
351
354
  if (typeof membershipId === 'undefined') {
352
355
  throw new AppwriteException('Missing required parameter: "membershipId"');
353
356
  }
354
-
355
357
  if (typeof roles === 'undefined') {
356
358
  throw new AppwriteException('Missing required parameter: "roles"');
357
359
  }
358
-
359
360
  const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
360
361
  const payload: Payload = {};
361
-
362
362
  if (typeof roles !== 'undefined') {
363
363
  payload['roles'] = roles;
364
364
  }
365
-
366
365
  const uri = new URL(this.client.config.endpoint + apiPath);
367
- return await this.client.call('patch', uri, {
366
+
367
+ const apiHeaders: { [header: string]: string } = {
368
368
  'content-type': 'application/json',
369
- }, payload);
370
- }
369
+ }
371
370
 
371
+ return await this.client.call(
372
+ 'patch',
373
+ uri,
374
+ apiHeaders,
375
+ payload
376
+ );
377
+ }
372
378
  /**
373
379
  * Delete team membership
374
380
  *
375
- * This endpoint allows a user to leave a team or for a team owner to delete
376
- * the membership of any other team member. You can also use this endpoint to
377
- * delete a user membership even if it is not accepted.
381
+ * This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
378
382
  *
379
383
  * @param {string} teamId
380
384
  * @param {string} membershipId
381
385
  * @throws {AppwriteException}
382
- * @returns {Promise}
383
- */
386
+ * @returns {Promise<{}>}
387
+ */
384
388
  async deleteMembership(teamId: string, membershipId: string): Promise<{}> {
385
389
  if (typeof teamId === 'undefined') {
386
390
  throw new AppwriteException('Missing required parameter: "teamId"');
387
391
  }
388
-
389
392
  if (typeof membershipId === 'undefined') {
390
393
  throw new AppwriteException('Missing required parameter: "membershipId"');
391
394
  }
392
-
393
395
  const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
394
396
  const payload: Payload = {};
395
-
396
397
  const uri = new URL(this.client.config.endpoint + apiPath);
397
- return await this.client.call('delete', uri, {
398
+
399
+ const apiHeaders: { [header: string]: string } = {
398
400
  'content-type': 'application/json',
399
- }, payload);
400
- }
401
+ }
401
402
 
403
+ return await this.client.call(
404
+ 'delete',
405
+ uri,
406
+ apiHeaders,
407
+ payload
408
+ );
409
+ }
402
410
  /**
403
411
  * Update team membership status
404
412
  *
405
- * Use this endpoint to allow a user to accept an invitation to join a team
406
- * after being redirected back to your app from the invitation email received
407
- * by the user.
408
- *
409
- * If the request is successful, a session for the user is automatically
410
- * created.
411
- *
413
+ * Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
414
+
415
+ If the request is successful, a session for the user is automatically created.
416
+
412
417
  *
413
418
  * @param {string} teamId
414
419
  * @param {string} membershipId
415
420
  * @param {string} userId
416
421
  * @param {string} secret
417
422
  * @throws {AppwriteException}
418
- * @returns {Promise}
419
- */
423
+ * @returns {Promise<Models.Membership>}
424
+ */
420
425
  async updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership> {
421
426
  if (typeof teamId === 'undefined') {
422
427
  throw new AppwriteException('Missing required parameter: "teamId"');
423
428
  }
424
-
425
429
  if (typeof membershipId === 'undefined') {
426
430
  throw new AppwriteException('Missing required parameter: "membershipId"');
427
431
  }
428
-
429
432
  if (typeof userId === 'undefined') {
430
433
  throw new AppwriteException('Missing required parameter: "userId"');
431
434
  }
432
-
433
435
  if (typeof secret === 'undefined') {
434
436
  throw new AppwriteException('Missing required parameter: "secret"');
435
437
  }
436
-
437
438
  const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
438
439
  const payload: Payload = {};
439
-
440
440
  if (typeof userId !== 'undefined') {
441
441
  payload['userId'] = userId;
442
442
  }
443
-
444
443
  if (typeof secret !== 'undefined') {
445
444
  payload['secret'] = secret;
446
445
  }
447
-
448
446
  const uri = new URL(this.client.config.endpoint + apiPath);
449
- return await this.client.call('patch', uri, {
447
+
448
+ const apiHeaders: { [header: string]: string } = {
450
449
  'content-type': 'application/json',
451
- }, payload);
452
- }
450
+ }
453
451
 
452
+ return await this.client.call(
453
+ 'patch',
454
+ uri,
455
+ apiHeaders,
456
+ payload
457
+ );
458
+ }
454
459
  /**
455
460
  * Get team preferences
456
461
  *
457
- * Get the team's shared preferences by its unique ID. If a preference doesn't
458
- * need to be shared by all team members, prefer storing them in [user
459
- * preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
462
+ * Get the team&#039;s shared preferences by its unique ID. If a preference doesn&#039;t need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
460
463
  *
461
464
  * @param {string} teamId
462
465
  * @throws {AppwriteException}
463
- * @returns {Promise}
464
- */
466
+ * @returns {Promise<Preferences>}
467
+ */
465
468
  async getPrefs<Preferences extends Models.Preferences>(teamId: string): Promise<Preferences> {
466
469
  if (typeof teamId === 'undefined') {
467
470
  throw new AppwriteException('Missing required parameter: "teamId"');
468
471
  }
469
-
470
472
  const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
471
473
  const payload: Payload = {};
472
-
473
474
  const uri = new URL(this.client.config.endpoint + apiPath);
474
- return await this.client.call('get', uri, {
475
+
476
+ const apiHeaders: { [header: string]: string } = {
475
477
  'content-type': 'application/json',
476
- }, payload);
477
- }
478
+ }
478
479
 
480
+ return await this.client.call(
481
+ 'get',
482
+ uri,
483
+ apiHeaders,
484
+ payload
485
+ );
486
+ }
479
487
  /**
480
488
  * Update preferences
481
489
  *
482
- * Update the team's preferences by its unique ID. The object you pass is
483
- * stored as is and replaces any previous value. The maximum allowed prefs
484
- * size is 64kB and throws an error if exceeded.
490
+ * Update the team&#039;s 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 an error if exceeded.
485
491
  *
486
492
  * @param {string} teamId
487
493
  * @param {object} prefs
488
494
  * @throws {AppwriteException}
489
- * @returns {Promise}
490
- */
495
+ * @returns {Promise<Preferences>}
496
+ */
491
497
  async updatePrefs<Preferences extends Models.Preferences>(teamId: string, prefs: object): Promise<Preferences> {
492
498
  if (typeof teamId === 'undefined') {
493
499
  throw new AppwriteException('Missing required parameter: "teamId"');
494
500
  }
495
-
496
501
  if (typeof prefs === 'undefined') {
497
502
  throw new AppwriteException('Missing required parameter: "prefs"');
498
503
  }
499
-
500
504
  const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
501
505
  const payload: Payload = {};
502
-
503
506
  if (typeof prefs !== 'undefined') {
504
507
  payload['prefs'] = prefs;
505
508
  }
506
-
507
509
  const uri = new URL(this.client.config.endpoint + apiPath);
508
- return await this.client.call('put', uri, {
510
+
511
+ const apiHeaders: { [header: string]: string } = {
509
512
  'content-type': 'application/json',
510
- }, payload);
513
+ }
514
+
515
+ return await this.client.call(
516
+ 'put',
517
+ uri,
518
+ apiHeaders,
519
+ payload
520
+ );
511
521
  }
512
- };
522
+ }