appwrite-cli 4.2.2 → 5.0.1

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 (315) hide show
  1. package/.github/workflows/npm-publish.yml +1 -1
  2. package/README.md +6 -9
  3. package/docs/examples/account/{create-email-session.md → create-email-password-session.md} +1 -1
  4. package/docs/examples/account/create-email-token.md +4 -0
  5. package/docs/examples/account/create-magic-u-r-l-token.md +5 -0
  6. package/docs/examples/account/create-mfa-authenticator.md +2 -0
  7. package/docs/examples/account/create-mfa-challenge.md +2 -0
  8. package/docs/examples/account/create-mfa-recovery-codes.md +1 -0
  9. package/docs/examples/account/create-o-auth2token.md +5 -0
  10. package/docs/examples/account/create-phone-token.md +3 -0
  11. package/docs/examples/account/create-push-target.md +4 -0
  12. package/docs/examples/account/create-session.md +3 -0
  13. package/docs/examples/account/create.md +1 -1
  14. package/docs/examples/account/delete-identity.md +1 -1
  15. package/docs/examples/account/delete-mfa-authenticator.md +3 -0
  16. package/docs/examples/account/delete-push-target.md +2 -0
  17. package/docs/examples/account/delete-session.md +1 -1
  18. package/docs/examples/account/delete.md +1 -0
  19. package/docs/examples/account/get-mfa-recovery-codes.md +1 -0
  20. package/docs/examples/account/get-session.md +1 -1
  21. package/docs/examples/account/list-mfa-factors.md +1 -0
  22. package/docs/examples/account/update-m-f-a.md +2 -0
  23. package/docs/examples/account/update-magic-u-r-l-session.md +2 -2
  24. package/docs/examples/account/update-mfa-authenticator.md +3 -0
  25. package/docs/examples/account/update-mfa-challenge.md +3 -0
  26. package/docs/examples/account/update-mfa-recovery-codes.md +1 -0
  27. package/docs/examples/account/update-name.md +1 -1
  28. package/docs/examples/account/update-phone-session.md +2 -2
  29. package/docs/examples/account/update-phone-verification.md +2 -2
  30. package/docs/examples/account/update-push-target.md +3 -0
  31. package/docs/examples/account/update-recovery.md +3 -4
  32. package/docs/examples/account/update-session.md +1 -1
  33. package/docs/examples/account/update-verification.md +2 -2
  34. package/docs/examples/assistant/chat.md +1 -1
  35. package/docs/examples/avatars/get-q-r.md +1 -1
  36. package/docs/examples/databases/create-boolean-attribute.md +2 -2
  37. package/docs/examples/databases/create-collection.md +3 -3
  38. package/docs/examples/databases/create-datetime-attribute.md +2 -2
  39. package/docs/examples/databases/create-document.md +3 -3
  40. package/docs/examples/databases/create-email-attribute.md +2 -2
  41. package/docs/examples/databases/create-enum-attribute.md +2 -2
  42. package/docs/examples/databases/create-float-attribute.md +2 -2
  43. package/docs/examples/databases/create-index.md +2 -2
  44. package/docs/examples/databases/create-integer-attribute.md +2 -2
  45. package/docs/examples/databases/create-ip-attribute.md +2 -2
  46. package/docs/examples/databases/create-relationship-attribute.md +3 -3
  47. package/docs/examples/databases/create-string-attribute.md +2 -2
  48. package/docs/examples/databases/create-url-attribute.md +2 -2
  49. package/docs/examples/databases/create.md +2 -2
  50. package/docs/examples/databases/delete-attribute.md +2 -2
  51. package/docs/examples/databases/delete-collection.md +2 -2
  52. package/docs/examples/databases/delete-document.md +3 -3
  53. package/docs/examples/databases/delete-index.md +2 -2
  54. package/docs/examples/databases/delete.md +1 -1
  55. package/docs/examples/databases/get-attribute.md +2 -2
  56. package/docs/examples/databases/get-collection-usage.md +2 -2
  57. package/docs/examples/databases/get-collection.md +2 -2
  58. package/docs/examples/databases/get-database-usage.md +1 -1
  59. package/docs/examples/databases/get-document.md +3 -3
  60. package/docs/examples/databases/get-index.md +2 -2
  61. package/docs/examples/databases/get.md +1 -1
  62. package/docs/examples/databases/list-attributes.md +2 -2
  63. package/docs/examples/databases/list-collection-logs.md +2 -2
  64. package/docs/examples/databases/list-collections.md +1 -1
  65. package/docs/examples/databases/list-document-logs.md +3 -3
  66. package/docs/examples/databases/list-documents.md +2 -2
  67. package/docs/examples/databases/list-indexes.md +2 -2
  68. package/docs/examples/databases/list-logs.md +1 -1
  69. package/docs/examples/databases/update-boolean-attribute.md +2 -2
  70. package/docs/examples/databases/update-collection.md +3 -3
  71. package/docs/examples/databases/update-datetime-attribute.md +2 -2
  72. package/docs/examples/databases/update-document.md +3 -3
  73. package/docs/examples/databases/update-email-attribute.md +2 -2
  74. package/docs/examples/databases/update-enum-attribute.md +3 -3
  75. package/docs/examples/databases/update-float-attribute.md +2 -2
  76. package/docs/examples/databases/update-integer-attribute.md +2 -2
  77. package/docs/examples/databases/update-ip-attribute.md +2 -2
  78. package/docs/examples/databases/update-relationship-attribute.md +2 -2
  79. package/docs/examples/databases/update-string-attribute.md +3 -3
  80. package/docs/examples/databases/update-url-attribute.md +2 -2
  81. package/docs/examples/databases/update.md +2 -2
  82. package/docs/examples/functions/create-build.md +3 -3
  83. package/docs/examples/functions/create-deployment.md +1 -1
  84. package/docs/examples/functions/create-execution.md +1 -1
  85. package/docs/examples/functions/create-variable.md +3 -3
  86. package/docs/examples/functions/create.md +3 -3
  87. package/docs/examples/functions/delete-deployment.md +2 -2
  88. package/docs/examples/functions/delete-variable.md +2 -2
  89. package/docs/examples/functions/delete.md +1 -1
  90. package/docs/examples/functions/download-deployment.md +2 -2
  91. package/docs/examples/functions/get-deployment.md +2 -2
  92. package/docs/examples/functions/get-execution.md +2 -2
  93. package/docs/examples/functions/get-function-usage.md +1 -1
  94. package/docs/examples/functions/get-variable.md +2 -2
  95. package/docs/examples/functions/get.md +1 -1
  96. package/docs/examples/functions/list-deployments.md +1 -1
  97. package/docs/examples/functions/list-executions.md +1 -1
  98. package/docs/examples/functions/list-variables.md +1 -1
  99. package/docs/examples/functions/update-deployment.md +2 -2
  100. package/docs/examples/functions/update-variable.md +3 -3
  101. package/docs/examples/functions/update.md +2 -2
  102. package/docs/examples/health/get-certificate.md +2 -0
  103. package/docs/examples/health/get-failed-jobs.md +3 -0
  104. package/docs/examples/health/get-queue-usage-dump.md +2 -0
  105. package/docs/examples/health/get-queue-usage.md +2 -0
  106. package/docs/examples/health/get-storage.md +1 -0
  107. package/docs/examples/messaging/create-apns-provider.md +9 -0
  108. package/docs/examples/messaging/create-email.md +13 -0
  109. package/docs/examples/messaging/create-fcm-provider.md +5 -0
  110. package/docs/examples/messaging/create-mailgun-provider.md +11 -0
  111. package/docs/examples/messaging/create-msg91provider.md +7 -0
  112. package/docs/examples/messaging/create-push.md +17 -0
  113. package/docs/examples/messaging/create-sendgrid-provider.md +9 -0
  114. package/docs/examples/messaging/create-sms.md +8 -0
  115. package/docs/examples/messaging/create-smtp-provider.md +15 -0
  116. package/docs/examples/messaging/create-subscriber.md +4 -0
  117. package/docs/examples/messaging/create-telesign-provider.md +7 -0
  118. package/docs/examples/messaging/create-textmagic-provider.md +7 -0
  119. package/docs/examples/messaging/create-topic.md +4 -0
  120. package/docs/examples/messaging/create-twilio-provider.md +7 -0
  121. package/docs/examples/messaging/create-vonage-provider.md +7 -0
  122. package/docs/examples/messaging/delete-provider.md +2 -0
  123. package/docs/examples/messaging/delete-subscriber.md +3 -0
  124. package/docs/examples/messaging/delete-topic.md +2 -0
  125. package/docs/examples/messaging/delete.md +2 -0
  126. package/docs/examples/messaging/get-message.md +2 -0
  127. package/docs/examples/messaging/get-provider.md +2 -0
  128. package/docs/examples/messaging/get-subscriber.md +3 -0
  129. package/docs/examples/messaging/get-topic.md +2 -0
  130. package/docs/examples/messaging/list-message-logs.md +3 -0
  131. package/docs/examples/messaging/list-messages.md +3 -0
  132. package/docs/examples/messaging/list-provider-logs.md +3 -0
  133. package/docs/examples/messaging/list-providers.md +3 -0
  134. package/docs/examples/messaging/list-subscriber-logs.md +3 -0
  135. package/docs/examples/messaging/list-subscribers.md +4 -0
  136. package/docs/examples/messaging/list-targets.md +3 -0
  137. package/docs/examples/messaging/list-topic-logs.md +3 -0
  138. package/docs/examples/messaging/list-topics.md +3 -0
  139. package/docs/examples/messaging/update-apns-provider.md +9 -0
  140. package/docs/examples/messaging/update-email.md +12 -0
  141. package/docs/examples/messaging/update-fcm-provider.md +5 -0
  142. package/docs/examples/messaging/update-mailgun-provider.md +11 -0
  143. package/docs/examples/messaging/update-msg91provider.md +7 -0
  144. package/docs/examples/messaging/update-push.md +17 -0
  145. package/docs/examples/messaging/update-sendgrid-provider.md +9 -0
  146. package/docs/examples/messaging/update-sms.md +8 -0
  147. package/docs/examples/messaging/update-smtp-provider.md +15 -0
  148. package/docs/examples/messaging/update-telesign-provider.md +7 -0
  149. package/docs/examples/messaging/update-textmagic-provider.md +7 -0
  150. package/docs/examples/messaging/update-topic.md +4 -0
  151. package/docs/examples/messaging/update-twilio-provider.md +7 -0
  152. package/docs/examples/messaging/update-vonage-provider.md +7 -0
  153. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  154. package/docs/examples/migrations/create-firebase-migration.md +1 -1
  155. package/docs/examples/migrations/create-firebase-o-auth-migration.md +1 -1
  156. package/docs/examples/migrations/create-n-host-migration.md +6 -6
  157. package/docs/examples/migrations/create-supabase-migration.md +4 -4
  158. package/docs/examples/migrations/delete.md +1 -1
  159. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  160. package/docs/examples/migrations/get-firebase-report-o-auth.md +1 -1
  161. package/docs/examples/migrations/get-firebase-report.md +1 -1
  162. package/docs/examples/migrations/get-n-host-report.md +6 -6
  163. package/docs/examples/migrations/get-supabase-report.md +4 -4
  164. package/docs/examples/migrations/get.md +1 -1
  165. package/docs/examples/migrations/retry.md +1 -1
  166. package/docs/examples/project/create-variable.md +2 -2
  167. package/docs/examples/project/delete-variable.md +1 -1
  168. package/docs/examples/project/get-usage.md +2 -0
  169. package/docs/examples/project/get-variable.md +1 -1
  170. package/docs/examples/project/update-variable.md +2 -2
  171. package/docs/examples/projects/create-key.md +2 -2
  172. package/docs/examples/projects/create-platform.md +2 -2
  173. package/docs/examples/projects/create-smtp-test.md +11 -0
  174. package/docs/examples/projects/create-webhook.md +4 -3
  175. package/docs/examples/projects/create.md +2 -2
  176. package/docs/examples/projects/delete-email-template.md +1 -1
  177. package/docs/examples/projects/delete-key.md +2 -2
  178. package/docs/examples/projects/delete-platform.md +2 -2
  179. package/docs/examples/projects/delete-sms-template.md +1 -1
  180. package/docs/examples/projects/delete-webhook.md +2 -2
  181. package/docs/examples/projects/delete.md +1 -1
  182. package/docs/examples/projects/get-email-template.md +1 -1
  183. package/docs/examples/projects/get-key.md +2 -2
  184. package/docs/examples/projects/get-platform.md +2 -2
  185. package/docs/examples/projects/get-sms-template.md +1 -1
  186. package/docs/examples/projects/get-webhook.md +2 -2
  187. package/docs/examples/projects/get.md +1 -1
  188. package/docs/examples/projects/list-keys.md +1 -1
  189. package/docs/examples/projects/list-platforms.md +1 -1
  190. package/docs/examples/projects/list-webhooks.md +1 -1
  191. package/docs/examples/projects/update-api-status-all.md +3 -0
  192. package/docs/examples/projects/update-api-status.md +4 -0
  193. package/docs/examples/projects/update-auth-duration.md +1 -1
  194. package/docs/examples/projects/update-auth-limit.md +1 -1
  195. package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
  196. package/docs/examples/projects/update-auth-password-history.md +1 -1
  197. package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
  198. package/docs/examples/projects/update-auth-status.md +1 -1
  199. package/docs/examples/projects/update-email-template.md +3 -3
  200. package/docs/examples/projects/update-key.md +3 -3
  201. package/docs/examples/projects/update-o-auth2.md +1 -1
  202. package/docs/examples/projects/update-personal-data-check.md +1 -1
  203. package/docs/examples/projects/update-platform.md +3 -3
  204. package/docs/examples/projects/update-service-status-all.md +1 -1
  205. package/docs/examples/projects/update-service-status.md +1 -1
  206. package/docs/examples/projects/update-sms-template.md +2 -2
  207. package/docs/examples/projects/update-smtp.md +11 -0
  208. package/docs/examples/projects/update-team.md +2 -2
  209. package/docs/examples/projects/update-webhook-signature.md +2 -2
  210. package/docs/examples/projects/update-webhook.md +5 -4
  211. package/docs/examples/projects/update.md +2 -2
  212. package/docs/examples/proxy/delete-rule.md +1 -1
  213. package/docs/examples/proxy/get-rule.md +1 -1
  214. package/docs/examples/proxy/update-rule-verification.md +1 -1
  215. package/docs/examples/storage/create-bucket.md +2 -2
  216. package/docs/examples/storage/create-file.md +2 -2
  217. package/docs/examples/storage/delete-bucket.md +1 -1
  218. package/docs/examples/storage/delete-file.md +2 -2
  219. package/docs/examples/storage/get-bucket-usage.md +1 -1
  220. package/docs/examples/storage/get-bucket.md +1 -1
  221. package/docs/examples/storage/get-file-download.md +2 -2
  222. package/docs/examples/storage/get-file-preview.md +2 -2
  223. package/docs/examples/storage/get-file-view.md +2 -2
  224. package/docs/examples/storage/get-file.md +2 -2
  225. package/docs/examples/storage/list-files.md +1 -1
  226. package/docs/examples/storage/update-bucket.md +2 -2
  227. package/docs/examples/storage/update-file.md +2 -2
  228. package/docs/examples/teams/create-membership.md +1 -1
  229. package/docs/examples/teams/create.md +2 -2
  230. package/docs/examples/teams/delete-membership.md +2 -2
  231. package/docs/examples/teams/delete.md +1 -1
  232. package/docs/examples/teams/get-membership.md +2 -2
  233. package/docs/examples/teams/get-prefs.md +1 -1
  234. package/docs/examples/teams/get.md +1 -1
  235. package/docs/examples/teams/list-logs.md +1 -1
  236. package/docs/examples/teams/list-memberships.md +1 -1
  237. package/docs/examples/teams/update-membership-status.md +4 -4
  238. package/docs/examples/teams/update-membership.md +2 -2
  239. package/docs/examples/teams/update-name.md +2 -2
  240. package/docs/examples/teams/update-prefs.md +1 -1
  241. package/docs/examples/users/create-argon2user.md +1 -1
  242. package/docs/examples/users/create-bcrypt-user.md +1 -1
  243. package/docs/examples/users/create-m-d5user.md +1 -1
  244. package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
  245. package/docs/examples/users/create-p-h-pass-user.md +1 -1
  246. package/docs/examples/users/create-s-h-a-user.md +1 -1
  247. package/docs/examples/users/create-scrypt-modified-user.md +4 -4
  248. package/docs/examples/users/create-scrypt-user.md +2 -2
  249. package/docs/examples/users/create-session.md +2 -0
  250. package/docs/examples/users/create-target.md +7 -0
  251. package/docs/examples/users/create-token.md +4 -0
  252. package/docs/examples/users/create.md +1 -1
  253. package/docs/examples/users/delete-identity.md +1 -1
  254. package/docs/examples/users/delete-mfa-authenticator.md +3 -0
  255. package/docs/examples/users/delete-session.md +2 -2
  256. package/docs/examples/users/delete-sessions.md +1 -1
  257. package/docs/examples/users/delete-target.md +3 -0
  258. package/docs/examples/users/delete.md +1 -1
  259. package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
  260. package/docs/examples/users/get-prefs.md +1 -1
  261. package/docs/examples/users/get-target.md +3 -0
  262. package/docs/examples/users/get-usage.md +0 -1
  263. package/docs/examples/users/get.md +1 -1
  264. package/docs/examples/users/list-logs.md +1 -1
  265. package/docs/examples/users/list-memberships.md +1 -1
  266. package/docs/examples/users/list-mfa-factors.md +2 -0
  267. package/docs/examples/users/list-sessions.md +1 -1
  268. package/docs/examples/users/list-targets.md +3 -0
  269. package/docs/examples/users/update-email-verification.md +1 -1
  270. package/docs/examples/users/update-email.md +1 -1
  271. package/docs/examples/users/update-labels.md +1 -1
  272. package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
  273. package/docs/examples/users/update-mfa.md +3 -0
  274. package/docs/examples/users/update-name.md +2 -2
  275. package/docs/examples/users/update-password.md +1 -1
  276. package/docs/examples/users/update-phone-verification.md +1 -1
  277. package/docs/examples/users/update-phone.md +1 -1
  278. package/docs/examples/users/update-prefs.md +1 -1
  279. package/docs/examples/users/update-status.md +1 -1
  280. package/docs/examples/users/update-target.md +6 -0
  281. package/docs/examples/vcs/create-repository-detection.md +2 -2
  282. package/docs/examples/vcs/create-repository.md +2 -2
  283. package/docs/examples/vcs/delete-installation.md +1 -1
  284. package/docs/examples/vcs/get-installation.md +1 -1
  285. package/docs/examples/vcs/get-repository.md +2 -2
  286. package/docs/examples/vcs/list-repositories.md +1 -1
  287. package/docs/examples/vcs/list-repository-branches.md +2 -2
  288. package/docs/examples/vcs/update-external-deployments.md +3 -3
  289. package/index.js +2 -0
  290. package/install.ps1 +5 -5
  291. package/install.sh +4 -4
  292. package/lib/client.js +4 -4
  293. package/lib/commands/account.js +906 -226
  294. package/lib/commands/avatars.js +3 -3
  295. package/lib/commands/databases.js +22 -22
  296. package/lib/commands/deploy.js +45 -6
  297. package/lib/commands/functions.js +5 -5
  298. package/lib/commands/generic.js +2 -2
  299. package/lib/commands/health.js +193 -1
  300. package/lib/commands/messaging.js +2815 -0
  301. package/lib/commands/migrations.js +2 -2
  302. package/lib/commands/project.js +15 -5
  303. package/lib/commands/projects.js +210 -72
  304. package/lib/commands/proxy.js +1 -1
  305. package/lib/commands/storage.js +6 -6
  306. package/lib/commands/teams.js +2 -2
  307. package/lib/commands/users.js +545 -14
  308. package/lib/paginate.js +2 -2
  309. package/lib/parser.js +2 -1
  310. package/package.json +1 -1
  311. package/scoop/appwrite.json +3 -3
  312. package/docs/examples/account/create-magic-u-r-l-session.md +0 -4
  313. package/docs/examples/account/create-phone-session.md +0 -3
  314. package/docs/examples/projects/get-usage.md +0 -3
  315. package/docs/examples/projects/update-smtp-configuration.md +0 -11
