@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,7 +1,5 @@
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
  import { Region } from '../enums/region';
6
4
  import { Api } from '../enums/api';
7
5
  import { AuthMethod } from '../enums/auth-method';
@@ -14,12 +12,12 @@ import { EmailTemplateLocale } from '../enums/email-template-locale';
14
12
  import { SmsTemplateType } from '../enums/sms-template-type';
15
13
  import { SmsTemplateLocale } from '../enums/sms-template-locale';
16
14
 
17
- export class Projects extends Service {
15
+ export class Projects {
16
+ client: Client;
18
17
 
19
- constructor(client: Client)
20
- {
21
- super(client);
22
- }
18
+ constructor(client: Client) {
19
+ this.client = client;
20
+ }
23
21
 
24
22
  /**
25
23
  * List projects
@@ -28,26 +26,30 @@ export class Projects extends Service {
28
26
  * @param {string[]} queries
29
27
  * @param {string} search
30
28
  * @throws {AppwriteException}
31
- * @returns {Promise}
32
- */
29
+ * @returns {Promise<Models.ProjectList>}
30
+ */
33
31
  async list(queries?: string[], search?: string): Promise<Models.ProjectList> {
34
32
  const apiPath = '/projects';
35
33
  const payload: Payload = {};
36
-
37
34
  if (typeof queries !== 'undefined') {
38
35
  payload['queries'] = queries;
39
36
  }
40
-
41
37
  if (typeof search !== 'undefined') {
42
38
  payload['search'] = search;
43
39
  }
44
-
45
40
  const uri = new URL(this.client.config.endpoint + apiPath);
46
- return await this.client.call('get', uri, {
41
+
42
+ const apiHeaders: { [header: string]: string } = {
47
43
  'content-type': 'application/json',
48
- }, payload);
49
- }
44
+ }
50
45
 
46
+ return await this.client.call(
47
+ 'get',
48
+ uri,
49
+ apiHeaders,
50
+ payload
51
+ );
52
+ }
51
53
  /**
52
54
  * Create project
53
55
  *
@@ -66,104 +68,99 @@ export class Projects extends Service {
66
68
  * @param {string} legalAddress
67
69
  * @param {string} legalTaxId
68
70
  * @throws {AppwriteException}
69
- * @returns {Promise}
70
- */
71
+ * @returns {Promise<Models.Project>}
72
+ */
71
73
  async create(projectId: string, name: string, teamId: string, region?: Region, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project> {
72
74
  if (typeof projectId === 'undefined') {
73
75
  throw new AppwriteException('Missing required parameter: "projectId"');
74
76
  }
75
-
76
77
  if (typeof name === 'undefined') {
77
78
  throw new AppwriteException('Missing required parameter: "name"');
78
79
  }
79
-
80
80
  if (typeof teamId === 'undefined') {
81
81
  throw new AppwriteException('Missing required parameter: "teamId"');
82
82
  }
83
-
84
83
  const apiPath = '/projects';
85
84
  const payload: Payload = {};
86
-
87
85
  if (typeof projectId !== 'undefined') {
88
86
  payload['projectId'] = projectId;
89
87
  }
90
-
91
88
  if (typeof name !== 'undefined') {
92
89
  payload['name'] = name;
93
90
  }
94
-
95
91
  if (typeof teamId !== 'undefined') {
96
92
  payload['teamId'] = teamId;
97
93
  }
98
-
99
94
  if (typeof region !== 'undefined') {
100
95
  payload['region'] = region;
101
96
  }
102
-
103
97
  if (typeof description !== 'undefined') {
104
98
  payload['description'] = description;
105
99
  }
106
-
107
100
  if (typeof logo !== 'undefined') {
108
101
  payload['logo'] = logo;
109
102
  }
110
-
111
103
  if (typeof url !== 'undefined') {
112
104
  payload['url'] = url;
113
105
  }
114
-
115
106
  if (typeof legalName !== 'undefined') {
116
107
  payload['legalName'] = legalName;
117
108
  }
118
-
119
109
  if (typeof legalCountry !== 'undefined') {
120
110
  payload['legalCountry'] = legalCountry;
121
111
  }
122
-
123
112
  if (typeof legalState !== 'undefined') {
124
113
  payload['legalState'] = legalState;
125
114
  }
126
-
127
115
  if (typeof legalCity !== 'undefined') {
128
116
  payload['legalCity'] = legalCity;
129
117
  }
130
-
131
118
  if (typeof legalAddress !== 'undefined') {
132
119
  payload['legalAddress'] = legalAddress;
133
120
  }
134
-
135
121
  if (typeof legalTaxId !== 'undefined') {
136
122
  payload['legalTaxId'] = legalTaxId;
137
123
  }
138
-
139
124
  const uri = new URL(this.client.config.endpoint + apiPath);
140
- return await this.client.call('post', uri, {
125
+
126
+ const apiHeaders: { [header: string]: string } = {
141
127
  'content-type': 'application/json',
142
- }, payload);
143
- }
128
+ }
144
129
 
130
+ return await this.client.call(
131
+ 'post',
132
+ uri,
133
+ apiHeaders,
134
+ payload
135
+ );
136
+ }
145
137
  /**
146
138
  * Get project
147
139
  *
148
140
  *
149
141
  * @param {string} projectId
150
142
  * @throws {AppwriteException}
151
- * @returns {Promise}
152
- */
143
+ * @returns {Promise<Models.Project>}
144
+ */
153
145
  async get(projectId: string): Promise<Models.Project> {
154
146
  if (typeof projectId === 'undefined') {
155
147
  throw new AppwriteException('Missing required parameter: "projectId"');
156
148
  }
157
-
158
149
  const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
159
150
  const payload: Payload = {};
160
-
161
151
  const uri = new URL(this.client.config.endpoint + apiPath);
162
- return await this.client.call('get', uri, {
152
+
153
+ const apiHeaders: { [header: string]: string } = {
163
154
  'content-type': 'application/json',
164
- }, payload);
165
- }
155
+ }
166
156
 
157
+ return await this.client.call(
158
+ 'get',
159
+ uri,
160
+ apiHeaders,
161
+ payload
162
+ );
163
+ }
167
164
  /**
168
165
  * Update project
169
166
  *
@@ -180,88 +177,87 @@ export class Projects extends Service {
180
177
  * @param {string} legalAddress
181
178
  * @param {string} legalTaxId
182
179
  * @throws {AppwriteException}
183
- * @returns {Promise}
184
- */
180
+ * @returns {Promise<Models.Project>}
181
+ */
185
182
  async update(projectId: string, name: string, description?: string, logo?: string, url?: string, legalName?: string, legalCountry?: string, legalState?: string, legalCity?: string, legalAddress?: string, legalTaxId?: string): Promise<Models.Project> {
186
183
  if (typeof projectId === 'undefined') {
187
184
  throw new AppwriteException('Missing required parameter: "projectId"');
188
185
  }
189
-
190
186
  if (typeof name === 'undefined') {
191
187
  throw new AppwriteException('Missing required parameter: "name"');
192
188
  }
193
-
194
189
  const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
195
190
  const payload: Payload = {};
196
-
197
191
  if (typeof name !== 'undefined') {
198
192
  payload['name'] = name;
199
193
  }
200
-
201
194
  if (typeof description !== 'undefined') {
202
195
  payload['description'] = description;
203
196
  }
204
-
205
197
  if (typeof logo !== 'undefined') {
206
198
  payload['logo'] = logo;
207
199
  }
208
-
209
200
  if (typeof url !== 'undefined') {
210
201
  payload['url'] = url;
211
202
  }
212
-
213
203
  if (typeof legalName !== 'undefined') {
214
204
  payload['legalName'] = legalName;
215
205
  }
216
-
217
206
  if (typeof legalCountry !== 'undefined') {
218
207
  payload['legalCountry'] = legalCountry;
219
208
  }
220
-
221
209
  if (typeof legalState !== 'undefined') {
222
210
  payload['legalState'] = legalState;
223
211
  }
224
-
225
212
  if (typeof legalCity !== 'undefined') {
226
213
  payload['legalCity'] = legalCity;
227
214
  }
228
-
229
215
  if (typeof legalAddress !== 'undefined') {
230
216
  payload['legalAddress'] = legalAddress;
231
217
  }
232
-
233
218
  if (typeof legalTaxId !== 'undefined') {
234
219
  payload['legalTaxId'] = legalTaxId;
235
220
  }
236
-
237
221
  const uri = new URL(this.client.config.endpoint + apiPath);
238
- return await this.client.call('patch', uri, {
222
+
223
+ const apiHeaders: { [header: string]: string } = {
239
224
  'content-type': 'application/json',
240
- }, payload);
241
- }
225
+ }
242
226
 
227
+ return await this.client.call(
228
+ 'patch',
229
+ uri,
230
+ apiHeaders,
231
+ payload
232
+ );
233
+ }
243
234
  /**
244
235
  * Delete project
245
236
  *
246
237
  *
247
238
  * @param {string} projectId
248
239
  * @throws {AppwriteException}
249
- * @returns {Promise}
250
- */
240
+ * @returns {Promise<{}>}
241
+ */
251
242
  async delete(projectId: string): Promise<{}> {
252
243
  if (typeof projectId === 'undefined') {
253
244
  throw new AppwriteException('Missing required parameter: "projectId"');
254
245
  }
255
-
256
246
  const apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
257
247
  const payload: Payload = {};
258
-
259
248
  const uri = new URL(this.client.config.endpoint + apiPath);
260
- return await this.client.call('delete', uri, {
249
+
250
+ const apiHeaders: { [header: string]: string } = {
261
251
  'content-type': 'application/json',
262
- }, payload);
263
- }
252
+ }
264
253
 
