@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,15 +1,13 @@
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 { SmtpEncryption } from '../enums/smtp-encryption';
6
4
 
7
- export class Messaging extends Service {
5
+ export class Messaging {
6
+ client: Client;
8
7
 
9
- constructor(client: Client)
10
- {
11
- super(client);
12
- }
8
+ constructor(client: Client) {
9
+ this.client = client;
10
+ }
13
11
 
14
12
  /**
15
13
  * List messages
@@ -19,26 +17,30 @@ export class Messaging extends Service {
19
17
  * @param {string[]} queries
20
18
  * @param {string} search
21
19
  * @throws {AppwriteException}
22
- * @returns {Promise}
23
- */
20
+ * @returns {Promise<Models.MessageList>}
21
+ */
24
22
  async listMessages(queries?: string[], search?: string): Promise<Models.MessageList> {
25
23
  const apiPath = '/messaging/messages';
26
24
  const payload: Payload = {};
27
-
28
25
  if (typeof queries !== 'undefined') {
29
26
  payload['queries'] = queries;
30
27
  }
31
-
32
28
  if (typeof search !== 'undefined') {
33
29
  payload['search'] = search;
34
30
  }
35
-
36
31
  const uri = new URL(this.client.config.endpoint + apiPath);
37
- return await this.client.call('get', uri, {
32
+
33
+ const apiHeaders: { [header: string]: string } = {
38
34
  'content-type': 'application/json',
39
- }, payload);
40
- }
35
+ }
41
36
 
37
+ return await this.client.call(
38
+ 'get',
39
+ uri,
40
+ apiHeaders,
41
+ payload
42
+ );
43
+ }
42
44
  /**
43
45
  * Create email
44
46
  *
@@ -57,83 +59,74 @@ export class Messaging extends Service {
57
59
  * @param {boolean} html
58
60
  * @param {string} scheduledAt
59
61
  * @throws {AppwriteException}
60
- * @returns {Promise}
61
- */
62
+ * @returns {Promise<Models.Message>}
63
+ */
62
64
  async createEmail(messageId: string, subject: string, content: string, topics?: string[], users?: string[], targets?: string[], cc?: string[], bcc?: string[], attachments?: string[], draft?: boolean, html?: boolean, scheduledAt?: string): Promise<Models.Message> {
63
65
  if (typeof messageId === 'undefined') {
64
66
  throw new AppwriteException('Missing required parameter: "messageId"');
65
67
  }
66
-
67
68
  if (typeof subject === 'undefined') {
68
69
  throw new AppwriteException('Missing required parameter: "subject"');
69
70
  }
70
-
71
71
  if (typeof content === 'undefined') {
72
72
  throw new AppwriteException('Missing required parameter: "content"');
73
73
  }
74
-
75
74
  const apiPath = '/messaging/messages/email';
76
75
  const payload: Payload = {};
77
-
78
76
  if (typeof messageId !== 'undefined') {
79
77
  payload['messageId'] = messageId;
80
78
  }
81
-
82
79
  if (typeof subject !== 'undefined') {
83
80
  payload['subject'] = subject;
84
81
  }
85
-
86
82
  if (typeof content !== 'undefined') {
87
83
  payload['content'] = content;
88
84
  }
89
-
90
85
  if (typeof topics !== 'undefined') {
91
86
  payload['topics'] = topics;
92
87
  }
93
-
94
88
  if (typeof users !== 'undefined') {
95
89
  payload['users'] = users;
96
90
  }
97
-
98
91
  if (typeof targets !== 'undefined') {
99
92
  payload['targets'] = targets;
100
93
  }
101
-
102
94
  if (typeof cc !== 'undefined') {
103
95
  payload['cc'] = cc;
104
96
  }
105
-
106
97
  if (typeof bcc !== 'undefined') {
107
98
  payload['bcc'] = bcc;
108
99
  }
109
-
110
100
  if (typeof attachments !== 'undefined') {
111
101
  payload['attachments'] = attachments;
112
102
  }
113
-
114
103
  if (typeof draft !== 'undefined') {
115
104
  payload['draft'] = draft;
116
105
  }
117
-
118
106
  if (typeof html !== 'undefined') {
119
107
  payload['html'] = html;
120
108
  }
121
-
122
109
  if (typeof scheduledAt !== 'undefined') {
123
110
  payload['scheduledAt'] = scheduledAt;
124
111
  }
125
-
126
112
  const uri = new URL(this.client.config.endpoint + apiPath);
127
- return await this.client.call('post', uri, {
113
+
114
+ const apiHeaders: { [header: string]: string } = {
128
115
  'content-type': 'application/json',
129
- }, payload);
130
- }
116
+ }
131
117
 
118
+ return await this.client.call(
119
+ 'post',
120
+ uri,
121
+ apiHeaders,
122
+ payload
123
+ );
124
+ }
132
125
  /**
133
126
  * Update email
134
127
  *
135
128
  * Update an email message by its unique ID.
136
- *
129
+
137
130
  *
138
131
  * @param {string} messageId
139
132
  * @param {string[]} topics
@@ -148,66 +141,60 @@ export class Messaging extends Service {
148
141
  * @param {string} scheduledAt
149
142
  * @param {string[]} attachments
150
143
  * @throws {AppwriteException}
151
- * @returns {Promise}
152
- */
144
+ * @returns {Promise<Models.Message>}
145
+ */
153
146
  async updateEmail(messageId: string, topics?: string[], users?: string[], targets?: string[], subject?: string, content?: string, draft?: boolean, html?: boolean, cc?: string[], bcc?: string[], scheduledAt?: string, attachments?: string[]): Promise<Models.Message> {
154
147
  if (typeof messageId === 'undefined') {
155
148
  throw new AppwriteException('Missing required parameter: "messageId"');
156
149
  }
157
-
158
150
  const apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', messageId);
159
151
  const payload: Payload = {};
160
-
161
152
  if (typeof topics !== 'undefined') {
162
153
  payload['topics'] = topics;
163
154
  }
164
-
165
155
  if (typeof users !== 'undefined') {
166
156
  payload['users'] = users;
167
157
  }
168
-
169
158
  if (typeof targets !== 'undefined') {
170
159
  payload['targets'] = targets;
171
160
  }
172
-
173
161
  if (typeof subject !== 'undefined') {
174
162
  payload['subject'] = subject;
175
163
  }
176
-
177
164
  if (typeof content !== 'undefined') {
178
165
  payload['content'] = content;
179
166
  }
180
-
181
167
  if (typeof draft !== 'undefined') {
182
168
  payload['draft'] = draft;
183
169
  }
184
-
185
170
  if (typeof html !== 'undefined') {
186
171
  payload['html'] = html;
187
172
  }
188
-
189
173
  if (typeof cc !== 'undefined') {
190
174
  payload['cc'] = cc;
191
175
  }
192
-
193
176
  if (typeof bcc !== 'undefined') {
194
177
  payload['bcc'] = bcc;
195
178
  }
196
-
197
179
  if (typeof scheduledAt !== 'undefined') {
198
180
  payload['scheduledAt'] = scheduledAt;
199
181
  }
200
-
201
182
  if (typeof attachments !== 'undefined') {
202
183
  payload['attachments'] = attachments;
203
184
  }
204
-
205
185
  const uri = new URL(this.client.config.endpoint + apiPath);
206
- return await this.client.call('patch', uri, {
186
+
187
+ const apiHeaders: { [header: string]: string } = {
207
188
  'content-type': 'application/json',
208
- }, payload);
209
- }
189
+ }
210
190
 
191
+ return await this.client.call(
192
+ 'patch',
193
+ uri,
194
+ apiHeaders,
195
+ payload
196
+ );
197
+ }
211
198
  /**
212
199
  * Create push notification
213
200
  *
@@ -230,99 +217,86 @@ export class Messaging extends Service {
230
217
  * @param {boolean} draft
231
218
  * @param {string} scheduledAt
232
219
  * @throws {AppwriteException}
233
- * @returns {Promise}
234
- */
220
+ * @returns {Promise<Models.Message>}
221
+ */
235
222
  async createPush(messageId: string, title: string, body: string, topics?: string[], users?: string[], targets?: string[], data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message> {
236
223
  if (typeof messageId === 'undefined') {
237
224
  throw new AppwriteException('Missing required parameter: "messageId"');
238
225
  }
239
-
240
226
  if (typeof title === 'undefined') {
241
227
  throw new AppwriteException('Missing required parameter: "title"');
242
228
  }
243
-
244
229
  if (typeof body === 'undefined') {
245
230
  throw new AppwriteException('Missing required parameter: "body"');
246
231
  }
247
-
248
232
  const apiPath = '/messaging/messages/push';
249
233
  const payload: Payload = {};
250
-
251
234
  if (typeof messageId !== 'undefined') {
252
235
  payload['messageId'] = messageId;
253
236
  }
254
-
255
237
  if (typeof title !== 'undefined') {
256
238
  payload['title'] = title;
257
239
  }
258
-
259
240
  if (typeof body !== 'undefined') {
260
241
  payload['body'] = body;
261
242
  }
262
-
263
243
  if (typeof topics !== 'undefined') {
264
244
  payload['topics'] = topics;
265
245
  }
266
-
267
246
  if (typeof users !== 'undefined') {
268
247
  payload['users'] = users;
269
248
  }
270
-
271
249
  if (typeof targets !== 'undefined') {
272
250
  payload['targets'] = targets;
273
251
  }
274
-
275
252
  if (typeof data !== 'undefined') {
276
253
  payload['data'] = data;
277
254
  }
278
-
279
255
  if (typeof action !== 'undefined') {
280
256
  payload['action'] = action;
281
257
  }
282
-
283
258
  if (typeof image !== 'undefined') {
284
259
  payload['image'] = image;
285
260
  }
286
-
287
261
  if (typeof icon !== 'undefined') {
288
262
  payload['icon'] = icon;
289
263
  }
290
-
291
264
  if (typeof sound !== 'undefined') {
292
265
  payload['sound'] = sound;
293
266
  }
294
-
295
267
  if (typeof color !== 'undefined') {
296
268
  payload['color'] = color;
297
269
  }
298
-
299
270
  if (typeof tag !== 'undefined') {
300
271
  payload['tag'] = tag;
301
272
  }
302
-
303
273
  if (typeof badge !== 'undefined') {
304
274
  payload['badge'] = badge;
305
275
  }
306
-
307
276
  if (typeof draft !== 'undefined') {
308
277
  payload['draft'] = draft;
309
278
  }
310
-
311
279
  if (typeof scheduledAt !== 'undefined') {
312
280
  payload['scheduledAt'] = scheduledAt;
313
281
  }
314
-
315
282
  const uri = new URL(this.client.config.endpoint + apiPath);
316
- return await this.client.call('post', uri, {
283
+
284
+ const apiHeaders: { [header: string]: string } = {
317
285
  'content-type': 'application/json',
318
- }, payload);
319
- }
286
+ }
320
287
 
288
+ return await this.client.call(
289
+ 'post',
290
+ uri,
291
+ apiHeaders,
292
+ payload
293
+ );
294
+ }
321
295
  /**
322
296
  * Update push notification
323
297
  *
324
298
  * Update a push notification by its unique ID.
325
- *
299
+
326
300
  *
327
301
  * @param {string} messageId
328
302
  * @param {string[]} topics
@@ -341,82 +315,72 @@ export class Messaging extends Service {
341
315
  * @param {boolean} draft
342
316
  * @param {string} scheduledAt
343
317
  * @throws {AppwriteException}
344
- * @returns {Promise}
345
- */
318
+ * @returns {Promise<Models.Message>}
319
+ */
346
320
  async updatePush(messageId: string, topics?: string[], users?: string[], targets?: string[], title?: string, body?: string, data?: object, action?: string, image?: string, icon?: string, sound?: string, color?: string, tag?: string, badge?: number, draft?: boolean, scheduledAt?: string): Promise<Models.Message> {
347
321
  if (typeof messageId === 'undefined') {
348
322
  throw new AppwriteException('Missing required parameter: "messageId"');
349
323
  }
350
-
351
324
  const apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
352
325
  const payload: Payload = {};
353
-
354
326
  if (typeof topics !== 'undefined') {
355
327
  payload['topics'] = topics;
356
328
  }
357
-
358
329
  if (typeof users !== 'undefined') {
359
330
  payload['users'] = users;
360
331
  }
361
-
362
332
  if (typeof targets !== 'undefined') {
363
333
  payload['targets'] = targets;
364
334
  }
365
-
366
335
  if (typeof title !== 'undefined') {
367
336
  payload['title'] = title;
368
337
  }
369
-
370
338
  if (typeof body !== 'undefined') {
371
339
  payload['body'] = body;
372
340
  }
373
-
374
341
  if (typeof data !== 'undefined') {
375
342
  payload['data'] = data;
376
343
  }
377
-
378
344
  if (typeof action !== 'undefined') {
379
345
  payload['action'] = action;
380
346
  }
381
-
382
347
  if (typeof image !== 'undefined') {
383
348
  payload['image'] = image;
384
349
  }
385
-
386
350
  if (typeof icon !== 'undefined') {
387
351
  payload['icon'] = icon;
388
352
  }
389
-
390
353
  if (typeof sound !== 'undefined') {
391
354
  payload['sound'] = sound;
392
355
  }
393
-
394
356
  if (typeof color !== 'undefined') {
395
357
  payload['color'] = color;
396
358
  }
397
-
398
359
  if (typeof tag !== 'undefined') {
399
360
  payload['tag'] = tag;
400
361
  }
401
-
402
362
  if (typeof badge !== 'undefined') {
403
363
  payload['badge'] = badge;
404
364
  }
405
-
406
365
  if (typeof draft !== 'undefined') {
407
366
  payload['draft'] = draft;
408
367
  }
409
-
410
368
  if (typeof scheduledAt !== 'undefined') {
411
369
  payload['scheduledAt'] = scheduledAt;
412
370
  }
413
-
414
371
  const uri = new URL(this.client.config.endpoint + apiPath);
415
- return await this.client.call('patch', uri, {
372
+
373
+ const apiHeaders: { [header: string]: string } = {
416
374
  'content-type': 'application/json',
417
- }, payload);
418
- }
375
+ }
419
376
 
