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