254
+ return await this.client.call(
255
+ 'delete',
256
+ uri,
257
+ apiHeaders,
258
+ payload
259
+ );
260
+ }
265
261
  /**
266
262
  * Update API status
267
263
  *
@@ -270,38 +266,39 @@ export class Projects extends Service {
270
266
  * @param {Api} api
271
267
  * @param {boolean} status
272
268
  * @throws {AppwriteException}
273
- * @returns {Promise}
274
- */
269
+ * @returns {Promise<Models.Project>}
270
+ */
275
271
  async updateApiStatus(projectId: string, api: Api, status: boolean): Promise<Models.Project> {
276
272
  if (typeof projectId === 'undefined') {
277
273
  throw new AppwriteException('Missing required parameter: "projectId"');
278
274
  }
279
-
280
275
  if (typeof api === 'undefined') {
281
276
  throw new AppwriteException('Missing required parameter: "api"');
282
277
  }
283
-
284
278
  if (typeof status === 'undefined') {
285
279
  throw new AppwriteException('Missing required parameter: "status"');
286
280
  }
287
-
288
281
  const apiPath = '/projects/{projectId}/api'.replace('{projectId}', projectId);
289
282
  const payload: Payload = {};
290
-
291
283
  if (typeof api !== 'undefined') {
292
284
  payload['api'] = api;
293
285
  }
294
-
295
286
  if (typeof status !== 'undefined') {
296
287
  payload['status'] = status;
297
288
  }
298
-
299
289
  const uri = new URL(this.client.config.endpoint + apiPath);
300
- return await this.client.call('patch', uri, {
290
+
291
+ const apiHeaders: { [header: string]: string } = {
301
292
  'content-type': 'application/json',
302
- }, payload);
303
- }
293
+ }
304
294
 
295
+ return await this.client.call(
296
+ 'patch',
297
+ uri,
298
+ apiHeaders,
299
+ payload
300
+ );
301
+ }
305
302
  /**
306
303
  * Update all API status
307
304
  *
@@ -309,30 +306,33 @@ export class Projects extends Service {
309
306
  * @param {string} projectId
310
307
  * @param {boolean} status
311
308
  * @throws {AppwriteException}
312
- * @returns {Promise}
313
- */
309
+ * @returns {Promise<Models.Project>}
310
+ */
314
311
  async updateApiStatusAll(projectId: string, status: boolean): Promise<Models.Project> {
315
312
  if (typeof projectId === 'undefined') {
316
313
  throw new AppwriteException('Missing required parameter: "projectId"');
317
314
  }
318
-
319
315
  if (typeof status === 'undefined') {
320
316
  throw new AppwriteException('Missing required parameter: "status"');
321
317
  }
322
-
323
318
  const apiPath = '/projects/{projectId}/api/all'.replace('{projectId}', projectId);
324
319
  const payload: Payload = {};
325
-
326
320
  if (typeof status !== 'undefined') {
327
321
  payload['status'] = status;
328
322
  }
329
-
330
323
  const uri = new URL(this.client.config.endpoint + apiPath);
331
- return await this.client.call('patch', uri, {
324
+
325
+ const apiHeaders: { [header: string]: string } = {
332
326
  'content-type': 'application/json',
333
- }, payload);
334
- }
327
+ }
335
328
 
329
+ return await this.client.call(
330
+ 'patch',
331
+ uri,
332
+ apiHeaders,
333
+ payload
334
+ );
335
+ }
336
336
  /**
337
337
  * Update project authentication duration
338
338
  *
@@ -340,30 +340,33 @@ export class Projects extends Service {
340
340
  * @param {string} projectId
341
341
  * @param {number} duration
342
342
  * @throws {AppwriteException}
343
- * @returns {Promise}
344
- */
343
+ * @returns {Promise<Models.Project>}
344
+ */
345
345
  async updateAuthDuration(projectId: string, duration: number): Promise<Models.Project> {
346
346
  if (typeof projectId === 'undefined') {
347
347
  throw new AppwriteException('Missing required parameter: "projectId"');
348
348
  }
349
-
350
349
  if (typeof duration === 'undefined') {
351
350
  throw new AppwriteException('Missing required parameter: "duration"');
352
351
  }
353
-
354
352
  const apiPath = '/projects/{projectId}/auth/duration'.replace('{projectId}', projectId);
355
353
  const payload: Payload = {};
356
-
357
354
  if (typeof duration !== 'undefined') {
358
355
  payload['duration'] = duration;
359
356
  }
360
-
361
357
  const uri = new URL(this.client.config.endpoint + apiPath);
362
- return await this.client.call('patch', uri, {
358
+
359
+ const apiHeaders: { [header: string]: string } = {
363
360
  'content-type': 'application/json',
364
- }, payload);
365
- }
361
+ }
366
362
 
363
+ return await this.client.call(
364
+ 'patch',
365
+ uri,
366
+ apiHeaders,
367
+ payload
368
+ );
369
+ }
367
370
  /**
368
371
  * Update project users limit
369
372
  *
@@ -371,30 +374,33 @@ export class Projects extends Service {
371
374
  * @param {string} projectId
372
375
  * @param {number} limit
373
376
  * @throws {AppwriteException}
374
- * @returns {Promise}
375
- */
377
+ * @returns {Promise<Models.Project>}
378
+ */
376
379
  async updateAuthLimit(projectId: string, limit: number): Promise<Models.Project> {
377
380
  if (typeof projectId === 'undefined') {
378
381
  throw new AppwriteException('Missing required parameter: "projectId"');
379
382
  }
380
-
381
383
  if (typeof limit === 'undefined') {
382
384
  throw new AppwriteException('Missing required parameter: "limit"');
383
385
  }
384
-
385
386
  const apiPath = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId);
386
387
  const payload: Payload = {};
387
-
388
388
  if (typeof limit !== 'undefined') {
389
389
  payload['limit'] = limit;
390
390
  }
391
-
392
391
  const uri = new URL(this.client.config.endpoint + apiPath);
393
- return await this.client.call('patch', uri, {
392
+
393
+ const apiHeaders: { [header: string]: string } = {
394
394
  'content-type': 'application/json',
395
- }, payload);
396
- }
395
+ }
397
396
 
397
+ return await this.client.call(
398
+ 'patch',
399
+ uri,
400
+ apiHeaders,
401
+ payload
402
+ );
403
+ }
398
404
  /**
399
405
  * Update project user sessions limit
400
406
  *
@@ -402,30 +408,67 @@ export class Projects extends Service {
402
408
  * @param {string} projectId
403
409
  * @param {number} limit
404
410
  * @throws {AppwriteException}
405
- * @returns {Promise}
406
- */
411
+ * @returns {Promise<Models.Project>}
412
+ */
407
413
  async updateAuthSessionsLimit(projectId: string, limit: number): Promise<Models.Project> {
408
414
  if (typeof projectId === 'undefined') {
409
415
  throw new AppwriteException('Missing required parameter: "projectId"');
410
416
  }
411
-
412
417
  if (typeof limit === 'undefined') {
413
418
  throw new AppwriteException('Missing required parameter: "limit"');
414
419
  }
415
-
416
420
  const apiPath = '/projects/{projectId}/auth/max-sessions'.replace('{projectId}', projectId);
417
421
  const payload: Payload = {};
418
-
419
422
  if (typeof limit !== 'undefined') {
420
423
  payload['limit'] = limit;
421
424
  }
422
-
423
425
  const uri = new URL(this.client.config.endpoint + apiPath);
424
- return await this.client.call('patch', uri, {
426
+
427
+ const apiHeaders: { [header: string]: string } = {
425
428
  'content-type': 'application/json',
426
- }, payload);
429
+ }
430
+
431
+ return await this.client.call(
432
+ 'patch',
433
+ uri,
434
+ apiHeaders,
435
+ payload
436
+ );
427
437
  }
438
+ /**
439
+ * Update the mock numbers for the project
440
+ *
441
+ *
442
+ * @param {string} projectId
443
+ * @param {object[]} numbers
444
+ * @throws {AppwriteException}
445
+ * @returns {Promise<Models.Project>}
446
+ */
447
+ async updateMockNumbers(projectId: string, numbers: object[]): Promise<Models.Project> {
448
+ if (typeof projectId === 'undefined') {
449
+ throw new AppwriteException('Missing required parameter: "projectId"');
450
+ }
451
+ if (typeof numbers === 'undefined') {
452
+ throw new AppwriteException('Missing required parameter: "numbers"');
453
+ }
454
+ const apiPath = '/projects/{projectId}/auth/mock-numbers'.replace('{projectId}', projectId);
455
+ const payload: Payload = {};
456
+ if (typeof numbers !== 'undefined') {
457
+ payload['numbers'] = numbers;
458
+ }
459
+ const uri = new URL(this.client.config.endpoint + apiPath);
460
+
461
+ const apiHeaders: { [header: string]: string } = {
462
+ 'content-type': 'application/json',
463
+ }
428
464
 
465
+ return await this.client.call(
466
+ 'patch',
467
+ uri,
468
+ apiHeaders,
469
+ payload
470
+ );
471
+ }
429
472
  /**
430
473
  * Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password
431
474
  *
@@ -433,30 +476,33 @@ export class Projects extends Service {
433
476
  * @param {string} projectId
434
477
  * @param {boolean} enabled
435
478
  * @throws {AppwriteException}
436
- * @returns {Promise}
437
- */
479
+ * @returns {Promise<Models.Project>}
480
+ */
438
481
  async updateAuthPasswordDictionary(projectId: string, enabled: boolean): Promise<Models.Project> {
439
482
  if (typeof projectId === 'undefined') {
440
483
  throw new AppwriteException('Missing required parameter: "projectId"');
441
484
  }
442
-
443
485
  if (typeof enabled === 'undefined') {
444
486
  throw new AppwriteException('Missing required parameter: "enabled"');
445
487
  }
446
-
447
488
  const apiPath = '/projects/{projectId}/auth/password-dictionary'.replace('{projectId}', projectId);
448
489
  const payload: Payload = {};
449
-
450
490
  if (typeof enabled !== 'undefined') {
451
491
  payload['enabled'] = enabled;
452
492
  }
453
-
454
493
  const uri = new URL(this.client.config.endpoint + apiPath);
455
- return await this.client.call('patch', uri, {
494
+
495
+ const apiHeaders: { [header: string]: string } = {
456
496
  'content-type': 'application/json',
457
- }, payload);
458
- }
497
+ }
459
498
 
