node-appwrite 12.0.1 → 13.0.0

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