377
+ return await this.client.call(
378
+ 'patch',
379
+ uri,
380
+ apiHeaders,
381
+ payload
382
+ );
383
+ }
420
384
  /**
421
385
  * Create SMS
422
386
  *
@@ -430,59 +394,56 @@ export class Messaging extends Service {
430
394
  * @param {boolean} draft
431
395
  * @param {string} scheduledAt
432
396
  * @throws {AppwriteException}
433
- * @returns {Promise}
434
- */
397
+ * @returns {Promise<Models.Message>}
398
+ */
435
399
  async createSms(messageId: string, content: string, topics?: string[], users?: string[], targets?: string[], draft?: boolean, scheduledAt?: string): Promise<Models.Message> {
436
400
  if (typeof messageId === 'undefined') {
437
401
  throw new AppwriteException('Missing required parameter: "messageId"');
438
402
  }
439
-
440
403
  if (typeof content === 'undefined') {
441
404
  throw new AppwriteException('Missing required parameter: "content"');
442
405
  }
443
-
444
406
  const apiPath = '/messaging/messages/sms';
445
407
  const payload: Payload = {};
446
-
447
408
  if (typeof messageId !== 'undefined') {
448
409
  payload['messageId'] = messageId;
449
410
  }
450
-
451
411
  if (typeof content !== 'undefined') {
452
412
  payload['content'] = content;
453
413
  }
454
-
455
414
  if (typeof topics !== 'undefined') {
456
415
  payload['topics'] = topics;
457
416
  }
458
-
459
417
  if (typeof users !== 'undefined') {
460
418
  payload['users'] = users;
461
419
  }
462
-
463
420
  if (typeof targets !== 'undefined') {
464
421
  payload['targets'] = targets;
465
422
  }
466
-
467
423
  if (typeof draft !== 'undefined') {
468
424
  payload['draft'] = draft;
469
425
  }
470
-
471
426
  if (typeof scheduledAt !== 'undefined') {
472
427
  payload['scheduledAt'] = scheduledAt;
473
428
  }
474
-
475
429
  const uri = new URL(this.client.config.endpoint + apiPath);
476
- return await this.client.call('post', uri, {
430
+
431
+ const apiHeaders: { [header: string]: string } = {
477
432
  'content-type': 'application/json',
478
- }, payload);
479
- }
433
+ }
480
434
 
435
+ return await this.client.call(
436
+ 'post',
437
+ uri,
438
+ apiHeaders,
439
+ payload
440
+ );
441
+ }
481
442
  /**
482
443
  * Update SMS
483
444
  *
484
445
  * Update an email message by its unique ID.
485
- *
446
+
486
447
  *
487
448
  * @param {string} messageId
488
449
  * @param {string[]} topics
@@ -492,94 +453,102 @@ export class Messaging extends Service {
492
453
  * @param {boolean} draft
493
454
  * @param {string} scheduledAt
494
455
  * @throws {AppwriteException}
495
- * @returns {Promise}
496
- */
456
+ * @returns {Promise<Models.Message>}
457
+ */
497
458
  async updateSms(messageId: string, topics?: string[], users?: string[], targets?: string[], content?: string, draft?: boolean, scheduledAt?: string): Promise<Models.Message> {
498
459
  if (typeof messageId === 'undefined') {
499
460
  throw new AppwriteException('Missing required parameter: "messageId"');
500
461
  }
501
-
502
462
  const apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId);
503
463
  const payload: Payload = {};
504
-
505
464
  if (typeof topics !== 'undefined') {
506
465
  payload['topics'] = topics;
507
466
  }
508
-
509
467
  if (typeof users !== 'undefined') {
510
468
  payload['users'] = users;
511
469
  }
512
-
513
470
  if (typeof targets !== 'undefined') {
514
471
  payload['targets'] = targets;
515
472
  }
516
-
517
473
  if (typeof content !== 'undefined') {
518
474
  payload['content'] = content;
519
475
  }
520
-
521
476
  if (typeof draft !== 'undefined') {
522
477
  payload['draft'] = draft;
523
478
  }
524
-
525
479
  if (typeof scheduledAt !== 'undefined') {
526
480
  payload['scheduledAt'] = scheduledAt;
527
481
  }
528
-
529
482
  const uri = new URL(this.client.config.endpoint + apiPath);
530
- return await this.client.call('patch', uri, {
483
+
484
+ const apiHeaders: { [header: string]: string } = {
531
485
  'content-type': 'application/json',
532
- }, payload);
533
- }
486
+ }
534
487
 
488
+ return await this.client.call(
489
+ 'patch',
490
+ uri,
491
+ apiHeaders,
492
+ payload
493
+ );
494
+ }
535
495
  /**
536
496
  * Get message
537
497
  *
538
498
  * Get a message by its unique ID.
539
- *
499
+
540
500
  *
541
501
  * @param {string} messageId
542
502
  * @throws {AppwriteException}
543
- * @returns {Promise}
544
- */
503
+ * @returns {Promise<Models.Message>}
504
+ */
545
505
  async getMessage(messageId: string): Promise<Models.Message> {
546
506
  if (typeof messageId === 'undefined') {
547
507
  throw new AppwriteException('Missing required parameter: "messageId"');
548
508
  }
549
-
550
509
  const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
551
510
  const payload: Payload = {};
552
-
553
511
  const uri = new URL(this.client.config.endpoint + apiPath);
554
- return await this.client.call('get', uri, {
512
+
513
+ const apiHeaders: { [header: string]: string } = {
555
514
  'content-type': 'application/json',
556
- }, payload);
557
- }
515
+ }
558
516
 
517
+ return await this.client.call(
518
+ 'get',
519
+ uri,
520
+ apiHeaders,
521
+ payload
522
+ );
523
+ }
559
524
  /**
560
525
  * Delete message
561
526
  *
562
- * Delete a message. If the message is not a draft or scheduled, but has been
563
- * sent, this will not recall the message.
527
+ * Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.
564
528
  *
565
529
  * @param {string} messageId
566
530
  * @throws {AppwriteException}
567
- * @returns {Promise}
568
- */
531
+ * @returns {Promise<{}>}
532
+ */
569
533
  async delete(messageId: string): Promise<{}> {
570
534
  if (typeof messageId === 'undefined') {
571
535
  throw new AppwriteException('Missing required parameter: "messageId"');
572
536
  }
573
-
574
537
  const apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
575
538
  const payload: Payload = {};
576
-
577
539
  const uri = new URL(this.client.config.endpoint + apiPath);
578
- return await this.client.call('delete', uri, {
540
+
541
+ const apiHeaders: { [header: string]: string } = {
579
542
  'content-type': 'application/json',
580
- }, payload);
581
- }
543
+ }
582
544
 
545
+ return await this.client.call(
546
+ 'delete',
547
+ uri,
548
+ apiHeaders,
549
+ payload
550
+ );
551
+ }
583
552
  /**
584
553
  * List message logs
585
554
  *
@@ -588,26 +557,30 @@ export class Messaging extends Service {
588
557
  * @param {string} messageId
589
558
  * @param {string[]} queries
590
559
  * @throws {AppwriteException}
591
- * @returns {Promise}
592
- */
560
+ * @returns {Promise<Models.LogList>}
561
+ */
593
562
  async listMessageLogs(messageId: string, queries?: string[]): Promise<Models.LogList> {
594
563
  if (typeof messageId === 'undefined') {
595
564
  throw new AppwriteException('Missing required parameter: "messageId"');
596
565
  }
597
-
598
566
  const apiPath = '/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId);
599
567
  const payload: Payload = {};
600
-
601
568
  if (typeof queries !== 'undefined') {
602
569
  payload['queries'] = queries;
603
570
  }
604
-
605
571
  const uri = new URL(this.client.config.endpoint + apiPath);
606
- return await this.client.call('get', uri, {
572
+
573
+ const apiHeaders: { [header: string]: string } = {
607
574
  'content-type': 'application/json',
608
- }, payload);
609
- }
575
+ }
610
576
 
577
+ return await this.client.call(
578
+ 'get',
579
+ uri,
580
+ apiHeaders,
581
+ payload
582
+ );
583
+ }
611
584
  /**
612
585
  * List message targets
613
586
  *
@@ -616,26 +589,30 @@ export class Messaging extends Service {
616
589
  * @param {string} messageId
617
590
  * @param {string[]} queries
618
591
  * @throws {AppwriteException}
619
- * @returns {Promise}
620
- */
592
+ * @returns {Promise<Models.TargetList>}
593
+ */
621
594
  async listTargets(messageId: string, queries?: string[]): Promise<Models.TargetList> {
622
595
  if (typeof messageId === 'undefined') {
623
596
  throw new AppwriteException('Missing required parameter: "messageId"');
624
597
  }
625
-
626
598
  const apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
627
599
  const payload: Payload = {};
628
-
629
600
  if (typeof queries !== 'undefined') {
630
601
  payload['queries'] = queries;
631
602
  }
632
-
633
603
  const uri = new URL(this.client.config.endpoint + apiPath);
634
- return await this.client.call('get', uri, {
604
+
605
+ const apiHeaders: { [header: string]: string } = {
635
606
  'content-type': 'application/json',
636
- }, payload);
637
- }
607
+ }
638
608
 