499
+ return await this.client.call(
500
+ 'patch',
501
+ uri,
502
+ apiHeaders,
503
+ payload
504
+ );
505
+ }
460
506
  /**
461
507
  * Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.
462
508
  *
@@ -464,30 +510,33 @@ export class Projects extends Service {
464
510
  * @param {string} projectId
465
511
  * @param {number} limit
466
512
  * @throws {AppwriteException}
467
- * @returns {Promise}
468
- */
513
+ * @returns {Promise<Models.Project>}
514
+ */
469
515
  async updateAuthPasswordHistory(projectId: string, limit: number): Promise<Models.Project> {
470
516
  if (typeof projectId === 'undefined') {
471
517
  throw new AppwriteException('Missing required parameter: "projectId"');
472
518
  }
473
-
474
519
  if (typeof limit === 'undefined') {
475
520
  throw new AppwriteException('Missing required parameter: "limit"');
476
521
  }
477
-
478
522
  const apiPath = '/projects/{projectId}/auth/password-history'.replace('{projectId}', projectId);
479
523
  const payload: Payload = {};
480
-
481
524
  if (typeof limit !== 'undefined') {
482
525
  payload['limit'] = limit;
483
526
  }
484
-
485
527
  const uri = new URL(this.client.config.endpoint + apiPath);
486
- return await this.client.call('patch', uri, {
528
+
529
+ const apiHeaders: { [header: string]: string } = {
487
530
  'content-type': 'application/json',
488
- }, payload);
489
- }
531
+ }
490
532
 
533
+ return await this.client.call(
534
+ 'patch',
535
+ uri,
536
+ apiHeaders,
537
+ payload
538
+ );
539
+ }
491
540
  /**
492
541
  * Enable or disable checking user passwords for similarity with their personal data.
493
542
  *
@@ -495,30 +544,67 @@ export class Projects extends Service {
495
544
  * @param {string} projectId
496
545
  * @param {boolean} enabled
497
546
  * @throws {AppwriteException}
498
- * @returns {Promise}
499
- */
547
+ * @returns {Promise<Models.Project>}
548
+ */
500
549
  async updatePersonalDataCheck(projectId: string, enabled: boolean): Promise<Models.Project> {
501
550
  if (typeof projectId === 'undefined') {
502
551
  throw new AppwriteException('Missing required parameter: "projectId"');
503
552
  }
504
-
505
553
  if (typeof enabled === 'undefined') {
506
554
  throw new AppwriteException('Missing required parameter: "enabled"');
507
555
  }
508
-
509
556
  const apiPath = '/projects/{projectId}/auth/personal-data'.replace('{projectId}', projectId);
510
557
  const payload: Payload = {};
511
-
512
558
  if (typeof enabled !== 'undefined') {
513
559
  payload['enabled'] = enabled;
514
560
  }
515
-
516
561
  const uri = new URL(this.client.config.endpoint + apiPath);
517
- return await this.client.call('patch', uri, {
562
+
563
+ const apiHeaders: { [header: string]: string } = {
518
564
  'content-type': 'application/json',
519
- }, payload);
565
+ }
566
+
567
+ return await this.client.call(
568
+ 'patch',
569
+ uri,
570
+ apiHeaders,
571
+ payload
572
+ );
520
573
  }
574
+ /**
575
+ * Update project sessions emails
576
+ *
577
+ *
578
+ * @param {string} projectId
579
+ * @param {boolean} alerts
580
+ * @throws {AppwriteException}
581
+ * @returns {Promise<Models.Project>}
582
+ */
583
+ async updateSessionAlerts(projectId: string, alerts: boolean): Promise<Models.Project> {
584
+ if (typeof projectId === 'undefined') {
585
+ throw new AppwriteException('Missing required parameter: "projectId"');
586
+ }
587
+ if (typeof alerts === 'undefined') {
588
+ throw new AppwriteException('Missing required parameter: "alerts"');
589
+ }
590
+ const apiPath = '/projects/{projectId}/auth/session-alerts'.replace('{projectId}', projectId);
591
+ const payload: Payload = {};
592
+ if (typeof alerts !== 'undefined') {
593
+ payload['alerts'] = alerts;
594
+ }
595
+ const uri = new URL(this.client.config.endpoint + apiPath);
521
596
 
597
+ const apiHeaders: { [header: string]: string } = {
598
+ 'content-type': 'application/json',
599
+ }
600
+
601
+ return await this.client.call(
602
+ 'patch',
603
+ uri,
604
+ apiHeaders,
605
+ payload
606
+ );
607
+ }
522
608
  /**
523
609
  * Update project auth method status. Use this endpoint to enable or disable a given auth method for this project.
524
610
  *
@@ -527,56 +613,101 @@ export class Projects extends Service {
527
613
  * @param {AuthMethod} method
528
614
  * @param {boolean} status
529
615
  * @throws {AppwriteException}
530
- * @returns {Promise}
531
- */
616
+ * @returns {Promise<Models.Project>}
617
+ */
532
618
  async updateAuthStatus(projectId: string, method: AuthMethod, status: boolean): Promise<Models.Project> {
533
619
  if (typeof projectId === 'undefined') {
534
620
  throw new AppwriteException('Missing required parameter: "projectId"');
535
621
  }
536
-
537
622
  if (typeof method === 'undefined') {
538
623
  throw new AppwriteException('Missing required parameter: "method"');
539
624
  }
540
-
541
625
  if (typeof status === 'undefined') {
542
626
  throw new AppwriteException('Missing required parameter: "status"');
543
627
  }
544
-
545
628
  const apiPath = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method);
546
629
  const payload: Payload = {};
547
-
548
630
  if (typeof status !== 'undefined') {
549
631
  payload['status'] = status;
550
632
  }
551
-
552
633
  const uri = new URL(this.client.config.endpoint + apiPath);
553
- return await this.client.call('patch', uri, {
634
+
635
+ const apiHeaders: { [header: string]: string } = {
554
636
  'content-type': 'application/json',
555
- }, payload);
637
+ }
638
+
639
+ return await this.client.call(
640
+ 'patch',
641
+ uri,
642
+ apiHeaders,
643
+ payload
644
+ );
556
645
  }
646
+ /**
647
+ * Create JWT
648
+ *
649
+ *
650
+ * @param {string} projectId
651
+ * @param {string[]} scopes
652
+ * @param {number} duration
653
+ * @throws {AppwriteException}
654
+ * @returns {Promise<Models.Jwt>}
655
+ */
656
+ async createJWT(projectId: string, scopes: string[], duration?: number): Promise<Models.Jwt> {
657
+ if (typeof projectId === 'undefined') {
658
+ throw new AppwriteException('Missing required parameter: "projectId"');
659
+ }
660
+ if (typeof scopes === 'undefined') {
661
+ throw new AppwriteException('Missing required parameter: "scopes"');
662
+ }
663
+ const apiPath = '/projects/{projectId}/jwts'.replace('{projectId}', projectId);
664
+ const payload: Payload = {};
665
+ if (typeof scopes !== 'undefined') {
666
+ payload['scopes'] = scopes;
667
+ }
668
+ if (typeof duration !== 'undefined') {
669
+ payload['duration'] = duration;
670
+ }
671
+ const uri = new URL(this.client.config.endpoint + apiPath);
557
672
 
673
+ const apiHeaders: { [header: string]: string } = {
674
+ 'content-type': 'application/json',
675
+ }
676
+
677
+ return await this.client.call(
678
+ 'post',
679
+ uri,
680
+ apiHeaders,
681
+ payload
682
+ );
683
+ }
558
684
  /**
559
685
  * List keys
560
686
  *
561
687
  *
562
688
  * @param {string} projectId
563
689
  * @throws {AppwriteException}
564
- * @returns {Promise}
565
- */
690
+ * @returns {Promise<Models.KeyList>}
691
+ */
566
692
  async listKeys(projectId: string): Promise<Models.KeyList> {
567
693
  if (typeof projectId === 'undefined') {
568
694
  throw new AppwriteException('Missing required parameter: "projectId"');
569
695
  }
570
-
571
696
  const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
572
697
  const payload: Payload = {};
573
-
574
698
  const uri = new URL(this.client.config.endpoint + apiPath);
575
- return await this.client.call('get', uri, {
699
+
700
+ const apiHeaders: { [header: string]: string } = {
576
701
  'content-type': 'application/json',
577
- }, payload);
578
- }
702
+ }
579
703
 