@@ -0,0 +1,2815 @@
1
+ const fs = require('fs');
2
+ const pathLib = require('path');
3
+ const tar = require("tar");
4
+ const ignore = require("ignore");
5
+ const { promisify } = require('util');
6
+ const libClient = require('../client.js');
7
+ const { getAllFiles } = require('../utils.js');
8
+ const { Command } = require('commander');
9
+ const { sdkForProject, sdkForConsole } = require('../sdks')
10
+ const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser')
11
+ const { localConfig, globalConfig } = require("../config");
12
+ const { File } = require('undici');
13
+ const { ReadableStream } = require('stream/web');
14
+
15
+ /**
16
+ * @param {fs.ReadStream} readStream
17
+ * @returns {ReadableStream}
18
+ */
19
+ function convertReadStreamToReadableStream(readStream) {
20
+ return new ReadableStream({
21
+ start(controller) {
22
+ readStream.on("data", (chunk) => {
23
+ controller.enqueue(chunk);
24
+ });
25
+ readStream.on("end", () => {
26
+ controller.close();
27
+ });
28
+ readStream.on("error", (err) => {
29
+ controller.error(err);
30
+ });
31
+ },
32
+ cancel() {
33
+ readStream.destroy();
34
+ },
35
+ });
36
+ }
37
+
38
+ const messaging = new Command("messaging").description(commandDescriptions['messaging']).configureHelp({
39
+ helpWidth: process.stdout.columns || 80
40
+ })
41
+
42
+ /**
43
+ * @typedef {Object} MessagingListMessagesRequestParams
44
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType
45
+ * @property {string} search Search term to filter your list results. Max length: 256 chars.
46
+ * @property {boolean} parseOutput
47
+ * @property {libClient | undefined} sdk
48
+ */
49
+
50
+ /**
51
+ * @param {MessagingListMessagesRequestParams} params
52
+ */
53
+ const messagingListMessages = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
54
+ let client = !sdk ? await sdkForProject() : sdk;
55
+ let apiPath = '/messaging/messages';
56
+ let payload = {};
57
+ if (typeof queries !== 'undefined') {
58
+ payload['queries'] = queries;
59
+ }
60
+ if (typeof search !== 'undefined') {
61
+ payload['search'] = search;
62
+ }
63
+
64
+ let response = undefined;
65
+
66
+ response = await client.call('get', apiPath, {
67
+ 'content-type': 'application/json',
68
+ }, payload);
69
+
70
+ if (parseOutput) {
71
+ parse(response)
72
+ success()
73
+ }
74
+
75
+ return response;
76
+ }
77
+
78
+ /**
79
+ * @typedef {Object} MessagingCreateEmailRequestParams
80
+ * @property {string} messageId Message ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
81
+ * @property {string} subject Email Subject.
82
+ * @property {string} content Email Content.
83
+ * @property {string[]} topics List of Topic IDs.
84
+ * @property {string[]} users List of User IDs.
85
+ * @property {string[]} targets List of Targets IDs.
86
+ * @property {string[]} cc Array of target IDs to be added as CC.
87
+ * @property {string[]} bcc Array of target IDs to be added as BCC.
88
+ * @property {string[]} attachments Array of compound bucket IDs to file IDs to be attached to the email.
89
+ * @property {boolean} draft Is message a draft
90
+ * @property {boolean} html Is content of type HTML
91
+ * @property {string} scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
92
+ * @property {boolean} parseOutput
93
+ * @property {libClient | undefined} sdk
94
+ */
95
+
96
+ /**
97
+ * @param {MessagingCreateEmailRequestParams} params
98
+ */
99
+ const messagingCreateEmail = async ({ messageId, subject, content, topics, users, targets, cc, bcc, attachments, draft, html, scheduledAt, parseOutput = true, sdk = undefined}) => {
100
+ let client = !sdk ? await sdkForProject() : sdk;
101
+ let apiPath = '/messaging/messages/email';
102
+ let payload = {};
103
+ if (typeof messageId !== 'undefined') {
104
+ payload['messageId'] = messageId;
105
+ }
106
+ if (typeof subject !== 'undefined') {
107
+ payload['subject'] = subject;
108
+ }
109
+ if (typeof content !== 'undefined') {
110
+ payload['content'] = content;
111
+ }
112
+ topics = topics === true ? [] : topics;
113
+ if (typeof topics !== 'undefined') {
114
+ payload['topics'] = topics;
115
+ }
116
+ users = users === true ? [] : users;
117
+ if (typeof users !== 'undefined') {
118
+ payload['users'] = users;
119
+ }
120
+ targets = targets === true ? [] : targets;
121
+ if (typeof targets !== 'undefined') {
122
+ payload['targets'] = targets;
123
+ }
124
+ cc = cc === true ? [] : cc;
125
+ if (typeof cc !== 'undefined') {
126
+ payload['cc'] = cc;
127
+ }
128
+ bcc = bcc === true ? [] : bcc;
129
+ if (typeof bcc !== 'undefined') {
130
+ payload['bcc'] = bcc;
131
+ }
132
+ attachments = attachments === true ? [] : attachments;
133
+ if (typeof attachments !== 'undefined') {
134
+ payload['attachments'] = attachments;
135
+ }
136
+ if (typeof draft !== 'undefined') {
137
+ payload['draft'] = draft;
138
+ }
139
+ if (typeof html !== 'undefined') {
140
+ payload['html'] = html;
141
+ }
142
+ if (typeof scheduledAt !== 'undefined') {
143
+ payload['scheduledAt'] = scheduledAt;
144
+ }
145
+
146
+ let response = undefined;
147
+
148
+ response = await client.call('post', apiPath, {
149
+ 'content-type': 'application/json',
150
+ }, payload);
151
+
152
+ if (parseOutput) {
153
+ parse(response)
154
+ success()
155
+ }
156
+
157
+ return response;
158
+ }
159
+
160
+ /**
161
+ * @typedef {Object} MessagingUpdateEmailRequestParams
162
+ * @property {string} messageId Message ID.
163
+ * @property {string[]} topics List of Topic IDs.
164
+ * @property {string[]} users List of User IDs.
165
+ * @property {string[]} targets List of Targets IDs.
166
+ * @property {string} subject Email Subject.
167
+ * @property {string} content Email Content.
168
+ * @property {boolean} draft Is message a draft
169
+ * @property {boolean} html Is content of type HTML
170
+ * @property {string[]} cc Array of target IDs to be added as CC.
171
+ * @property {string[]} bcc Array of target IDs to be added as BCC.
172
+ * @property {string} scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
173
+ * @property {boolean} parseOutput
174
+ * @property {libClient | undefined} sdk
175
+ */
176
+
177
+ /**
178
+ * @param {MessagingUpdateEmailRequestParams} params
179
+ */
180
+ const messagingUpdateEmail = async ({ messageId, topics, users, targets, subject, content, draft, html, cc, bcc, scheduledAt, parseOutput = true, sdk = undefined}) => {
181
+ let client = !sdk ? await sdkForProject() : sdk;
182
+ let apiPath = '/messaging/messages/email/{messageId}'.replace('{messageId}', messageId);
183
+ let payload = {};
184
+ topics = topics === true ? [] : topics;
185
+ if (typeof topics !== 'undefined') {
186
+ payload['topics'] = topics;
187
+ }
188
+ users = users === true ? [] : users;
189
+ if (typeof users !== 'undefined') {
190
+ payload['users'] = users;
191
+ }
192
+ targets = targets === true ? [] : targets;
193
+ if (typeof targets !== 'undefined') {
194
+ payload['targets'] = targets;
195
+ }
196
+ if (typeof subject !== 'undefined') {
197
+ payload['subject'] = subject;
198
+ }
199
+ if (typeof content !== 'undefined') {
200
+ payload['content'] = content;
201
+ }
202
+ if (typeof draft !== 'undefined') {
203
+ payload['draft'] = draft;
204
+ }
205
+ if (typeof html !== 'undefined') {
206
+ payload['html'] = html;
207
+ }
208
+ cc = cc === true ? [] : cc;
209
+ if (typeof cc !== 'undefined') {
210
+ payload['cc'] = cc;
211
+ }
212
+ bcc = bcc === true ? [] : bcc;
213
+ if (typeof bcc !== 'undefined') {
214
+ payload['bcc'] = bcc;
215
+ }
216
+ if (typeof scheduledAt !== 'undefined') {
217
+ payload['scheduledAt'] = scheduledAt;
218
+ }
219
+
220
+ let response = undefined;
221
+
222
+ response = await client.call('patch', apiPath, {
223
+ 'content-type': 'application/json',
224
+ }, payload);
225
+
226
+ if (parseOutput) {
227
+ parse(response)
228
+ success()
229
+ }
230
+
231
+ return response;
232
+ }
233
+
234
+ /**
235
+ * @typedef {Object} MessagingCreatePushRequestParams
236
+ * @property {string} messageId Message ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
237
+ * @property {string} title Title for push notification.
238
+ * @property {string} body Body for push notification.
239
+ * @property {string[]} topics List of Topic IDs.
240
+ * @property {string[]} users List of User IDs.
241
+ * @property {string[]} targets List of Targets IDs.
242
+ * @property {object} data Additional Data for push notification.
243
+ * @property {string} action Action for push notification.
244
+ * @property {string} image Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage.
245
+ * @property {string} icon Icon for push notification. Available only for Android and Web Platform.
246
+ * @property {string} sound Sound for push notification. Available only for Android and IOS Platform.
247
+ * @property {string} color Color for push notification. Available only for Android Platform.
248
+ * @property {string} tag Tag for push notification. Available only for Android Platform.
249
+ * @property {string} badge Badge for push notification. Available only for IOS Platform.
250
+ * @property {boolean} draft Is message a draft
251
+ * @property {string} scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
252
+ * @property {boolean} parseOutput
253
+ * @property {libClient | undefined} sdk
254
+ */
255
+
256
+ /**
257
+ * @param {MessagingCreatePushRequestParams} params
258
+ */
259
+ const messagingCreatePush = async ({ messageId, title, body, topics, users, targets, data, action, image, icon, sound, color, tag, badge, draft, scheduledAt, parseOutput = true, sdk = undefined}) => {
260
+ let client = !sdk ? await sdkForProject() : sdk;
261
+ let apiPath = '/messaging/messages/push';
262
+ let payload = {};
263
+ if (typeof messageId !== 'undefined') {
264
+ payload['messageId'] = messageId;
265
+ }
266
+ if (typeof title !== 'undefined') {
267
+ payload['title'] = title;
268
+ }
269
+ if (typeof body !== 'undefined') {
270
+ payload['body'] = body;
271
+ }
272
+ topics = topics === true ? [] : topics;
273
+ if (typeof topics !== 'undefined') {
274
+ payload['topics'] = topics;
275
+ }
276
+ users = users === true ? [] : users;
277
+ if (typeof users !== 'undefined') {
278
+ payload['users'] = users;
279
+ }
280
+ targets = targets === true ? [] : targets;
281
+ if (typeof targets !== 'undefined') {
282
+ payload['targets'] = targets;
283
+ }
284
+ if (typeof data !== 'undefined') {
285
+ payload['data'] = JSON.parse(data);
286
+ }
287
+ if (typeof action !== 'undefined') {
288
+ payload['action'] = action;
289
+ }
290
+ if (typeof image !== 'undefined') {
291
+ payload['image'] = image;
292
+ }
293
+ if (typeof icon !== 'undefined') {
294
+ payload['icon'] = icon;
295
+ }
296
+ if (typeof sound !== 'undefined') {
297
+ payload['sound'] = sound;
298
+ }
299
+ if (typeof color !== 'undefined') {
300
+ payload['color'] = color;
301
+ }
302
+ if (typeof tag !== 'undefined') {
303
+ payload['tag'] = tag;
304
+ }
305
+ if (typeof badge !== 'undefined') {
306
+ payload['badge'] = badge;
307
+ }
308
+ if (typeof draft !== 'undefined') {
309
+ payload['draft'] = draft;
310
+ }
311
+ if (typeof scheduledAt !== 'undefined') {
312
+ payload['scheduledAt'] = scheduledAt;
313
+ }
314
+
315
+ let response = undefined;
316
+
317
+ response = await client.call('post', apiPath, {
318
+ 'content-type': 'application/json',
319
+ }, payload);
320
+
321
+ if (parseOutput) {
322
+ parse(response)
323
+ success()
324
+ }
325
+
326
+ return response;
327
+ }
328
+
329
+ /**
330
+ * @typedef {Object} MessagingUpdatePushRequestParams
331
+ * @property {string} messageId Message ID.
332
+ * @property {string[]} topics List of Topic IDs.
333
+ * @property {string[]} users List of User IDs.
334
+ * @property {string[]} targets List of Targets IDs.
335
+ * @property {string} title Title for push notification.
336
+ * @property {string} body Body for push notification.
337
+ * @property {object} data Additional Data for push notification.
338
+ * @property {string} action Action for push notification.
339
+ * @property {string} image Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage.
340
+ * @property {string} icon Icon for push notification. Available only for Android and Web platforms.
341
+ * @property {string} sound Sound for push notification. Available only for Android and iOS platforms.
342
+ * @property {string} color Color for push notification. Available only for Android platforms.
343
+ * @property {string} tag Tag for push notification. Available only for Android platforms.
344
+ * @property {number} badge Badge for push notification. Available only for iOS platforms.
345
+ * @property {boolean} draft Is message a draft
346
+ * @property {string} scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
347
+ * @property {boolean} parseOutput
348
+ * @property {libClient | undefined} sdk
349
+ */
350
+
351
+ /**
352
+ * @param {MessagingUpdatePushRequestParams} params
353
+ */
354
+ const messagingUpdatePush = async ({ messageId, topics, users, targets, title, body, data, action, image, icon, sound, color, tag, badge, draft, scheduledAt, parseOutput = true, sdk = undefined}) => {
355
+ let client = !sdk ? await sdkForProject() : sdk;
356
+ let apiPath = '/messaging/messages/push/{messageId}'.replace('{messageId}', messageId);
357
+ let payload = {};
358
+ topics = topics === true ? [] : topics;
359
+ if (typeof topics !== 'undefined') {
360
+ payload['topics'] = topics;
361
+ }
362
+ users = users === true ? [] : users;
363
+ if (typeof users !== 'undefined') {
364
+ payload['users'] = users;
365
+ }
366
+ targets = targets === true ? [] : targets;
367
+ if (typeof targets !== 'undefined') {
368
+ payload['targets'] = targets;
369
+ }
370
+ if (typeof title !== 'undefined') {
371
+ payload['title'] = title;
372
+ }
373
+ if (typeof body !== 'undefined') {
374
+ payload['body'] = body;
375
+ }
376
+ if (typeof data !== 'undefined') {
377
+ payload['data'] = JSON.parse(data);
378
+ }
379
+ if (typeof action !== 'undefined') {
380
+ payload['action'] = action;
381
+ }
382
+ if (typeof image !== 'undefined') {
383
+ payload['image'] = image;
384
+ }
385
+ if (typeof icon !== 'undefined') {
386
+ payload['icon'] = icon;
387
+ }
388
+ if (typeof sound !== 'undefined') {
389
+ payload['sound'] = sound;
390
+ }
391
+ if (typeof color !== 'undefined') {
392
+ payload['color'] = color;
393
+ }
394
+ if (typeof tag !== 'undefined') {
395
+ payload['tag'] = tag;
396
+ }
397
+ if (typeof badge !== 'undefined') {
398
+ payload['badge'] = badge;
399
+ }
400
+ if (typeof draft !== 'undefined') {
401
+ payload['draft'] = draft;
402
+ }
403
+ if (typeof scheduledAt !== 'undefined') {
404
+ payload['scheduledAt'] = scheduledAt;
405
+ }
406
+
407
+ let response = undefined;
408
+
409
+ response = await client.call('patch', apiPath, {
410
+ 'content-type': 'application/json',
411
+ }, payload);
412
+
413
+ if (parseOutput) {
414
+ parse(response)
415
+ success()
416
+ }
417
+
418
+ return response;
419
+ }
420
+
421
+ /**
422
+ * @typedef {Object} MessagingCreateSmsRequestParams
423
+ * @property {string} messageId Message ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
424
+ * @property {string} content SMS Content.
425
+ * @property {string[]} topics List of Topic IDs.
426
+ * @property {string[]} users List of User IDs.
427
+ * @property {string[]} targets List of Targets IDs.
428
+ * @property {boolean} draft Is message a draft
429
+ * @property {string} scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
430
+ * @property {boolean} parseOutput
431
+ * @property {libClient | undefined} sdk
432
+ */
433
+
434
+ /**
435
+ * @param {MessagingCreateSmsRequestParams} params
436
+ */
437
+ const messagingCreateSms = async ({ messageId, content, topics, users, targets, draft, scheduledAt, parseOutput = true, sdk = undefined}) => {
438
+ let client = !sdk ? await sdkForProject() : sdk;
439
+ let apiPath = '/messaging/messages/sms';
440
+ let payload = {};
441
+ if (typeof messageId !== 'undefined') {
442
+ payload['messageId'] = messageId;
443
+ }
444
+ if (typeof content !== 'undefined') {
445
+ payload['content'] = content;
446
+ }
447
+ topics = topics === true ? [] : topics;
448
+ if (typeof topics !== 'undefined') {
449
+ payload['topics'] = topics;
450
+ }
451
+ users = users === true ? [] : users;
452
+ if (typeof users !== 'undefined') {
453
+ payload['users'] = users;
454
+ }
455
+ targets = targets === true ? [] : targets;
456
+ if (typeof targets !== 'undefined') {
457
+ payload['targets'] = targets;
458
+ }
459
+ if (typeof draft !== 'undefined') {
460
+ payload['draft'] = draft;
461
+ }
462
+ if (typeof scheduledAt !== 'undefined') {
463
+ payload['scheduledAt'] = scheduledAt;
464
+ }
465
+
466
+ let response = undefined;
467
+
468
+ response = await client.call('post', apiPath, {
469
+ 'content-type': 'application/json',
470
+ }, payload);
471
+
472
+ if (parseOutput) {
473
+ parse(response)
474
+ success()
475
+ }
476
+
477
+ return response;
478
+ }
479
+
480
+ /**
481
+ * @typedef {Object} MessagingUpdateSmsRequestParams
482
+ * @property {string} messageId Message ID.
483
+ * @property {string[]} topics List of Topic IDs.
484
+ * @property {string[]} users List of User IDs.
485
+ * @property {string[]} targets List of Targets IDs.
486
+ * @property {string} content Email Content.
487
+ * @property {boolean} draft Is message a draft
488
+ * @property {string} scheduledAt Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.
489
+ * @property {boolean} parseOutput
490
+ * @property {libClient | undefined} sdk
491
+ */
492
+
493
+ /**
494
+ * @param {MessagingUpdateSmsRequestParams} params
495
+ */
496
+ const messagingUpdateSms = async ({ messageId, topics, users, targets, content, draft, scheduledAt, parseOutput = true, sdk = undefined}) => {
497
+ let client = !sdk ? await sdkForProject() : sdk;
498
+ let apiPath = '/messaging/messages/sms/{messageId}'.replace('{messageId}', messageId);
499
+ let payload = {};
500
+ topics = topics === true ? [] : topics;
501
+ if (typeof topics !== 'undefined') {
502
+ payload['topics'] = topics;
503
+ }
504
+ users = users === true ? [] : users;
505
+ if (typeof users !== 'undefined') {
506
+ payload['users'] = users;
507
+ }
508
+ targets = targets === true ? [] : targets;
509
+ if (typeof targets !== 'undefined') {
510
+ payload['targets'] = targets;
511
+ }
512
+ if (typeof content !== 'undefined') {
513
+ payload['content'] = content;
514
+ }
515
+ if (typeof draft !== 'undefined') {
516
+ payload['draft'] = draft;
517
+ }
518
+ if (typeof scheduledAt !== 'undefined') {
519
+ payload['scheduledAt'] = scheduledAt;
520
+ }
521
+
522
+ let response = undefined;
523
+
524
+ response = await client.call('patch', apiPath, {
525
+ 'content-type': 'application/json',
526
+ }, payload);
527
+
528
+ if (parseOutput) {
529
+ parse(response)
530
+ success()
531
+ }
532
+
533
+ return response;
534
+ }
535
+
536
+ /**
537
+ * @typedef {Object} MessagingGetMessageRequestParams
538
+ * @property {string} messageId Message ID.
539
+ * @property {boolean} parseOutput
540
+ * @property {libClient | undefined} sdk
541
+ */
542
+
543
+ /**
544
+ * @param {MessagingGetMessageRequestParams} params
545
+ */
546
+ const messagingGetMessage = async ({ messageId, parseOutput = true, sdk = undefined}) => {
547
+ let client = !sdk ? await sdkForProject() : sdk;
548
+ let apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
549
+ let payload = {};
550
+
551
+ let response = undefined;
552
+
553
+ response = await client.call('get', apiPath, {
554
+ 'content-type': 'application/json',
555
+ }, payload);
556
+
557
+ if (parseOutput) {
558
+ parse(response)
559
+ success()
560
+ }
561
+
562
+ return response;
563
+ }
564
+
565
+ /**
566
+ * @typedef {Object} MessagingDeleteRequestParams
567
+ * @property {string} messageId Message ID.
568
+ * @property {boolean} parseOutput
569
+ * @property {libClient | undefined} sdk
570
+ */
571
+
572
+ /**
573
+ * @param {MessagingDeleteRequestParams} params
574
+ */
575
+ const messagingDelete = async ({ messageId, parseOutput = true, sdk = undefined}) => {
576
+ let client = !sdk ? await sdkForProject() : sdk;
577
+ let apiPath = '/messaging/messages/{messageId}'.replace('{messageId}', messageId);
578
+ let payload = {};
579
+
580
+ let response = undefined;
581
+
582
+ response = await client.call('delete', apiPath, {
583
+ 'content-type': 'application/json',
584
+ }, payload);
585
+
586
+ if (parseOutput) {
587
+ parse(response)
588
+ success()
589
+ }
590
+
591
+ return response;
592
+ }
593
+
594
+ /**
595
+ * @typedef {Object} MessagingListMessageLogsRequestParams
596
+ * @property {string} messageId Message ID.
597
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
598
+ * @property {boolean} parseOutput
599
+ * @property {libClient | undefined} sdk
600
+ */
601
+
602
+ /**
603
+ * @param {MessagingListMessageLogsRequestParams} params
604
+ */
605
+ const messagingListMessageLogs = async ({ messageId, queries, parseOutput = true, sdk = undefined}) => {
606
+ let client = !sdk ? await sdkForProject() : sdk;
607
+ let apiPath = '/messaging/messages/{messageId}/logs'.replace('{messageId}', messageId);
608
+ let payload = {};
609
+ if (typeof queries !== 'undefined') {
610
+ payload['queries'] = queries;
611
+ }
612
+
613
+ let response = undefined;
614
+
615
+ response = await client.call('get', apiPath, {
616
+ 'content-type': 'application/json',
617
+ }, payload);
618
+
619
+ if (parseOutput) {
620
+ parse(response)
621
+ success()
622
+ }
623
+
624
+ return response;
625
+ }
626
+
627
+ /**
628
+ * @typedef {Object} MessagingListTargetsRequestParams
629
+ * @property {string} messageId Message ID.
630
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType
631
+ * @property {boolean} parseOutput
632
+ * @property {libClient | undefined} sdk
633
+ */
634
+
635
+ /**
636
+ * @param {MessagingListTargetsRequestParams} params
637
+ */
638
+ const messagingListTargets = async ({ messageId, queries, parseOutput = true, sdk = undefined}) => {
639
+ let client = !sdk ? await sdkForProject() : sdk;
640
+ let apiPath = '/messaging/messages/{messageId}/targets'.replace('{messageId}', messageId);
641
+ let payload = {};
642
+ if (typeof queries !== 'undefined') {
643
+ payload['queries'] = queries;
644
+ }
645
+
646
+ let response = undefined;
647
+
648
+ response = await client.call('get', apiPath, {
649
+ 'content-type': 'application/json',
650
+ }, payload);
651
+
652
+ if (parseOutput) {
653
+ parse(response)
654
+ success()
655
+ }
656
+
657
+ return response;
658
+ }
659
+
660
+ /**
661
+ * @typedef {Object} MessagingListProvidersRequestParams
662
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
663
+ * @property {string} search Search term to filter your list results. Max length: 256 chars.
664
+ * @property {boolean} parseOutput
665
+ * @property {libClient | undefined} sdk
666
+ */
667
+
668
+ /**
669
+ * @param {MessagingListProvidersRequestParams} params
670
+ */
671
+ const messagingListProviders = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
672
+ let client = !sdk ? await sdkForProject() : sdk;
673
+ let apiPath = '/messaging/providers';
674
+ let payload = {};
675
+ if (typeof queries !== 'undefined') {
676
+ payload['queries'] = queries;
677
+ }
678
+ if (typeof search !== 'undefined') {
679
+ payload['search'] = search;
680
+ }
681
+
682
+ let response = undefined;
683
+
684
+ response = await client.call('get', apiPath, {
685
+ 'content-type': 'application/json',
686
+ }, payload);
687
+
688
+ if (parseOutput) {
689
+ parse(response)
690
+ success()
691
+ }
692
+
693
+ return response;
694
+ }
695
+
696
+ /**
697
+ * @typedef {Object} MessagingCreateApnsProviderRequestParams
698
+ * @property {string} providerId Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
699
+ * @property {string} name Provider name.
700
+ * @property {string} authKey APNS authentication key.
701
+ * @property {string} authKeyId APNS authentication key ID.
702
+ * @property {string} teamId APNS team ID.
703
+ * @property {string} bundleId APNS bundle ID.
704
+ * @property {boolean} sandbox Use APNS sandbox environment.
705
+ * @property {boolean} enabled Set as enabled.
706
+ * @property {boolean} parseOutput
707
+ * @property {libClient | undefined} sdk
708
+ */
709
+
710
+ /**
711
+ * @param {MessagingCreateApnsProviderRequestParams} params
712
+ */
713
+ const messagingCreateApnsProvider = async ({ providerId, name, authKey, authKeyId, teamId, bundleId, sandbox, enabled, parseOutput = true, sdk = undefined}) => {
714
+ let client = !sdk ? await sdkForProject() : sdk;
715
+ let apiPath = '/messaging/providers/apns';
716
+ let payload = {};
717
+ if (typeof providerId !== 'undefined') {
718
+ payload['providerId'] = providerId;
719
+ }
720
+ if (typeof name !== 'undefined') {
721
+ payload['name'] = name;
722
+ }
723
+ if (typeof authKey !== 'undefined') {
724
+ payload['authKey'] = authKey;
725
+ }
726
+ if (typeof authKeyId !== 'undefined') {
727
+ payload['authKeyId'] = authKeyId;
728
+ }
729
+ if (typeof teamId !== 'undefined') {
730
+ payload['teamId'] = teamId;
731
+ }
732
+ if (typeof bundleId !== 'undefined') {
733
+ payload['bundleId'] = bundleId;
734
+ }
735
+ if (typeof sandbox !== 'undefined') {
736
+ payload['sandbox'] = sandbox;
737
+ }
738
+ if (typeof enabled !== 'undefined') {
739
+ payload['enabled'] = enabled;
740
+ }
741
+
742
+ let response = undefined;
743
+
744
+ response = await client.call('post', apiPath, {
745
+ 'content-type': 'application/json',
746
+ }, payload);
747
+
748
+ if (parseOutput) {
749
+ parse(response)
750
+ success()
751
+ }
752
+
753
+ return response;
754
+ }
755
+
756
+ /**
757
+ * @typedef {Object} MessagingUpdateApnsProviderRequestParams
758
+ * @property {string} providerId Provider ID.
759
+ * @property {string} name Provider name.
760
+ * @property {boolean} enabled Set as enabled.
761
+ * @property {string} authKey APNS authentication key.
762
+ * @property {string} authKeyId APNS authentication key ID.
763
+ * @property {string} teamId APNS team ID.
764
+ * @property {string} bundleId APNS bundle ID.
765
+ * @property {boolean} sandbox Use APNS sandbox environment.
766
+ * @property {boolean} parseOutput
767
+ * @property {libClient | undefined} sdk
768
+ */
769
+
770
+ /**
771
+ * @param {MessagingUpdateApnsProviderRequestParams} params
772
+ */
773
+ const messagingUpdateApnsProvider = async ({ providerId, name, enabled, authKey, authKeyId, teamId, bundleId, sandbox, parseOutput = true, sdk = undefined}) => {
774
+ let client = !sdk ? await sdkForProject() : sdk;
775
+ let apiPath = '/messaging/providers/apns/{providerId}'.replace('{providerId}', providerId);
776
+ let payload = {};
777
+ if (typeof name !== 'undefined') {
778
+ payload['name'] = name;
779
+ }
780
+ if (typeof enabled !== 'undefined') {
781
+ payload['enabled'] = enabled;
782
+ }
783
+ if (typeof authKey !== 'undefined') {
784
+ payload['authKey'] = authKey;
785
+ }
786
+ if (typeof authKeyId !== 'undefined') {
787
+ payload['authKeyId'] = authKeyId;
788
+ }
789
+ if (typeof teamId !== 'undefined') {
790
+ payload['teamId'] = teamId;
791
+ }
792
+ if (typeof bundleId !== 'undefined') {
793
+ payload['bundleId'] = bundleId;
794
+ }
795
+ if (typeof sandbox !== 'undefined') {
796
+ payload['sandbox'] = sandbox;
797
+ }
798
+
799
+ let response = undefined;
800
+
801
+ response = await client.call('patch', apiPath, {
802
+ 'content-type': 'application/json',
803
+ }, payload);
804
+
805
+ if (parseOutput) {
806
+ parse(response)
807
+ success()
808
+ }
809
+
810
+ return response;
811
+ }
812
+
813
+ /**
814
+ * @typedef {Object} MessagingCreateFcmProviderRequestParams
815
+ * @property {string} providerId Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
816
+ * @property {string} name Provider name.
817
+ * @property {object} serviceAccountJSON FCM service account JSON.
818
+ * @property {boolean} enabled Set as enabled.
819
+ * @property {boolean} parseOutput
820
+ * @property {libClient | undefined} sdk
821
+ */
822
+
823
+ /**
824
+ * @param {MessagingCreateFcmProviderRequestParams} params
825
+ */
826
+ const messagingCreateFcmProvider = async ({ providerId, name, serviceAccountJSON, enabled, parseOutput = true, sdk = undefined}) => {
827
+ let client = !sdk ? await sdkForProject() : sdk;
828
+ let apiPath = '/messaging/providers/fcm';
829
+ let payload = {};
830
+ if (typeof providerId !== 'undefined') {
831
+ payload['providerId'] = providerId;
832
+ }
833
+ if (typeof name !== 'undefined') {
834
+ payload['name'] = name;
835
+ }
836
+ if (typeof serviceAccountJSON !== 'undefined') {
837
+ payload['serviceAccountJSON'] = JSON.parse(serviceAccountJSON);
838
+ }
839
+ if (typeof enabled !== 'undefined') {
840
+ payload['enabled'] = enabled;
841
+ }
842
+
843
+ let response = undefined;
844
+
845
+ response = await client.call('post', apiPath, {
846
+ 'content-type': 'application/json',
847
+ }, payload);
848
+
849
+ if (parseOutput) {
850
+ parse(response)
851
+ success()
852
+ }
853
+
854
+ return response;
855
+ }
856
+
857
+ /**
858
+ * @typedef {Object} MessagingUpdateFcmProviderRequestParams
859
+ * @property {string} providerId Provider ID.
860
+ * @property {string} name Provider name.
861
+ * @property {boolean} enabled Set as enabled.
862
+ * @property {object} serviceAccountJSON FCM service account JSON.
863
+ * @property {boolean} parseOutput
864
+ * @property {libClient | undefined} sdk
865
+ */
866
+
867
+ /**
868
+ * @param {MessagingUpdateFcmProviderRequestParams} params
869
+ */
870
+ const messagingUpdateFcmProvider = async ({ providerId, name, enabled, serviceAccountJSON, parseOutput = true, sdk = undefined}) => {
871
+ let client = !sdk ? await sdkForProject() : sdk;
872
+ let apiPath = '/messaging/providers/fcm/{providerId}'.replace('{providerId}', providerId);
873
+ let payload = {};
874
+ if (typeof name !== 'undefined') {
875
+ payload['name'] = name;
876
+ }
877
+ if (typeof enabled !== 'undefined') {
878
+ payload['enabled'] = enabled;
879
+ }
880
+ if (typeof serviceAccountJSON !== 'undefined') {
881
+ payload['serviceAccountJSON'] = JSON.parse(serviceAccountJSON);
882
+ }
883
+
884
+ let response = undefined;
885
+
886
+ response = await client.call('patch', apiPath, {
887
+ 'content-type': 'application/json',
888
+ }, payload);
889
+
890
+ if (parseOutput) {
891
+ parse(response)
892
+ success()
893
+ }
894
+
895
+ return response;
896
+ }
897
+
898
+ /**
899
+ * @typedef {Object} MessagingCreateMailgunProviderRequestParams
900
+ * @property {string} providerId Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
901
+ * @property {string} name Provider name.
902
+ * @property {string} apiKey Mailgun API Key.
903
+ * @property {string} domain Mailgun Domain.
904
+ * @property {boolean} isEuRegion Set as EU region.
905
+ * @property {string} fromName Sender Name.
906
+ * @property {string} fromEmail Sender email address.
907
+ * @property {string} replyToName Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.
908
+ * @property {string} replyToEmail Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.
909
+ * @property {boolean} enabled Set as enabled.
910
+ * @property {boolean} parseOutput
911
+ * @property {libClient | undefined} sdk
912
+ */
913
+
914
+ /**
915
+ * @param {MessagingCreateMailgunProviderRequestParams} params
916
+ */
917
+ const messagingCreateMailgunProvider = async ({ providerId, name, apiKey, domain, isEuRegion, fromName, fromEmail, replyToName, replyToEmail, enabled, parseOutput = true, sdk = undefined}) => {
918
+ let client = !sdk ? await sdkForProject() : sdk;
919
+ let apiPath = '/messaging/providers/mailgun';
920
+ let payload = {};
921
+ if (typeof providerId !== 'undefined') {
922
+ payload['providerId'] = providerId;
923
+ }
924
+ if (typeof name !== 'undefined') {
925
+ payload['name'] = name;
926
+ }
927
+ if (typeof apiKey !== 'undefined') {
928
+ payload['apiKey'] = apiKey;
929
+ }
930
+ if (typeof domain !== 'undefined') {
931
+ payload['domain'] = domain;
932
+ }
933
+ if (typeof isEuRegion !== 'undefined') {
934
+ payload['isEuRegion'] = isEuRegion;
935
+ }
936
+ if (typeof fromName !== 'undefined') {
937
+ payload['fromName'] = fromName;
938
+ }
939
+ if (typeof fromEmail !== 'undefined') {
940
+ payload['fromEmail'] = fromEmail;
941
+ }
942
+ if (typeof replyToName !== 'undefined') {
943
+ payload['replyToName'] = replyToName;
944
+ }
945
+ if (typeof replyToEmail !== 'undefined') {
946
+ payload['replyToEmail'] = replyToEmail;
947
+ }
948
+ if (typeof enabled !== 'undefined') {
949
+ payload['enabled'] = enabled;
950
+ }
951
+
952
+ let response = undefined;
953
+
954
+ response = await client.call('post', apiPath, {
955
+ 'content-type': 'application/json',
956
+ }, payload);
957
+
958
+ if (parseOutput) {
959
+ parse(response)
960
+ success()
961
+ }
962
+
963
+ return response;
964
+ }
965
+
966
+ /**
967
+ * @typedef {Object} MessagingUpdateMailgunProviderRequestParams
968
+ * @property {string} providerId Provider ID.
969
+ * @property {string} name Provider name.
970
+ * @property {string} apiKey Mailgun API Key.
971
+ * @property {string} domain Mailgun Domain.
972
+ * @property {boolean} isEuRegion Set as EU region.
973
+ * @property {boolean} enabled Set as enabled.
974
+ * @property {string} fromName Sender Name.
975
+ * @property {string} fromEmail Sender email address.
976
+ * @property {string} replyToName Name set in the reply to field for the mail. Default value is sender name.
977
+ * @property {string} replyToEmail Email set in the reply to field for the mail. Default value is sender email.
978
+ * @property {boolean} parseOutput
979
+ * @property {libClient | undefined} sdk
980
+ */
981
+
982
+ /**
983
+ * @param {MessagingUpdateMailgunProviderRequestParams} params
984
+ */
985
+ const messagingUpdateMailgunProvider = async ({ providerId, name, apiKey, domain, isEuRegion, enabled, fromName, fromEmail, replyToName, replyToEmail, parseOutput = true, sdk = undefined}) => {
986
+ let client = !sdk ? await sdkForProject() : sdk;
987
+ let apiPath = '/messaging/providers/mailgun/{providerId}'.replace('{providerId}', providerId);
988
+ let payload = {};
989
+ if (typeof name !== 'undefined') {
990
+ payload['name'] = name;
991
+ }
992
+ if (typeof apiKey !== 'undefined') {
993
+ payload['apiKey'] = apiKey;
994
+ }
995
+ if (typeof domain !== 'undefined') {
996
+ payload['domain'] = domain;
997
+ }
998
+ if (typeof isEuRegion !== 'undefined') {
999
+ payload['isEuRegion'] = isEuRegion;
1000
+ }
1001
+ if (typeof enabled !== 'undefined') {
1002
+ payload['enabled'] = enabled;
1003
+ }
1004
+ if (typeof fromName !== 'undefined') {
1005
+ payload['fromName'] = fromName;
1006
+ }
1007
+ if (typeof fromEmail !== 'undefined') {
1008
+ payload['fromEmail'] = fromEmail;
1009
+ }
1010
+ if (typeof replyToName !== 'undefined') {
1011
+ payload['replyToName'] = replyToName;
1012
+ }
1013
+ if (typeof replyToEmail !== 'undefined') {
1014
+ payload['replyToEmail'] = replyToEmail;
1015
+ }
1016
+
1017
+ let response = undefined;
1018
+
1019
+ response = await client.call('patch', apiPath, {
1020
+ 'content-type': 'application/json',
1021
+ }, payload);
1022
+
1023
+ if (parseOutput) {
1024
+ parse(response)
1025
+ success()
1026
+ }
1027
+
1028
+ return response;
1029
+ }
1030
+
1031
+ /**
1032
+ * @typedef {Object} MessagingCreateMsg91ProviderRequestParams
1033
+ * @property {string} providerId Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1034
+ * @property {string} name Provider name.
1035
+ * @property {string} from Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
1036
+ * @property {string} senderId Msg91 Sender ID.
1037
+ * @property {string} authKey Msg91 Auth Key.
1038
+ * @property {boolean} enabled Set as enabled.
1039
+ * @property {boolean} parseOutput
1040
+ * @property {libClient | undefined} sdk
1041
+ */
1042
+
1043
+ /**
1044
+ * @param {MessagingCreateMsg91ProviderRequestParams} params
1045
+ */
1046
+ const messagingCreateMsg91Provider = async ({ providerId, name, from, senderId, authKey, enabled, parseOutput = true, sdk = undefined}) => {
1047
+ let client = !sdk ? await sdkForProject() : sdk;
1048
+ let apiPath = '/messaging/providers/msg91';
1049
+ let payload = {};
1050
+ if (typeof providerId !== 'undefined') {
1051
+ payload['providerId'] = providerId;
1052
+ }
1053
+ if (typeof name !== 'undefined') {
1054
+ payload['name'] = name;
1055
+ }
1056
+ if (typeof from !== 'undefined') {
1057
+ payload['from'] = from;
1058
+ }
1059
+ if (typeof senderId !== 'undefined') {
1060
+ payload['senderId'] = senderId;
1061
+ }
1062
+ if (typeof authKey !== 'undefined') {
1063
+ payload['authKey'] = authKey;
1064
+ }
1065
+ if (typeof enabled !== 'undefined') {
1066
+ payload['enabled'] = enabled;
1067
+ }
1068
+
1069
+ let response = undefined;
1070
+
1071
+ response = await client.call('post', apiPath, {
1072
+ 'content-type': 'application/json',
1073
+ }, payload);
1074
+
1075
+ if (parseOutput) {
1076
+ parse(response)
1077
+ success()
1078
+ }
1079
+
1080
+ return response;
1081
+ }
1082
+
1083
+ /**
1084
+ * @typedef {Object} MessagingUpdateMsg91ProviderRequestParams
1085
+ * @property {string} providerId Provider ID.
1086
+ * @property {string} name Provider name.
1087
+ * @property {boolean} enabled Set as enabled.
1088
+ * @property {string} senderId Msg91 Sender ID.
1089
+ * @property {string} authKey Msg91 Auth Key.
1090
+ * @property {string} from Sender number.
1091
+ * @property {boolean} parseOutput
1092
+ * @property {libClient | undefined} sdk
1093
+ */
1094
+
1095
+ /**
1096
+ * @param {MessagingUpdateMsg91ProviderRequestParams} params
1097
+ */
1098
+ const messagingUpdateMsg91Provider = async ({ providerId, name, enabled, senderId, authKey, from, parseOutput = true, sdk = undefined}) => {
1099
+ let client = !sdk ? await sdkForProject() : sdk;
1100
+ let apiPath = '/messaging/providers/msg91/{providerId}'.replace('{providerId}', providerId);
1101
+ let payload = {};
1102
+ if (typeof name !== 'undefined') {
1103
+ payload['name'] = name;
1104
+ }
1105
+ if (typeof enabled !== 'undefined') {
1106
+ payload['enabled'] = enabled;
1107
+ }
1108
+ if (typeof senderId !== 'undefined') {
1109
+ payload['senderId'] = senderId;
1110
+ }
1111
+ if (typeof authKey !== 'undefined') {
1112
+ payload['authKey'] = authKey;
1113
+ }
1114
+ if (typeof from !== 'undefined') {
1115
+ payload['from'] = from;
1116
+ }
1117
+
1118
+ let response = undefined;
1119
+
1120
+ response = await client.call('patch', apiPath, {
1121
+ 'content-type': 'application/json',
1122
+ }, payload);
1123
+
1124
+ if (parseOutput) {
1125
+ parse(response)
1126
+ success()
1127
+ }
1128
+
1129
+ return response;
1130
+ }
1131
+
1132
+ /**
1133
+ * @typedef {Object} MessagingCreateSendgridProviderRequestParams
1134
+ * @property {string} providerId Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1135
+ * @property {string} name Provider name.
1136
+ * @property {string} apiKey Sendgrid API key.
1137
+ * @property {string} fromName Sender Name.
1138
+ * @property {string} fromEmail Sender email address.
1139
+ * @property {string} replyToName Name set in the reply to field for the mail. Default value is sender name.
1140
+ * @property {string} replyToEmail Email set in the reply to field for the mail. Default value is sender email.
1141
+ * @property {boolean} enabled Set as enabled.
1142
+ * @property {boolean} parseOutput
1143
+ * @property {libClient | undefined} sdk
1144
+ */
1145
+
1146
+ /**
1147
+ * @param {MessagingCreateSendgridProviderRequestParams} params
1148
+ */
1149
+ const messagingCreateSendgridProvider = async ({ providerId, name, apiKey, fromName, fromEmail, replyToName, replyToEmail, enabled, parseOutput = true, sdk = undefined}) => {
1150
+ let client = !sdk ? await sdkForProject() : sdk;
1151
+ let apiPath = '/messaging/providers/sendgrid';
1152
+ let payload = {};
1153
+ if (typeof providerId !== 'undefined') {
1154
+ payload['providerId'] = providerId;
1155
+ }
1156
+ if (typeof name !== 'undefined') {
1157
+ payload['name'] = name;
1158
+ }
1159
+ if (typeof apiKey !== 'undefined') {
1160
+ payload['apiKey'] = apiKey;
1161
+ }
1162
+ if (typeof fromName !== 'undefined') {
1163
+ payload['fromName'] = fromName;
1164
+ }
1165
+ if (typeof fromEmail !== 'undefined') {
1166
+ payload['fromEmail'] = fromEmail;
1167
+ }
1168
+ if (typeof replyToName !== 'undefined') {
1169
+ payload['replyToName'] = replyToName;
1170
+ }
1171
+ if (typeof replyToEmail !== 'undefined') {
1172
+ payload['replyToEmail'] = replyToEmail;
1173
+ }
1174
+ if (typeof enabled !== 'undefined') {
1175
+ payload['enabled'] = enabled;
1176
+ }
1177
+
1178
+ let response = undefined;
1179
+
1180
+ response = await client.call('post', apiPath, {
1181
+ 'content-type': 'application/json',
1182
+ }, payload);
1183
+
1184
+ if (parseOutput) {
1185
+ parse(response)
1186
+ success()
1187
+ }
1188
+
1189
+ return response;
1190
+ }
1191
+
1192
+ /**
1193
+ * @typedef {Object} MessagingUpdateSendgridProviderRequestParams
1194
+ * @property {string} providerId Provider ID.
1195
+ * @property {string} name Provider name.
1196
+ * @property {boolean} enabled Set as enabled.
1197
+ * @property {string} apiKey Sendgrid API key.
1198
+ * @property {string} fromName Sender Name.
1199
+ * @property {string} fromEmail Sender email address.
1200
+ * @property {string} replyToName Name set in the Reply To field for the mail. Default value is Sender Name.
1201
+ * @property {string} replyToEmail Email set in the Reply To field for the mail. Default value is Sender Email.
1202
+ * @property {boolean} parseOutput
1203
+ * @property {libClient | undefined} sdk
1204
+ */
1205
+
1206
+ /**
1207
+ * @param {MessagingUpdateSendgridProviderRequestParams} params
1208
+ */
1209
+ const messagingUpdateSendgridProvider = async ({ providerId, name, enabled, apiKey, fromName, fromEmail, replyToName, replyToEmail, parseOutput = true, sdk = undefined}) => {
1210
+ let client = !sdk ? await sdkForProject() : sdk;
1211
+ let apiPath = '/messaging/providers/sendgrid/{providerId}'.replace('{providerId}', providerId);
1212
+ let payload = {};
1213
+ if (typeof name !== 'undefined') {
1214
+ payload['name'] = name;
1215
+ }
1216
+ if (typeof enabled !== 'undefined') {
1217
+ payload['enabled'] = enabled;
1218
+ }
1219
+ if (typeof apiKey !== 'undefined') {
1220
+ payload['apiKey'] = apiKey;
1221
+ }
1222
+ if (typeof fromName !== 'undefined') {
1223
+ payload['fromName'] = fromName;
1224
+ }
1225
+ if (typeof fromEmail !== 'undefined') {
1226
+ payload['fromEmail'] = fromEmail;
1227
+ }
1228
+ if (typeof replyToName !== 'undefined') {
1229
+ payload['replyToName'] = replyToName;
1230
+ }
1231
+ if (typeof replyToEmail !== 'undefined') {
1232
+ payload['replyToEmail'] = replyToEmail;
1233
+ }
1234
+
1235
+ let response = undefined;
1236
+
1237
+ response = await client.call('patch', apiPath, {
1238
+ 'content-type': 'application/json',
1239
+ }, payload);
1240
+
1241
+ if (parseOutput) {
1242
+ parse(response)
1243
+ success()
1244
+ }
1245
+
1246
+ return response;
1247
+ }
1248
+
1249
+ /**
1250
+ * @typedef {Object} MessagingCreateSmtpProviderRequestParams
1251
+ * @property {string} providerId Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1252
+ * @property {string} name Provider name.
1253
+ * @property {string} host SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as 'smtp1.example.com:25;smtp2.example.com'. You can also specify encryption type, for example: 'tls://smtp1.example.com:587;ssl://smtp2.example.com:465"'. Hosts will be tried in order.
1254
+ * @property {number} port The default SMTP server port.
1255
+ * @property {string} username Authentication username.
1256
+ * @property {string} password Authentication password.
1257
+ * @property {SmtpEncryption} encryption Encryption type. Can be omitted, 'ssl', or 'tls'
1258
+ * @property {boolean} autoTLS Enable SMTP AutoTLS feature.
1259
+ * @property {string} mailer The value to use for the X-Mailer header.
1260
+ * @property {string} fromName Sender Name.
1261
+ * @property {string} fromEmail Sender email address.
1262
+ * @property {string} replyToName Name set in the reply to field for the mail. Default value is sender name.
1263
+ * @property {string} replyToEmail Email set in the reply to field for the mail. Default value is sender email.
1264
+ * @property {boolean} enabled Set as enabled.
1265
+ * @property {boolean} parseOutput
1266
+ * @property {libClient | undefined} sdk
1267
+ */
1268
+
1269
+ /**
1270
+ * @param {MessagingCreateSmtpProviderRequestParams} params
1271
+ */
1272
+ const messagingCreateSmtpProvider = async ({ providerId, name, host, port, username, password, encryption, autoTLS, mailer, fromName, fromEmail, replyToName, replyToEmail, enabled, parseOutput = true, sdk = undefined}) => {
1273
+ let client = !sdk ? await sdkForProject() : sdk;
1274
+ let apiPath = '/messaging/providers/smtp';
1275
+ let payload = {};
1276
+ if (typeof providerId !== 'undefined') {
1277
+ payload['providerId'] = providerId;
1278
+ }
1279
+ if (typeof name !== 'undefined') {
1280
+ payload['name'] = name;
1281
+ }
1282
+ if (typeof host !== 'undefined') {
1283
+ payload['host'] = host;
1284
+ }
1285
+ if (typeof port !== 'undefined') {
1286
+ payload['port'] = port;
1287
+ }
1288
+ if (typeof username !== 'undefined') {
1289
+ payload['username'] = username;
1290
+ }
1291
+ if (typeof password !== 'undefined') {
1292
+ payload['password'] = password;
1293
+ }
1294
+ if (typeof encryption !== 'undefined') {
1295
+ payload['encryption'] = encryption;
1296
+ }
1297
+ if (typeof autoTLS !== 'undefined') {
1298
+ payload['autoTLS'] = autoTLS;
1299
+ }
1300
+ if (typeof mailer !== 'undefined') {
1301
+ payload['mailer'] = mailer;
1302
+ }
1303
+ if (typeof fromName !== 'undefined') {
1304
+ payload['fromName'] = fromName;
1305
+ }
1306
+ if (typeof fromEmail !== 'undefined') {
1307
+ payload['fromEmail'] = fromEmail;
1308
+ }
1309
+ if (typeof replyToName !== 'undefined') {
1310
+ payload['replyToName'] = replyToName;
1311
+ }
1312
+ if (typeof replyToEmail !== 'undefined') {
1313
+ payload['replyToEmail'] = replyToEmail;
1314
+ }
1315
+ if (typeof enabled !== 'undefined') {
1316
+ payload['enabled'] = enabled;
1317
+ }
1318
+
1319
+ let response = undefined;
1320
+
1321
+ response = await client.call('post', apiPath, {
1322
+ 'content-type': 'application/json',
1323
+ }, payload);
1324
+
1325
+ if (parseOutput) {
1326
+ parse(response)
1327
+ success()
1328
+ }
1329
+
1330
+ return response;
1331
+ }
1332
+
1333
+ /**
1334
+ * @typedef {Object} MessagingUpdateSmtpProviderRequestParams
1335
+ * @property {string} providerId Provider ID.
1336
+ * @property {string} name Provider name.
1337
+ * @property {string} host SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as 'smtp1.example.com:25;smtp2.example.com'. You can also specify encryption type, for example: 'tls://smtp1.example.com:587;ssl://smtp2.example.com:465"'. Hosts will be tried in order.
1338
+ * @property {number} port SMTP port.
1339
+ * @property {string} username Authentication username.
1340
+ * @property {string} password Authentication password.
1341
+ * @property {SmtpEncryption} encryption Encryption type. Can be 'ssl' or 'tls'
1342
+ * @property {boolean} autoTLS Enable SMTP AutoTLS feature.
1343
+ * @property {string} mailer The value to use for the X-Mailer header.
1344
+ * @property {string} fromName Sender Name.
1345
+ * @property {string} fromEmail Sender email address.
1346
+ * @property {string} replyToName Name set in the Reply To field for the mail. Default value is Sender Name.
1347
+ * @property {string} replyToEmail Email set in the Reply To field for the mail. Default value is Sender Email.
1348
+ * @property {boolean} enabled Set as enabled.
1349
+ * @property {boolean} parseOutput
1350
+ * @property {libClient | undefined} sdk
1351
+ */
1352
+
1353
+ /**
1354
+ * @param {MessagingUpdateSmtpProviderRequestParams} params
1355
+ */
1356
+ const messagingUpdateSmtpProvider = async ({ providerId, name, host, port, username, password, encryption, autoTLS, mailer, fromName, fromEmail, replyToName, replyToEmail, enabled, parseOutput = true, sdk = undefined}) => {
1357
+ let client = !sdk ? await sdkForProject() : sdk;
1358
+ let apiPath = '/messaging/providers/smtp/{providerId}'.replace('{providerId}', providerId);
1359
+ let payload = {};
1360
+ if (typeof name !== 'undefined') {
1361
+ payload['name'] = name;
1362
+ }
1363
+ if (typeof host !== 'undefined') {
1364
+ payload['host'] = host;
1365
+ }
1366
+ if (typeof port !== 'undefined') {
1367
+ payload['port'] = port;
1368
+ }
1369
+ if (typeof username !== 'undefined') {
1370
+ payload['username'] = username;
1371
+ }
1372
+ if (typeof password !== 'undefined') {
1373
+ payload['password'] = password;
1374
+ }
1375
+ if (typeof encryption !== 'undefined') {
1376
+ payload['encryption'] = encryption;
1377
+ }
1378
+ if (typeof autoTLS !== 'undefined') {
1379
+ payload['autoTLS'] = autoTLS;
1380
+ }
1381
+ if (typeof mailer !== 'undefined') {
1382
+ payload['mailer'] = mailer;
1383
+ }
1384
+ if (typeof fromName !== 'undefined') {
1385
+ payload['fromName'] = fromName;
1386
+ }
1387
+ if (typeof fromEmail !== 'undefined') {
1388
+ payload['fromEmail'] = fromEmail;
1389
+ }
1390
+ if (typeof replyToName !== 'undefined') {
1391
+ payload['replyToName'] = replyToName;
1392
+ }
1393
+ if (typeof replyToEmail !== 'undefined') {
1394
+ payload['replyToEmail'] = replyToEmail;
1395
+ }
1396
+ if (typeof enabled !== 'undefined') {
1397
+ payload['enabled'] = enabled;
1398
+ }
1399
+
1400
+ let response = undefined;
1401
+
1402
+ response = await client.call('patch', apiPath, {
1403
+ 'content-type': 'application/json',
1404
+ }, payload);
1405
+
1406
+ if (parseOutput) {
1407
+ parse(response)
1408
+ success()
1409
+ }
1410
+
1411
+ return response;
1412
+ }
1413
+
1414
+ /**
1415
+ * @typedef {Object} MessagingCreateTelesignProviderRequestParams
1416
+ * @property {string} providerId Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1417
+ * @property {string} name Provider name.
1418
+ * @property {string} from Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
1419
+ * @property {string} customerId Telesign customer ID.
1420
+ * @property {string} apiKey Telesign API key.
1421
+ * @property {boolean} enabled Set as enabled.
1422
+ * @property {boolean} parseOutput
1423
+ * @property {libClient | undefined} sdk
1424
+ */
1425
+
1426
+ /**
1427
+ * @param {MessagingCreateTelesignProviderRequestParams} params
1428
+ */
1429
+ const messagingCreateTelesignProvider = async ({ providerId, name, from, customerId, apiKey, enabled, parseOutput = true, sdk = undefined}) => {
1430
+ let client = !sdk ? await sdkForProject() : sdk;
1431
+ let apiPath = '/messaging/providers/telesign';
1432
+ let payload = {};
1433
+ if (typeof providerId !== 'undefined') {
1434
+ payload['providerId'] = providerId;
1435
+ }
1436
+ if (typeof name !== 'undefined') {
1437
+ payload['name'] = name;
1438
+ }
1439
+ if (typeof from !== 'undefined') {
1440
+ payload['from'] = from;
1441
+ }
1442
+ if (typeof customerId !== 'undefined') {
1443
+ payload['customerId'] = customerId;
1444
+ }
1445
+ if (typeof apiKey !== 'undefined') {
1446
+ payload['apiKey'] = apiKey;
1447
+ }
1448
+ if (typeof enabled !== 'undefined') {
1449
+ payload['enabled'] = enabled;
1450
+ }
1451
+
1452
+ let response = undefined;
1453
+
1454
+ response = await client.call('post', apiPath, {
1455
+ 'content-type': 'application/json',
1456
+ }, payload);
1457
+
1458
+ if (parseOutput) {
1459
+ parse(response)
1460
+ success()
1461
+ }
1462
+
1463
+ return response;
1464
+ }
1465
+
1466
+ /**
1467
+ * @typedef {Object} MessagingUpdateTelesignProviderRequestParams
1468
+ * @property {string} providerId Provider ID.
1469
+ * @property {string} name Provider name.
1470
+ * @property {boolean} enabled Set as enabled.
1471
+ * @property {string} customerId Telesign customer ID.
1472
+ * @property {string} apiKey Telesign API key.
1473
+ * @property {string} from Sender number.
1474
+ * @property {boolean} parseOutput
1475
+ * @property {libClient | undefined} sdk
1476
+ */
1477
+
1478
+ /**
1479
+ * @param {MessagingUpdateTelesignProviderRequestParams} params
1480
+ */
1481
+ const messagingUpdateTelesignProvider = async ({ providerId, name, enabled, customerId, apiKey, from, parseOutput = true, sdk = undefined}) => {
1482
+ let client = !sdk ? await sdkForProject() : sdk;
1483
+ let apiPath = '/messaging/providers/telesign/{providerId}'.replace('{providerId}', providerId);
1484
+ let payload = {};
1485
+ if (typeof name !== 'undefined') {
1486
+ payload['name'] = name;
1487
+ }
1488
+ if (typeof enabled !== 'undefined') {
1489
+ payload['enabled'] = enabled;
1490
+ }
1491
+ if (typeof customerId !== 'undefined') {
1492
+ payload['customerId'] = customerId;
1493
+ }
1494
+ if (typeof apiKey !== 'undefined') {
1495
+ payload['apiKey'] = apiKey;
1496
+ }
1497
+ if (typeof from !== 'undefined') {
1498
+ payload['from'] = from;
1499
+ }
1500
+
1501
+ let response = undefined;
1502
+
1503
+ response = await client.call('patch', apiPath, {
1504
+ 'content-type': 'application/json',
1505
+ }, payload);
1506
+
1507
+ if (parseOutput) {
1508
+ parse(response)
1509
+ success()
1510
+ }
1511
+
1512
+ return response;
1513
+ }
1514
+
1515
+ /**
1516
+ * @typedef {Object} MessagingCreateTextmagicProviderRequestParams
1517
+ * @property {string} providerId Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1518
+ * @property {string} name Provider name.
1519
+ * @property {string} from Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
1520
+ * @property {string} username Textmagic username.
1521
+ * @property {string} apiKey Textmagic apiKey.
1522
+ * @property {boolean} enabled Set as enabled.
1523
+ * @property {boolean} parseOutput
1524
+ * @property {libClient | undefined} sdk
1525
+ */
1526
+
1527
+ /**
1528
+ * @param {MessagingCreateTextmagicProviderRequestParams} params
1529
+ */
1530
+ const messagingCreateTextmagicProvider = async ({ providerId, name, from, username, apiKey, enabled, parseOutput = true, sdk = undefined}) => {
1531
+ let client = !sdk ? await sdkForProject() : sdk;
1532
+ let apiPath = '/messaging/providers/textmagic';
1533
+ let payload = {};
1534
+ if (typeof providerId !== 'undefined') {
1535
+ payload['providerId'] = providerId;
1536
+ }
1537
+ if (typeof name !== 'undefined') {
1538
+ payload['name'] = name;
1539
+ }
1540
+ if (typeof from !== 'undefined') {
1541
+ payload['from'] = from;
1542
+ }
1543
+ if (typeof username !== 'undefined') {
1544
+ payload['username'] = username;
1545
+ }
1546
+ if (typeof apiKey !== 'undefined') {
1547
+ payload['apiKey'] = apiKey;
1548
+ }
1549
+ if (typeof enabled !== 'undefined') {
1550
+ payload['enabled'] = enabled;
1551
+ }
1552
+
1553
+ let response = undefined;
1554
+
1555
+ response = await client.call('post', apiPath, {
1556
+ 'content-type': 'application/json',
1557
+ }, payload);
1558
+
1559
+ if (parseOutput) {
1560
+ parse(response)
1561
+ success()
1562
+ }
1563
+
1564
+ return response;
1565
+ }
1566
+
1567
+ /**
1568
+ * @typedef {Object} MessagingUpdateTextmagicProviderRequestParams
1569
+ * @property {string} providerId Provider ID.
1570
+ * @property {string} name Provider name.
1571
+ * @property {boolean} enabled Set as enabled.
1572
+ * @property {string} username Textmagic username.
1573
+ * @property {string} apiKey Textmagic apiKey.
1574
+ * @property {string} from Sender number.
1575
+ * @property {boolean} parseOutput
1576
+ * @property {libClient | undefined} sdk
1577
+ */
1578
+
1579
+ /**
1580
+ * @param {MessagingUpdateTextmagicProviderRequestParams} params
1581
+ */
1582
+ const messagingUpdateTextmagicProvider = async ({ providerId, name, enabled, username, apiKey, from, parseOutput = true, sdk = undefined}) => {
1583
+ let client = !sdk ? await sdkForProject() : sdk;
1584
+ let apiPath = '/messaging/providers/textmagic/{providerId}'.replace('{providerId}', providerId);
1585
+ let payload = {};
1586
+ if (typeof name !== 'undefined') {
1587
+ payload['name'] = name;
1588
+ }
1589
+ if (typeof enabled !== 'undefined') {
1590
+ payload['enabled'] = enabled;
1591
+ }
1592
+ if (typeof username !== 'undefined') {
1593
+ payload['username'] = username;
1594
+ }
1595
+ if (typeof apiKey !== 'undefined') {
1596
+ payload['apiKey'] = apiKey;
1597
+ }
1598
+ if (typeof from !== 'undefined') {
1599
+ payload['from'] = from;
1600
+ }
1601
+
1602
+ let response = undefined;
1603
+
1604
+ response = await client.call('patch', apiPath, {
1605
+ 'content-type': 'application/json',
1606
+ }, payload);
1607
+
1608
+ if (parseOutput) {
1609
+ parse(response)
1610
+ success()
1611
+ }
1612
+
1613
+ return response;
1614
+ }
1615
+
1616
+ /**
1617
+ * @typedef {Object} MessagingCreateTwilioProviderRequestParams
1618
+ * @property {string} providerId Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1619
+ * @property {string} name Provider name.
1620
+ * @property {string} from Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
1621
+ * @property {string} accountSid Twilio account secret ID.
1622
+ * @property {string} authToken Twilio authentication token.
1623
+ * @property {boolean} enabled Set as enabled.
1624
+ * @property {boolean} parseOutput
1625
+ * @property {libClient | undefined} sdk
1626
+ */
1627
+
1628
+ /**
1629
+ * @param {MessagingCreateTwilioProviderRequestParams} params
1630
+ */
1631
+ const messagingCreateTwilioProvider = async ({ providerId, name, from, accountSid, authToken, enabled, parseOutput = true, sdk = undefined}) => {
1632
+ let client = !sdk ? await sdkForProject() : sdk;
1633
+ let apiPath = '/messaging/providers/twilio';
1634
+ let payload = {};
1635
+ if (typeof providerId !== 'undefined') {
1636
+ payload['providerId'] = providerId;
1637
+ }
1638
+ if (typeof name !== 'undefined') {
1639
+ payload['name'] = name;
1640
+ }
1641
+ if (typeof from !== 'undefined') {
1642
+ payload['from'] = from;
1643
+ }
1644
+ if (typeof accountSid !== 'undefined') {
1645
+ payload['accountSid'] = accountSid;
1646
+ }
1647
+ if (typeof authToken !== 'undefined') {
1648
+ payload['authToken'] = authToken;
1649
+ }
1650
+ if (typeof enabled !== 'undefined') {
1651
+ payload['enabled'] = enabled;
1652
+ }
1653
+
1654
+ let response = undefined;
1655
+
1656
+ response = await client.call('post', apiPath, {
1657
+ 'content-type': 'application/json',
1658
+ }, payload);
1659
+
1660
+ if (parseOutput) {
1661
+ parse(response)
1662
+ success()
1663
+ }
1664
+
1665
+ return response;
1666
+ }
1667
+
1668
+ /**
1669
+ * @typedef {Object} MessagingUpdateTwilioProviderRequestParams
1670
+ * @property {string} providerId Provider ID.
1671
+ * @property {string} name Provider name.
1672
+ * @property {boolean} enabled Set as enabled.
1673
+ * @property {string} accountSid Twilio account secret ID.
1674
+ * @property {string} authToken Twilio authentication token.
1675
+ * @property {string} from Sender number.
1676
+ * @property {boolean} parseOutput
1677
+ * @property {libClient | undefined} sdk
1678
+ */
1679
+
1680
+ /**
1681
+ * @param {MessagingUpdateTwilioProviderRequestParams} params
1682
+ */
1683
+ const messagingUpdateTwilioProvider = async ({ providerId, name, enabled, accountSid, authToken, from, parseOutput = true, sdk = undefined}) => {
1684
+ let client = !sdk ? await sdkForProject() : sdk;
1685
+ let apiPath = '/messaging/providers/twilio/{providerId}'.replace('{providerId}', providerId);
1686
+ let payload = {};
1687
+ if (typeof name !== 'undefined') {
1688
+ payload['name'] = name;
1689
+ }
1690
+ if (typeof enabled !== 'undefined') {
1691
+ payload['enabled'] = enabled;
1692
+ }
1693
+ if (typeof accountSid !== 'undefined') {
1694
+ payload['accountSid'] = accountSid;
1695
+ }
1696
+ if (typeof authToken !== 'undefined') {
1697
+ payload['authToken'] = authToken;
1698
+ }
1699
+ if (typeof from !== 'undefined') {
1700
+ payload['from'] = from;
1701
+ }
1702
+
1703
+ let response = undefined;
1704
+
1705
+ response = await client.call('patch', apiPath, {
1706
+ 'content-type': 'application/json',
1707
+ }, payload);
1708
+
1709
+ if (parseOutput) {
1710
+ parse(response)
1711
+ success()
1712
+ }
1713
+
1714
+ return response;
1715
+ }
1716
+
1717
+ /**
1718
+ * @typedef {Object} MessagingCreateVonageProviderRequestParams
1719
+ * @property {string} providerId Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1720
+ * @property {string} name Provider name.
1721
+ * @property {string} from Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
1722
+ * @property {string} apiKey Vonage API key.
1723
+ * @property {string} apiSecret Vonage API secret.
1724
+ * @property {boolean} enabled Set as enabled.
1725
+ * @property {boolean} parseOutput
1726
+ * @property {libClient | undefined} sdk
1727
+ */
1728
+
1729
+ /**
1730
+ * @param {MessagingCreateVonageProviderRequestParams} params
1731
+ */
1732
+ const messagingCreateVonageProvider = async ({ providerId, name, from, apiKey, apiSecret, enabled, parseOutput = true, sdk = undefined}) => {
1733
+ let client = !sdk ? await sdkForProject() : sdk;
1734
+ let apiPath = '/messaging/providers/vonage';
1735
+ let payload = {};
1736
+ if (typeof providerId !== 'undefined') {
1737
+ payload['providerId'] = providerId;
1738
+ }
1739
+ if (typeof name !== 'undefined') {
1740
+ payload['name'] = name;
1741
+ }
1742
+ if (typeof from !== 'undefined') {
1743
+ payload['from'] = from;
1744
+ }
1745
+ if (typeof apiKey !== 'undefined') {
1746
+ payload['apiKey'] = apiKey;
1747
+ }
1748
+ if (typeof apiSecret !== 'undefined') {
1749
+ payload['apiSecret'] = apiSecret;
1750
+ }
1751
+ if (typeof enabled !== 'undefined') {
1752
+ payload['enabled'] = enabled;
1753
+ }
1754
+
1755
+ let response = undefined;
1756
+
1757
+ response = await client.call('post', apiPath, {
1758
+ 'content-type': 'application/json',
1759
+ }, payload);
1760
+
1761
+ if (parseOutput) {
1762
+ parse(response)
1763
+ success()
1764
+ }
1765
+
1766
+ return response;
1767
+ }
1768
+
1769
+ /**
1770
+ * @typedef {Object} MessagingUpdateVonageProviderRequestParams
1771
+ * @property {string} providerId Provider ID.
1772
+ * @property {string} name Provider name.
1773
+ * @property {boolean} enabled Set as enabled.
1774
+ * @property {string} apiKey Vonage API key.
1775
+ * @property {string} apiSecret Vonage API secret.
1776
+ * @property {string} from Sender number.
1777
+ * @property {boolean} parseOutput
1778
+ * @property {libClient | undefined} sdk
1779
+ */
1780
+
1781
+ /**
1782
+ * @param {MessagingUpdateVonageProviderRequestParams} params
1783
+ */
1784
+ const messagingUpdateVonageProvider = async ({ providerId, name, enabled, apiKey, apiSecret, from, parseOutput = true, sdk = undefined}) => {
1785
+ let client = !sdk ? await sdkForProject() : sdk;
1786
+ let apiPath = '/messaging/providers/vonage/{providerId}'.replace('{providerId}', providerId);
1787
+ let payload = {};
1788
+ if (typeof name !== 'undefined') {
1789
+ payload['name'] = name;
1790
+ }
1791
+ if (typeof enabled !== 'undefined') {
1792
+ payload['enabled'] = enabled;
1793
+ }
1794
+ if (typeof apiKey !== 'undefined') {
1795
+ payload['apiKey'] = apiKey;
1796
+ }
1797
+ if (typeof apiSecret !== 'undefined') {
1798
+ payload['apiSecret'] = apiSecret;
1799
+ }
1800
+ if (typeof from !== 'undefined') {
1801
+ payload['from'] = from;
1802
+ }
1803
+
1804
+ let response = undefined;
1805
+
1806
+ response = await client.call('patch', apiPath, {
1807
+ 'content-type': 'application/json',
1808
+ }, payload);
1809
+
1810
+ if (parseOutput) {
1811
+ parse(response)
1812
+ success()
1813
+ }
1814
+
1815
+ return response;
1816
+ }
1817
+
1818
+ /**
1819
+ * @typedef {Object} MessagingGetProviderRequestParams
1820
+ * @property {string} providerId Provider ID.
1821
+ * @property {boolean} parseOutput
1822
+ * @property {libClient | undefined} sdk
1823
+ */
1824
+
1825
+ /**
1826
+ * @param {MessagingGetProviderRequestParams} params
1827
+ */
1828
+ const messagingGetProvider = async ({ providerId, parseOutput = true, sdk = undefined}) => {
1829
+ let client = !sdk ? await sdkForProject() : sdk;
1830
+ let apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
1831
+ let payload = {};
1832
+
1833
+ let response = undefined;
1834
+
1835
+ response = await client.call('get', apiPath, {
1836
+ 'content-type': 'application/json',
1837
+ }, payload);
1838
+
1839
+ if (parseOutput) {
1840
+ parse(response)
1841
+ success()
1842
+ }
1843
+
1844
+ return response;
1845
+ }
1846
+
1847
+ /**
1848
+ * @typedef {Object} MessagingDeleteProviderRequestParams
1849
+ * @property {string} providerId Provider ID.
1850
+ * @property {boolean} parseOutput
1851
+ * @property {libClient | undefined} sdk
1852
+ */
1853
+
1854
+ /**
1855
+ * @param {MessagingDeleteProviderRequestParams} params
1856
+ */
1857
+ const messagingDeleteProvider = async ({ providerId, parseOutput = true, sdk = undefined}) => {
1858
+ let client = !sdk ? await sdkForProject() : sdk;
1859
+ let apiPath = '/messaging/providers/{providerId}'.replace('{providerId}', providerId);
1860
+ let payload = {};
1861
+
1862
+ let response = undefined;
1863
+
1864
+ response = await client.call('delete', apiPath, {
1865
+ 'content-type': 'application/json',
1866
+ }, payload);
1867
+
1868
+ if (parseOutput) {
1869
+ parse(response)
1870
+ success()
1871
+ }
1872
+
1873
+ return response;
1874
+ }
1875
+
1876
+ /**
1877
+ * @typedef {Object} MessagingListProviderLogsRequestParams
1878
+ * @property {string} providerId Provider ID.
1879
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
1880
+ * @property {boolean} parseOutput
1881
+ * @property {libClient | undefined} sdk
1882
+ */
1883
+
1884
+ /**
1885
+ * @param {MessagingListProviderLogsRequestParams} params
1886
+ */
1887
+ const messagingListProviderLogs = async ({ providerId, queries, parseOutput = true, sdk = undefined}) => {
1888
+ let client = !sdk ? await sdkForProject() : sdk;
1889
+ let apiPath = '/messaging/providers/{providerId}/logs'.replace('{providerId}', providerId);
1890
+ let payload = {};
1891
+ if (typeof queries !== 'undefined') {
1892
+ payload['queries'] = queries;
1893
+ }
1894
+
1895
+ let response = undefined;
1896
+
1897
+ response = await client.call('get', apiPath, {
1898
+ 'content-type': 'application/json',
1899
+ }, payload);
1900
+
1901
+ if (parseOutput) {
1902
+ parse(response)
1903
+ success()
1904
+ }
1905
+
1906
+ return response;
1907
+ }
1908
+
1909
+ /**
1910
+ * @typedef {Object} MessagingListSubscriberLogsRequestParams
1911
+ * @property {string} subscriberId Subscriber ID.
1912
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
1913
+ * @property {boolean} parseOutput
1914
+ * @property {libClient | undefined} sdk
1915
+ */
1916
+
1917
+ /**
1918
+ * @param {MessagingListSubscriberLogsRequestParams} params
1919
+ */
1920
+ const messagingListSubscriberLogs = async ({ subscriberId, queries, parseOutput = true, sdk = undefined}) => {
1921
+ let client = !sdk ? await sdkForProject() : sdk;
1922
+ let apiPath = '/messaging/subscribers/{subscriberId}/logs'.replace('{subscriberId}', subscriberId);
1923
+ let payload = {};
1924
+ if (typeof queries !== 'undefined') {
1925
+ payload['queries'] = queries;
1926
+ }
1927
+
1928
+ let response = undefined;
1929
+
1930
+ response = await client.call('get', apiPath, {
1931
+ 'content-type': 'application/json',
1932
+ }, payload);
1933
+
1934
+ if (parseOutput) {
1935
+ parse(response)
1936
+ success()
1937
+ }
1938
+
1939
+ return response;
1940
+ }
1941
+
1942
+ /**
1943
+ * @typedef {Object} MessagingListTopicsRequestParams
1944
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal
1945
+ * @property {string} search Search term to filter your list results. Max length: 256 chars.
1946
+ * @property {boolean} parseOutput
1947
+ * @property {libClient | undefined} sdk
1948
+ */
1949
+
1950
+ /**
1951
+ * @param {MessagingListTopicsRequestParams} params
1952
+ */
1953
+ const messagingListTopics = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
1954
+ let client = !sdk ? await sdkForProject() : sdk;
1955
+ let apiPath = '/messaging/topics';
1956
+ let payload = {};
1957
+ if (typeof queries !== 'undefined') {
1958
+ payload['queries'] = queries;
1959
+ }
1960
+ if (typeof search !== 'undefined') {
1961
+ payload['search'] = search;
1962
+ }
1963
+
1964
+ let response = undefined;
1965
+
1966
+ response = await client.call('get', apiPath, {
1967
+ 'content-type': 'application/json',
1968
+ }, payload);
1969
+
1970
+ if (parseOutput) {
1971
+ parse(response)
1972
+ success()
1973
+ }
1974
+
1975
+ return response;
1976
+ }
1977
+
1978
+ /**
1979
+ * @typedef {Object} MessagingCreateTopicRequestParams
1980
+ * @property {string} topicId Topic ID. Choose a custom Topic ID or a new Topic ID.
1981
+ * @property {string} name Topic Name.
1982
+ * @property {string[]} subscribe An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
1983
+ * @property {boolean} parseOutput
1984
+ * @property {libClient | undefined} sdk
1985
+ */
1986
+
1987
+ /**
1988
+ * @param {MessagingCreateTopicRequestParams} params
1989
+ */
1990
+ const messagingCreateTopic = async ({ topicId, name, subscribe, parseOutput = true, sdk = undefined}) => {
1991
+ let client = !sdk ? await sdkForProject() : sdk;
1992
+ let apiPath = '/messaging/topics';
1993
+ let payload = {};
1994
+ if (typeof topicId !== 'undefined') {
1995
+ payload['topicId'] = topicId;
1996
+ }
1997
+ if (typeof name !== 'undefined') {
1998
+ payload['name'] = name;
1999
+ }
2000
+ subscribe = subscribe === true ? [] : subscribe;
2001
+ if (typeof subscribe !== 'undefined') {
2002
+ payload['subscribe'] = subscribe;
2003
+ }
2004
+
2005
+ let response = undefined;
2006
+
2007
+ response = await client.call('post', apiPath, {
2008
+ 'content-type': 'application/json',
2009
+ }, payload);
2010
+
2011
+ if (parseOutput) {
2012
+ parse(response)
2013
+ success()
2014
+ }
2015
+
2016
+ return response;
2017
+ }
2018
+
2019
+ /**
2020
+ * @typedef {Object} MessagingGetTopicRequestParams
2021
+ * @property {string} topicId Topic ID.
2022
+ * @property {boolean} parseOutput
2023
+ * @property {libClient | undefined} sdk
2024
+ */
2025
+
2026
+ /**
2027
+ * @param {MessagingGetTopicRequestParams} params
2028
+ */
2029
+ const messagingGetTopic = async ({ topicId, parseOutput = true, sdk = undefined}) => {
2030
+ let client = !sdk ? await sdkForProject() : sdk;
2031
+ let apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
2032
+ let payload = {};
2033
+
2034
+ let response = undefined;
2035
+
2036
+ response = await client.call('get', apiPath, {
2037
+ 'content-type': 'application/json',
2038
+ }, payload);
2039
+
2040
+ if (parseOutput) {
2041
+ parse(response)
2042
+ success()
2043
+ }
2044
+
2045
+ return response;
2046
+ }
2047
+
2048
+ /**
2049
+ * @typedef {Object} MessagingUpdateTopicRequestParams
2050
+ * @property {string} topicId Topic ID.
2051
+ * @property {string} name Topic Name.
2052
+ * @property {string[]} subscribe An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
2053
+ * @property {boolean} parseOutput
2054
+ * @property {libClient | undefined} sdk
2055
+ */
2056
+
2057
+ /**
2058
+ * @param {MessagingUpdateTopicRequestParams} params
2059
+ */
2060
+ const messagingUpdateTopic = async ({ topicId, name, subscribe, parseOutput = true, sdk = undefined}) => {
2061
+ let client = !sdk ? await sdkForProject() : sdk;
2062
+ let apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
2063
+ let payload = {};
2064
+ if (typeof name !== 'undefined') {
2065
+ payload['name'] = name;
2066
+ }
2067
+ subscribe = subscribe === true ? [] : subscribe;
2068
+ if (typeof subscribe !== 'undefined') {
2069
+ payload['subscribe'] = subscribe;
2070
+ }
2071
+
2072
+ let response = undefined;
2073
+
2074
+ response = await client.call('patch', apiPath, {
2075
+ 'content-type': 'application/json',
2076
+ }, payload);
2077
+
2078
+ if (parseOutput) {
2079
+ parse(response)
2080
+ success()
2081
+ }
2082
+
2083
+ return response;
2084
+ }
2085
+
2086
+ /**
2087
+ * @typedef {Object} MessagingDeleteTopicRequestParams
2088
+ * @property {string} topicId Topic ID.
2089
+ * @property {boolean} parseOutput
2090
+ * @property {libClient | undefined} sdk
2091
+ */
2092
+
2093
+ /**
2094
+ * @param {MessagingDeleteTopicRequestParams} params
2095
+ */
2096
+ const messagingDeleteTopic = async ({ topicId, parseOutput = true, sdk = undefined}) => {
2097
+ let client = !sdk ? await sdkForProject() : sdk;
2098
+ let apiPath = '/messaging/topics/{topicId}'.replace('{topicId}', topicId);
2099
+ let payload = {};
2100
+
2101
+ let response = undefined;
2102
+
2103
+ response = await client.call('delete', apiPath, {
2104
+ 'content-type': 'application/json',
2105
+ }, payload);
2106
+
2107
+ if (parseOutput) {
2108
+ parse(response)
2109
+ success()
2110
+ }
2111
+
2112
+ return response;
2113
+ }
2114
+
2115
+ /**
2116
+ * @typedef {Object} MessagingListTopicLogsRequestParams
2117
+ * @property {string} topicId Topic ID.
2118
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
2119
+ * @property {boolean} parseOutput
2120
+ * @property {libClient | undefined} sdk
2121
+ */
2122
+
2123
+ /**
2124
+ * @param {MessagingListTopicLogsRequestParams} params
2125
+ */
2126
+ const messagingListTopicLogs = async ({ topicId, queries, parseOutput = true, sdk = undefined}) => {
2127
+ let client = !sdk ? await sdkForProject() : sdk;
2128
+ let apiPath = '/messaging/topics/{topicId}/logs'.replace('{topicId}', topicId);
2129
+ let payload = {};
2130
+ if (typeof queries !== 'undefined') {
2131
+ payload['queries'] = queries;
2132
+ }
2133
+
2134
+ let response = undefined;
2135
+
2136
+ response = await client.call('get', apiPath, {
2137
+ 'content-type': 'application/json',
2138
+ }, payload);
2139
+
2140
+ if (parseOutput) {
2141
+ parse(response)
2142
+ success()
2143
+ }
2144
+
2145
+ return response;
2146
+ }
2147
+
2148
+ /**
2149
+ * @typedef {Object} MessagingListSubscribersRequestParams
2150
+ * @property {string} topicId Topic ID. The topic ID subscribed to.
2151
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled
2152
+ * @property {string} search Search term to filter your list results. Max length: 256 chars.
2153
+ * @property {boolean} parseOutput
2154
+ * @property {libClient | undefined} sdk
2155
+ */
2156
+
2157
+ /**
2158
+ * @param {MessagingListSubscribersRequestParams} params
2159
+ */
2160
+ const messagingListSubscribers = async ({ topicId, queries, search, parseOutput = true, sdk = undefined}) => {
2161
+ let client = !sdk ? await sdkForProject() : sdk;
2162
+ let apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
2163
+ let payload = {};
2164
+ if (typeof queries !== 'undefined') {
2165
+ payload['queries'] = queries;
2166
+ }
2167
+ if (typeof search !== 'undefined') {
2168
+ payload['search'] = search;
2169
+ }
2170
+
2171
+ let response = undefined;
2172
+
2173
+ response = await client.call('get', apiPath, {
2174
+ 'content-type': 'application/json',
2175
+ }, payload);
2176
+
2177
+ if (parseOutput) {
2178
+ parse(response)
2179
+ success()
2180
+ }
2181
+
2182
+ return response;
2183
+ }
2184
+
2185
+ /**
2186
+ * @typedef {Object} MessagingCreateSubscriberRequestParams
2187
+ * @property {string} topicId Topic ID. The topic ID to subscribe to.
2188
+ * @property {string} subscriberId Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.
2189
+ * @property {string} targetId Target ID. The target ID to link to the specified Topic ID.
2190
+ * @property {boolean} parseOutput
2191
+ * @property {libClient | undefined} sdk
2192
+ */
2193
+
2194
+ /**
2195
+ * @param {MessagingCreateSubscriberRequestParams} params
2196
+ */
2197
+ const messagingCreateSubscriber = async ({ topicId, subscriberId, targetId, parseOutput = true, sdk = undefined}) => {
2198
+ let client = !sdk ? await sdkForProject() : sdk;
2199
+ let apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);
2200
+ let payload = {};
2201
+ if (typeof subscriberId !== 'undefined') {
2202
+ payload['subscriberId'] = subscriberId;
2203
+ }
2204
+ if (typeof targetId !== 'undefined') {
2205
+ payload['targetId'] = targetId;
2206
+ }
2207
+
2208
+ let response = undefined;
2209
+
2210
+ response = await client.call('post', apiPath, {
2211
+ 'content-type': 'application/json',
2212
+ }, payload);
2213
+
2214
+ if (parseOutput) {
2215
+ parse(response)
2216
+ success()
2217
+ }
2218
+
2219
+ return response;
2220
+ }
2221
+
2222
+ /**
2223
+ * @typedef {Object} MessagingGetSubscriberRequestParams
2224
+ * @property {string} topicId Topic ID. The topic ID subscribed to.
2225
+ * @property {string} subscriberId Subscriber ID.
2226
+ * @property {boolean} parseOutput
2227
+ * @property {libClient | undefined} sdk
2228
+ */
2229
+
2230
+ /**
2231
+ * @param {MessagingGetSubscriberRequestParams} params
2232
+ */
2233
+ const messagingGetSubscriber = async ({ topicId, subscriberId, parseOutput = true, sdk = undefined}) => {
2234
+ let client = !sdk ? await sdkForProject() : sdk;
2235
+ let apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
2236
+ let payload = {};
2237
+
2238
+ let response = undefined;
2239
+
2240
+ response = await client.call('get', apiPath, {
2241
+ 'content-type': 'application/json',
2242
+ }, payload);
2243
+
2244
+ if (parseOutput) {
2245
+ parse(response)
2246
+ success()
2247
+ }
2248
+
2249
+ return response;
2250
+ }
2251
+
2252
+ /**
2253
+ * @typedef {Object} MessagingDeleteSubscriberRequestParams
2254
+ * @property {string} topicId Topic ID. The topic ID subscribed to.
2255
+ * @property {string} subscriberId Subscriber ID.
2256
+ * @property {boolean} parseOutput
2257
+ * @property {libClient | undefined} sdk
2258
+ */
2259
+
2260
+ /**
2261
+ * @param {MessagingDeleteSubscriberRequestParams} params
2262
+ */
2263
+ const messagingDeleteSubscriber = async ({ topicId, subscriberId, parseOutput = true, sdk = undefined}) => {
2264
+ let client = !sdk ? await sdkForProject() : sdk;
2265
+ let apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);
2266
+ let payload = {};
2267
+
2268
+ let response = undefined;
2269
+
2270
+ response = await client.call('delete', apiPath, {
2271
+ 'content-type': 'application/json',
2272
+ }, payload);
2273
+
2274
+ if (parseOutput) {
2275
+ parse(response)
2276
+ success()
2277
+ }
2278
+
2279
+ return response;
2280
+ }
2281
+
2282
+ messaging
2283
+ .command(`listMessages`)
2284
+ .description(`Get a list of all messages from the current Appwrite project.`)
2285
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType`)
2286
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2287
+ .action(actionRunner(messagingListMessages))
2288
+
2289
+ messaging
2290
+ .command(`createEmail`)
2291
+ .description(`Create a new email message.`)
2292
+ .requiredOption(`--messageId <messageId>`, `Message ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2293
+ .requiredOption(`--subject <subject>`, `Email Subject.`)
2294
+ .requiredOption(`--content <content>`, `Email Content.`)
2295
+ .option(`--topics [topics...]`, `List of Topic IDs.`)
2296
+ .option(`--users [users...]`, `List of User IDs.`)
2297
+ .option(`--targets [targets...]`, `List of Targets IDs.`)
2298
+ .option(`--cc [cc...]`, `Array of target IDs to be added as CC.`)
2299
+ .option(`--bcc [bcc...]`, `Array of target IDs to be added as BCC.`)
2300
+ .option(`--attachments [attachments...]`, `Array of compound bucket IDs to file IDs to be attached to the email.`)
2301
+ .option(`--draft <draft>`, `Is message a draft`, parseBool)
2302
+ .option(`--html <html>`, `Is content of type HTML`, parseBool)
2303
+ .option(`--scheduledAt <scheduledAt>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2304
+ .action(actionRunner(messagingCreateEmail))
2305
+
2306
+ messaging
2307
+ .command(`updateEmail`)
2308
+ .description(`Update an email message by its unique ID. `)
2309
+ .requiredOption(`--messageId <messageId>`, `Message ID.`)
2310
+ .option(`--topics [topics...]`, `List of Topic IDs.`)
2311
+ .option(`--users [users...]`, `List of User IDs.`)
2312
+ .option(`--targets [targets...]`, `List of Targets IDs.`)
2313
+ .option(`--subject <subject>`, `Email Subject.`)
2314
+ .option(`--content <content>`, `Email Content.`)
2315
+ .option(`--draft <draft>`, `Is message a draft`, parseBool)
2316
+ .option(`--html <html>`, `Is content of type HTML`, parseBool)
2317
+ .option(`--cc [cc...]`, `Array of target IDs to be added as CC.`)
2318
+ .option(`--bcc [bcc...]`, `Array of target IDs to be added as BCC.`)
2319
+ .option(`--scheduledAt <scheduledAt>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2320
+ .action(actionRunner(messagingUpdateEmail))
2321
+
2322
+ messaging
2323
+ .command(`createPush`)
2324
+ .description(`Create a new push notification.`)
2325
+ .requiredOption(`--messageId <messageId>`, `Message ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2326
+ .requiredOption(`--title <title>`, `Title for push notification.`)
2327
+ .requiredOption(`--body <body>`, `Body for push notification.`)
2328
+ .option(`--topics [topics...]`, `List of Topic IDs.`)
2329
+ .option(`--users [users...]`, `List of User IDs.`)
2330
+ .option(`--targets [targets...]`, `List of Targets IDs.`)
2331
+ .option(`--data <data>`, `Additional Data for push notification.`)
2332
+ .option(`--action <action>`, `Action for push notification.`)
2333
+ .option(`--image <image>`, `Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage.`)
2334
+ .option(`--icon <icon>`, `Icon for push notification. Available only for Android and Web Platform.`)
2335
+ .option(`--sound <sound>`, `Sound for push notification. Available only for Android and IOS Platform.`)
2336
+ .option(`--color <color>`, `Color for push notification. Available only for Android Platform.`)
2337
+ .option(`--tag <tag>`, `Tag for push notification. Available only for Android Platform.`)
2338
+ .option(`--badge <badge>`, `Badge for push notification. Available only for IOS Platform.`)
2339
+ .option(`--draft <draft>`, `Is message a draft`, parseBool)
2340
+ .option(`--scheduledAt <scheduledAt>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2341
+ .action(actionRunner(messagingCreatePush))
2342
+
2343
+ messaging
2344
+ .command(`updatePush`)
2345
+ .description(`Update a push notification by its unique ID. `)
2346
+ .requiredOption(`--messageId <messageId>`, `Message ID.`)
2347
+ .option(`--topics [topics...]`, `List of Topic IDs.`)
2348
+ .option(`--users [users...]`, `List of User IDs.`)
2349
+ .option(`--targets [targets...]`, `List of Targets IDs.`)
2350
+ .option(`--title <title>`, `Title for push notification.`)
2351
+ .option(`--body <body>`, `Body for push notification.`)
2352
+ .option(`--data <data>`, `Additional Data for push notification.`)
2353
+ .option(`--action <action>`, `Action for push notification.`)
2354
+ .option(`--image <image>`, `Image for push notification. Must be a compound bucket ID to file ID of a jpeg, png, or bmp image in Appwrite Storage.`)
2355
+ .option(`--icon <icon>`, `Icon for push notification. Available only for Android and Web platforms.`)
2356
+ .option(`--sound <sound>`, `Sound for push notification. Available only for Android and iOS platforms.`)
2357
+ .option(`--color <color>`, `Color for push notification. Available only for Android platforms.`)
2358
+ .option(`--tag <tag>`, `Tag for push notification. Available only for Android platforms.`)
2359
+ .option(`--badge <badge>`, `Badge for push notification. Available only for iOS platforms.`, parseInteger)
2360
+ .option(`--draft <draft>`, `Is message a draft`, parseBool)
2361
+ .option(`--scheduledAt <scheduledAt>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2362
+ .action(actionRunner(messagingUpdatePush))
2363
+
2364
+ messaging
2365
+ .command(`createSms`)
2366
+ .description(`Create a new SMS message.`)
2367
+ .requiredOption(`--messageId <messageId>`, `Message ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2368
+ .requiredOption(`--content <content>`, `SMS Content.`)
2369
+ .option(`--topics [topics...]`, `List of Topic IDs.`)
2370
+ .option(`--users [users...]`, `List of User IDs.`)
2371
+ .option(`--targets [targets...]`, `List of Targets IDs.`)
2372
+ .option(`--draft <draft>`, `Is message a draft`, parseBool)
2373
+ .option(`--scheduledAt <scheduledAt>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2374
+ .action(actionRunner(messagingCreateSms))
2375
+
2376
+ messaging
2377
+ .command(`updateSms`)
2378
+ .description(`Update an email message by its unique ID. `)
2379
+ .requiredOption(`--messageId <messageId>`, `Message ID.`)
2380
+ .option(`--topics [topics...]`, `List of Topic IDs.`)
2381
+ .option(`--users [users...]`, `List of User IDs.`)
2382
+ .option(`--targets [targets...]`, `List of Targets IDs.`)
2383
+ .option(`--content <content>`, `Email Content.`)
2384
+ .option(`--draft <draft>`, `Is message a draft`, parseBool)
2385
+ .option(`--scheduledAt <scheduledAt>`, `Scheduled delivery time for message in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future.`)
2386
+ .action(actionRunner(messagingUpdateSms))
2387
+
2388
+ messaging
2389
+ .command(`getMessage`)
2390
+ .description(`Get a message by its unique ID. `)
2391
+ .requiredOption(`--messageId <messageId>`, `Message ID.`)
2392
+ .action(actionRunner(messagingGetMessage))
2393
+
2394
+ messaging
2395
+ .command(`delete`)
2396
+ .description(`Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.`)
2397
+ .requiredOption(`--messageId <messageId>`, `Message ID.`)
2398
+ .action(actionRunner(messagingDelete))
2399
+
2400
+ messaging
2401
+ .command(`listMessageLogs`)
2402
+ .description(`Get the message activity logs listed by its unique ID.`)
2403
+ .requiredOption(`--messageId <messageId>`, `Message ID.`)
2404
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
2405
+ .action(actionRunner(messagingListMessageLogs))
2406
+
2407
+ messaging
2408
+ .command(`listTargets`)
2409
+ .description(`Get a list of the targets associated with a message.`)
2410
+ .requiredOption(`--messageId <messageId>`, `Message ID.`)
2411
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType`)
2412
+ .action(actionRunner(messagingListTargets))
2413
+
2414
+ messaging
2415
+ .command(`listProviders`)
2416
+ .description(`Get a list of all providers from the current Appwrite project.`)
2417
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled`)
2418
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2419
+ .action(actionRunner(messagingListProviders))
2420
+
2421
+ messaging
2422
+ .command(`createApnsProvider`)
2423
+ .description(`Create a new Apple Push Notification service provider.`)
2424
+ .requiredOption(`--providerId <providerId>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2425
+ .requiredOption(`--name <name>`, `Provider name.`)
2426
+ .option(`--authKey <authKey>`, `APNS authentication key.`)
2427
+ .option(`--authKeyId <authKeyId>`, `APNS authentication key ID.`)
2428
+ .option(`--teamId <teamId>`, `APNS team ID.`)
2429
+ .option(`--bundleId <bundleId>`, `APNS bundle ID.`)
2430
+ .option(`--sandbox <sandbox>`, `Use APNS sandbox environment.`, parseBool)
2431
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2432
+ .action(actionRunner(messagingCreateApnsProvider))
2433
+
2434
+ messaging
2435
+ .command(`updateApnsProvider`)
2436
+ .description(`Update a Apple Push Notification service provider by its unique ID.`)
2437
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2438
+ .option(`--name <name>`, `Provider name.`)
2439
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2440
+ .option(`--authKey <authKey>`, `APNS authentication key.`)
2441
+ .option(`--authKeyId <authKeyId>`, `APNS authentication key ID.`)
2442
+ .option(`--teamId <teamId>`, `APNS team ID.`)
2443
+ .option(`--bundleId <bundleId>`, `APNS bundle ID.`)
2444
+ .option(`--sandbox <sandbox>`, `Use APNS sandbox environment.`, parseBool)
2445
+ .action(actionRunner(messagingUpdateApnsProvider))
2446
+
2447
+ messaging
2448
+ .command(`createFcmProvider`)
2449
+ .description(`Create a new Firebase Cloud Messaging provider.`)
2450
+ .requiredOption(`--providerId <providerId>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2451
+ .requiredOption(`--name <name>`, `Provider name.`)
2452
+ .option(`--serviceAccountJSON <serviceAccountJSON>`, `FCM service account JSON.`)
2453
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2454
+ .action(actionRunner(messagingCreateFcmProvider))
2455
+
2456
+ messaging
2457
+ .command(`updateFcmProvider`)
2458
+ .description(`Update a Firebase Cloud Messaging provider by its unique ID.`)
2459
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2460
+ .option(`--name <name>`, `Provider name.`)
2461
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2462
+ .option(`--serviceAccountJSON <serviceAccountJSON>`, `FCM service account JSON.`)
2463
+ .action(actionRunner(messagingUpdateFcmProvider))
2464
+
2465
+ messaging
2466
+ .command(`createMailgunProvider`)
2467
+ .description(`Create a new Mailgun provider.`)
2468
+ .requiredOption(`--providerId <providerId>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2469
+ .requiredOption(`--name <name>`, `Provider name.`)
2470
+ .option(`--apiKey <apiKey>`, `Mailgun API Key.`)
2471
+ .option(`--domain <domain>`, `Mailgun Domain.`)
2472
+ .option(`--isEuRegion <isEuRegion>`, `Set as EU region.`, parseBool)
2473
+ .option(`--fromName <fromName>`, `Sender Name.`)
2474
+ .option(`--fromEmail <fromEmail>`, `Sender email address.`)
2475
+ .option(`--replyToName <replyToName>`, `Name set in the reply to field for the mail. Default value is sender name. Reply to name must have reply to email as well.`)
2476
+ .option(`--replyToEmail <replyToEmail>`, `Email set in the reply to field for the mail. Default value is sender email. Reply to email must have reply to name as well.`)
2477
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2478
+ .action(actionRunner(messagingCreateMailgunProvider))
2479
+
2480
+ messaging
2481
+ .command(`updateMailgunProvider`)
2482
+ .description(`Update a Mailgun provider by its unique ID.`)
2483
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2484
+ .option(`--name <name>`, `Provider name.`)
2485
+ .option(`--apiKey <apiKey>`, `Mailgun API Key.`)
2486
+ .option(`--domain <domain>`, `Mailgun Domain.`)
2487
+ .option(`--isEuRegion <isEuRegion>`, `Set as EU region.`, parseBool)
2488
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2489
+ .option(`--fromName <fromName>`, `Sender Name.`)
2490
+ .option(`--fromEmail <fromEmail>`, `Sender email address.`)
2491
+ .option(`--replyToName <replyToName>`, `Name set in the reply to field for the mail. Default value is sender name.`)
2492
+ .option(`--replyToEmail <replyToEmail>`, `Email set in the reply to field for the mail. Default value is sender email.`)
2493
+ .action(actionRunner(messagingUpdateMailgunProvider))
2494
+
2495
+ messaging
2496
+ .command(`createMsg91Provider`)
2497
+ .description(`Create a new MSG91 provider.`)
2498
+ .requiredOption(`--providerId <providerId>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2499
+ .requiredOption(`--name <name>`, `Provider name.`)
2500
+ .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
2501
+ .option(`--senderId <senderId>`, `Msg91 Sender ID.`)
2502
+ .option(`--authKey <authKey>`, `Msg91 Auth Key.`)
2503
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2504
+ .action(actionRunner(messagingCreateMsg91Provider))
2505
+
2506
+ messaging
2507
+ .command(`updateMsg91Provider`)
2508
+ .description(`Update a MSG91 provider by its unique ID.`)
2509
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2510
+ .option(`--name <name>`, `Provider name.`)
2511
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2512
+ .option(`--senderId <senderId>`, `Msg91 Sender ID.`)
2513
+ .option(`--authKey <authKey>`, `Msg91 Auth Key.`)
2514
+ .option(`--from <from>`, `Sender number.`)
2515
+ .action(actionRunner(messagingUpdateMsg91Provider))
2516
+
2517
+ messaging
2518
+ .command(`createSendgridProvider`)
2519
+ .description(`Create a new Sendgrid provider.`)
2520
+ .requiredOption(`--providerId <providerId>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2521
+ .requiredOption(`--name <name>`, `Provider name.`)
2522
+ .option(`--apiKey <apiKey>`, `Sendgrid API key.`)
2523
+ .option(`--fromName <fromName>`, `Sender Name.`)
2524
+ .option(`--fromEmail <fromEmail>`, `Sender email address.`)
2525
+ .option(`--replyToName <replyToName>`, `Name set in the reply to field for the mail. Default value is sender name.`)
2526
+ .option(`--replyToEmail <replyToEmail>`, `Email set in the reply to field for the mail. Default value is sender email.`)
2527
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2528
+ .action(actionRunner(messagingCreateSendgridProvider))
2529
+
2530
+ messaging
2531
+ .command(`updateSendgridProvider`)
2532
+ .description(`Update a Sendgrid provider by its unique ID.`)
2533
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2534
+ .option(`--name <name>`, `Provider name.`)
2535
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2536
+ .option(`--apiKey <apiKey>`, `Sendgrid API key.`)
2537
+ .option(`--fromName <fromName>`, `Sender Name.`)
2538
+ .option(`--fromEmail <fromEmail>`, `Sender email address.`)
2539
+ .option(`--replyToName <replyToName>`, `Name set in the Reply To field for the mail. Default value is Sender Name.`)
2540
+ .option(`--replyToEmail <replyToEmail>`, `Email set in the Reply To field for the mail. Default value is Sender Email.`)
2541
+ .action(actionRunner(messagingUpdateSendgridProvider))
2542
+
2543
+ messaging
2544
+ .command(`createSmtpProvider`)
2545
+ .description(`Create a new SMTP provider.`)
2546
+ .requiredOption(`--providerId <providerId>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2547
+ .requiredOption(`--name <name>`, `Provider name.`)
2548
+ .requiredOption(`--host <host>`, `SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as 'smtp1.example.com:25;smtp2.example.com'. You can also specify encryption type, for example: 'tls://smtp1.example.com:587;ssl://smtp2.example.com:465"'. Hosts will be tried in order.`)
2549
+ .option(`--port <port>`, `The default SMTP server port.`, parseInteger)
2550
+ .option(`--username <username>`, `Authentication username.`)
2551
+ .option(`--password <password>`, `Authentication password.`)
2552
+ .option(`--encryption <encryption>`, `Encryption type. Can be omitted, 'ssl', or 'tls'`)
2553
+ .option(`--autoTLS <autoTLS>`, `Enable SMTP AutoTLS feature.`, parseBool)
2554
+ .option(`--mailer <mailer>`, `The value to use for the X-Mailer header.`)
2555
+ .option(`--fromName <fromName>`, `Sender Name.`)
2556
+ .option(`--fromEmail <fromEmail>`, `Sender email address.`)
2557
+ .option(`--replyToName <replyToName>`, `Name set in the reply to field for the mail. Default value is sender name.`)
2558
+ .option(`--replyToEmail <replyToEmail>`, `Email set in the reply to field for the mail. Default value is sender email.`)
2559
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2560
+ .action(actionRunner(messagingCreateSmtpProvider))
2561
+
2562
+ messaging
2563
+ .command(`updateSmtpProvider`)
2564
+ .description(`Update a SMTP provider by its unique ID.`)
2565
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2566
+ .option(`--name <name>`, `Provider name.`)
2567
+ .option(`--host <host>`, `SMTP hosts. Either a single hostname or multiple semicolon-delimited hostnames. You can also specify a different port for each host such as 'smtp1.example.com:25;smtp2.example.com'. You can also specify encryption type, for example: 'tls://smtp1.example.com:587;ssl://smtp2.example.com:465"'. Hosts will be tried in order.`)
2568
+ .option(`--port <port>`, `SMTP port.`, parseInteger)
2569
+ .option(`--username <username>`, `Authentication username.`)
2570
+ .option(`--password <password>`, `Authentication password.`)
2571
+ .option(`--encryption <encryption>`, `Encryption type. Can be 'ssl' or 'tls'`)
2572
+ .option(`--autoTLS <autoTLS>`, `Enable SMTP AutoTLS feature.`, parseBool)
2573
+ .option(`--mailer <mailer>`, `The value to use for the X-Mailer header.`)
2574
+ .option(`--fromName <fromName>`, `Sender Name.`)
2575
+ .option(`--fromEmail <fromEmail>`, `Sender email address.`)
2576
+ .option(`--replyToName <replyToName>`, `Name set in the Reply To field for the mail. Default value is Sender Name.`)
2577
+ .option(`--replyToEmail <replyToEmail>`, `Email set in the Reply To field for the mail. Default value is Sender Email.`)
2578
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2579
+ .action(actionRunner(messagingUpdateSmtpProvider))
2580
+
2581
+ messaging
2582
+ .command(`createTelesignProvider`)
2583
+ .description(`Create a new Telesign provider.`)
2584
+ .requiredOption(`--providerId <providerId>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2585
+ .requiredOption(`--name <name>`, `Provider name.`)
2586
+ .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
2587
+ .option(`--customerId <customerId>`, `Telesign customer ID.`)
2588
+ .option(`--apiKey <apiKey>`, `Telesign API key.`)
2589
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2590
+ .action(actionRunner(messagingCreateTelesignProvider))
2591
+
2592
+ messaging
2593
+ .command(`updateTelesignProvider`)
2594
+ .description(`Update a Telesign provider by its unique ID.`)
2595
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2596
+ .option(`--name <name>`, `Provider name.`)
2597
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2598
+ .option(`--customerId <customerId>`, `Telesign customer ID.`)
2599
+ .option(`--apiKey <apiKey>`, `Telesign API key.`)
2600
+ .option(`--from <from>`, `Sender number.`)
2601
+ .action(actionRunner(messagingUpdateTelesignProvider))
2602
+
2603
+ messaging
2604
+ .command(`createTextmagicProvider`)
2605
+ .description(`Create a new Textmagic provider.`)
2606
+ .requiredOption(`--providerId <providerId>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2607
+ .requiredOption(`--name <name>`, `Provider name.`)
2608
+ .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
2609
+ .option(`--username <username>`, `Textmagic username.`)
2610
+ .option(`--apiKey <apiKey>`, `Textmagic apiKey.`)
2611
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2612
+ .action(actionRunner(messagingCreateTextmagicProvider))
2613
+
2614
+ messaging
2615
+ .command(`updateTextmagicProvider`)
2616
+ .description(`Update a Textmagic provider by its unique ID.`)
2617
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2618
+ .option(`--name <name>`, `Provider name.`)
2619
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2620
+ .option(`--username <username>`, `Textmagic username.`)
2621
+ .option(`--apiKey <apiKey>`, `Textmagic apiKey.`)
2622
+ .option(`--from <from>`, `Sender number.`)
2623
+ .action(actionRunner(messagingUpdateTextmagicProvider))
2624
+
2625
+ messaging
2626
+ .command(`createTwilioProvider`)
2627
+ .description(`Create a new Twilio provider.`)
2628
+ .requiredOption(`--providerId <providerId>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2629
+ .requiredOption(`--name <name>`, `Provider name.`)
2630
+ .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
2631
+ .option(`--accountSid <accountSid>`, `Twilio account secret ID.`)
2632
+ .option(`--authToken <authToken>`, `Twilio authentication token.`)
2633
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2634
+ .action(actionRunner(messagingCreateTwilioProvider))
2635
+
2636
+ messaging
2637
+ .command(`updateTwilioProvider`)
2638
+ .description(`Update a Twilio provider by its unique ID.`)
2639
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2640
+ .option(`--name <name>`, `Provider name.`)
2641
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2642
+ .option(`--accountSid <accountSid>`, `Twilio account secret ID.`)
2643
+ .option(`--authToken <authToken>`, `Twilio authentication token.`)
2644
+ .option(`--from <from>`, `Sender number.`)
2645
+ .action(actionRunner(messagingUpdateTwilioProvider))
2646
+
2647
+ messaging
2648
+ .command(`createVonageProvider`)
2649
+ .description(`Create a new Vonage provider.`)
2650
+ .requiredOption(`--providerId <providerId>`, `Provider ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2651
+ .requiredOption(`--name <name>`, `Provider name.`)
2652
+ .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
2653
+ .option(`--apiKey <apiKey>`, `Vonage API key.`)
2654
+ .option(`--apiSecret <apiSecret>`, `Vonage API secret.`)
2655
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2656
+ .action(actionRunner(messagingCreateVonageProvider))
2657
+
2658
+ messaging
2659
+ .command(`updateVonageProvider`)
2660
+ .description(`Update a Vonage provider by its unique ID.`)
2661
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2662
+ .option(`--name <name>`, `Provider name.`)
2663
+ .option(`--enabled <enabled>`, `Set as enabled.`, parseBool)
2664
+ .option(`--apiKey <apiKey>`, `Vonage API key.`)
2665
+ .option(`--apiSecret <apiSecret>`, `Vonage API secret.`)
2666
+ .option(`--from <from>`, `Sender number.`)
2667
+ .action(actionRunner(messagingUpdateVonageProvider))
2668
+
2669
+ messaging
2670
+ .command(`getProvider`)
2671
+ .description(`Get a provider by its unique ID. `)
2672
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2673
+ .action(actionRunner(messagingGetProvider))
2674
+
2675
+ messaging
2676
+ .command(`deleteProvider`)
2677
+ .description(`Delete a provider by its unique ID.`)
2678
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2679
+ .action(actionRunner(messagingDeleteProvider))
2680
+
2681
+ messaging
2682
+ .command(`listProviderLogs`)
2683
+ .description(`Get the provider activity logs listed by its unique ID.`)
2684
+ .requiredOption(`--providerId <providerId>`, `Provider ID.`)
2685
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
2686
+ .action(actionRunner(messagingListProviderLogs))
2687
+
2688
+ messaging
2689
+ .command(`listSubscriberLogs`)
2690
+ .description(`Get the subscriber activity logs listed by its unique ID.`)
2691
+ .requiredOption(`--subscriberId <subscriberId>`, `Subscriber ID.`)
2692
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
2693
+ .action(actionRunner(messagingListSubscriberLogs))
2694
+
2695
+ messaging
2696
+ .command(`listTopics`)
2697
+ .description(`Get a list of all topics from the current Appwrite project.`)
2698
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal`)
2699
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2700
+ .action(actionRunner(messagingListTopics))
2701
+
2702
+ messaging
2703
+ .command(`createTopic`)
2704
+ .description(`Create a new topic.`)
2705
+ .requiredOption(`--topicId <topicId>`, `Topic ID. Choose a custom Topic ID or a new Topic ID.`)
2706
+ .requiredOption(`--name <name>`, `Topic Name.`)
2707
+ .option(`--subscribe [subscribe...]`, `An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.`)
2708
+ .action(actionRunner(messagingCreateTopic))
2709
+
2710
+ messaging
2711
+ .command(`getTopic`)
2712
+ .description(`Get a topic by its unique ID. `)
2713
+ .requiredOption(`--topicId <topicId>`, `Topic ID.`)
2714
+ .action(actionRunner(messagingGetTopic))
2715
+
2716
+ messaging
2717
+ .command(`updateTopic`)
2718
+ .description(`Update a topic by its unique ID. `)
2719
+ .requiredOption(`--topicId <topicId>`, `Topic ID.`)
2720
+ .option(`--name <name>`, `Topic Name.`)
2721
+ .option(`--subscribe [subscribe...]`, `An array of role strings with subscribe permission. By default all users are granted with any subscribe permission. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.`)
2722
+ .action(actionRunner(messagingUpdateTopic))
2723
+
2724
+ messaging
2725
+ .command(`deleteTopic`)
2726
+ .description(`Delete a topic by its unique ID.`)
2727
+ .requiredOption(`--topicId <topicId>`, `Topic ID.`)
2728
+ .action(actionRunner(messagingDeleteTopic))
2729
+
2730
+ messaging
2731
+ .command(`listTopicLogs`)
2732
+ .description(`Get the topic activity logs listed by its unique ID.`)
2733
+ .requiredOption(`--topicId <topicId>`, `Topic ID.`)
2734
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
2735
+ .action(actionRunner(messagingListTopicLogs))
2736
+
2737
+ messaging
2738
+ .command(`listSubscribers`)
2739
+ .description(`Get a list of all subscribers from the current Appwrite project.`)
2740
+ .requiredOption(`--topicId <topicId>`, `Topic ID. The topic ID subscribed to.`)
2741
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled`)
2742
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2743
+ .action(actionRunner(messagingListSubscribers))
2744
+
2745
+ messaging
2746
+ .command(`createSubscriber`)
2747
+ .description(`Create a new subscriber.`)
2748
+ .requiredOption(`--topicId <topicId>`, `Topic ID. The topic ID to subscribe to.`)
2749
+ .requiredOption(`--subscriberId <subscriberId>`, `Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.`)
2750
+ .requiredOption(`--targetId <targetId>`, `Target ID. The target ID to link to the specified Topic ID.`)
2751
+ .action(actionRunner(messagingCreateSubscriber))
2752
+
2753
+ messaging
2754
+ .command(`getSubscriber`)
2755
+ .description(`Get a subscriber by its unique ID. `)
2756
+ .requiredOption(`--topicId <topicId>`, `Topic ID. The topic ID subscribed to.`)
2757
+ .requiredOption(`--subscriberId <subscriberId>`, `Subscriber ID.`)
2758
+ .action(actionRunner(messagingGetSubscriber))
2759
+
2760
+ messaging
2761
+ .command(`deleteSubscriber`)
2762
+ .description(`Delete a subscriber by its unique ID.`)
2763
+ .requiredOption(`--topicId <topicId>`, `Topic ID. The topic ID subscribed to.`)
2764
+ .requiredOption(`--subscriberId <subscriberId>`, `Subscriber ID.`)
2765
+ .action(actionRunner(messagingDeleteSubscriber))
2766
+
2767
+ module.exports = {
2768
+ messaging,
2769
+ messagingListMessages,
2770
+ messagingCreateEmail,
2771
+ messagingUpdateEmail,
2772
+ messagingCreatePush,
2773
+ messagingUpdatePush,
2774
+ messagingCreateSms,
2775
+ messagingUpdateSms,
2776
+ messagingGetMessage,
2777
+ messagingDelete,
2778
+ messagingListMessageLogs,
2779
+ messagingListTargets,
2780
+ messagingListProviders,
2781
+ messagingCreateApnsProvider,
2782
+ messagingUpdateApnsProvider,
2783
+ messagingCreateFcmProvider,
2784
+ messagingUpdateFcmProvider,
2785
+ messagingCreateMailgunProvider,
2786
+ messagingUpdateMailgunProvider,
2787
+ messagingCreateMsg91Provider,
2788
+ messagingUpdateMsg91Provider,
2789
+ messagingCreateSendgridProvider,
2790
+ messagingUpdateSendgridProvider,
2791
+ messagingCreateSmtpProvider,
2792
+ messagingUpdateSmtpProvider,
2793
+ messagingCreateTelesignProvider,
2794
+ messagingUpdateTelesignProvider,
2795
+ messagingCreateTextmagicProvider,
2796
+ messagingUpdateTextmagicProvider,
2797
+ messagingCreateTwilioProvider,
2798
+ messagingUpdateTwilioProvider,
2799
+ messagingCreateVonageProvider,
2800
+ messagingUpdateVonageProvider,
2801
+ messagingGetProvider,
2802
+ messagingDeleteProvider,
2803
+ messagingListProviderLogs,
2804
+ messagingListSubscriberLogs,
2805
+ messagingListTopics,
2806
+ messagingCreateTopic,
2807
+ messagingGetTopic,
2808
+ messagingUpdateTopic,
2809
+ messagingDeleteTopic,
2810
+ messagingListTopicLogs,
2811
+ messagingListSubscribers,
2812
+ messagingCreateSubscriber,
2813
+ messagingGetSubscriber,
2814
+ messagingDeleteSubscriber
2815
+ };