609
+ return await this.client.call(
610
+ 'get',
611
+ uri,
612
+ apiHeaders,
613
+ payload
614
+ );
615
+ }
639
616
  /**
640
617
  * List providers
641
618
  *
@@ -644,26 +621,30 @@ export class Messaging extends Service {
644
621
  * @param {string[]} queries
645
622
  * @param {string} search
646
623
  * @throws {AppwriteException}
647
- * @returns {Promise}
648
- */
624
+ * @returns {Promise<Models.ProviderList>}
625
+ */
649
626
  async listProviders(queries?: string[], search?: string): Promise<Models.ProviderList> {
650
627
  const apiPath = '/messaging/providers';
651
628
  const payload: Payload = {};
652
-
653
629
  if (typeof queries !== 'undefined') {
654
630
  payload['queries'] = queries;
655
631
  }
656
-
657
632
  if (typeof search !== 'undefined') {
658
633
  payload['search'] = search;
659
634
  }
660
-
661
635
  const uri = new URL(this.client.config.endpoint + apiPath);
662
- return await this.client.call('get', uri, {
636
+
637
+ const apiHeaders: { [header: string]: string } = {
663
638
  'content-type': 'application/json',
664
- }, payload);
665
- }
639
+ }
666
640
 
641
+ return await this.client.call(
642
+ 'get',
643
+ uri,
644
+ apiHeaders,
645
+ payload
646
+ );
647
+ }
667
648
  /**
668
649
  * Create APNS provider
669
650
  *
@@ -678,58 +659,54 @@ export class Messaging extends Service {
678
659
  * @param {boolean} sandbox
679
660
  * @param {boolean} enabled
680
661
  * @throws {AppwriteException}
681
- * @returns {Promise}
682
- */
662
+ * @returns {Promise<Models.Provider>}
663
+ */
683
664
  async createApnsProvider(providerId: string, name: string, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean, enabled?: boolean): Promise<Models.Provider> {
684
665
  if (typeof providerId === 'undefined') {
685
666
  throw new AppwriteException('Missing required parameter: "providerId"');
686
667
  }
687
-
688
668
  if (typeof name === 'undefined') {
689
669
  throw new AppwriteException('Missing required parameter: "name"');
690
670
  }
691
-
692
671
  const apiPath = '/messaging/providers/apns';
693
672
  const payload: Payload = {};
694
-
695
673
  if (typeof providerId !== 'undefined') {
696
674
  payload['providerId'] = providerId;
697
675
  }
698
-
699
676
  if (typeof name !== 'undefined') {
700
677
  payload['name'] = name;
701
678
  }
702
-
703
679
  if (typeof authKey !== 'undefined') {
704
680
  payload['authKey'] = authKey;
705
681
  }
706
-
707
682
  if (typeof authKeyId !== 'undefined') {
708
683
  payload['authKeyId'] = authKeyId;
709
684
  }
710
-
711
685
  if (typeof teamId !== 'undefined') {
712
686
  payload['teamId'] = teamId;
713
687
  }
714
-
715
688
  if (typeof bundleId !== 'undefined') {
716
689
  payload['bundleId'] = bundleId;
717
690
  }
718
-
719
691
  if (typeof sandbox !== 'undefined') {
720
692
  payload['sandbox'] = sandbox;
721
693
  }
722
-
723
694
  if (typeof enabled !== 'undefined') {
724
695
  payload['enabled'] = enabled;
725
696
  }
726
-
727
697
  const uri = new URL(this.client.config.endpoint + apiPath);
728
- return await this.client.call('post', uri, {
698
+
699
+ const apiHeaders: { [header: string]: string } = {
729
700
  'content-type': 'application/json',
730
- }, payload);
731
- }
701
+ }
732
702
 
703
+ return await this.client.call(
704
+ 'post',
705
+ uri,
706
+ apiHeaders,
707
+ payload
708
+ );
709
+ }
733
710
  /**
734
711
  * Update APNS provider
735
712
  *
@@ -744,50 +721,48 @@ export class Messaging extends Service {
744
721
  * @param {string} bundleId
745
722
  * @param {boolean} sandbox
746
723
  * @throws {AppwriteException}
747
- * @returns {Promise}
748
- */
724
+ * @returns {Promise<Models.Provider>}
725
+ */
749
726
  async updateApnsProvider(providerId: string, name?: string, enabled?: boolean, authKey?: string, authKeyId?: string, teamId?: string, bundleId?: string, sandbox?: boolean): Promise<Models.Provider> {
750
727
  if (typeof providerId === 'undefined') {
751
728
  throw new AppwriteException('Missing required parameter: "providerId"');
752
729
  }
753
-
754
730
  const apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId);
755
731
  const payload: Payload = {};
756
-
757
732
  if (typeof name !== 'undefined') {
758
733
  payload['name'] = name;
759
734
  }
760
-
761
735
  if (typeof enabled !== 'undefined') {
762
736
  payload['enabled'] = enabled;
763
737
  }
764
-
765
738
  if (typeof authKey !== 'undefined') {
766
739
  payload['authKey'] = authKey;
767
740
  }
768
-
769
741
  if (typeof authKeyId !== 'undefined') {
770
742
  payload['authKeyId'] = authKeyId;
771
743
  }
772
-
773
744
  if (typeof teamId !== 'undefined') {
774
745
  payload['teamId'] = teamId;
775
746
  }
776
-
777
747
  if (typeof bundleId !== 'undefined') {
778
748
  payload['bundleId'] = bundleId;
779
749
  }
780
-
781
750
  if (typeof sandbox !== 'undefined') {
782
751
  payload['sandbox'] = sandbox;
783
752
  }
784
-
785
753
  const uri = new URL(this.client.config.endpoint + apiPath);
786
- return await this.client.call('patch', uri, {
754
+
755
+ const apiHeaders: { [header: string]: string } = {
787
756
  'content-type': 'application/json',
788
- }, payload);
789
- }
757
+ }
790
758
 
759
+ return await this.client.call(
760
+ 'patch',
761
+ uri,
762
+ apiHeaders,
763
+ payload
764
+ );
765
+ }
791
766
  /**
792
767
  * Create FCM provider
793
768
  *
@@ -798,42 +773,42 @@ export class Messaging extends Service {
798
773
  * @param {object} serviceAccountJSON
799
774
  * @param {boolean} enabled
800
775
  * @throws {AppwriteException}
801
- * @returns {Promise}
802
- */
776
+ * @returns {Promise<Models.Provider>}
777
+ */
803
778
  async createFcmProvider(providerId: string, name: string, serviceAccountJSON?: object, enabled?: boolean): Promise<Models.Provider> {
804
779
  if (typeof providerId === 'undefined') {
805
780
  throw new AppwriteException('Missing required parameter: "providerId"');
806
781
  }
807
-
808
782
  if (typeof name === 'undefined') {
809
783
  throw new AppwriteException('Missing required parameter: "name"');
810
784
  }
811
-
812
785
  const apiPath = '/messaging/providers/fcm';
813
786
  const payload: Payload = {};
814
-
815
787
  if (typeof providerId !== 'undefined') {
816
788
  payload['providerId'] = providerId;
817
789
  }
818
-
819
790
  if (typeof name !== 'undefined') {
820
791
  payload['name'] = name;
821
792
  }
822
-
823
793
  if (typeof serviceAccountJSON !== 'undefined') {
824
794
  payload['serviceAccountJSON'] = serviceAccountJSON;
825
795
  }
826
-
827
796
  if (typeof enabled !== 'undefined') {
828
797
  payload['enabled'] = enabled;
829
798
  }
830
-
831
799
  const uri = new URL(this.client.config.endpoint + apiPath);
832
- return await this.client.call('post', uri, {
800
+
801
+ const apiHeaders: { [header: string]: string } = {
833
802
  'content-type': 'application/json',
834
- }, payload);
835
- }
803
+ }
836
804
 
805
+ return await this.client.call(
806
+ 'post',
807
+ uri,
808
+ apiHeaders,
809
+ payload
810
+ );
811
+ }
837
812
  /**
838
813
  * Update FCM provider
839
814
  *
@@ -844,34 +819,36 @@ export class Messaging extends Service {
844
819
  * @param {boolean} enabled
845
820
  * @param {object} serviceAccountJSON
846
821
  * @throws {AppwriteException}
847
- * @returns {Promise}
848
- */
822
+ * @returns {Promise<Models.Provider>}
823
+ */
849
824
  async updateFcmProvider(providerId: string, name?: string, enabled?: boolean, serviceAccountJSON?: object): Promise<Models.Provider> {
850
825
  if (typeof providerId === 'undefined') {
851
826
  throw new AppwriteException('Missing required parameter: "providerId"');
852
827
  }
853
-
854
828
  const apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId);
855
829
  const payload: Payload = {};
856
-
857
830
  if (typeof name !== 'undefined') {
858
831
  payload['name'] = name;
859
832
  }
860
-
861
833
  if (typeof enabled !== 'undefined') {
862
834
  payload['enabled'] = enabled;
863
835
  }
864
-
865
836
  if (typeof serviceAccountJSON !== 'undefined') {
866
837
  payload['serviceAccountJSON'] = serviceAccountJSON;
867
838
  }
868
-
869
839
  const uri = new URL(this.client.config.endpoint + apiPath);
870
- return await this.client.call('patch', uri, {
840
+
841
+ const apiHeaders: { [header: string]: string } = {
871
842
  'content-type': 'application/json',
872
- }, payload);
873
- }
843
+ }
874
844
 