704
+ return await this.client.call(
705
+ 'get',
706
+ uri,
707
+ apiHeaders,
708
+ payload
709
+ );
710
+ }
580
711
  /**
581
712
  * Create key
582
713
  *
@@ -586,42 +717,42 @@ export class Projects extends Service {
586
717
  * @param {string[]} scopes
587
718
  * @param {string} expire
588
719
  * @throws {AppwriteException}
589
- * @returns {Promise}
590
- */
720
+ * @returns {Promise<Models.Key>}
721
+ */
591
722
  async createKey(projectId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key> {
592
723
  if (typeof projectId === 'undefined') {
593
724
  throw new AppwriteException('Missing required parameter: "projectId"');
594
725
  }
595
-
596
726
  if (typeof name === 'undefined') {
597
727
  throw new AppwriteException('Missing required parameter: "name"');
598
728
  }
599
-
600
729
  if (typeof scopes === 'undefined') {
601
730
  throw new AppwriteException('Missing required parameter: "scopes"');
602
731
  }
603
-
604
732
  const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
605
733
  const payload: Payload = {};
606
-
607
734
  if (typeof name !== 'undefined') {
608
735
  payload['name'] = name;
609
736
  }
610
-
611
737
  if (typeof scopes !== 'undefined') {
612
738
  payload['scopes'] = scopes;
613
739
  }
614
-
615
740
  if (typeof expire !== 'undefined') {
616
741
  payload['expire'] = expire;
617
742
  }
618
-
619
743
  const uri = new URL(this.client.config.endpoint + apiPath);
620
- return await this.client.call('post', uri, {
744
+
745
+ const apiHeaders: { [header: string]: string } = {
621
746
  'content-type': 'application/json',
622
- }, payload);
623
- }
747
+ }
624
748
 
749
+ return await this.client.call(
750
+ 'post',
751
+ uri,
752
+ apiHeaders,
753
+ payload
754
+ );
755
+ }
625
756
  /**
626
757
  * Get key
627
758
  *
@@ -629,26 +760,30 @@ export class Projects extends Service {
629
760
  * @param {string} projectId
630
761
  * @param {string} keyId
631
762
  * @throws {AppwriteException}
632
- * @returns {Promise}
633
- */
763
+ * @returns {Promise<Models.Key>}
764
+ */
634
765
  async getKey(projectId: string, keyId: string): Promise<Models.Key> {
635
766
  if (typeof projectId === 'undefined') {
636
767
  throw new AppwriteException('Missing required parameter: "projectId"');
637
768
  }
638
-
639
769
  if (typeof keyId === 'undefined') {
640
770
  throw new AppwriteException('Missing required parameter: "keyId"');
641
771
  }
642
-
643
772
  const apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
644
773
  const payload: Payload = {};
645
-
646
774
  const uri = new URL(this.client.config.endpoint + apiPath);
647
- return await this.client.call('get', uri, {
775
+
776
+ const apiHeaders: { [header: string]: string } = {
648
777
  'content-type': 'application/json',
649
- }, payload);
650
- }
778
+ }
651
779
 
780
+ return await this.client.call(
781
+ 'get',
782
+ uri,
783
+ apiHeaders,
784
+ payload
785
+ );
786
+ }
652
787
  /**
653
788
  * Update key
654
789
  *
@@ -659,46 +794,45 @@ export class Projects extends Service {
659
794
  * @param {string[]} scopes
660
795
  * @param {string} expire
661
796
  * @throws {AppwriteException}
662
- * @returns {Promise}
663
- */
797
+ * @returns {Promise<Models.Key>}
798
+ */
664
799
  async updateKey(projectId: string, keyId: string, name: string, scopes: string[], expire?: string): Promise<Models.Key> {
665
800
  if (typeof projectId === 'undefined') {
666
801
  throw new AppwriteException('Missing required parameter: "projectId"');
667
802
  }
668
-
669
803
  if (typeof keyId === 'undefined') {
670
804
  throw new AppwriteException('Missing required parameter: "keyId"');
671
805
  }
672
-
673
806
  if (typeof name === 'undefined') {
674
807
  throw new AppwriteException('Missing required parameter: "name"');
675
808
  }
676
-
677
809
  if (typeof scopes === 'undefined') {
678
810
  throw new AppwriteException('Missing required parameter: "scopes"');
679
811
  }
680
-
681
812
  const apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
682
813
  const payload: Payload = {};
683
-
684
814
  if (typeof name !== 'undefined') {
685
815
  payload['name'] = name;
686
816
  }
687
-
688
817
  if (typeof scopes !== 'undefined') {
689
818
  payload['scopes'] = scopes;
690
819
  }
691
-
692
820
  if (typeof expire !== 'undefined') {
693
821
  payload['expire'] = expire;
694
822
  }
695
-
696
823
  const uri = new URL(this.client.config.endpoint + apiPath);
697
- return await this.client.call('put', uri, {
824
+
825
+ const apiHeaders: { [header: string]: string } = {
698
826
  'content-type': 'application/json',
699
- }, payload);
700
- }
827
+ }
701
828
 
829
+ return await this.client.call(
830
+ 'put',
831
+ uri,
832
+ apiHeaders,
833
+ payload
834
+ );
835
+ }
702
836
  /**
703
837
  * Delete key
704
838
  *
@@ -706,26 +840,30 @@ export class Projects extends Service {
706
840
  * @param {string} projectId
707
841
  * @param {string} keyId
708
842
  * @throws {AppwriteException}
709
- * @returns {Promise}
710
- */
843
+ * @returns {Promise<{}>}
844
+ */
711
845
  async deleteKey(projectId: string, keyId: string): Promise<{}> {
712
846
  if (typeof projectId === 'undefined') {
713
847
  throw new AppwriteException('Missing required parameter: "projectId"');
714
848
  }
715
-
716
849
  if (typeof keyId === 'undefined') {
717
850
  throw new AppwriteException('Missing required parameter: "keyId"');
718
851
  }
719
-
720
852
  const apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
721
853
  const payload: Payload = {};
722
-
723
854
  const uri = new URL(this.client.config.endpoint + apiPath);
724
- return await this.client.call('delete', uri, {
855
+
856
+ const apiHeaders: { [header: string]: string } = {
725
857
  'content-type': 'application/json',
726
- }, payload);
727
- }
858
+ }
728
859
 
860
+ return await this.client.call(
861
+ 'delete',
862
+ uri,
863
+ apiHeaders,
864
+ payload
865
+ );
866
+ }
729
867
  /**
730
868
  * Update project OAuth2
731
869
  *
@@ -736,64 +874,69 @@ export class Projects extends Service {
736
874
  * @param {string} secret
737
875
  * @param {boolean} enabled
738
876
  * @throws {AppwriteException}
739
- * @returns {Promise}
740
- */
877
+ * @returns {Promise<Models.Project>}
878
+ */
741
879
  async updateOAuth2(projectId: string, provider: OAuthProvider, appId?: string, secret?: string, enabled?: boolean): Promise<Models.Project> {
742
880
  if (typeof projectId === 'undefined') {
743
881
  throw new AppwriteException('Missing required parameter: "projectId"');
744
882
  }
745
-
746
883
  if (typeof provider === 'undefined') {
747
884
  throw new AppwriteException('Missing required parameter: "provider"');
748
885
  }
749
-
750
886
  const apiPath = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId);
751
887
  const payload: Payload = {};
752
-
753
888
  if (typeof provider !== 'undefined') {
754
889
  payload['provider'] = provider;
755
890
  }
756
-
757
891
  if (typeof appId !== 'undefined') {
758
892
  payload['appId'] = appId;
759
893
  }
760
-
761
894
  if (typeof secret !== 'undefined') {
762
895
  payload['secret'] = secret;
763
896
  }
764
-
765
897
  if (typeof enabled !== 'undefined') {
766
898
  payload['enabled'] = enabled;
767
899
  }
768
-
769
900
  const uri = new URL(this.client.config.endpoint + apiPath);
770
- return await this.client.call('patch', uri, {
901
+
902
+ const apiHeaders: { [header: string]: string } = {
771
903
  'content-type': 'application/json',
772
- }, payload);
773
- }
904
+ }
774
905
 
906
+ return await this.client.call(
907
+ 'patch',
908
+ uri,
909
+ apiHeaders,
910
+ payload
911
+ );
912
+ }
775
913
  /**
776
914
  * List platforms
777
915
  *
778
916
  *
779
917
  * @param {string} projectId
780
918
  * @throws {AppwriteException}
781
- * @returns {Promise}
782
- */
919
+ * @returns {Promise<Models.PlatformList>}
920
+ */
783
921
  async listPlatforms(projectId: string): Promise<Models.PlatformList> {
784
922
  if (typeof projectId === 'undefined') {
785
923
  throw new AppwriteException('Missing required parameter: "projectId"');
786
924
  }
787
-
788
925
  const apiPath = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
789
926
  const payload: Payload = {};
790
-
791
927
  const uri = new URL(this.client.config.endpoint + apiPath);
792
- return await this.client.call('get', uri, {
928
+
929
+ const apiHeaders: { [header: string]: string } = {
793
930
  'content-type': 'application/json',
794
- }, payload);
795
- }
931
+ }
796
932
 
933
+ return await this.client.call(
934
+ 'get',
935
+ uri,
936
+ apiHeaders,
937
+ payload
938
+ );
939
+ }
797
940
  /**
798
941
  * Create platform
799
942
  *
@@ -805,50 +948,48 @@ export class Projects extends Service {
805
948
  * @param {string} store
806
949
  * @param {string} hostname
807
950
  * @throws {AppwriteException}
808
- * @returns {Promise}
809
- */
951
+ * @returns {Promise<Models.Platform>}
952
+ */
810
953
  async createPlatform(projectId: string, type: PlatformType, name: string, key?: string, store?: string, hostname?: string): Promise<Models.Platform> {
811
954
  if (typeof projectId === 'undefined') {
812
955
  throw new AppwriteException('Missing required parameter: "projectId"');
813
956
  }
814
-
815
957
  if (typeof type === 'undefined') {
816
958
  throw new AppwriteException('Missing required parameter: "type"');
817
959
  }
818
-
819
960
  if (typeof name === 'undefined') {
820
961
  throw new AppwriteException('Missing required parameter: "name"');
821
962
  }
822
-
823
963
  const apiPath = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
824
964
  const payload: Payload = {};
825
-
826
965
  if (typeof type !== 'undefined') {
827
966
  payload['type'] = type;
828
967
  }
829
-
830
968
  if (typeof name !== 'undefined') {
831
969
  payload['name'] = name;
832
970
  }
833
-
834
971
  if (typeof key !== 'undefined') {
835
972
  payload['key'] = key;
836
973
  }
837
-
838
974
  if (typeof store !== 'undefined') {
839
975
  payload['store'] = store;
840
976
  }
841
-
842
977
  if (typeof hostname !== 'undefined') {
843
978
  payload['hostname'] = hostname;
844
979
  }
845
-
846
980
  const uri = new URL(this.client.config.endpoint + apiPath);
847
- return await this.client.call('post', uri, {
981
+
982
+ const apiHeaders: { [header: string]: string } = {
848
983
  'content-type': 'application/json',
849
- }, payload);
850
- }
984
+ }
851
985
 
