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