845
+ return await this.client.call(
846
+ 'patch',
847
+ uri,
848
+ apiHeaders,
849
+ payload
850
+ );
851
+ }
875
852
  /**
876
853
  * Create Mailgun provider
877
854
  *
@@ -888,66 +865,60 @@ export class Messaging extends Service {
888
865
  * @param {string} replyToEmail
889
866
  * @param {boolean} enabled
890
867
  * @throws {AppwriteException}
891
- * @returns {Promise}
892
- */
868
+ * @returns {Promise<Models.Provider>}
869
+ */
893
870
  async createMailgunProvider(providerId: string, name: string, apiKey?: string, domain?: string, isEuRegion?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> {
894
871
  if (typeof providerId === 'undefined') {
895
872
  throw new AppwriteException('Missing required parameter: "providerId"');
896
873
  }
897
-
898
874
  if (typeof name === 'undefined') {
899
875
  throw new AppwriteException('Missing required parameter: "name"');
900
876
  }
901
-
902
877
  const apiPath = '/messaging/providers/mailgun';
903
878
  const payload: Payload = {};
904
-
905
879
  if (typeof providerId !== 'undefined') {
906
880
  payload['providerId'] = providerId;
907
881
  }
908
-
909
882
  if (typeof name !== 'undefined') {
910
883
  payload['name'] = name;
911
884
  }
912
-
913
885
  if (typeof apiKey !== 'undefined') {
914
886
  payload['apiKey'] = apiKey;
915
887
  }
916
-
917
888
  if (typeof domain !== 'undefined') {
918
889
  payload['domain'] = domain;
919
890
  }
920
-
921
891
  if (typeof isEuRegion !== 'undefined') {
922
892
  payload['isEuRegion'] = isEuRegion;
923
893
  }
924
-
925
894
  if (typeof fromName !== 'undefined') {
926
895
  payload['fromName'] = fromName;
927
896
  }
928
-
929
897
  if (typeof fromEmail !== 'undefined') {
930
898
  payload['fromEmail'] = fromEmail;
931
899
  }
932
-
933
900
  if (typeof replyToName !== 'undefined') {
934
901
  payload['replyToName'] = replyToName;
935
902
  }
936
-
937
903
  if (typeof replyToEmail !== 'undefined') {
938
904
  payload['replyToEmail'] = replyToEmail;
939
905
  }
940
-
941
906
  if (typeof enabled !== 'undefined') {
942
907
  payload['enabled'] = enabled;
943
908
  }
944
-
945
909
  const uri = new URL(this.client.config.endpoint + apiPath);
946
- return await this.client.call('post', uri, {
910
+
911
+ const apiHeaders: { [header: string]: string } = {
947
912
  'content-type': 'application/json',
948
- }, payload);
949
- }
913
+ }
950
914
 
915
+ return await this.client.call(
916
+ 'post',
917
+ uri,
918
+ apiHeaders,
919
+ payload
920
+ );
921
+ }
951
922
  /**
952
923
  * Update Mailgun provider
953
924
  *
@@ -964,58 +935,54 @@ export class Messaging extends Service {
964
935
  * @param {string} replyToName
965
936
  * @param {string} replyToEmail
966
937
  * @throws {AppwriteException}
967
- * @returns {Promise}
968
- */
938
+ * @returns {Promise<Models.Provider>}
939
+ */
969
940
  async updateMailgunProvider(providerId: string, name?: string, apiKey?: string, domain?: string, isEuRegion?: boolean, enabled?: boolean, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise<Models.Provider> {
970
941
  if (typeof providerId === 'undefined') {
971
942
  throw new AppwriteException('Missing required parameter: "providerId"');
972
943
  }
973
-
974
944
  const apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId);
975
945
  const payload: Payload = {};
976
-
977
946
  if (typeof name !== 'undefined') {
978
947
  payload['name'] = name;
979
948
  }
980
-
981
949
  if (typeof apiKey !== 'undefined') {
982
950
  payload['apiKey'] = apiKey;
983
951
  }
984
-
985
952
  if (typeof domain !== 'undefined') {
986
953
  payload['domain'] = domain;
987
954
  }
988
-
989
955
  if (typeof isEuRegion !== 'undefined') {
990
956
  payload['isEuRegion'] = isEuRegion;
991
957
  }
992
-
993
958
  if (typeof enabled !== 'undefined') {
994
959
  payload['enabled'] = enabled;
995
960
  }
996
-
997
961
  if (typeof fromName !== 'undefined') {
998
962
  payload['fromName'] = fromName;
999
963
  }
1000
-
1001
964
  if (typeof fromEmail !== 'undefined') {
1002
965
  payload['fromEmail'] = fromEmail;
1003
966
  }
1004
-
1005
967
  if (typeof replyToName !== 'undefined') {
1006
968
  payload['replyToName'] = replyToName;
1007
969
  }
1008
-
1009
970
  if (typeof replyToEmail !== 'undefined') {
1010
971
  payload['replyToEmail'] = replyToEmail;
1011
972
  }
1012
-
1013
973
  const uri = new URL(this.client.config.endpoint + apiPath);
1014
- return await this.client.call('patch', uri, {
974
+
975
+ const apiHeaders: { [header: string]: string } = {
1015
976
  'content-type': 'application/json',
1016
- }, payload);
1017
- }
977
+ }
1018
978
 
979
+ return await this.client.call(
980
+ 'patch',
981
+ uri,
982
+ apiHeaders,
983
+ payload
984
+ );
985
+ }
1019
986
  /**
1020
987
  * Create Msg91 provider
1021
988
  *
@@ -1028,50 +995,48 @@ export class Messaging extends Service {
1028
995
  * @param {string} authKey
1029
996
  * @param {boolean} enabled
1030
997
  * @throws {AppwriteException}
1031
- * @returns {Promise}
1032
- */
998
+ * @returns {Promise<Models.Provider>}
999
+ */
1033
1000
  async createMsg91Provider(providerId: string, name: string, templateId?: string, senderId?: string, authKey?: string, enabled?: boolean): Promise<Models.Provider> {
1034
1001
  if (typeof providerId === 'undefined') {
1035
1002
  throw new AppwriteException('Missing required parameter: "providerId"');
1036
1003
  }
1037
-
1038
1004
  if (typeof name === 'undefined') {
1039
1005
  throw new AppwriteException('Missing required parameter: "name"');
1040
1006
  }
1041
-
1042
1007
  const apiPath = '/messaging/providers/msg91';
1043
1008
  const payload: Payload = {};
1044
-
1045
1009
  if (typeof providerId !== 'undefined') {
1046
1010
  payload['providerId'] = providerId;
1047
1011
  }
1048
-
1049
1012
  if (typeof name !== 'undefined') {
1050
1013
  payload['name'] = name;
1051
1014
  }
1052
-
1053
1015
  if (typeof templateId !== 'undefined') {
1054
1016
  payload['templateId'] = templateId;
1055
1017
  }
1056
-
1057
1018
  if (typeof senderId !== 'undefined') {
1058
1019
  payload['senderId'] = senderId;
1059
1020
  }
1060
-
1061
1021
  if (typeof authKey !== 'undefined') {
1062
1022
  payload['authKey'] = authKey;
1063
1023
  }
1064
-
1065
1024
  if (typeof enabled !== 'undefined') {
1066
1025
  payload['enabled'] = enabled;
1067
1026
  }
1068
-
1069
1027
  const uri = new URL(this.client.config.endpoint + apiPath);
1070
- return await this.client.call('post', uri, {
1028
+
1029
+ const apiHeaders: { [header: string]: string } = {
1071
1030
  'content-type': 'application/json',
1072
- }, payload);
1073
- }
1031
+ }
1074
1032
 
1033
+ return await this.client.call(
1034
+ 'post',
1035
+ uri,
1036
+ apiHeaders,
1037
+ payload
1038
+ );
1039
+ }
1075
1040
  /**
1076
1041
  * Update Msg91 provider
1077
1042
  *
@@ -1084,42 +1049,42 @@ export class Messaging extends Service {
1084
1049
  * @param {string} senderId
1085
1050
  * @param {string} authKey
1086
1051
  * @throws {AppwriteException}
1087
- * @returns {Promise}
1088
- */
1052
+ * @returns {Promise<Models.Provider>}
1053
+ */
1089
1054
  async updateMsg91Provider(providerId: string, name?: string, enabled?: boolean, templateId?: string, senderId?: string, authKey?: string): Promise<Models.Provider> {
1090
1055
  if (typeof providerId === 'undefined') {
1091
1056
  throw new AppwriteException('Missing required parameter: "providerId"');
1092
1057
  }
1093
-
1094
1058
  const apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId);
1095
1059
  const payload: Payload = {};
1096
-
1097
1060
  if (typeof name !== 'undefined') {
1098
1061
  payload['name'] = name;
1099
1062
  }
1100
-
1101
1063
  if (typeof enabled !== 'undefined') {
1102
1064
  payload['enabled'] = enabled;
1103
1065
  }
1104
-
1105
1066
  if (typeof templateId !== 'undefined') {
1106
1067
  payload['templateId'] = templateId;
1107
1068
  }
1108
-
1109
1069
  if (typeof senderId !== 'undefined') {
1110
1070
  payload['senderId'] = senderId;
1111
1071
  }
1112
-
1113
1072
  if (typeof authKey !== 'undefined') {
1114
1073
  payload['authKey'] = authKey;
1115
1074
  }
1116
-
1117
1075
  const uri = new URL(this.client.config.endpoint + apiPath);
1118
- return await this.client.call('patch', uri, {
1076
+
1077
+ const apiHeaders: { [header: string]: string } = {
1119
1078
  'content-type': 'application/json',
1120
- }, payload);
1121
- }
1079
+ }
1122
1080
 
1081
+ return await this.client.call(
1082
+ 'patch',
1083
+ uri,
1084
+ apiHeaders,
1085
+ payload
1086
+ );
1087
+ }
1123
1088
  /**
1124
1089
  * Create Sendgrid provider
1125
1090
  *
@@ -1134,58 +1099,54 @@ export class Messaging extends Service {
1134
1099
  * @param {string} replyToEmail
1135
1100
  * @param {boolean} enabled
1136
1101
  * @throws {AppwriteException}
1137
- * @returns {Promise}
1138
- */
1102
+ * @returns {Promise<Models.Provider>}
1103
+ */
1139
1104
  async createSendgridProvider(providerId: string, name: string, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> {
1140
1105
  if (typeof providerId === 'undefined') {
1141
1106
  throw new AppwriteException('Missing required parameter: "providerId"');
1142
1107
  }
1143
-
1144
1108
  if (typeof name === 'undefined') {
1145
1109
  throw new AppwriteException('Missing required parameter: "name"');
1146
1110
  }
1147
-
1148
1111
  const apiPath = '/messaging/providers/sendgrid';
1149
1112
  const payload: Payload = {};
1150
-
1151
1113
  if (typeof providerId !== 'undefined') {
1152
1114
  payload['providerId'] = providerId;
1153
1115
  }
1154
-
1155
1116
  if (typeof name !== 'undefined') {
1156
1117
  payload['name'] = name;
1157
1118
  }
1158
-
1159
1119
  if (typeof apiKey !== 'undefined') {
1160
1120
  payload['apiKey'] = apiKey;
1161
1121
  }
1162
-
1163
1122
  if (typeof fromName !== 'undefined') {
1164
1123
  payload['fromName'] = fromName;
1165
1124
  }
1166
-
1167
1125
  if (typeof fromEmail !== 'undefined') {
1168
1126
  payload['fromEmail'] = fromEmail;
1169
1127
  }
1170
-
1171
1128
  if (typeof replyToName !== 'undefined') {
1172
1129
  payload['replyToName'] = replyToName;
1173
1130
  }
1174
-
1175
1131
  if (typeof replyToEmail !== 'undefined') {
1176
1132
  payload['replyToEmail'] = replyToEmail;
1177
1133
  }
1178
-
1179
1134
  if (typeof enabled !== 'undefined') {
1180
1135
  payload['enabled'] = enabled;
1181
1136
  }
1182
-
1183
1137
  const uri = new URL(this.client.config.endpoint + apiPath);
1184
- return await this.client.call('post', uri, {
1138
+
1139
+ const apiHeaders: { [header: string]: string } = {
1185
1140
  'content-type': 'application/json',
1186
- }, payload);
1187
- }
1141
+ }
1188
1142
 
1143
+ return await this.client.call(
1144
+ 'post',
1145
+ uri,
1146
+ apiHeaders,
1147
+ payload
1148
+ );
1149
+ }
1189
1150
  /**
1190
1151
  * Update Sendgrid provider
1191
1152
  *
@@ -1200,50 +1161,48 @@ export class Messaging extends Service {
1200
1161
  * @param {string} replyToName
1201
1162
  * @param {string} replyToEmail
1202
1163
  * @throws {AppwriteException}
1203
- * @returns {Promise}
1204
- */
1164
+ * @returns {Promise<Models.Provider>}
1165
+ */
1205
1166
  async updateSendgridProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string): Promise<Models.Provider> {
1206
1167
  if (typeof providerId === 'undefined') {
1207
1168
  throw new AppwriteException('Missing required parameter: "providerId"');
1208
1169
  }
1209
-
1210
1170
  const apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId);
1211
1171
  const payload: Payload = {};
1212
-
1213
1172
  if (typeof name !== 'undefined') {
1214
1173
  payload['name'] = name;
1215
1174
  }
1216
-
1217
1175
  if (typeof enabled !== 'undefined') {
1218
1176
  payload['enabled'] = enabled;
1219
1177
  }
1220
-
1221
1178
  if (typeof apiKey !== 'undefined') {
1222
1179
  payload['apiKey'] = apiKey;
1223
1180
  }