986
+ return await this.client.call(
987
+ 'post',
988
+ uri,
989
+ apiHeaders,
990
+ payload
991
+ );
992
+ }
852
993
  /**
853
994
  * Get platform
854
995
  *
@@ -856,26 +997,30 @@ export class Projects extends Service {
856
997
  * @param {string} projectId
857
998
  * @param {string} platformId
858
999
  * @throws {AppwriteException}
859
- * @returns {Promise}
860
- */
1000
+ * @returns {Promise<Models.Platform>}
1001
+ */
861
1002
  async getPlatform(projectId: string, platformId: string): Promise<Models.Platform> {
862
1003
  if (typeof projectId === 'undefined') {
863
1004
  throw new AppwriteException('Missing required parameter: "projectId"');
864
1005
  }
865
-
866
1006
  if (typeof platformId === 'undefined') {
867
1007
  throw new AppwriteException('Missing required parameter: "platformId"');
868
1008
  }
869
-
870
1009
  const apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
871
1010
  const payload: Payload = {};
872
-
873
1011
  const uri = new URL(this.client.config.endpoint + apiPath);
874
- return await this.client.call('get', uri, {
1012
+
1013
+ const apiHeaders: { [header: string]: string } = {
875
1014
  'content-type': 'application/json',
876
- }, payload);
877
- }
1015
+ }
878
1016
 
1017
+ return await this.client.call(
1018
+ 'get',
1019
+ uri,
1020
+ apiHeaders,
1021
+ payload
1022
+ );
1023
+ }
879
1024
  /**
880
1025
  * Update platform
881
1026
  *
@@ -887,46 +1032,45 @@ export class Projects extends Service {
887
1032
  * @param {string} store
888
1033
  * @param {string} hostname
889
1034
  * @throws {AppwriteException}
890
- * @returns {Promise}
891
- */
1035
+ * @returns {Promise<Models.Platform>}
1036
+ */
892
1037
  async updatePlatform(projectId: string, platformId: string, name: string, key?: string, store?: string, hostname?: string): Promise<Models.Platform> {
893
1038
  if (typeof projectId === 'undefined') {
894
1039
  throw new AppwriteException('Missing required parameter: "projectId"');
895
1040
  }
896
-
897
1041
  if (typeof platformId === 'undefined') {
898
1042
  throw new AppwriteException('Missing required parameter: "platformId"');
899
1043
  }
900
-
901
1044
  if (typeof name === 'undefined') {
902
1045
  throw new AppwriteException('Missing required parameter: "name"');
903
1046
  }
904
-
905
1047
  const apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
906
1048
  const payload: Payload = {};
907
-
908
1049
  if (typeof name !== 'undefined') {
909
1050
  payload['name'] = name;
910
1051
  }
911
-
912
1052
  if (typeof key !== 'undefined') {
913
1053
  payload['key'] = key;
914
1054
  }
915
-
916
1055
  if (typeof store !== 'undefined') {
917
1056
  payload['store'] = store;
918
1057
  }
919
-
920
1058
  if (typeof hostname !== 'undefined') {
921
1059
  payload['hostname'] = hostname;
922
1060
  }
923
-
924
1061
  const uri = new URL(this.client.config.endpoint + apiPath);
925
- return await this.client.call('put', uri, {
1062
+
1063
+ const apiHeaders: { [header: string]: string } = {
926
1064
  'content-type': 'application/json',
927
- }, payload);
928
- }
1065
+ }
929
1066
 
1067
+ return await this.client.call(
1068
+ 'put',
1069
+ uri,
1070
+ apiHeaders,
1071
+ payload
1072
+ );
1073
+ }
930
1074
  /**
931
1075
  * Delete platform
932
1076
  *
@@ -934,26 +1078,30 @@ export class Projects extends Service {
934
1078
  * @param {string} projectId
935
1079
  * @param {string} platformId
936
1080
  * @throws {AppwriteException}
937
- * @returns {Promise}
938
- */
1081
+ * @returns {Promise<{}>}
1082
+ */
939
1083
  async deletePlatform(projectId: string, platformId: string): Promise<{}> {
940
1084
  if (typeof projectId === 'undefined') {
941
1085
  throw new AppwriteException('Missing required parameter: "projectId"');
942
1086
  }
943
-
944
1087
  if (typeof platformId === 'undefined') {
945
1088
  throw new AppwriteException('Missing required parameter: "platformId"');
946
1089
  }
947
-
948
1090
  const apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
949
1091
  const payload: Payload = {};
950
-
951
1092
  const uri = new URL(this.client.config.endpoint + apiPath);
952
- return await this.client.call('delete', uri, {
1093
+
1094
+ const apiHeaders: { [header: string]: string } = {
953
1095
  'content-type': 'application/json',
954
- }, payload);
955
- }
1096
+ }
956
1097
 
1098
+ return await this.client.call(
1099
+ 'delete',
1100
+ uri,
1101
+ apiHeaders,
1102
+ payload
1103
+ );
1104
+ }
957
1105
  /**
958
1106
  * Update service status
959
1107
  *
@@ -962,38 +1110,39 @@ export class Projects extends Service {
962
1110
  * @param {ApiService} service
963
1111
  * @param {boolean} status
964
1112
  * @throws {AppwriteException}
965
- * @returns {Promise}
966
- */
1113
+ * @returns {Promise<Models.Project>}
1114
+ */
967
1115
  async updateServiceStatus(projectId: string, service: ApiService, status: boolean): Promise<Models.Project> {
968
1116
  if (typeof projectId === 'undefined') {
969
1117
  throw new AppwriteException('Missing required parameter: "projectId"');
970
1118
  }
971
-
972
1119
  if (typeof service === 'undefined') {
973
1120
  throw new AppwriteException('Missing required parameter: "service"');
974
1121
  }
975
-
976
1122
  if (typeof status === 'undefined') {
977
1123
  throw new AppwriteException('Missing required parameter: "status"');
978
1124
  }
979
-
980
1125
  const apiPath = '/projects/{projectId}/service'.replace('{projectId}', projectId);
981
1126
  const payload: Payload = {};
982
-
983
1127
  if (typeof service !== 'undefined') {
984
1128
  payload['service'] = service;
985
1129
  }
986
-
987
1130
  if (typeof status !== 'undefined') {
988
1131
  payload['status'] = status;
989
1132
  }
990
-
991
1133
  const uri = new URL(this.client.config.endpoint + apiPath);
992
- return await this.client.call('patch', uri, {
1134
+
1135
+ const apiHeaders: { [header: string]: string } = {
993
1136
  'content-type': 'application/json',
994
- }, payload);
995
- }
1137
+ }
996
1138
 
1139
+ return await this.client.call(
1140
+ 'patch',
1141
+ uri,
1142
+ apiHeaders,
1143
+ payload
1144
+ );
1145
+ }
997
1146
  /**
998
1147
  * Update all service status
999
1148
  *
@@ -1001,30 +1150,33 @@ export class Projects extends Service {
1001
1150
  * @param {string} projectId
1002
1151
  * @param {boolean} status
1003
1152
  * @throws {AppwriteException}
1004
- * @returns {Promise}
1005
- */
1153
+ * @returns {Promise<Models.Project>}
1154
+ */
1006
1155
  async updateServiceStatusAll(projectId: string, status: boolean): Promise<Models.Project> {
1007
1156
  if (typeof projectId === 'undefined') {
1008
1157
  throw new AppwriteException('Missing required parameter: "projectId"');
1009
1158
  }
1010
-
1011
1159
  if (typeof status === 'undefined') {
1012
1160
  throw new AppwriteException('Missing required parameter: "status"');
1013
1161
  }
1014
-
1015
1162
  const apiPath = '/projects/{projectId}/service/all'.replace('{projectId}', projectId);
1016
1163
  const payload: Payload = {};
1017
-
1018
1164
  if (typeof status !== 'undefined') {
1019
1165
  payload['status'] = status;
1020
1166
  }
1021
-
1022
1167
  const uri = new URL(this.client.config.endpoint + apiPath);
1023
- return await this.client.call('patch', uri, {
1168
+
1169
+ const apiHeaders: { [header: string]: string } = {
1024
1170
  'content-type': 'application/json',
1025
- }, payload);
1026
- }
1171
+ }
1027
1172
 
1173
+ return await this.client.call(
1174
+ 'patch',
1175
+ uri,
1176
+ apiHeaders,
1177
+ payload
1178
+ );
1179
+ }
1028
1180
  /**
1029
1181
  * Update SMTP
1030
1182
  *
@@ -1040,62 +1192,57 @@ export class Projects extends Service {
1040
1192
  * @param {string} password
1041
1193
  * @param {SMTPSecure} secure
1042
1194
  * @throws {AppwriteException}
1043
- * @returns {Promise}
1044
- */
1195
+ * @returns {Promise<Models.Project>}
1196
+ */
1045
1197
  async updateSmtp(projectId: string, enabled: boolean, senderName?: string, senderEmail?: string, replyTo?: string, host?: string, port?: number, username?: string, password?: string, secure?: SMTPSecure): Promise<Models.Project> {
1046
1198
  if (typeof projectId === 'undefined') {
1047
1199
  throw new AppwriteException('Missing required parameter: "projectId"');
1048
1200
  }
1049
-
1050
1201
  if (typeof enabled === 'undefined') {
1051
1202
  throw new AppwriteException('Missing required parameter: "enabled"');
1052
1203
  }
1053
-
1054
1204
  const apiPath = '/projects/{projectId}/smtp'.replace('{projectId}', projectId);
1055
1205
  const payload: Payload = {};
1056
-
1057
1206
  if (typeof enabled !== 'undefined') {
1058
1207
  payload['enabled'] = enabled;
1059
1208
  }
1060
-
1061
1209
  if (typeof senderName !== 'undefined') {
1062
1210
  payload['senderName'] = senderName;
1063
1211
  }
1064
-
1065
1212
  if (typeof senderEmail !== 'undefined') {
1066
1213
  payload['senderEmail'] = senderEmail;
1067
1214
  }
1068
-
1069
1215
  if (typeof replyTo !== 'undefined') {
1070
1216
  payload['replyTo'] = replyTo;
1071
1217
  }
1072
-
1073
1218
  if (typeof host !== 'undefined') {
1074
1219
  payload['host'] = host;
1075
1220
  }
1076
-
1077
1221
  if (typeof port !== 'undefined') {
1078
1222
  payload['port'] = port;
1079
1223
  }
1080
-
1081
1224
  if (typeof username !== 'undefined') {
1082
1225
  payload['username'] = username;
1083
1226
  }
1084
-
1085
1227
  if (typeof password !== 'undefined') {
1086
1228
  payload['password'] = password;
1087
1229
  }
1088
-
1089
1230
  if (typeof secure !== 'undefined') {
1090
1231
  payload['secure'] = secure;
1091
1232
  }
1092
-
1093
1233
  const uri = new URL(this.client.config.endpoint + apiPath);
1094
- return await this.client.call('patch', uri, {
1234
+
1235
+ const apiHeaders: { [header: string]: string } = {
1095
1236
  'content-type': 'application/json',
1096
- }, payload);
1097
- }
1237
+ }
1098
1238
 
