appwrite-cli 13.0.0-rc.1 → 13.0.0-rc.3

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