1224
-
1225
1181
  if (typeof fromName !== 'undefined') {
1226
1182
  payload['fromName'] = fromName;
1227
1183
  }
1228
-
1229
1184
  if (typeof fromEmail !== 'undefined') {
1230
1185
  payload['fromEmail'] = fromEmail;
1231
1186
  }
1232
-
1233
1187
  if (typeof replyToName !== 'undefined') {
1234
1188
  payload['replyToName'] = replyToName;
1235
1189
  }
1236
-
1237
1190
  if (typeof replyToEmail !== 'undefined') {
1238
1191
  payload['replyToEmail'] = replyToEmail;
1239
1192
  }
1240
-
1241
1193
  const uri = new URL(this.client.config.endpoint + apiPath);
1242
- return await this.client.call('patch', uri, {
1194
+
1195
+ const apiHeaders: { [header: string]: string } = {
1243
1196
  'content-type': 'application/json',
1244
- }, payload);
1245
- }
1197
+ }
1246
1198
 
1199
+ return await this.client.call(
1200
+ 'patch',
1201
+ uri,
1202
+ apiHeaders,
1203
+ payload
1204
+ );
1205
+ }
1247
1206
  /**
1248
1207
  * Create SMTP provider
1249
1208
  *
@@ -1264,86 +1223,75 @@ export class Messaging extends Service {
1264
1223
  * @param {string} replyToEmail
1265
1224
  * @param {boolean} enabled
1266
1225
  * @throws {AppwriteException}
1267
- * @returns {Promise}
1268
- */
1226
+ * @returns {Promise<Models.Provider>}
1227
+ */
1269
1228
  async createSmtpProvider(providerId: string, name: string, host: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> {
1270
1229
  if (typeof providerId === 'undefined') {
1271
1230
  throw new AppwriteException('Missing required parameter: "providerId"');
1272
1231
  }
1273
-
1274
1232
  if (typeof name === 'undefined') {
1275
1233
  throw new AppwriteException('Missing required parameter: "name"');
1276
1234
  }
1277
-
1278
1235
  if (typeof host === 'undefined') {
1279
1236
  throw new AppwriteException('Missing required parameter: "host"');
1280
1237
  }
1281
-
1282
1238
  const apiPath = '/messaging/providers/smtp';
1283
1239
  const payload: Payload = {};
1284
-
1285
1240
  if (typeof providerId !== 'undefined') {
1286
1241
  payload['providerId'] = providerId;
1287
1242
  }
1288
-
1289
1243
  if (typeof name !== 'undefined') {
1290
1244
  payload['name'] = name;
1291
1245
  }
1292
-
1293
1246
  if (typeof host !== 'undefined') {
1294
1247
  payload['host'] = host;
1295
1248
  }
1296
-
1297
1249
  if (typeof port !== 'undefined') {
1298
1250
  payload['port'] = port;
1299
1251
  }
1300
-
1301
1252
  if (typeof username !== 'undefined') {
1302
1253
  payload['username'] = username;
1303
1254
  }
1304
-
1305
1255
  if (typeof password !== 'undefined') {
1306
1256
  payload['password'] = password;
1307
1257
  }
1308
-
1309
1258
  if (typeof encryption !== 'undefined') {
1310
1259
  payload['encryption'] = encryption;
1311
1260
  }
1312
-
1313
1261
  if (typeof autoTLS !== 'undefined') {
1314
1262
  payload['autoTLS'] = autoTLS;
1315
1263
  }
1316
-
1317
1264
  if (typeof mailer !== 'undefined') {
1318
1265
  payload['mailer'] = mailer;
1319
1266
  }
1320
-
1321
1267
  if (typeof fromName !== 'undefined') {
1322
1268
  payload['fromName'] = fromName;
1323
1269
  }
1324
-
1325
1270
  if (typeof fromEmail !== 'undefined') {
1326
1271
  payload['fromEmail'] = fromEmail;
1327
1272
  }
1328
-
1329
1273
  if (typeof replyToName !== 'undefined') {
1330
1274
  payload['replyToName'] = replyToName;
1331
1275
  }
1332
-
1333
1276
  if (typeof replyToEmail !== 'undefined') {
1334
1277
  payload['replyToEmail'] = replyToEmail;
1335
1278
  }
1336
-
1337
1279
  if (typeof enabled !== 'undefined') {
1338
1280
  payload['enabled'] = enabled;
1339
1281
  }
1340
-
1341
1282
  const uri = new URL(this.client.config.endpoint + apiPath);
1342
- return await this.client.call('post', uri, {
1283
+
1284
+ const apiHeaders: { [header: string]: string } = {
1343
1285
  'content-type': 'application/json',
1344
- }, payload);
1345
- }
1286
+ }
1346
1287
 
1288
+ return await this.client.call(
1289
+ 'post',
1290
+ uri,
1291
+ apiHeaders,
1292
+ payload
1293
+ );
1294
+ }
1347
1295
  /**
1348
1296
  * Update SMTP provider
1349
1297
  *
@@ -1364,74 +1312,66 @@ export class Messaging extends Service {
1364
1312
  * @param {string} replyToEmail
1365
1313
  * @param {boolean} enabled
1366
1314
  * @throws {AppwriteException}
1367
- * @returns {Promise}
1368
- */
1315
+ * @returns {Promise<Models.Provider>}
1316
+ */
1369
1317
  async updateSmtpProvider(providerId: string, name?: string, host?: string, port?: number, username?: string, password?: string, encryption?: SmtpEncryption, autoTLS?: boolean, mailer?: string, fromName?: string, fromEmail?: string, replyToName?: string, replyToEmail?: string, enabled?: boolean): Promise<Models.Provider> {
1370
1318
  if (typeof providerId === 'undefined') {
1371
1319
  throw new AppwriteException('Missing required parameter: "providerId"');
1372
1320
  }
1373
-
1374
1321
  const apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId);
1375
1322
  const payload: Payload = {};
1376
-
1377
1323
  if (typeof name !== 'undefined') {
1378
1324
  payload['name'] = name;
1379
1325
  }
1380
-
1381
1326
  if (typeof host !== 'undefined') {
1382
1327
  payload['host'] = host;
1383
1328
  }
1384
-
1385
1329
  if (typeof port !== 'undefined') {
1386
1330
  payload['port'] = port;
1387
1331
  }
1388
-
1389
1332
  if (typeof username !== 'undefined') {
1390
1333
  payload['username'] = username;
1391
1334
  }
1392
-
1393
1335
  if (typeof password !== 'undefined') {
1394
1336
  payload['password'] = password;
1395
1337
  }
1396
-
1397
1338
  if (typeof encryption !== 'undefined') {
1398
1339
  payload['encryption'] = encryption;
1399
1340
  }
1400
-
1401
1341
  if (typeof autoTLS !== 'undefined') {
1402
1342
  payload['autoTLS'] = autoTLS;
1403
1343
  }
1404
-
1405
1344
  if (typeof mailer !== 'undefined') {
1406
1345
  payload['mailer'] = mailer;
1407
1346
  }
1408
-
1409
1347
  if (typeof fromName !== 'undefined') {
1410
1348
  payload['fromName'] = fromName;
1411
1349
  }
1412
-
1413
1350
  if (typeof fromEmail !== 'undefined') {
1414
1351
  payload['fromEmail'] = fromEmail;
1415
1352
  }
1416
-
1417
1353
  if (typeof replyToName !== 'undefined') {
1418
1354
  payload['replyToName'] = replyToName;
1419
1355
  }
1420
-
1421
1356
  if (typeof replyToEmail !== 'undefined') {
1422
1357
  payload['replyToEmail'] = replyToEmail;
1423
1358
  }
1424
-
1425
1359
  if (typeof enabled !== 'undefined') {
1426
1360
  payload['enabled'] = enabled;
1427
1361
  }
1428
-
1429
1362
  const uri = new URL(this.client.config.endpoint + apiPath);
1430
- return await this.client.call('patch', uri, {
1363
+
1364
+ const apiHeaders: { [header: string]: string } = {
1431
1365
  'content-type': 'application/json',
1432
- }, payload);
1433
- }
1366
+ }
1434
1367
 
1368
+ return await this.client.call(
1369
+ 'patch',
1370
+ uri,
1371
+ apiHeaders,
1372
+ payload
1373
+ );
1374
+ }
1435
1375
  /**
1436
1376
  * Create Telesign provider
1437
1377
  *
@@ -1444,50 +1384,48 @@ export class Messaging extends Service {
1444
1384
  * @param {string} apiKey
1445
1385
  * @param {boolean} enabled
1446
1386
  * @throws {AppwriteException}
1447
- * @returns {Promise}
1448
- */
1387
+ * @returns {Promise<Models.Provider>}
1388
+ */
1449
1389
  async createTelesignProvider(providerId: string, name: string, from?: string, customerId?: string, apiKey?: string, enabled?: boolean): Promise<Models.Provider> {
1450
1390
  if (typeof providerId === 'undefined') {
1451
1391
  throw new AppwriteException('Missing required parameter: "providerId"');
1452
1392
  }
1453
-
1454
1393
  if (typeof name === 'undefined') {
1455
1394
  throw new AppwriteException('Missing required parameter: "name"');
1456
1395
  }
1457
-
1458
1396
  const apiPath = '/messaging/providers/telesign';
1459
1397
  const payload: Payload = {};
1460
-
1461
1398
  if (typeof providerId !== 'undefined') {
1462
1399
  payload['providerId'] = providerId;
1463
1400
  }
1464
-
1465
1401
  if (typeof name !== 'undefined') {
1466
1402
  payload['name'] = name;
1467
1403
  }
1468
-
1469
1404
  if (typeof from !== 'undefined') {
1470
1405
  payload['from'] = from;
1471
1406
  }
1472
-
1473
1407
  if (typeof customerId !== 'undefined') {
1474
1408
  payload['customerId'] = customerId;
1475
1409
  }
1476
-
1477
1410
  if (typeof apiKey !== 'undefined') {
1478
1411
  payload['apiKey'] = apiKey;
1479
1412
  }
1480
-
1481
1413
  if (typeof enabled !== 'undefined') {
1482
1414
  payload['enabled'] = enabled;
1483
1415
  }
1484
-
1485
1416
  const uri = new URL(this.client.config.endpoint + apiPath);
1486
- return await this.client.call('post', uri, {
1417
+
1418
+ const apiHeaders: { [header: string]: string } = {
1487
1419
  'content-type': 'application/json',
1488
- }, payload);
1489
- }
1420
+ }
1490
1421
 
1422
+ return await this.client.call(
1423
+ 'post',
1424
+ uri,
1425
+ apiHeaders,
1426
+ payload
1427
+ );
1428
+ }
1491
1429
  /**
1492
1430
  * Update Telesign provider
1493
1431
  *
@@ -1500,42 +1438,42 @@ export class Messaging extends Service {
1500
1438
  * @param {string} apiKey
1501
1439
  * @param {string} from
1502
1440
  * @throws {AppwriteException}
1503
- * @returns {Promise}
1504
- */
1441
+ * @returns {Promise<Models.Provider>}
1442
+ */
1505
1443
  async updateTelesignProvider(providerId: string, name?: string, enabled?: boolean, customerId?: string, apiKey?: string, from?: string): Promise<Models.Provider> {
1506
1444
  if (typeof providerId === 'undefined') {
1507
1445
  throw new AppwriteException('Missing required parameter: "providerId"');
1508
1446
  }
1509
-
1510
1447
  const apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId);
1511
1448
  const payload: Payload = {};
1512
-
1513
1449
  if (typeof name !== 'undefined') {
1514
1450
  payload['name'] = name;
1515
1451
  }