1239
+ return await this.client.call(
1240
+ 'patch',
1241
+ uri,
1242
+ apiHeaders,
1243
+ payload
1244
+ );
1245
+ }
1099
1246
  /**
1100
1247
  * Create SMTP test
1101
1248
  *
@@ -1111,105 +1258,100 @@ export class Projects extends Service {
1111
1258
  * @param {string} password
1112
1259
  * @param {SMTPSecure} secure
1113
1260
  * @throws {AppwriteException}
1114
- * @returns {Promise}
1115
- */
1261
+ * @returns {Promise<{}>}
1262
+ */
1116
1263
  async createSmtpTest(projectId: string, emails: string[], senderName: string, senderEmail: string, host: string, replyTo?: string, port?: number, username?: string, password?: string, secure?: SMTPSecure): Promise<{}> {
1117
1264
  if (typeof projectId === 'undefined') {
1118
1265
  throw new AppwriteException('Missing required parameter: "projectId"');
1119
1266
  }
1120
-
1121
1267
  if (typeof emails === 'undefined') {
1122
1268
  throw new AppwriteException('Missing required parameter: "emails"');
1123
1269
  }
1124
-
1125
1270
  if (typeof senderName === 'undefined') {
1126
1271
  throw new AppwriteException('Missing required parameter: "senderName"');
1127
1272
  }
1128
-
1129
1273
  if (typeof senderEmail === 'undefined') {
1130
1274
  throw new AppwriteException('Missing required parameter: "senderEmail"');
1131
1275
  }
1132
-
1133
1276
  if (typeof host === 'undefined') {
1134
1277
  throw new AppwriteException('Missing required parameter: "host"');
1135
1278
  }
1136
-
1137
1279
  const apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId);
1138
1280
  const payload: Payload = {};
1139
-
1140
1281
  if (typeof emails !== 'undefined') {
1141
1282
  payload['emails'] = emails;
1142
1283
  }
1143
-
1144
1284
  if (typeof senderName !== 'undefined') {
1145
1285
  payload['senderName'] = senderName;
1146
1286
  }
1147
-
1148
1287
  if (typeof senderEmail !== 'undefined') {
1149
1288
  payload['senderEmail'] = senderEmail;
1150
1289
  }
1151
-
1152
1290
  if (typeof replyTo !== 'undefined') {
1153
1291
  payload['replyTo'] = replyTo;
1154
1292
  }
1155
-
1156
1293
  if (typeof host !== 'undefined') {
1157
1294
  payload['host'] = host;
1158
1295
  }
1159
-
1160
1296
  if (typeof port !== 'undefined') {
1161
1297
  payload['port'] = port;
1162
1298
  }
1163
-
1164
1299
  if (typeof username !== 'undefined') {
1165
1300
  payload['username'] = username;
1166
1301
  }
1167
-
1168
1302
  if (typeof password !== 'undefined') {
1169
1303
  payload['password'] = password;
1170
1304
  }
1171
-
1172
1305
  if (typeof secure !== 'undefined') {
1173
1306
  payload['secure'] = secure;
1174
1307
  }
1175
-
1176
1308
  const uri = new URL(this.client.config.endpoint + apiPath);
1177
- return await this.client.call('post', uri, {
1309
+
1310
+ const apiHeaders: { [header: string]: string } = {
1178
1311
  'content-type': 'application/json',
1179
- }, payload);
1180
- }
1312
+ }
1181
1313
 
1314
+ return await this.client.call(
1315
+ 'post',
1316
+ uri,
1317
+ apiHeaders,
1318
+ payload
1319
+ );
1320
+ }
1182
1321
  /**
1183
- * Update Project Team
1322
+ * Update project team
1184
1323
  *
1185
1324
  *
1186
1325
  * @param {string} projectId
1187
1326
  * @param {string} teamId
1188
1327
  * @throws {AppwriteException}
1189
- * @returns {Promise}
1190
- */
1328
+ * @returns {Promise<Models.Project>}
1329
+ */
1191
1330
  async updateTeam(projectId: string, teamId: string): Promise<Models.Project> {
1192
1331
  if (typeof projectId === 'undefined') {
1193
1332
  throw new AppwriteException('Missing required parameter: "projectId"');
1194
1333
  }
1195
-
1196
1334
  if (typeof teamId === 'undefined') {
1197
1335
  throw new AppwriteException('Missing required parameter: "teamId"');
1198
1336
  }
1199
-
1200
1337
  const apiPath = '/projects/{projectId}/team'.replace('{projectId}', projectId);
1201
1338
  const payload: Payload = {};
1202
-
1203
1339
  if (typeof teamId !== 'undefined') {
1204
1340
  payload['teamId'] = teamId;
1205
1341
  }
1206
-
1207
1342
  const uri = new URL(this.client.config.endpoint + apiPath);
1208
- return await this.client.call('patch', uri, {
1343
+
1344
+ const apiHeaders: { [header: string]: string } = {
1209
1345
  'content-type': 'application/json',
1210
- }, payload);
1211
- }
1346
+ }
1212
1347
 
1348
+ return await this.client.call(
1349
+ 'patch',
1350
+ uri,
1351
+ apiHeaders,
1352
+ payload
1353
+ );
1354
+ }
1213
1355
  /**
1214
1356
  * Get custom email template
1215
1357
  *
@@ -1218,30 +1360,33 @@ export class Projects extends Service {
1218
1360
  * @param {EmailTemplateType} type
1219
1361
  * @param {EmailTemplateLocale} locale
1220
1362
  * @throws {AppwriteException}
1221
- * @returns {Promise}
1222
- */
1363
+ * @returns {Promise<Models.EmailTemplate>}
1364
+ */
1223
1365
  async getEmailTemplate(projectId: string, type: EmailTemplateType, locale: EmailTemplateLocale): Promise<Models.EmailTemplate> {
1224
1366
  if (typeof projectId === 'undefined') {
1225
1367
  throw new AppwriteException('Missing required parameter: "projectId"');
1226
1368
  }
1227
-
1228
1369
  if (typeof type === 'undefined') {
1229
1370
  throw new AppwriteException('Missing required parameter: "type"');
1230
1371
  }
1231
-
1232
1372
  if (typeof locale === 'undefined') {
1233
1373
  throw new AppwriteException('Missing required parameter: "locale"');
1234
1374
  }
1235
-
1236
1375
  const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1237
1376
  const payload: Payload = {};
1238
-
1239
1377
  const uri = new URL(this.client.config.endpoint + apiPath);
1240
- return await this.client.call('get', uri, {
1378
+
1379
+ const apiHeaders: { [header: string]: string } = {
1241
1380
  'content-type': 'application/json',
1242
- }, payload);
1243
- }
1381
+ }
1244
1382
 
1383
+ return await this.client.call(
1384
+ 'get',
1385
+ uri,
1386
+ apiHeaders,
1387
+ payload
1388
+ );
1389
+ }
1245
1390
  /**
1246
1391
  * Update custom email templates
1247
1392
  *
@@ -1255,58 +1400,54 @@ export class Projects extends Service {
1255
1400
  * @param {string} senderEmail
1256
1401
  * @param {string} replyTo
1257
1402
  * @throws {AppwriteException}
1258
- * @returns {Promise}
1259
- */
1403
+ * @returns {Promise<Models.Project>}
1404
+ */
1260
1405
  async updateEmailTemplate(projectId: string, type: EmailTemplateType, locale: EmailTemplateLocale, subject: string, message: string, senderName?: string, senderEmail?: string, replyTo?: string): Promise<Models.Project> {
1261
1406
  if (typeof projectId === 'undefined') {
1262
1407
  throw new AppwriteException('Missing required parameter: "projectId"');
1263
1408
  }
1264
-
1265
1409
  if (typeof type === 'undefined') {
1266
1410
  throw new AppwriteException('Missing required parameter: "type"');
1267
1411
  }
1268
-
1269
1412
  if (typeof locale === 'undefined') {
1270
1413
  throw new AppwriteException('Missing required parameter: "locale"');
1271
1414
  }
1272
-
1273
1415
  if (typeof subject === 'undefined') {
1274
1416
  throw new AppwriteException('Missing required parameter: "subject"');
1275
1417
  }
1276
-
1277
1418
  if (typeof message === 'undefined') {
1278
1419
  throw new AppwriteException('Missing required parameter: "message"');
1279
1420
  }
1280
-
1281
1421
  const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1282
1422
  const payload: Payload = {};
1283
-
1284
1423
  if (typeof subject !== 'undefined') {
1285
1424
  payload['subject'] = subject;
1286
1425
  }
1287
-
1288
1426
  if (typeof message !== 'undefined') {
1289
1427
  payload['message'] = message;
1290
1428
  }
1291
-
1292
1429
  if (typeof senderName !== 'undefined') {
1293
1430
  payload['senderName'] = senderName;
1294
1431
  }
1295
-
1296
1432
  if (typeof senderEmail !== 'undefined') {
1297
1433
  payload['senderEmail'] = senderEmail;
1298
1434
  }
1299
-
1300
1435
  if (typeof replyTo !== 'undefined') {
1301
1436
  payload['replyTo'] = replyTo;
1302
1437
  }
1303
-
1304
1438
  const uri = new URL(this.client.config.endpoint + apiPath);
1305
- return await this.client.call('patch', uri, {
1439
+
1440
+ const apiHeaders: { [header: string]: string } = {
1306
1441
  'content-type': 'application/json',
1307
- }, payload);
1308
- }
1442
+ }
1309
1443
 
