@appconda/nextjs 1.0.12

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