1516
-
1517
1452
  if (typeof enabled !== 'undefined') {
1518
1453
  payload['enabled'] = enabled;
1519
1454
  }
1520
-
1521
1455
  if (typeof customerId !== 'undefined') {
1522
1456
  payload['customerId'] = customerId;
1523
1457
  }
1524
-
1525
1458
  if (typeof apiKey !== 'undefined') {
1526
1459
  payload['apiKey'] = apiKey;
1527
1460
  }
1528
-
1529
1461
  if (typeof from !== 'undefined') {
1530
1462
  payload['from'] = from;
1531
1463
  }
1532
-
1533
1464
  const uri = new URL(this.client.config.endpoint + apiPath);
1534
- return await this.client.call('patch', uri, {
1465
+
1466
+ const apiHeaders: { [header: string]: string } = {
1535
1467
  'content-type': 'application/json',
1536
- }, payload);
1537
- }
1468
+ }
1538
1469
 
1470
+ return await this.client.call(
1471
+ 'patch',
1472
+ uri,
1473
+ apiHeaders,
1474
+ payload
1475
+ );
1476
+ }
1539
1477
  /**
1540
1478
  * Create Textmagic provider
1541
1479
  *
@@ -1548,50 +1486,48 @@ export class Messaging extends Service {
1548
1486
  * @param {string} apiKey
1549
1487
  * @param {boolean} enabled
1550
1488
  * @throws {AppwriteException}
1551
- * @returns {Promise}
1552
- */
1489
+ * @returns {Promise<Models.Provider>}
1490
+ */
1553
1491
  async createTextmagicProvider(providerId: string, name: string, from?: string, username?: string, apiKey?: string, enabled?: boolean): Promise<Models.Provider> {
1554
1492
  if (typeof providerId === 'undefined') {
1555
1493
  throw new AppwriteException('Missing required parameter: "providerId"');
1556
1494
  }
1557
-
1558
1495
  if (typeof name === 'undefined') {
1559
1496
  throw new AppwriteException('Missing required parameter: "name"');
1560
1497
  }
1561
-
1562
1498
  const apiPath = '/messaging/providers/textmagic';
1563
1499
  const payload: Payload = {};
1564
-
1565
1500
  if (typeof providerId !== 'undefined') {
1566
1501
  payload['providerId'] = providerId;
1567
1502
  }
1568
-
1569
1503
  if (typeof name !== 'undefined') {
1570
1504
  payload['name'] = name;
1571
1505
  }
1572
-
1573
1506
  if (typeof from !== 'undefined') {
1574
1507
  payload['from'] = from;
1575
1508
  }
1576
-
1577
1509
  if (typeof username !== 'undefined') {
1578
1510
  payload['username'] = username;
1579
1511
  }
1580
-
1581
1512
  if (typeof apiKey !== 'undefined') {
1582
1513
  payload['apiKey'] = apiKey;
1583
1514
  }
1584
-
1585
1515
  if (typeof enabled !== 'undefined') {
1586
1516
  payload['enabled'] = enabled;
1587
1517
  }
1588
-
1589
1518
  const uri = new URL(this.client.config.endpoint + apiPath);
1590
- return await this.client.call('post', uri, {
1519
+
1520
+ const apiHeaders: { [header: string]: string } = {
1591
1521
  'content-type': 'application/json',
1592
- }, payload);
1593
- }
1522
+ }
1594
1523
 
1524
+ return await this.client.call(
1525
+ 'post',
1526
+ uri,
1527
+ apiHeaders,
1528
+ payload
1529
+ );
1530
+ }
1595
1531
  /**
1596
1532
  * Update Textmagic provider
1597
1533
  *
@@ -1604,42 +1540,42 @@ export class Messaging extends Service {
1604
1540
  * @param {string} apiKey
1605
1541
  * @param {string} from
1606
1542
  * @throws {AppwriteException}
1607
- * @returns {Promise}
1608
- */
1543
+ * @returns {Promise<Models.Provider>}
1544
+ */
1609
1545
  async updateTextmagicProvider(providerId: string, name?: string, enabled?: boolean, username?: string, apiKey?: string, from?: string): Promise<Models.Provider> {
1610
1546
  if (typeof providerId === 'undefined') {
1611
1547
  throw new AppwriteException('Missing required parameter: "providerId"');
1612
1548
  }
1613
-
1614
1549
  const apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId);
1615
1550
  const payload: Payload = {};
1616
-
1617
1551
  if (typeof name !== 'undefined') {
1618
1552
  payload['name'] = name;
1619
1553
  }
1620
-
1621
1554
  if (typeof enabled !== 'undefined') {
1622
1555
  payload['enabled'] = enabled;
1623
1556
  }
1624
-
1625
1557
  if (typeof username !== 'undefined') {
1626
1558
  payload['username'] = username;
1627
1559
  }
1628
-
1629
1560
  if (typeof apiKey !== 'undefined') {
1630
1561
  payload['apiKey'] = apiKey;
1631
1562
  }
1632
-
1633
1563
  if (typeof from !== 'undefined') {
1634
1564
  payload['from'] = from;
1635
1565
  }
1636
-
1637
1566
  const uri = new URL(this.client.config.endpoint + apiPath);
1638
- return await this.client.call('patch', uri, {
1567
+
1568
+ const apiHeaders: { [header: string]: string } = {
1639
1569
  'content-type': 'application/json',
1640
- }, payload);
1641
- }
1570
+ }
1642
1571
 
1572
+ return await this.client.call(
1573
+ 'patch',
1574
+ uri,
1575
+ apiHeaders,
1576
+ payload
1577
+ );
1578
+ }
1643
1579
  /**
1644
1580
  * Create Twilio provider
1645
1581
  *
@@ -1652,50 +1588,48 @@ export class Messaging extends Service {
1652
1588
  * @param {string} authToken
1653
1589
  * @param {boolean} enabled
1654
1590
  * @throws {AppwriteException}
1655
- * @returns {Promise}
1656
- */
1591
+ * @returns {Promise<Models.Provider>}
1592
+ */
1657
1593
  async createTwilioProvider(providerId: string, name: string, from?: string, accountSid?: string, authToken?: string, enabled?: boolean): Promise<Models.Provider> {
1658
1594
  if (typeof providerId === 'undefined') {
1659
1595
  throw new AppwriteException('Missing required parameter: "providerId"');
1660
1596
  }
1661
-
1662
1597
  if (typeof name === 'undefined') {
1663
1598
  throw new AppwriteException('Missing required parameter: "name"');
1664
1599
  }
1665
-
1666
1600
  const apiPath = '/messaging/providers/twilio';
1667
1601
  const payload: Payload = {};
1668
-
1669
1602
  if (typeof providerId !== 'undefined') {
1670
1603
  payload['providerId'] = providerId;
1671
1604
  }
1672
-
1673
1605
  if (typeof name !== 'undefined') {
1674
1606
  payload['name'] = name;
1675
1607
  }
1676
-
1677
1608
  if (typeof from !== 'undefined') {
1678
1609
  payload['from'] = from;
1679
1610
  }
1680
-
1681
1611
  if (typeof accountSid !== 'undefined') {
1682
1612
  payload['accountSid'] = accountSid;
1683
1613
  }
1684
-
1685
1614
  if (typeof authToken !== 'undefined') {
1686
1615
  payload['authToken'] = authToken;
1687
1616
  }
1688
-
1689
1617
  if (typeof enabled !== 'undefined') {
1690
1618
  payload['enabled'] = enabled;
1691
1619
  }
1692
-
1693
1620
  const uri = new URL(this.client.config.endpoint + apiPath);
1694
- return await this.client.call('post', uri, {
1621
+
1622
+ const apiHeaders: { [header: string]: string } = {
1695
1623
  'content-type': 'application/json',
1696
- }, payload);
1697
- }
1624
+ }
1698
1625
 
1626
+ return await this.client.call(
1627
+ 'post',
1628
+ uri,
1629
+ apiHeaders,
1630
+ payload
1631
+ );
1632
+ }
1699
1633
  /**
1700
1634
  * Update Twilio provider
1701
1635
  *
@@ -1708,42 +1642,42 @@ export class Messaging extends Service {
1708
1642
  * @param {string} authToken
1709
1643
  * @param {string} from
1710
1644
  * @throws {AppwriteException}
1711
- * @returns {Promise}
1712
- */
1645
+ * @returns {Promise<Models.Provider>}
1646
+ */
1713
1647
  async updateTwilioProvider(providerId: string, name?: string, enabled?: boolean, accountSid?: string, authToken?: string, from?: string): Promise<Models.Provider> {
1714
1648
  if (typeof providerId === 'undefined') {
1715
1649
  throw new AppwriteException('Missing required parameter: "providerId"');
1716
1650
  }
1717
-
1718
1651
  const apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId);
1719
1652
  const payload: Payload = {};
1720
-
1721
1653
  if (typeof name !== 'undefined') {
1722
1654
  payload['name'] = name;
1723
1655
  }
1724
-
1725
1656
  if (typeof enabled !== 'undefined') {
1726
1657
  payload['enabled'] = enabled;
1727
1658
  }
1728
-
1729
1659
  if (typeof accountSid !== 'undefined') {
1730
1660
  payload['accountSid'] = accountSid;
1731
1661
  }
1732
-
1733
1662
  if (typeof authToken !== 'undefined') {
1734
1663
  payload['authToken'] = authToken;
1735
1664
  }
1736
-
1737
1665
  if (typeof from !== 'undefined') {
1738
1666
  payload['from'] = from;
1739
1667
  }
1740
-
1741
1668
  const uri = new URL(this.client.config.endpoint + apiPath);
1742
- return await this.client.call('patch', uri, {
1669
+
1670
+ const apiHeaders: { [header: string]: string } = {
1743
1671
  'content-type': 'application/json',
1744
- }, payload);
1745
- }
1672
+ }
1746
1673
 
1674
+ return await this.client.call(
1675
+ 'patch',
1676
+ uri,
1677
+ apiHeaders,
1678
+ payload
1679
+ );
1680
+ }
1747
1681
  /**
1748
1682
  * Create Vonage provider
1749
1683
  *
@@ -1756,50 +1690,48 @@ export class Messaging extends Service {
1756
1690
  * @param {string} apiSecret
1757
1691
  * @param {boolean} enabled
1758
1692
  * @throws {AppwriteException}
1759
- * @returns {Promise}
1760
- */
1693
+ * @returns {Promise<Models.Provider>}
1694
+ */
1761
1695
  async createVonageProvider(providerId: string, name: string, from?: string, apiKey?: string, apiSecret?: string, enabled?: boolean): Promise<Models.Provider> {
1762
1696
  if (typeof providerId === 'undefined') {
1763
1697
  throw new AppwriteException('Missing required parameter: "providerId"');
1764
1698
  }
1765
-
1766
1699
  if (typeof name === 'undefined') {
1767
1700
  throw new AppwriteException('Missing required parameter: "name"');
1768
1701
  }
1769
-
1770
1702
  const apiPath = '/messaging/providers/vonage';
1771
1703
  const payload: Payload = {};
1772
-
1773
1704
  if (typeof providerId !== 'undefined') {
1774
1705
  payload['providerId'] = providerId;
1775
1706
  }
1776
-
1777
1707
  if (typeof name !== 'undefined') {
1778
1708
  payload['name'] = name;
1779
1709
  }
1780
-
1781
1710
  if (typeof from !== 'undefined') {
1782
1711
  payload['from'] = from;
1783
1712
  }
1784
-
1785
1713
  if (typeof apiKey !== 'undefined') {
1786
1714
  payload['apiKey'] = apiKey;
1787
1715
  }
1788
-
1789
1716
  if (typeof apiSecret !== 'undefined') {
1790
1717
  payload['apiSecret'] = apiSecret;
1791
1718
  }
1792
-
1793
1719
  if (typeof enabled !== 'undefined') {
1794
1720
  payload['enabled'] = enabled;
1795
1721
  }
1796
-
1797
1722
  const uri = new URL(this.client.config.endpoint + apiPath);
1798
- return await this.client.call('post', uri, {
1723
+
1724
+ const apiHeaders: { [header: string]: string } = {
1799
1725
  'content-type': 'application/json',
1800
- }, payload);
1801
- }
1726
+ }
1802
1727
 