1444
+ return await this.client.call(
1445
+ 'patch',
1446
+ uri,
1447
+ apiHeaders,
1448
+ payload
1449
+ );
1450
+ }
1310
1451
  /**
1311
1452
  * Reset custom email template
1312
1453
  *
@@ -1315,30 +1456,33 @@ export class Projects extends Service {
1315
1456
  * @param {EmailTemplateType} type
1316
1457
  * @param {EmailTemplateLocale} locale
1317
1458
  * @throws {AppwriteException}
1318
- * @returns {Promise}
1319
- */
1459
+ * @returns {Promise<Models.EmailTemplate>}
1460
+ */
1320
1461
  async deleteEmailTemplate(projectId: string, type: EmailTemplateType, locale: EmailTemplateLocale): Promise<Models.EmailTemplate> {
1321
1462
  if (typeof projectId === 'undefined') {
1322
1463
  throw new AppwriteException('Missing required parameter: "projectId"');
1323
1464
  }
1324
-
1325
1465
  if (typeof type === 'undefined') {
1326
1466
  throw new AppwriteException('Missing required parameter: "type"');
1327
1467
  }
1328
-
1329
1468
  if (typeof locale === 'undefined') {
1330
1469
  throw new AppwriteException('Missing required parameter: "locale"');
1331
1470
  }
1332
-
1333
1471
  const apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1334
1472
  const payload: Payload = {};
1335
-
1336
1473
  const uri = new URL(this.client.config.endpoint + apiPath);
1337
- return await this.client.call('delete', uri, {
1474
+
1475
+ const apiHeaders: { [header: string]: string } = {
1338
1476
  'content-type': 'application/json',
1339
- }, payload);
1340
- }
1477
+ }
1341
1478
 
1479
+ return await this.client.call(
1480
+ 'delete',
1481
+ uri,
1482
+ apiHeaders,
1483
+ payload
1484
+ );
1485
+ }
1342
1486
  /**
1343
1487
  * Get custom SMS template
1344
1488
  *
@@ -1347,30 +1491,33 @@ export class Projects extends Service {
1347
1491
  * @param {SmsTemplateType} type
1348
1492
  * @param {SmsTemplateLocale} locale
1349
1493
  * @throws {AppwriteException}
1350
- * @returns {Promise}
1351
- */
1494
+ * @returns {Promise<Models.SmsTemplate>}
1495
+ */
1352
1496
  async getSmsTemplate(projectId: string, type: SmsTemplateType, locale: SmsTemplateLocale): Promise<Models.SmsTemplate> {
1353
1497
  if (typeof projectId === 'undefined') {
1354
1498
  throw new AppwriteException('Missing required parameter: "projectId"');
1355
1499
  }
1356
-
1357
1500
  if (typeof type === 'undefined') {
1358
1501
  throw new AppwriteException('Missing required parameter: "type"');
1359
1502
  }
1360
-
1361
1503
  if (typeof locale === 'undefined') {
1362
1504
  throw new AppwriteException('Missing required parameter: "locale"');
1363
1505
  }
1364
-
1365
1506
  const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1366
1507
  const payload: Payload = {};
1367
-
1368
1508
  const uri = new URL(this.client.config.endpoint + apiPath);
1369
- return await this.client.call('get', uri, {
1509
+
1510
+ const apiHeaders: { [header: string]: string } = {
1370
1511
  'content-type': 'application/json',
1371
- }, payload);
1372
- }
1512
+ }
1373
1513
 
1514
+ return await this.client.call(
1515
+ 'get',
1516
+ uri,
1517
+ apiHeaders,
1518
+ payload
1519
+ );
1520
+ }
1374
1521
  /**
1375
1522
  * Update custom SMS template
1376
1523
  *
@@ -1380,38 +1527,39 @@ export class Projects extends Service {
1380
1527
  * @param {SmsTemplateLocale} locale
1381
1528
  * @param {string} message
1382
1529
  * @throws {AppwriteException}
1383
- * @returns {Promise}
1384
- */
1530
+ * @returns {Promise<Models.SmsTemplate>}
1531
+ */
1385
1532
  async updateSmsTemplate(projectId: string, type: SmsTemplateType, locale: SmsTemplateLocale, message: string): Promise<Models.SmsTemplate> {
1386
1533
  if (typeof projectId === 'undefined') {
1387
1534
  throw new AppwriteException('Missing required parameter: "projectId"');
1388
1535
  }
1389
-
1390
1536
  if (typeof type === 'undefined') {
1391
1537
  throw new AppwriteException('Missing required parameter: "type"');
1392
1538
  }
1393
-
1394
1539
  if (typeof locale === 'undefined') {
1395
1540
  throw new AppwriteException('Missing required parameter: "locale"');
1396
1541
  }
1397
-
1398
1542
  if (typeof message === 'undefined') {
1399
1543
  throw new AppwriteException('Missing required parameter: "message"');
1400
1544
  }
1401
-
1402
1545
  const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1403
1546
  const payload: Payload = {};
1404
-
1405
1547
  if (typeof message !== 'undefined') {
1406
1548
  payload['message'] = message;
1407
1549
  }
1408
-
1409
1550
  const uri = new URL(this.client.config.endpoint + apiPath);
1410
- return await this.client.call('patch', uri, {
1551
+
1552
+ const apiHeaders: { [header: string]: string } = {
1411
1553
  'content-type': 'application/json',
1412
- }, payload);
1413
- }
1554
+ }
1414
1555
 
1556
+ return await this.client.call(
1557
+ 'patch',
1558
+ uri,
1559
+ apiHeaders,
1560
+ payload
1561
+ );
1562
+ }
1415
1563
  /**
1416
1564
  * Reset custom SMS template
1417
1565
  *
@@ -1420,52 +1568,60 @@ export class Projects extends Service {
1420
1568
  * @param {SmsTemplateType} type
1421
1569
  * @param {SmsTemplateLocale} locale
1422
1570
  * @throws {AppwriteException}
1423
- * @returns {Promise}
1424
- */
1571
+ * @returns {Promise<Models.SmsTemplate>}
1572
+ */
1425
1573
  async deleteSmsTemplate(projectId: string, type: SmsTemplateType, locale: SmsTemplateLocale): Promise<Models.SmsTemplate> {
1426
1574
  if (typeof projectId === 'undefined') {
1427
1575
  throw new AppwriteException('Missing required parameter: "projectId"');
1428
1576
  }
1429
-
1430
1577
  if (typeof type === 'undefined') {
1431
1578
  throw new AppwriteException('Missing required parameter: "type"');
1432
1579
  }
1433
-
1434
1580
  if (typeof locale === 'undefined') {
1435
1581
  throw new AppwriteException('Missing required parameter: "locale"');
1436
1582
  }
1437
-
1438
1583
  const apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1439
1584
  const payload: Payload = {};
1440
-
1441
1585
  const uri = new URL(this.client.config.endpoint + apiPath);
1442
- return await this.client.call('delete', uri, {
1586
+
1587
+ const apiHeaders: { [header: string]: string } = {
1443
1588
  'content-type': 'application/json',
1444
- }, payload);
1445
- }
1589
+ }
1446
1590
 
1591
+ return await this.client.call(
1592
+ 'delete',
1593
+ uri,
1594
+ apiHeaders,
1595
+ payload
1596
+ );
1597
+ }
1447
1598
  /**
1448
1599
  * List webhooks
1449
1600
  *
1450
1601
  *
1451
1602
  * @param {string} projectId
1452
1603
  * @throws {AppwriteException}
1453
- * @returns {Promise}
1454
- */
1604
+ * @returns {Promise<Models.WebhookList>}
1605
+ */
1455
1606
  async listWebhooks(projectId: string): Promise<Models.WebhookList> {
1456
1607
  if (typeof projectId === 'undefined') {
1457
1608
  throw new AppwriteException('Missing required parameter: "projectId"');
1458
1609
  }
1459
-
1460
1610
  const apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1461
1611
  const payload: Payload = {};
1462
-
1463
1612
  const uri = new URL(this.client.config.endpoint + apiPath);
1464
- return await this.client.call('get', uri, {
1613
+
1614
+ const apiHeaders: { [header: string]: string } = {
1465
1615
  'content-type': 'application/json',
1466
- }, payload);
1467
- }
1616
+ }
1468
1617
 