1728
+ return await this.client.call(
1729
+ 'post',
1730
+ uri,
1731
+ apiHeaders,
1732
+ payload
1733
+ );
1734
+ }
1803
1735
  /**
1804
1736
  * Update Vonage provider
1805
1737
  *
@@ -1812,66 +1744,71 @@ export class Messaging extends Service {
1812
1744
  * @param {string} apiSecret
1813
1745
  * @param {string} from
1814
1746
  * @throws {AppwriteException}
1815
- * @returns {Promise}
1816
- */
1747
+ * @returns {Promise<Models.Provider>}
1748
+ */
1817
1749
  async updateVonageProvider(providerId: string, name?: string, enabled?: boolean, apiKey?: string, apiSecret?: string, from?: string): Promise<Models.Provider> {
1818
1750
  if (typeof providerId === 'undefined') {
1819
1751
  throw new AppwriteException('Missing required parameter: "providerId"');
1820
1752
  }
1821
-
1822
1753
  const apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId);
1823
1754
  const payload: Payload = {};
1824
-
1825
1755
  if (typeof name !== 'undefined') {
1826
1756
  payload['name'] = name;
1827
1757
  }
1828
-
1829
1758
  if (typeof enabled !== 'undefined') {
1830
1759
  payload['enabled'] = enabled;
1831
1760
  }
1832
-
1833
1761
  if (typeof apiKey !== 'undefined') {
1834
1762
  payload['apiKey'] = apiKey;
1835
1763
  }
1836
-
1837
1764
  if (typeof apiSecret !== 'undefined') {
1838
1765
  payload['apiSecret'] = apiSecret;
1839
1766
  }
1840
-
1841
1767
  if (typeof from !== 'undefined') {
1842
1768
  payload['from'] = from;
1843
1769
  }
1844
-
1845
1770
  const uri = new URL(this.client.config.endpoint + apiPath);
1846
- return await this.client.call('patch', uri, {
1771
+
1772
+ const apiHeaders: { [header: string]: string } = {
1847
1773
  'content-type': 'application/json',
1848
- }, payload);
1849
- }
1774
+ }
1850
1775
 
1776
+ return await this.client.call(
1777
+ 'patch',
1778
+ uri,
1779
+ apiHeaders,
1780
+ payload
1781
+ );
1782
+ }
1851
1783
  /**
1852
1784
  * Get provider
1853
1785
  *
1854
1786
  * Get a provider by its unique ID.
1855
- *
1787
+
1856
1788
  *
1857
1789
  * @param {string} providerId
1858
1790
  * @throws {AppwriteException}
1859
- * @returns {Promise}
1860
- */
1791
+ * @returns {Promise<Models.Provider>}
1792
+ */
1861
1793
  async getProvider(providerId: string): Promise<Models.Provider> {
1862
1794
  if (typeof providerId === 'undefined') {
1863
1795
  throw new AppwriteException('Missing required parameter: "providerId"');
1864
1796
  }
1865
-
1866
1797
  const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
1867
1798
  const payload: Payload = {};
1868
-
1869
1799
  const uri = new URL(this.client.config.endpoint + apiPath);
1870
- return await this.client.call('get', uri, {
1800
+
1801
+ const apiHeaders: { [header: string]: string } = {
1871
1802
  'content-type': 'application/json',
1872
- }, payload);
1873
- }
1803
+ }
1874
1804
 
1805
+ return await this.client.call(
1806
+ 'get',
1807
+ uri,
1808
+ apiHeaders,
1809
+ payload
1810
+ );
1811
+ }
1875
1812
  /**
1876
1813
  * Delete provider
1877
1814
  *
@@ -1879,22 +1816,27 @@ export class Messaging extends Service {
1879
1816
  *
1880
1817
  * @param {string} providerId
1881
1818
  * @throws {AppwriteException}
1882
- * @returns {Promise}
1883
- */
1819
+ * @returns {Promise<{}>}
1820
+ */
1884
1821
  async deleteProvider(providerId: string): Promise<{}> {
1885
1822
  if (typeof providerId === 'undefined') {
1886
1823
  throw new AppwriteException('Missing required parameter: "providerId"');
1887
1824
  }
1888
-
1889
1825
  const apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
1890
1826
  const payload: Payload = {};
1891
-
1892
1827
  const uri = new URL(this.client.config.endpoint + apiPath);
1893
- return await this.client.call('delete', uri, {
1828
+
1829
+ const apiHeaders: { [header: string]: string } = {
1894
1830
  'content-type': 'application/json',
1895
- }, payload);
1896
- }
1831
+ }
1897
1832
 
1833
+ return await this.client.call(
1834
+ 'delete',
1835
+ uri,
1836
+ apiHeaders,
1837
+ payload
1838
+ );
1839
+ }
1898
1840
  /**
1899
1841
  * List provider logs
1900
1842
  *
@@ -1903,26 +1845,30 @@ export class Messaging extends Service {
1903
1845
  * @param {string} providerId
1904
1846
  * @param {string[]} queries
1905
1847
  * @throws {AppwriteException}
1906
- * @returns {Promise}
1907
- */
1848
+ * @returns {Promise<Models.LogList>}
1849
+ */
1908
1850
  async listProviderLogs(providerId: string, queries?: string[]): Promise<Models.LogList> {
1909
1851
  if (typeof providerId === 'undefined') {
1910
1852
  throw new AppwriteException('Missing required parameter: "providerId"');
1911
1853
  }
1912
-
1913
1854
  const apiPath = '/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId);
1914
1855
  const payload: Payload = {};
1915
-
1916
1856
  if (typeof queries !== 'undefined') {
1917
1857
  payload['queries'] = queries;
1918
1858
  }
1919
-
1920
1859
  const uri = new URL(this.client.config.endpoint + apiPath);
1921
- return await this.client.call('get', uri, {
1860
+
1861
+ const apiHeaders: { [header: string]: string } = {
1922
1862
  'content-type': 'application/json',
1923
- }, payload);
1924
- }
1863
+ }
1925
1864
 
1865
+ return await this.client.call(
1866
+ 'get',
1867
+ uri,
1868
+ apiHeaders,
1869
+ payload
1870
+ );
1871
+ }
1926
1872
  /**
1927
1873
  * List subscriber logs
1928
1874
  *
@@ -1931,26 +1877,30 @@ export class Messaging extends Service {
1931
1877
  * @param {string} subscriberId
1932
1878
  * @param {string[]} queries
1933
1879
  * @throws {AppwriteException}
1934
- * @returns {Promise}
1935
- */
1880
+ * @returns {Promise<Models.LogList>}
1881
+ */
1936
1882
  async listSubscriberLogs(subscriberId: string, queries?: string[]): Promise<Models.LogList> {
1937
1883
  if (typeof subscriberId === 'undefined') {
1938
1884
  throw new AppwriteException('Missing required parameter: "subscriberId"');
1939
1885
  }
1940
-
1941
1886
  const apiPath = '/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId);
1942
1887
  const payload: Payload = {};
1943
-
1944
1888
  if (typeof queries !== 'undefined') {
1945
1889
  payload['queries'] = queries;
1946
1890
  }
1947
-
1948
1891
  const uri = new URL(this.client.config.endpoint + apiPath);
1949
- return await this.client.call('get', uri, {
1892
+
1893
+ const apiHeaders: { [header: string]: string } = {
1950
1894
  'content-type': 'application/json',
1951
- }, payload);
1952
- }
1895
+ }
1953
1896
 
1897
+ return await this.client.call(
1898
+ 'get',
1899
+ uri,
1900
+ apiHeaders,
1901
+ payload
1902
+ );
1903
+ }
1954
1904
  /**
1955
1905
  * List topics
1956
1906
  *
@@ -1959,26 +1909,30 @@ export class Messaging extends Service {
1959
1909
  * @param {string[]} queries
1960
1910
  * @param {string} search
1961
1911
  * @throws {AppwriteException}
1962
- * @returns {Promise}
1963
- */
1912
+ * @returns {Promise<Models.TopicList>}
1913
+ */
1964
1914
  async listTopics(queries?: string[], search?: string): Promise<Models.TopicList> {
1965
1915
  const apiPath = '/messaging/topics';
1966
1916
  const payload: Payload = {};
1967
-
1968
1917
  if (typeof queries !== 'undefined') {
1969
1918
  payload['queries'] = queries;
1970
1919
  }
1971
-
1972
1920
  if (typeof search !== 'undefined') {
1973
1921
  payload['search'] = search;
1974
1922
  }
1975
-
1976
1923
  const uri = new URL(this.client.config.endpoint + apiPath);
1977
- return await this.client.call('get', uri, {
1924
+
1925
+ const apiHeaders: { [header: string]: string } = {
1978
1926
  'content-type': 'application/json',
1979
- }, payload);
1980
- }
1927
+ }
1981
1928
 
1929
+ return await this.client.call(
1930
+ 'get',
1931
+ uri,
1932
+ apiHeaders,
1933
+ payload
1934
+ );
1935
+ }
1982
1936
  /**
1983
1937
  * Create topic
1984
1938
  *
@@ -1988,96 +1942,105 @@ export class Messaging extends Service {
1988
1942
  * @param {string} name
1989
1943
  * @param {string[]} subscribe
1990
1944
  * @throws {AppwriteException}
1991
- * @returns {Promise}
1992
- */
1945
+ * @returns {Promise<Models.Topic>}
1946
+ */
1993
1947
  async createTopic(topicId: string, name: string, subscribe?: string[]): Promise<Models.Topic> {
1994
1948
  if (typeof topicId === 'undefined') {
1995
1949
  throw new AppwriteException('Missing required parameter: "topicId"');
1996
1950
  }
1997
-
1998
1951
  if (typeof name === 'undefined') {
1999
1952
  throw new AppwriteException('Missing required parameter: "name"');
2000
1953
  }
2001
-
2002
1954
  const apiPath = '/messaging/topics';
2003
1955
  const payload: Payload = {};
2004
-
2005
1956
  if (typeof topicId !== 'undefined') {
2006
1957
  payload['topicId'] = topicId;
2007
1958
  }
2008
-
2009
1959
  if (typeof name !== 'undefined') {
2010
1960
  payload['name'] = name;
2011
1961
  }
2012
-
2013
1962
  if (typeof subscribe !== 'undefined') {
2014
1963
  payload['subscribe'] = subscribe;
2015
1964
  }
2016
-
2017
1965
  const uri = new URL(this.client.config.endpoint + apiPath);
2018
- return await this.client.call('post', uri, {
1966
+
1967
+ const apiHeaders: { [header: string]: string } = {
2019
1968
  'content-type': 'application/json',
2020
- }, payload);
2021
- }
1969
+ }
2022
1970
 