1618
+ return await this.client.call(
1619
+ 'get',
1620
+ uri,
1621
+ apiHeaders,
1622
+ payload
1623
+ );
1624
+ }
1469
1625
  /**
1470
1626
  * Create webhook
1471
1627
  *
@@ -1479,66 +1635,60 @@ export class Projects extends Service {
1479
1635
  * @param {string} httpUser
1480
1636
  * @param {string} httpPass
1481
1637
  * @throws {AppwriteException}
1482
- * @returns {Promise}
1483
- */
1638
+ * @returns {Promise<Models.Webhook>}
1639
+ */
1484
1640
  async createWebhook(projectId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
1485
1641
  if (typeof projectId === 'undefined') {
1486
1642
  throw new AppwriteException('Missing required parameter: "projectId"');
1487
1643
  }
1488
-
1489
1644
  if (typeof name === 'undefined') {
1490
1645
  throw new AppwriteException('Missing required parameter: "name"');
1491
1646
  }
1492
-
1493
1647
  if (typeof events === 'undefined') {
1494
1648
  throw new AppwriteException('Missing required parameter: "events"');
1495
1649
  }
1496
-
1497
1650
  if (typeof url === 'undefined') {
1498
1651
  throw new AppwriteException('Missing required parameter: "url"');
1499
1652
  }
1500
-
1501
1653
  if (typeof security === 'undefined') {
1502
1654
  throw new AppwriteException('Missing required parameter: "security"');
1503
1655
  }
1504
-
1505
1656
  const apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1506
1657
  const payload: Payload = {};
1507
-
1508
1658
  if (typeof name !== 'undefined') {
1509
1659
  payload['name'] = name;
1510
1660
  }
1511
-
1512
1661
  if (typeof enabled !== 'undefined') {
1513
1662
  payload['enabled'] = enabled;
1514
1663
  }
1515
-
1516
1664
  if (typeof events !== 'undefined') {
1517
1665
  payload['events'] = events;
1518
1666
  }
1519
-
1520
1667
  if (typeof url !== 'undefined') {
1521
1668
  payload['url'] = url;
1522
1669
  }
1523
-
1524
1670
  if (typeof security !== 'undefined') {
1525
1671
  payload['security'] = security;
1526
1672
  }
1527
-
1528
1673
  if (typeof httpUser !== 'undefined') {
1529
1674
  payload['httpUser'] = httpUser;
1530
1675
  }
1531
-
1532
1676
  if (typeof httpPass !== 'undefined') {
1533
1677
  payload['httpPass'] = httpPass;
1534
1678
  }
1535
-
1536
1679
  const uri = new URL(this.client.config.endpoint + apiPath);
1537
- return await this.client.call('post', uri, {
1680
+
1681
+ const apiHeaders: { [header: string]: string } = {
1538
1682
  'content-type': 'application/json',
1539
- }, payload);
1540
- }
1683
+ }
1541
1684
 
1685
+ return await this.client.call(
1686
+ 'post',
1687
+ uri,
1688
+ apiHeaders,
1689
+ payload
1690
+ );
1691
+ }
1542
1692
  /**
1543
1693
  * Get webhook
1544
1694
  *
@@ -1546,26 +1696,30 @@ export class Projects extends Service {
1546
1696
  * @param {string} projectId
1547
1697
  * @param {string} webhookId
1548
1698
  * @throws {AppwriteException}
1549
- * @returns {Promise}
1550
- */
1699
+ * @returns {Promise<Models.Webhook>}
1700
+ */
1551
1701
  async getWebhook(projectId: string, webhookId: string): Promise<Models.Webhook> {
1552
1702
  if (typeof projectId === 'undefined') {
1553
1703
  throw new AppwriteException('Missing required parameter: "projectId"');
1554
1704
  }
1555
-
1556
1705
  if (typeof webhookId === 'undefined') {
1557
1706
  throw new AppwriteException('Missing required parameter: "webhookId"');
1558
1707
  }
1559
-
1560
1708
  const apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1561
1709
  const payload: Payload = {};
1562
-
1563
1710
  const uri = new URL(this.client.config.endpoint + apiPath);
1564
- return await this.client.call('get', uri, {
1711
+
1712
+ const apiHeaders: { [header: string]: string } = {
1565
1713
  'content-type': 'application/json',
1566
- }, payload);
1567
- }
1714
+ }
1568
1715
 
1716
+ return await this.client.call(
1717
+ 'get',
1718
+ uri,
1719
+ apiHeaders,
1720
+ payload
1721
+ );
1722
+ }
1569
1723
  /**
1570
1724
  * Update webhook
1571
1725
  *
@@ -1580,70 +1734,63 @@ export class Projects extends Service {
1580
1734
  * @param {string} httpUser
1581
1735
  * @param {string} httpPass
1582
1736
  * @throws {AppwriteException}
1583
- * @returns {Promise}
1584
- */
1737
+ * @returns {Promise<Models.Webhook>}
1738
+ */
1585
1739
  async updateWebhook(projectId: string, webhookId: string, name: string, events: string[], url: string, security: boolean, enabled?: boolean, httpUser?: string, httpPass?: string): Promise<Models.Webhook> {
1586
1740
  if (typeof projectId === 'undefined') {
1587
1741
  throw new AppwriteException('Missing required parameter: "projectId"');
1588
1742
  }
1589
-
1590
1743
  if (typeof webhookId === 'undefined') {
1591
1744
  throw new AppwriteException('Missing required parameter: "webhookId"');
1592
1745
  }
1593
-
1594
1746
  if (typeof name === 'undefined') {
1595
1747
  throw new AppwriteException('Missing required parameter: "name"');
1596
1748
  }
1597
-
1598
1749
  if (typeof events === 'undefined') {
1599
1750
  throw new AppwriteException('Missing required parameter: "events"');
1600
1751
  }
1601
-
1602
1752
  if (typeof url === 'undefined') {
1603
1753
  throw new AppwriteException('Missing required parameter: "url"');
1604
1754
  }
1605
-
1606
1755
  if (typeof security === 'undefined') {
1607
1756
  throw new AppwriteException('Missing required parameter: "security"');
1608
1757
  }
1609
-
1610
1758
  const apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1611
1759
  const payload: Payload = {};
1612
-
1613
1760
  if (typeof name !== 'undefined') {
1614
1761
  payload['name'] = name;
1615
1762
  }
1616
-
1617
1763
  if (typeof enabled !== 'undefined') {
1618
1764
  payload['enabled'] = enabled;
1619
1765
  }
1620
-
1621
1766
  if (typeof events !== 'undefined') {
1622
1767
  payload['events'] = events;
1623
1768
  }
1624
-
1625
1769
  if (typeof url !== 'undefined') {
1626
1770
  payload['url'] = url;
1627
1771
  }
1628
-
1629
1772
  if (typeof security !== 'undefined') {
1630
1773
  payload['security'] = security;
1631
1774
  }
1632
-
1633
1775
  if (typeof httpUser !== 'undefined') {
1634
1776
  payload['httpUser'] = httpUser;
1635
1777
  }
1636
-
1637
1778
  if (typeof httpPass !== 'undefined') {
1638
1779
  payload['httpPass'] = httpPass;
1639
1780
  }
1640
-
1641
1781
  const uri = new URL(this.client.config.endpoint + apiPath);
1642
- return await this.client.call('put', uri, {
1782
+
1783
+ const apiHeaders: { [header: string]: string } = {
1643
1784
  'content-type': 'application/json',
1644
- }, payload);
1645
- }
1785
+ }
1646
1786
 
1787
+ return await this.client.call(
1788
+ 'put',
1789
+ uri,
1790
+ apiHeaders,
1791
+ payload
1792
+ );
1793
+ }
1647
1794
  /**
1648
1795
  * Delete webhook
1649
1796
  *
@@ -1651,26 +1798,30 @@ export class Projects extends Service {
1651
1798
  * @param {string} projectId
1652
1799
  * @param {string} webhookId
1653
1800
  * @throws {AppwriteException}
1654
- * @returns {Promise}
1655
- */
1801
+ * @returns {Promise<{}>}
1802
+ */
1656
1803
  async deleteWebhook(projectId: string, webhookId: string): Promise<{}> {
1657
1804
  if (typeof projectId === 'undefined') {
1658
1805
  throw new AppwriteException('Missing required parameter: "projectId"');
1659
1806
  }
1660
-
1661
1807
  if (typeof webhookId === 'undefined') {
1662
1808
  throw new AppwriteException('Missing required parameter: "webhookId"');
1663
1809
  }
1664
-
1665
1810
  const apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1666
1811
  const payload: Payload = {};
1667
-
1668
1812
  const uri = new URL(this.client.config.endpoint + apiPath);
1669
- return await this.client.call('delete', uri, {
1813
+
1814
+ const apiHeaders: { [header: string]: string } = {
1670
1815
  'content-type': 'application/json',
1671
- }, payload);
1672
- }
1816
+ }
1673
1817
 
1818
+ return await this.client.call(
1819
+ 'delete',
1820
+ uri,
1821
+ apiHeaders,
1822
+ payload
1823
+ );
1824
+ }
1674
1825
  /**
1675
1826
  * Update webhook signature key
1676
1827
  *
@@ -1678,23 +1829,28 @@ export class Projects extends Service {
1678
1829
  * @param {string} projectId
1679
1830
  * @param {string} webhookId
1680
1831
  * @throws {AppwriteException}
1681
- * @returns {Promise}
1682
- */
1832
+ * @returns {Promise<Models.Webhook>}
1833
+ */
1683
1834
  async updateWebhookSignature(projectId: string, webhookId: string): Promise<Models.Webhook> {
1684
1835
  if (typeof projectId === 'undefined') {
1685
1836
  throw new AppwriteException('Missing required parameter: "projectId"');
1686
1837
  }
1687
-
1688
1838
  if (typeof webhookId === 'undefined') {
1689
1839
  throw new AppwriteException('Missing required parameter: "webhookId"');
1690
1840
  }
1691
-
1692
1841
  const apiPath = '/projects/{projectId}/webhooks/{webhookId}/signature'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1693
1842
  const payload: Payload = {};
1694
-
1695
1843
  const uri = new URL(this.client.config.endpoint + apiPath);
1696
- return await this.client.call('patch', uri, {
1844
+
1845
+ const apiHeaders: { [header: string]: string } = {
1697
1846
  'content-type': 'application/json',
1698
- }, payload);
1847
+ }
1848
+
1849
+ return await this.client.call(
1850
+ 'patch',
1851
+ uri,
1852
+ apiHeaders,
1853
+ payload
1854
+ );
1699
1855
  }
1700
- };
1856
+ }