1971
+ return await this.client.call(
1972
+ 'post',
1973
+ uri,
1974
+ apiHeaders,
1975
+ payload
1976
+ );
1977
+ }
2023
1978
  /**
2024
1979
  * Get topic
2025
1980
  *
2026
1981
  * Get a topic by its unique ID.
2027
- *
1982
+
2028
1983
  *
2029
1984
  * @param {string} topicId
2030
1985
  * @throws {AppwriteException}
2031
- * @returns {Promise}
2032
- */
1986
+ * @returns {Promise<Models.Topic>}
1987
+ */
2033
1988
  async getTopic(topicId: string): Promise<Models.Topic> {
2034
1989
  if (typeof topicId === 'undefined') {
2035
1990
  throw new AppwriteException('Missing required parameter: "topicId"');
2036
1991
  }
2037
-
2038
1992
  const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
2039
1993
  const payload: Payload = {};
2040
-
2041
1994
  const uri = new URL(this.client.config.endpoint + apiPath);
2042
- return await this.client.call('get', uri, {
1995
+
1996
+ const apiHeaders: { [header: string]: string } = {
2043
1997
  'content-type': 'application/json',
2044
- }, payload);
2045
- }
1998
+ }
2046
1999
 
2000
+ return await this.client.call(
2001
+ 'get',
2002
+ uri,
2003
+ apiHeaders,
2004
+ payload
2005
+ );
2006
+ }
2047
2007
  /**
2048
2008
  * Update topic
2049
2009
  *
2050
2010
  * Update a topic by its unique ID.
2051
- *
2011
+
2052
2012
  *
2053
2013
  * @param {string} topicId
2054
2014
  * @param {string} name
2055
2015
  * @param {string[]} subscribe
2056
2016
  * @throws {AppwriteException}
2057
- * @returns {Promise}
2058
- */
2017
+ * @returns {Promise<Models.Topic>}
2018
+ */
2059
2019
  async updateTopic(topicId: string, name?: string, subscribe?: string[]): Promise<Models.Topic> {
2060
2020
  if (typeof topicId === 'undefined') {
2061
2021
  throw new AppwriteException('Missing required parameter: "topicId"');
2062
2022
  }
2063
-
2064
2023
  const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
2065
2024
  const payload: Payload = {};
2066
-
2067
2025
  if (typeof name !== 'undefined') {
2068
2026
  payload['name'] = name;
2069
2027
  }
2070
-
2071
2028
  if (typeof subscribe !== 'undefined') {
2072
2029
  payload['subscribe'] = subscribe;
2073
2030
  }
2074
-
2075
2031
  const uri = new URL(this.client.config.endpoint + apiPath);
2076
- return await this.client.call('patch', uri, {
2032
+
2033
+ const apiHeaders: { [header: string]: string } = {
2077
2034
  'content-type': 'application/json',
2078
- }, payload);
2079
- }
2035
+ }
2080
2036
 
2037
+ return await this.client.call(
2038
+ 'patch',
2039
+ uri,
2040
+ apiHeaders,
2041
+ payload
2042
+ );
2043
+ }
2081
2044
  /**
2082
2045
  * Delete topic
2083
2046
  *
@@ -2085,22 +2048,27 @@ export class Messaging extends Service {
2085
2048
  *
2086
2049
  * @param {string} topicId
2087
2050
  * @throws {AppwriteException}
2088
- * @returns {Promise}
2089
- */
2051
+ * @returns {Promise<{}>}
2052
+ */
2090
2053
  async deleteTopic(topicId: string): Promise<{}> {
2091
2054
  if (typeof topicId === 'undefined') {
2092
2055
  throw new AppwriteException('Missing required parameter: "topicId"');
2093
2056
  }
2094
-
2095
2057
  const apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
2096
2058
  const payload: Payload = {};
2097
-
2098
2059
  const uri = new URL(this.client.config.endpoint + apiPath);
2099
- return await this.client.call('delete', uri, {
2060
+
2061
+ const apiHeaders: { [header: string]: string } = {
2100
2062
  'content-type': 'application/json',
2101
- }, payload);
2102
- }
2063
+ }
2103
2064
 
2065
+ return await this.client.call(
2066
+ 'delete',
2067
+ uri,
2068
+ apiHeaders,
2069
+ payload
2070
+ );
2071
+ }
2104
2072
  /**
2105
2073
  * List topic logs
2106
2074
  *
@@ -2109,26 +2077,30 @@ export class Messaging extends Service {
2109
2077
  * @param {string} topicId
2110
2078
  * @param {string[]} queries
2111
2079
  * @throws {AppwriteException}
2112
- * @returns {Promise}
2113
- */
2080
+ * @returns {Promise<Models.LogList>}
2081
+ */
2114
2082
  async listTopicLogs(topicId: string, queries?: string[]): Promise<Models.LogList> {
2115
2083
  if (typeof topicId === 'undefined') {
2116
2084
  throw new AppwriteException('Missing required parameter: "topicId"');
2117
2085
  }
2118
-
2119
2086
  const apiPath = '/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId);
2120
2087
  const payload: Payload = {};
2121
-
2122
2088
  if (typeof queries !== 'undefined') {
2123
2089
  payload['queries'] = queries;
2124
2090
  }
2125
-
2126
2091
  const uri = new URL(this.client.config.endpoint + apiPath);
2127
- return await this.client.call('get', uri, {
2092
+
2093
+ const apiHeaders: { [header: string]: string } = {
2128
2094
  'content-type': 'application/json',
2129
- }, payload);
2130
- }
2095
+ }
2131
2096
 
2097
+ return await this.client.call(
2098
+ 'get',
2099
+ uri,
2100
+ apiHeaders,
2101
+ payload
2102
+ );
2103
+ }
2132
2104
  /**
2133
2105
  * List subscribers
2134
2106
  *
@@ -2138,30 +2110,33 @@ export class Messaging extends Service {
2138
2110
  * @param {string[]} queries
2139
2111
  * @param {string} search
2140
2112
  * @throws {AppwriteException}
2141
- * @returns {Promise}
2142
- */
2113
+ * @returns {Promise<Models.SubscriberList>}
2114
+ */
2143
2115
  async listSubscribers(topicId: string, queries?: string[], search?: string): Promise<Models.SubscriberList> {
2144
2116
  if (typeof topicId === 'undefined') {
2145
2117
  throw new AppwriteException('Missing required parameter: "topicId"');
2146
2118
  }
2147
-
2148
2119
  const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
2149
2120
  const payload: Payload = {};
2150
-
2151
2121
  if (typeof queries !== 'undefined') {
2152
2122
  payload['queries'] = queries;
2153
2123
  }
2154
-
2155
2124
  if (typeof search !== 'undefined') {
2156
2125
  payload['search'] = search;
2157
2126
  }
2158
-
2159
2127
  const uri = new URL(this.client.config.endpoint + apiPath);
2160
- return await this.client.call('get', uri, {
2128
+
2129
+ const apiHeaders: { [header: string]: string } = {
2161
2130
  'content-type': 'application/json',
2162
- }, payload);
2163
- }
2131
+ }
2164
2132
 
2133
+ return await this.client.call(
2134
+ 'get',
2135
+ uri,
2136
+ apiHeaders,
2137
+ payload
2138
+ );
2139
+ }
2165
2140
  /**
2166
2141
  * Create subscriber
2167
2142
  *
@@ -2171,67 +2146,72 @@ export class Messaging extends Service {
2171
2146
  * @param {string} subscriberId
2172
2147
  * @param {string} targetId
2173
2148
  * @throws {AppwriteException}
2174
- * @returns {Promise}
2175
- */
2149
+ * @returns {Promise<Models.Subscriber>}
2150
+ */
2176
2151
  async createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber> {
2177
2152
  if (typeof topicId === 'undefined') {
2178
2153
  throw new AppwriteException('Missing required parameter: "topicId"');
2179
2154
  }
2180
-
2181
2155
  if (typeof subscriberId === 'undefined') {
2182
2156
  throw new AppwriteException('Missing required parameter: "subscriberId"');
2183
2157
  }
2184
-
2185
2158
  if (typeof targetId === 'undefined') {
2186
2159
  throw new AppwriteException('Missing required parameter: "targetId"');
2187
2160
  }
2188
-
2189
2161
  const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
2190
2162
  const payload: Payload = {};
2191
-
2192
2163
  if (typeof subscriberId !== 'undefined') {
2193
2164
  payload['subscriberId'] = subscriberId;
2194
2165
  }
2195
-
2196
2166
  if (typeof targetId !== 'undefined') {
2197
2167
  payload['targetId'] = targetId;
2198
2168
  }
2199
-
2200
2169
  const uri = new URL(this.client.config.endpoint + apiPath);
2201
- return await this.client.call('post', uri, {
2170
+
2171
+ const apiHeaders: { [header: string]: string } = {
2202
2172
  'content-type': 'application/json',
2203
- }, payload);
2204
- }
2173
+ }
2205
2174
 
2175
+ return await this.client.call(
2176
+ 'post',
2177
+ uri,
2178
+ apiHeaders,
2179
+ payload
2180
+ );
2181
+ }
2206
2182
  /**
2207
2183
  * Get subscriber
2208
2184
  *
2209
2185
  * Get a subscriber by its unique ID.
2210
- *
2186
+
2211
2187
  *
2212
2188
  * @param {string} topicId
2213
2189
  * @param {string} subscriberId
2214
2190
  * @throws {AppwriteException}
2215
- * @returns {Promise}
2216
- */
2191
+ * @returns {Promise<Models.Subscriber>}
2192
+ */
2217
2193
  async getSubscriber(topicId: string, subscriberId: string): Promise<Models.Subscriber> {
2218
2194
  if (typeof topicId === 'undefined') {
2219
2195
  throw new AppwriteException('Missing required parameter: "topicId"');
2220
2196
  }
2221
-
2222
2197
  if (typeof subscriberId === 'undefined') {
2223
2198
  throw new AppwriteException('Missing required parameter: "subscriberId"');
2224
2199
  }
2225
-
2226
2200
  const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
2227
2201
  const payload: Payload = {};
2228
-
2229
2202
  const uri = new URL(this.client.config.endpoint + apiPath);
2230
- return await this.client.call('get', uri, {
2203
+
2204
+ const apiHeaders: { [header: string]: string } = {
2231
2205
  'content-type': 'application/json',
2232
- }, payload);
2233
- }
2206
+ }
2234
2207
 
2208
+ return await this.client.call(
2209
+ 'get',
2210
+ uri,
2211
+ apiHeaders,
2212
+ payload
2213
+ );
2214
+ }
2235
2215
  /**
2236
2216
  * Delete subscriber
2237
2217
  *
@@ -2240,23 +2220,28 @@ export class Messaging extends Service {
2240
2220
  * @param {string} topicId
2241
2221
  * @param {string} subscriberId
2242
2222
  * @throws {AppwriteException}
2243
- * @returns {Promise}
2244
- */
2223
+ * @returns {Promise<{}>}
2224
+ */
2245
2225
  async deleteSubscriber(topicId: string, subscriberId: string): Promise<{}> {
2246
2226
  if (typeof topicId === 'undefined') {
2247
2227
  throw new AppwriteException('Missing required parameter: "topicId"');
2248
2228
  }
2249
-
2250
2229
  if (typeof subscriberId === 'undefined') {
2251
2230
  throw new AppwriteException('Missing required parameter: "subscriberId"');
2252
2231
  }
2253
-
2254
2232
  const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
2255
2233
  const payload: Payload = {};
2256
-
2257
2234
  const uri = new URL(this.client.config.endpoint + apiPath);
2258
- return await this.client.call('delete', uri, {
2235
+
2236
+ const apiHeaders: { [header: string]: string } = {
2259
2237
  'content-type': 'application/json',
2260
- }, payload);
2238
+ }
2239
+
2240
+ return await this.client.call(
2241
+ 'delete',
2242
+ uri,
2243
+ apiHeaders,
2244
+ payload
2245
+ );
2261
2246
  }
2262
- };
2247
+ }