appwrite-cli 13.0.0-rc.2 → 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 (718) hide show
  1. package/.github/workflows/{npm-publish.yml → publish.yml} +1 -1
  2. package/CHANGELOG.md +106 -101
  3. package/LICENSE.md +2 -2
  4. package/README.md +36 -59
  5. package/cli.ts +152 -0
  6. package/dist/bundle.cjs +4613 -3653
  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.map +1 -1
  16. package/dist/lib/client.js +7 -6
  17. package/dist/lib/client.js.map +1 -1
  18. package/dist/lib/commands/config.d.ts +562 -0
  19. package/dist/lib/commands/config.d.ts.map +1 -0
  20. package/dist/lib/commands/config.js +416 -0
  21. package/dist/lib/commands/config.js.map +1 -0
  22. package/dist/lib/commands/db.d.ts +34 -0
  23. package/dist/lib/commands/db.d.ts.map +1 -0
  24. package/dist/lib/commands/db.js +247 -0
  25. package/dist/lib/commands/db.js.map +1 -0
  26. package/dist/lib/commands/errors.d.ts +68 -0
  27. package/dist/lib/commands/errors.d.ts.map +1 -0
  28. package/dist/lib/commands/errors.js +72 -0
  29. package/dist/lib/commands/errors.js.map +1 -0
  30. package/dist/lib/commands/init.d.ts.map +1 -1
  31. package/dist/lib/commands/init.js +15 -14
  32. package/dist/lib/commands/init.js.map +1 -1
  33. package/dist/lib/commands/pull.d.ts +104 -2
  34. package/dist/lib/commands/pull.d.ts.map +1 -1
  35. package/dist/lib/commands/pull.js +470 -281
  36. package/dist/lib/commands/pull.js.map +1 -1
  37. package/dist/lib/commands/push.d.ts +106 -0
  38. package/dist/lib/commands/push.d.ts.map +1 -1
  39. package/dist/lib/commands/push.js +1257 -1628
  40. package/dist/lib/commands/push.js.map +1 -1
  41. package/dist/lib/commands/run.js +1 -1
  42. package/dist/lib/commands/run.js.map +1 -1
  43. package/dist/lib/commands/schema.d.ts +59 -0
  44. package/dist/lib/commands/schema.d.ts.map +1 -0
  45. package/dist/lib/commands/schema.js +86 -0
  46. package/dist/lib/commands/schema.js.map +1 -0
  47. package/dist/lib/commands/services/account.d.ts.map +1 -1
  48. package/dist/lib/commands/services/account.js +86 -64
  49. package/dist/lib/commands/services/account.js.map +1 -1
  50. package/dist/lib/commands/services/console.d.ts.map +1 -1
  51. package/dist/lib/commands/services/console.js +4 -17
  52. package/dist/lib/commands/services/console.js.map +1 -1
  53. package/dist/lib/commands/services/databases.d.ts.map +1 -1
  54. package/dist/lib/commands/services/databases.js +160 -152
  55. package/dist/lib/commands/services/databases.js.map +1 -1
  56. package/dist/lib/commands/services/functions.d.ts.map +1 -1
  57. package/dist/lib/commands/services/functions.js +41 -33
  58. package/dist/lib/commands/services/functions.js.map +1 -1
  59. package/dist/lib/commands/services/graphql.d.ts.map +1 -1
  60. package/dist/lib/commands/services/graphql.js +3 -3
  61. package/dist/lib/commands/services/graphql.js.map +1 -1
  62. package/dist/lib/commands/services/health.d.ts.map +1 -1
  63. package/dist/lib/commands/services/health.js +24 -24
  64. package/dist/lib/commands/services/health.js.map +1 -1
  65. package/dist/lib/commands/services/locale.d.ts.map +1 -1
  66. package/dist/lib/commands/services/locale.js +9 -9
  67. package/dist/lib/commands/services/locale.js.map +1 -1
  68. package/dist/lib/commands/services/messaging.d.ts.map +1 -1
  69. package/dist/lib/commands/services/messaging.js +59 -59
  70. package/dist/lib/commands/services/messaging.js.map +1 -1
  71. package/dist/lib/commands/services/migrations.d.ts.map +1 -1
  72. package/dist/lib/commands/services/migrations.js +19 -19
  73. package/dist/lib/commands/services/migrations.js.map +1 -1
  74. package/dist/lib/commands/services/project.d.ts.map +1 -1
  75. package/dist/lib/commands/services/project.js +8 -8
  76. package/dist/lib/commands/services/project.js.map +1 -1
  77. package/dist/lib/commands/services/projects.d.ts.map +1 -1
  78. package/dist/lib/commands/services/projects.js +64 -64
  79. package/dist/lib/commands/services/projects.js.map +1 -1
  80. package/dist/lib/commands/services/proxy.d.ts.map +1 -1
  81. package/dist/lib/commands/services/proxy.js +11 -11
  82. package/dist/lib/commands/services/proxy.js.map +1 -1
  83. package/dist/lib/commands/services/sites.d.ts.map +1 -1
  84. package/dist/lib/commands/services/sites.js +41 -33
  85. package/dist/lib/commands/services/sites.js.map +1 -1
  86. package/dist/lib/commands/services/storage.d.ts.map +1 -1
  87. package/dist/lib/commands/services/storage.js +38 -16
  88. package/dist/lib/commands/services/storage.js.map +1 -1
  89. package/dist/lib/commands/services/tables-db.d.ts +3 -0
  90. package/dist/lib/commands/services/tables-db.d.ts.map +1 -0
  91. package/dist/lib/commands/services/{tablesdb.js → tables-db.js} +171 -163
  92. package/dist/lib/commands/services/tables-db.js.map +1 -0
  93. package/dist/lib/commands/services/teams.d.ts.map +1 -1
  94. package/dist/lib/commands/services/teams.js +16 -16
  95. package/dist/lib/commands/services/teams.js.map +1 -1
  96. package/dist/lib/commands/services/tokens.d.ts.map +1 -1
  97. package/dist/lib/commands/services/tokens.js +6 -6
  98. package/dist/lib/commands/services/tokens.js.map +1 -1
  99. package/dist/lib/commands/services/users.d.ts.map +1 -1
  100. package/dist/lib/commands/services/users.js +54 -54
  101. package/dist/lib/commands/services/users.js.map +1 -1
  102. package/dist/lib/commands/services/vcs.d.ts.map +1 -1
  103. package/dist/lib/commands/services/vcs.js +13 -13
  104. package/dist/lib/commands/services/vcs.js.map +1 -1
  105. package/dist/lib/commands/types.d.ts.map +1 -1
  106. package/dist/lib/commands/types.js +1 -1
  107. package/dist/lib/commands/types.js.map +1 -1
  108. package/dist/lib/commands/update.d.ts.map +1 -1
  109. package/dist/lib/commands/update.js +9 -8
  110. package/dist/lib/commands/update.js.map +1 -1
  111. package/dist/lib/commands/utils/attributes.d.ts +47 -0
  112. package/dist/lib/commands/utils/attributes.d.ts.map +1 -0
  113. package/dist/lib/commands/utils/attributes.js +514 -0
  114. package/dist/lib/commands/utils/attributes.js.map +1 -0
  115. package/dist/lib/commands/utils/change-approval.d.ts +25 -0
  116. package/dist/lib/commands/utils/change-approval.d.ts.map +1 -0
  117. package/dist/lib/commands/utils/change-approval.js +129 -0
  118. package/dist/lib/commands/utils/change-approval.js.map +1 -0
  119. package/dist/lib/commands/utils/database-sync.d.ts +10 -0
  120. package/dist/lib/commands/utils/database-sync.d.ts.map +1 -0
  121. package/dist/lib/commands/utils/database-sync.js +136 -0
  122. package/dist/lib/commands/utils/database-sync.js.map +1 -0
  123. package/dist/lib/commands/utils/deployment.d.ts +34 -0
  124. package/dist/lib/commands/utils/deployment.d.ts.map +1 -0
  125. package/dist/lib/commands/utils/deployment.js +109 -0
  126. package/dist/lib/commands/utils/deployment.js.map +1 -0
  127. package/dist/lib/commands/utils/error-formatter.d.ts +19 -0
  128. package/dist/lib/commands/utils/error-formatter.d.ts.map +1 -0
  129. package/dist/lib/commands/utils/error-formatter.js +333 -0
  130. package/dist/lib/commands/utils/error-formatter.js.map +1 -0
  131. package/dist/lib/commands/utils/pools.d.ts +16 -0
  132. package/dist/lib/commands/utils/pools.d.ts.map +1 -0
  133. package/dist/lib/commands/utils/pools.js +198 -0
  134. package/dist/lib/commands/utils/pools.js.map +1 -0
  135. package/dist/lib/config.d.ts +27 -26
  136. package/dist/lib/config.d.ts.map +1 -1
  137. package/dist/lib/config.js +8 -45
  138. package/dist/lib/config.js.map +1 -1
  139. package/dist/lib/constants.d.ts +14 -0
  140. package/dist/lib/constants.d.ts.map +1 -0
  141. package/dist/lib/constants.js +19 -0
  142. package/dist/lib/constants.js.map +1 -0
  143. package/dist/lib/emulation/docker.d.ts +4 -4
  144. package/dist/lib/emulation/docker.d.ts.map +1 -1
  145. package/dist/lib/emulation/docker.js +80 -67
  146. package/dist/lib/emulation/docker.js.map +1 -1
  147. package/dist/lib/parser.d.ts.map +1 -1
  148. package/dist/lib/parser.js +11 -10
  149. package/dist/lib/parser.js.map +1 -1
  150. package/dist/lib/questions.d.ts.map +1 -1
  151. package/dist/lib/questions.js +20 -20
  152. package/dist/lib/questions.js.map +1 -1
  153. package/dist/lib/sdks.d.ts.map +1 -1
  154. package/dist/lib/sdks.js +10 -11
  155. package/dist/lib/sdks.js.map +1 -1
  156. package/dist/lib/types.d.ts +0 -214
  157. package/dist/lib/types.d.ts.map +1 -1
  158. package/dist/lib/utils.d.ts +3 -0
  159. package/dist/lib/utils.d.ts.map +1 -1
  160. package/dist/lib/utils.js +42 -2
  161. package/dist/lib/utils.js.map +1 -1
  162. package/dist/package.json +12 -11
  163. package/docs/examples/account/create-anonymous-session.md +1 -0
  164. package/docs/examples/account/create-email-password-session.md +3 -0
  165. package/docs/examples/account/create-email-token.md +3 -0
  166. package/docs/examples/account/create-email-verification.md +2 -0
  167. package/docs/examples/account/create-jwt.md +1 -0
  168. package/docs/examples/account/create-magic-url-token.md +3 -0
  169. package/docs/examples/account/create-mfa-authenticator.md +2 -0
  170. package/docs/examples/account/create-mfa-challenge.md +2 -0
  171. package/docs/examples/account/create-mfa-recovery-codes.md +1 -0
  172. package/docs/examples/account/create-o-auth-2-session.md +2 -0
  173. package/docs/examples/account/create-o-auth-2-token.md +2 -0
  174. package/docs/examples/account/create-phone-token.md +3 -0
  175. package/docs/examples/account/create-phone-verification.md +1 -0
  176. package/docs/examples/account/create-push-target.md +3 -0
  177. package/docs/examples/account/create-recovery.md +3 -0
  178. package/docs/examples/account/create-session.md +3 -0
  179. package/docs/examples/account/create-verification.md +2 -0
  180. package/docs/examples/account/create.md +4 -0
  181. package/docs/examples/account/delete-identity.md +2 -0
  182. package/docs/examples/account/delete-mfa-authenticator.md +2 -0
  183. package/docs/examples/account/delete-push-target.md +2 -0
  184. package/docs/examples/account/delete-session.md +2 -0
  185. package/docs/examples/account/delete-sessions.md +1 -0
  186. package/docs/examples/account/delete.md +1 -0
  187. package/docs/examples/account/get-mfa-recovery-codes.md +1 -0
  188. package/docs/examples/account/get-prefs.md +1 -0
  189. package/docs/examples/account/get-session.md +2 -0
  190. package/docs/examples/account/get.md +1 -0
  191. package/docs/examples/account/list-identities.md +1 -0
  192. package/docs/examples/account/list-logs.md +1 -0
  193. package/docs/examples/account/list-mfa-factors.md +1 -0
  194. package/docs/examples/account/list-sessions.md +1 -0
  195. package/docs/examples/account/update-email-verification.md +3 -0
  196. package/docs/examples/account/update-email.md +3 -0
  197. package/docs/examples/account/update-magic-url-session.md +3 -0
  198. package/docs/examples/account/update-mfa-authenticator.md +3 -0
  199. package/docs/examples/account/update-mfa-challenge.md +3 -0
  200. package/docs/examples/account/update-mfa-recovery-codes.md +1 -0
  201. package/docs/examples/account/update-mfa.md +2 -0
  202. package/docs/examples/account/update-name.md +2 -0
  203. package/docs/examples/account/update-password.md +2 -0
  204. package/docs/examples/account/update-phone-session.md +3 -0
  205. package/docs/examples/account/update-phone-verification.md +3 -0
  206. package/docs/examples/account/update-phone.md +3 -0
  207. package/docs/examples/account/update-prefs.md +2 -0
  208. package/docs/examples/account/update-push-target.md +3 -0
  209. package/docs/examples/account/update-recovery.md +4 -0
  210. package/docs/examples/account/update-session.md +2 -0
  211. package/docs/examples/account/update-status.md +1 -0
  212. package/docs/examples/account/update-verification.md +3 -0
  213. package/docs/examples/console/get-resource.md +3 -0
  214. package/docs/examples/console/variables.md +1 -0
  215. package/docs/examples/databases/create-boolean-attribute.md +5 -0
  216. package/docs/examples/databases/create-collection.md +4 -0
  217. package/docs/examples/databases/create-datetime-attribute.md +5 -0
  218. package/docs/examples/databases/create-document.md +5 -0
  219. package/docs/examples/databases/create-documents.md +4 -0
  220. package/docs/examples/databases/create-email-attribute.md +5 -0
  221. package/docs/examples/databases/create-enum-attribute.md +6 -0
  222. package/docs/examples/databases/create-float-attribute.md +5 -0
  223. package/docs/examples/databases/create-index.md +6 -0
  224. package/docs/examples/databases/create-integer-attribute.md +5 -0
  225. package/docs/examples/databases/create-ip-attribute.md +5 -0
  226. package/docs/examples/databases/create-line-attribute.md +5 -0
  227. package/docs/examples/databases/create-operations.md +2 -0
  228. package/docs/examples/databases/create-point-attribute.md +5 -0
  229. package/docs/examples/databases/create-polygon-attribute.md +5 -0
  230. package/docs/examples/databases/create-relationship-attribute.md +5 -0
  231. package/docs/examples/databases/create-string-attribute.md +6 -0
  232. package/docs/examples/databases/create-transaction.md +1 -0
  233. package/docs/examples/databases/create-url-attribute.md +5 -0
  234. package/docs/examples/databases/create.md +3 -0
  235. package/docs/examples/databases/decrement-document-attribute.md +5 -0
  236. package/docs/examples/databases/delete-attribute.md +4 -0
  237. package/docs/examples/databases/delete-collection.md +3 -0
  238. package/docs/examples/databases/delete-document.md +4 -0
  239. package/docs/examples/databases/delete-documents.md +3 -0
  240. package/docs/examples/databases/delete-index.md +4 -0
  241. package/docs/examples/databases/delete-transaction.md +2 -0
  242. package/docs/examples/databases/delete.md +2 -0
  243. package/docs/examples/databases/get-attribute.md +4 -0
  244. package/docs/examples/databases/get-collection-usage.md +3 -0
  245. package/docs/examples/databases/get-collection.md +3 -0
  246. package/docs/examples/databases/get-document.md +4 -0
  247. package/docs/examples/databases/get-index.md +4 -0
  248. package/docs/examples/databases/get-transaction.md +2 -0
  249. package/docs/examples/databases/get-usage.md +2 -0
  250. package/docs/examples/databases/get.md +2 -0
  251. package/docs/examples/databases/increment-document-attribute.md +5 -0
  252. package/docs/examples/databases/list-attributes.md +3 -0
  253. package/docs/examples/databases/list-collection-logs.md +3 -0
  254. package/docs/examples/databases/list-collections.md +2 -0
  255. package/docs/examples/databases/list-document-logs.md +4 -0
  256. package/docs/examples/databases/list-documents.md +3 -0
  257. package/docs/examples/databases/list-indexes.md +3 -0
  258. package/docs/examples/databases/list-logs.md +2 -0
  259. package/docs/examples/databases/list-transactions.md +1 -0
  260. package/docs/examples/databases/list-usage.md +1 -0
  261. package/docs/examples/databases/list.md +1 -0
  262. package/docs/examples/databases/update-boolean-attribute.md +6 -0
  263. package/docs/examples/databases/update-collection.md +4 -0
  264. package/docs/examples/databases/update-datetime-attribute.md +6 -0
  265. package/docs/examples/databases/update-document.md +4 -0
  266. package/docs/examples/databases/update-documents.md +3 -0
  267. package/docs/examples/databases/update-email-attribute.md +6 -0
  268. package/docs/examples/databases/update-enum-attribute.md +7 -0
  269. package/docs/examples/databases/update-float-attribute.md +6 -0
  270. package/docs/examples/databases/update-integer-attribute.md +6 -0
  271. package/docs/examples/databases/update-ip-attribute.md +6 -0
  272. package/docs/examples/databases/update-line-attribute.md +5 -0
  273. package/docs/examples/databases/update-point-attribute.md +5 -0
  274. package/docs/examples/databases/update-polygon-attribute.md +5 -0
  275. package/docs/examples/databases/update-relationship-attribute.md +4 -0
  276. package/docs/examples/databases/update-string-attribute.md +6 -0
  277. package/docs/examples/databases/update-transaction.md +2 -0
  278. package/docs/examples/databases/update-url-attribute.md +6 -0
  279. package/docs/examples/databases/update.md +3 -0
  280. package/docs/examples/databases/upsert-document.md +4 -0
  281. package/docs/examples/databases/upsert-documents.md +4 -0
  282. package/docs/examples/functions/create-deployment.md +4 -0
  283. package/docs/examples/functions/create-duplicate-deployment.md +3 -0
  284. package/docs/examples/functions/create-execution.md +2 -0
  285. package/docs/examples/functions/create-template-deployment.md +7 -0
  286. package/docs/examples/functions/create-variable.md +4 -0
  287. package/docs/examples/functions/create-vcs-deployment.md +4 -0
  288. package/docs/examples/functions/create.md +4 -0
  289. package/docs/examples/functions/delete-deployment.md +3 -0
  290. package/docs/examples/functions/delete-execution.md +3 -0
  291. package/docs/examples/functions/delete-variable.md +3 -0
  292. package/docs/examples/functions/delete.md +2 -0
  293. package/docs/examples/functions/get-deployment-download.md +3 -0
  294. package/docs/examples/functions/get-deployment.md +3 -0
  295. package/docs/examples/functions/get-execution.md +3 -0
  296. package/docs/examples/functions/get-template.md +2 -0
  297. package/docs/examples/functions/get-usage.md +2 -0
  298. package/docs/examples/functions/get-variable.md +3 -0
  299. package/docs/examples/functions/get.md +2 -0
  300. package/docs/examples/functions/list-deployments.md +2 -0
  301. package/docs/examples/functions/list-executions.md +2 -0
  302. package/docs/examples/functions/list-runtimes.md +1 -0
  303. package/docs/examples/functions/list-specifications.md +1 -0
  304. package/docs/examples/functions/list-templates.md +1 -0
  305. package/docs/examples/functions/list-usage.md +1 -0
  306. package/docs/examples/functions/list-variables.md +2 -0
  307. package/docs/examples/functions/list.md +1 -0
  308. package/docs/examples/functions/update-deployment-status.md +3 -0
  309. package/docs/examples/functions/update-function-deployment.md +3 -0
  310. package/docs/examples/functions/update-variable.md +4 -0
  311. package/docs/examples/functions/update.md +3 -0
  312. package/docs/examples/graphql/mutation.md +2 -0
  313. package/docs/examples/graphql/query.md +2 -0
  314. package/docs/examples/health/get-antivirus.md +1 -0
  315. package/docs/examples/health/get-cache.md +1 -0
  316. package/docs/examples/health/get-certificate.md +1 -0
  317. package/docs/examples/health/get-db.md +1 -0
  318. package/docs/examples/health/get-failed-jobs.md +2 -0
  319. package/docs/examples/health/get-pub-sub.md +1 -0
  320. package/docs/examples/health/get-queue-builds.md +1 -0
  321. package/docs/examples/health/get-queue-certificates.md +1 -0
  322. package/docs/examples/health/get-queue-databases.md +1 -0
  323. package/docs/examples/health/get-queue-deletes.md +1 -0
  324. package/docs/examples/health/get-queue-functions.md +1 -0
  325. package/docs/examples/health/get-queue-logs.md +1 -0
  326. package/docs/examples/health/get-queue-mails.md +1 -0
  327. package/docs/examples/health/get-queue-messaging.md +1 -0
  328. package/docs/examples/health/get-queue-migrations.md +1 -0
  329. package/docs/examples/health/get-queue-stats-resources.md +1 -0
  330. package/docs/examples/health/get-queue-usage.md +1 -0
  331. package/docs/examples/health/get-queue-webhooks.md +1 -0
  332. package/docs/examples/health/get-storage-local.md +1 -0
  333. package/docs/examples/health/get-storage.md +1 -0
  334. package/docs/examples/health/get-time.md +1 -0
  335. package/docs/examples/health/get.md +1 -0
  336. package/docs/examples/locale/get.md +1 -0
  337. package/docs/examples/locale/list-codes.md +1 -0
  338. package/docs/examples/locale/list-continents.md +1 -0
  339. package/docs/examples/locale/list-countries-eu.md +1 -0
  340. package/docs/examples/locale/list-countries-phones.md +1 -0
  341. package/docs/examples/locale/list-countries.md +1 -0
  342. package/docs/examples/locale/list-currencies.md +1 -0
  343. package/docs/examples/locale/list-languages.md +1 -0
  344. package/docs/examples/messaging/create-apns-provider.md +3 -0
  345. package/docs/examples/messaging/create-email.md +4 -0
  346. package/docs/examples/messaging/create-fcm-provider.md +3 -0
  347. package/docs/examples/messaging/create-mailgun-provider.md +3 -0
  348. package/docs/examples/messaging/create-msg-91-provider.md +3 -0
  349. package/docs/examples/messaging/create-push.md +2 -0
  350. package/docs/examples/messaging/create-resend-provider.md +3 -0
  351. package/docs/examples/messaging/create-sendgrid-provider.md +3 -0
  352. package/docs/examples/messaging/create-sms.md +3 -0
  353. package/docs/examples/messaging/create-smtp-provider.md +4 -0
  354. package/docs/examples/messaging/create-subscriber.md +4 -0
  355. package/docs/examples/messaging/create-telesign-provider.md +3 -0
  356. package/docs/examples/messaging/create-textmagic-provider.md +3 -0
  357. package/docs/examples/messaging/create-topic.md +3 -0
  358. package/docs/examples/messaging/create-twilio-provider.md +3 -0
  359. package/docs/examples/messaging/create-vonage-provider.md +3 -0
  360. package/docs/examples/messaging/delete-provider.md +2 -0
  361. package/docs/examples/messaging/delete-subscriber.md +3 -0
  362. package/docs/examples/messaging/delete-topic.md +2 -0
  363. package/docs/examples/messaging/delete.md +2 -0
  364. package/docs/examples/messaging/get-message.md +2 -0
  365. package/docs/examples/messaging/get-provider.md +2 -0
  366. package/docs/examples/messaging/get-subscriber.md +3 -0
  367. package/docs/examples/messaging/get-topic.md +2 -0
  368. package/docs/examples/messaging/list-message-logs.md +2 -0
  369. package/docs/examples/messaging/list-messages.md +1 -0
  370. package/docs/examples/messaging/list-provider-logs.md +2 -0
  371. package/docs/examples/messaging/list-providers.md +1 -0
  372. package/docs/examples/messaging/list-subscriber-logs.md +2 -0
  373. package/docs/examples/messaging/list-subscribers.md +2 -0
  374. package/docs/examples/messaging/list-targets.md +2 -0
  375. package/docs/examples/messaging/list-topic-logs.md +2 -0
  376. package/docs/examples/messaging/list-topics.md +1 -0
  377. package/docs/examples/messaging/update-apns-provider.md +2 -0
  378. package/docs/examples/messaging/update-email.md +2 -0
  379. package/docs/examples/messaging/update-fcm-provider.md +2 -0
  380. package/docs/examples/messaging/update-mailgun-provider.md +2 -0
  381. package/docs/examples/messaging/update-msg-91-provider.md +2 -0
  382. package/docs/examples/messaging/update-push.md +2 -0
  383. package/docs/examples/messaging/update-resend-provider.md +2 -0
  384. package/docs/examples/messaging/update-sendgrid-provider.md +2 -0
  385. package/docs/examples/messaging/update-sms.md +2 -0
  386. package/docs/examples/messaging/update-smtp-provider.md +2 -0
  387. package/docs/examples/messaging/update-telesign-provider.md +2 -0
  388. package/docs/examples/messaging/update-textmagic-provider.md +2 -0
  389. package/docs/examples/messaging/update-topic.md +2 -0
  390. package/docs/examples/messaging/update-twilio-provider.md +2 -0
  391. package/docs/examples/messaging/update-vonage-provider.md +2 -0
  392. package/docs/examples/migrations/create-appwrite-migration.md +5 -0
  393. package/docs/examples/migrations/create-csv-export.md +3 -0
  394. package/docs/examples/migrations/create-csv-import.md +4 -0
  395. package/docs/examples/migrations/create-firebase-migration.md +3 -0
  396. package/docs/examples/migrations/create-n-host-migration.md +8 -0
  397. package/docs/examples/migrations/create-supabase-migration.md +7 -0
  398. package/docs/examples/migrations/delete.md +2 -0
  399. package/docs/examples/migrations/get-appwrite-report.md +5 -0
  400. package/docs/examples/migrations/get-firebase-report.md +3 -0
  401. package/docs/examples/migrations/get-n-host-report.md +8 -0
  402. package/docs/examples/migrations/get-supabase-report.md +7 -0
  403. package/docs/examples/migrations/get.md +2 -0
  404. package/docs/examples/migrations/list.md +1 -0
  405. package/docs/examples/migrations/retry.md +2 -0
  406. package/docs/examples/project/create-variable.md +3 -0
  407. package/docs/examples/project/delete-variable.md +2 -0
  408. package/docs/examples/project/get-usage.md +3 -0
  409. package/docs/examples/project/get-variable.md +2 -0
  410. package/docs/examples/project/list-variables.md +1 -0
  411. package/docs/examples/project/update-variable.md +3 -0
  412. package/docs/examples/projects/create-dev-key.md +4 -0
  413. package/docs/examples/projects/create-jwt.md +3 -0
  414. package/docs/examples/projects/create-key.md +4 -0
  415. package/docs/examples/projects/create-platform.md +4 -0
  416. package/docs/examples/projects/create-smtp-test.md +6 -0
  417. package/docs/examples/projects/create-webhook.md +6 -0
  418. package/docs/examples/projects/create.md +4 -0
  419. package/docs/examples/projects/delete-dev-key.md +3 -0
  420. package/docs/examples/projects/delete-email-template.md +4 -0
  421. package/docs/examples/projects/delete-key.md +3 -0
  422. package/docs/examples/projects/delete-platform.md +3 -0
  423. package/docs/examples/projects/delete-sms-template.md +4 -0
  424. package/docs/examples/projects/delete-webhook.md +3 -0
  425. package/docs/examples/projects/delete.md +2 -0
  426. package/docs/examples/projects/get-dev-key.md +3 -0
  427. package/docs/examples/projects/get-email-template.md +4 -0
  428. package/docs/examples/projects/get-key.md +3 -0
  429. package/docs/examples/projects/get-platform.md +3 -0
  430. package/docs/examples/projects/get-sms-template.md +4 -0
  431. package/docs/examples/projects/get-webhook.md +3 -0
  432. package/docs/examples/projects/get.md +2 -0
  433. package/docs/examples/projects/list-dev-keys.md +2 -0
  434. package/docs/examples/projects/list-keys.md +2 -0
  435. package/docs/examples/projects/list-platforms.md +2 -0
  436. package/docs/examples/projects/list-webhooks.md +2 -0
  437. package/docs/examples/projects/list.md +1 -0
  438. package/docs/examples/projects/update-api-status-all.md +3 -0
  439. package/docs/examples/projects/update-api-status.md +4 -0
  440. package/docs/examples/projects/update-auth-duration.md +3 -0
  441. package/docs/examples/projects/update-auth-limit.md +3 -0
  442. package/docs/examples/projects/update-auth-password-dictionary.md +3 -0
  443. package/docs/examples/projects/update-auth-password-history.md +3 -0
  444. package/docs/examples/projects/update-auth-sessions-limit.md +3 -0
  445. package/docs/examples/projects/update-auth-status.md +4 -0
  446. package/docs/examples/projects/update-dev-key.md +5 -0
  447. package/docs/examples/projects/update-email-template.md +6 -0
  448. package/docs/examples/projects/update-key.md +5 -0
  449. package/docs/examples/projects/update-memberships-privacy.md +5 -0
  450. package/docs/examples/projects/update-mock-numbers.md +3 -0
  451. package/docs/examples/projects/update-o-auth-2.md +3 -0
  452. package/docs/examples/projects/update-personal-data-check.md +3 -0
  453. package/docs/examples/projects/update-platform.md +4 -0
  454. package/docs/examples/projects/update-service-status-all.md +3 -0
  455. package/docs/examples/projects/update-service-status.md +4 -0
  456. package/docs/examples/projects/update-session-alerts.md +3 -0
  457. package/docs/examples/projects/update-session-invalidation.md +3 -0
  458. package/docs/examples/projects/update-sms-template.md +5 -0
  459. package/docs/examples/projects/update-smtp.md +3 -0
  460. package/docs/examples/projects/update-team.md +3 -0
  461. package/docs/examples/projects/update-webhook-signature.md +3 -0
  462. package/docs/examples/projects/update-webhook.md +7 -0
  463. package/docs/examples/projects/update.md +3 -0
  464. package/docs/examples/proxy/create-api-rule.md +2 -0
  465. package/docs/examples/proxy/create-function-rule.md +3 -0
  466. package/docs/examples/proxy/create-redirect-rule.md +6 -0
  467. package/docs/examples/proxy/create-site-rule.md +3 -0
  468. package/docs/examples/proxy/delete-rule.md +2 -0
  469. package/docs/examples/proxy/get-rule.md +2 -0
  470. package/docs/examples/proxy/list-rules.md +1 -0
  471. package/docs/examples/proxy/update-rule-verification.md +2 -0
  472. package/docs/examples/sites/create-deployment.md +4 -0
  473. package/docs/examples/sites/create-duplicate-deployment.md +3 -0
  474. package/docs/examples/sites/create-template-deployment.md +7 -0
  475. package/docs/examples/sites/create-variable.md +4 -0
  476. package/docs/examples/sites/create-vcs-deployment.md +4 -0
  477. package/docs/examples/sites/create.md +5 -0
  478. package/docs/examples/sites/delete-deployment.md +3 -0
  479. package/docs/examples/sites/delete-log.md +3 -0
  480. package/docs/examples/sites/delete-variable.md +3 -0
  481. package/docs/examples/sites/delete.md +2 -0
  482. package/docs/examples/sites/get-deployment-download.md +3 -0
  483. package/docs/examples/sites/get-deployment.md +3 -0
  484. package/docs/examples/sites/get-log.md +3 -0
  485. package/docs/examples/sites/get-template.md +2 -0
  486. package/docs/examples/sites/get-usage.md +2 -0
  487. package/docs/examples/sites/get-variable.md +3 -0
  488. package/docs/examples/sites/get.md +2 -0
  489. package/docs/examples/sites/list-deployments.md +2 -0
  490. package/docs/examples/sites/list-frameworks.md +1 -0
  491. package/docs/examples/sites/list-logs.md +2 -0
  492. package/docs/examples/sites/list-specifications.md +1 -0
  493. package/docs/examples/sites/list-templates.md +1 -0
  494. package/docs/examples/sites/list-usage.md +1 -0
  495. package/docs/examples/sites/list-variables.md +2 -0
  496. package/docs/examples/sites/list.md +1 -0
  497. package/docs/examples/sites/update-deployment-status.md +3 -0
  498. package/docs/examples/sites/update-site-deployment.md +3 -0
  499. package/docs/examples/sites/update-variable.md +4 -0
  500. package/docs/examples/sites/update.md +4 -0
  501. package/docs/examples/storage/create-bucket.md +3 -0
  502. package/docs/examples/storage/create-file.md +4 -0
  503. package/docs/examples/storage/delete-bucket.md +2 -0
  504. package/docs/examples/storage/delete-file.md +3 -0
  505. package/docs/examples/storage/get-bucket-usage.md +2 -0
  506. package/docs/examples/storage/get-bucket.md +2 -0
  507. package/docs/examples/storage/get-file-download.md +3 -0
  508. package/docs/examples/storage/get-file-preview.md +3 -0
  509. package/docs/examples/storage/get-file-view.md +3 -0
  510. package/docs/examples/storage/get-file.md +3 -0
  511. package/docs/examples/storage/get-usage.md +1 -0
  512. package/docs/examples/storage/list-buckets.md +1 -0
  513. package/docs/examples/storage/list-files.md +2 -0
  514. package/docs/examples/storage/update-bucket.md +3 -0
  515. package/docs/examples/storage/update-file.md +3 -0
  516. package/docs/examples/tablesdb/create-boolean-column.md +5 -0
  517. package/docs/examples/tablesdb/create-datetime-column.md +5 -0
  518. package/docs/examples/tablesdb/create-email-column.md +5 -0
  519. package/docs/examples/tablesdb/create-enum-column.md +6 -0
  520. package/docs/examples/tablesdb/create-float-column.md +5 -0
  521. package/docs/examples/tablesdb/create-index.md +6 -0
  522. package/docs/examples/tablesdb/create-integer-column.md +5 -0
  523. package/docs/examples/tablesdb/create-ip-column.md +5 -0
  524. package/docs/examples/tablesdb/create-line-column.md +5 -0
  525. package/docs/examples/tablesdb/create-operations.md +2 -0
  526. package/docs/examples/tablesdb/create-point-column.md +5 -0
  527. package/docs/examples/tablesdb/create-polygon-column.md +5 -0
  528. package/docs/examples/tablesdb/create-relationship-column.md +5 -0
  529. package/docs/examples/tablesdb/create-row.md +5 -0
  530. package/docs/examples/tablesdb/create-rows.md +4 -0
  531. package/docs/examples/tablesdb/create-string-column.md +6 -0
  532. package/docs/examples/tablesdb/create-table.md +4 -0
  533. package/docs/examples/tablesdb/create-transaction.md +1 -0
  534. package/docs/examples/tablesdb/create-url-column.md +5 -0
  535. package/docs/examples/tablesdb/create.md +3 -0
  536. package/docs/examples/tablesdb/decrement-row-column.md +5 -0
  537. package/docs/examples/tablesdb/delete-column.md +4 -0
  538. package/docs/examples/tablesdb/delete-index.md +4 -0
  539. package/docs/examples/tablesdb/delete-row.md +4 -0
  540. package/docs/examples/tablesdb/delete-rows.md +3 -0
  541. package/docs/examples/tablesdb/delete-table.md +3 -0
  542. package/docs/examples/tablesdb/delete-transaction.md +2 -0
  543. package/docs/examples/tablesdb/delete.md +2 -0
  544. package/docs/examples/tablesdb/get-column.md +4 -0
  545. package/docs/examples/tablesdb/get-index.md +4 -0
  546. package/docs/examples/tablesdb/get-row.md +4 -0
  547. package/docs/examples/tablesdb/get-table-usage.md +3 -0
  548. package/docs/examples/tablesdb/get-table.md +3 -0
  549. package/docs/examples/tablesdb/get-transaction.md +2 -0
  550. package/docs/examples/tablesdb/get-usage.md +2 -0
  551. package/docs/examples/tablesdb/get.md +2 -0
  552. package/docs/examples/tablesdb/increment-row-column.md +5 -0
  553. package/docs/examples/tablesdb/list-columns.md +3 -0
  554. package/docs/examples/tablesdb/list-indexes.md +3 -0
  555. package/docs/examples/tablesdb/list-row-logs.md +4 -0
  556. package/docs/examples/tablesdb/list-rows.md +3 -0
  557. package/docs/examples/tablesdb/list-table-logs.md +3 -0
  558. package/docs/examples/tablesdb/list-tables.md +2 -0
  559. package/docs/examples/tablesdb/list-transactions.md +1 -0
  560. package/docs/examples/tablesdb/list-usage.md +1 -0
  561. package/docs/examples/tablesdb/list.md +1 -0
  562. package/docs/examples/tablesdb/update-boolean-column.md +6 -0
  563. package/docs/examples/tablesdb/update-datetime-column.md +6 -0
  564. package/docs/examples/tablesdb/update-email-column.md +6 -0
  565. package/docs/examples/tablesdb/update-enum-column.md +7 -0
  566. package/docs/examples/tablesdb/update-float-column.md +6 -0
  567. package/docs/examples/tablesdb/update-integer-column.md +6 -0
  568. package/docs/examples/tablesdb/update-ip-column.md +6 -0
  569. package/docs/examples/tablesdb/update-line-column.md +5 -0
  570. package/docs/examples/tablesdb/update-point-column.md +5 -0
  571. package/docs/examples/tablesdb/update-polygon-column.md +5 -0
  572. package/docs/examples/tablesdb/update-relationship-column.md +4 -0
  573. package/docs/examples/tablesdb/update-row.md +4 -0
  574. package/docs/examples/tablesdb/update-rows.md +3 -0
  575. package/docs/examples/tablesdb/update-string-column.md +6 -0
  576. package/docs/examples/tablesdb/update-table.md +4 -0
  577. package/docs/examples/tablesdb/update-transaction.md +2 -0
  578. package/docs/examples/tablesdb/update-url-column.md +6 -0
  579. package/docs/examples/tablesdb/update.md +3 -0
  580. package/docs/examples/tablesdb/upsert-row.md +4 -0
  581. package/docs/examples/tablesdb/upsert-rows.md +4 -0
  582. package/docs/examples/teams/create-membership.md +3 -0
  583. package/docs/examples/teams/create.md +3 -0
  584. package/docs/examples/teams/delete-membership.md +3 -0
  585. package/docs/examples/teams/delete.md +2 -0
  586. package/docs/examples/teams/get-membership.md +3 -0
  587. package/docs/examples/teams/get-prefs.md +2 -0
  588. package/docs/examples/teams/get.md +2 -0
  589. package/docs/examples/teams/list-logs.md +2 -0
  590. package/docs/examples/teams/list-memberships.md +2 -0
  591. package/docs/examples/teams/list.md +1 -0
  592. package/docs/examples/teams/update-membership-status.md +5 -0
  593. package/docs/examples/teams/update-membership.md +4 -0
  594. package/docs/examples/teams/update-name.md +3 -0
  595. package/docs/examples/teams/update-prefs.md +3 -0
  596. package/docs/examples/tokens/create-file-token.md +3 -0
  597. package/docs/examples/tokens/delete.md +2 -0
  598. package/docs/examples/tokens/get.md +2 -0
  599. package/docs/examples/tokens/list.md +3 -0
  600. package/docs/examples/tokens/update.md +2 -0
  601. package/docs/examples/users/create-argon-2-user.md +4 -0
  602. package/docs/examples/users/create-bcrypt-user.md +4 -0
  603. package/docs/examples/users/create-jwt.md +2 -0
  604. package/docs/examples/users/create-md-5-user.md +4 -0
  605. package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
  606. package/docs/examples/users/create-ph-pass-user.md +4 -0
  607. package/docs/examples/users/create-scrypt-modified-user.md +7 -0
  608. package/docs/examples/users/create-scrypt-user.md +9 -0
  609. package/docs/examples/users/create-session.md +2 -0
  610. package/docs/examples/users/create-sha-user.md +4 -0
  611. package/docs/examples/users/create-target.md +5 -0
  612. package/docs/examples/users/create-token.md +2 -0
  613. package/docs/examples/users/create.md +2 -0
  614. package/docs/examples/users/delete-identity.md +2 -0
  615. package/docs/examples/users/delete-mfa-authenticator.md +3 -0
  616. package/docs/examples/users/delete-session.md +3 -0
  617. package/docs/examples/users/delete-sessions.md +2 -0
  618. package/docs/examples/users/delete-target.md +3 -0
  619. package/docs/examples/users/delete.md +2 -0
  620. package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
  621. package/docs/examples/users/get-prefs.md +2 -0
  622. package/docs/examples/users/get-target.md +3 -0
  623. package/docs/examples/users/get-usage.md +1 -0
  624. package/docs/examples/users/get.md +2 -0
  625. package/docs/examples/users/list-identities.md +1 -0
  626. package/docs/examples/users/list-logs.md +2 -0
  627. package/docs/examples/users/list-memberships.md +2 -0
  628. package/docs/examples/users/list-mfa-factors.md +2 -0
  629. package/docs/examples/users/list-sessions.md +2 -0
  630. package/docs/examples/users/list-targets.md +2 -0
  631. package/docs/examples/users/list.md +1 -0
  632. package/docs/examples/users/update-email-verification.md +3 -0
  633. package/docs/examples/users/update-email.md +3 -0
  634. package/docs/examples/users/update-labels.md +3 -0
  635. package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
  636. package/docs/examples/users/update-mfa.md +3 -0
  637. package/docs/examples/users/update-name.md +3 -0
  638. package/docs/examples/users/update-password.md +3 -0
  639. package/docs/examples/users/update-phone-verification.md +3 -0
  640. package/docs/examples/users/update-phone.md +3 -0
  641. package/docs/examples/users/update-prefs.md +3 -0
  642. package/docs/examples/users/update-status.md +3 -0
  643. package/docs/examples/users/update-target.md +3 -0
  644. package/docs/examples/vcs/create-repository-detection.md +4 -0
  645. package/docs/examples/vcs/create-repository.md +4 -0
  646. package/docs/examples/vcs/delete-installation.md +2 -0
  647. package/docs/examples/vcs/get-installation.md +2 -0
  648. package/docs/examples/vcs/get-repository-contents.md +3 -0
  649. package/docs/examples/vcs/get-repository.md +3 -0
  650. package/docs/examples/vcs/list-installations.md +1 -0
  651. package/docs/examples/vcs/list-repositories.md +3 -0
  652. package/docs/examples/vcs/list-repository-branches.md +3 -0
  653. package/docs/examples/vcs/update-external-deployments.md +4 -0
  654. package/index.ts +25 -165
  655. package/install.ps1 +2 -2
  656. package/install.sh +1 -1
  657. package/lib/client.ts +14 -6
  658. package/lib/commands/config.ts +494 -0
  659. package/lib/commands/db.ts +324 -0
  660. package/lib/commands/errors.ts +93 -0
  661. package/lib/commands/init.ts +25 -14
  662. package/lib/commands/pull.ts +683 -420
  663. package/lib/commands/push.ts +1677 -2404
  664. package/lib/commands/run.ts +1 -1
  665. package/lib/commands/schema.ts +122 -0
  666. package/lib/commands/services/account.ts +200 -385
  667. package/lib/commands/services/console.ts +13 -34
  668. package/lib/commands/services/databases.ts +298 -1215
  669. package/lib/commands/services/functions.ts +115 -434
  670. package/lib/commands/services/graphql.ts +5 -2
  671. package/lib/commands/services/health.ts +87 -149
  672. package/lib/commands/services/locale.ts +36 -33
  673. package/lib/commands/services/messaging.ts +180 -999
  674. package/lib/commands/services/migrations.ts +54 -226
  675. package/lib/commands/services/project.ts +19 -23
  676. package/lib/commands/services/projects.ts +182 -714
  677. package/lib/commands/services/proxy.ts +30 -58
  678. package/lib/commands/services/sites.ts +107 -379
  679. package/lib/commands/services/storage.ts +93 -302
  680. package/lib/commands/services/tables-db.ts +1150 -0
  681. package/lib/commands/services/teams.ts +48 -110
  682. package/lib/commands/services/tokens.ts +16 -28
  683. package/lib/commands/services/users.ts +133 -403
  684. package/lib/commands/services/vcs.ts +48 -151
  685. package/lib/commands/types.ts +1 -1
  686. package/lib/commands/update.ts +13 -22
  687. package/lib/commands/utils/attributes.ts +719 -0
  688. package/lib/commands/utils/change-approval.ts +186 -0
  689. package/lib/commands/utils/database-sync.ts +180 -0
  690. package/lib/commands/utils/deployment.ts +184 -0
  691. package/lib/commands/utils/error-formatter.ts +417 -0
  692. package/lib/commands/utils/pools.ts +355 -0
  693. package/lib/config.ts +46 -82
  694. package/lib/constants.ts +22 -0
  695. package/lib/emulation/docker.ts +101 -87
  696. package/lib/parser.ts +16 -11
  697. package/lib/questions.ts +20 -21
  698. package/lib/sdks.ts +15 -11
  699. package/lib/types.ts +0 -229
  700. package/lib/utils.ts +45 -4
  701. package/package.json +12 -11
  702. package/scoop/appwrite.config.json +29 -19
  703. package/.github/workflows/build-verify.yml +0 -71
  704. package/bun.lock +0 -625
  705. package/dist/lib/commands/services/avatars.d.ts +0 -3
  706. package/dist/lib/commands/services/avatars.d.ts.map +0 -1
  707. package/dist/lib/commands/services/avatars.js +0 -118
  708. package/dist/lib/commands/services/avatars.js.map +0 -1
  709. package/dist/lib/commands/services/tablesdb.d.ts +0 -3
  710. package/dist/lib/commands/services/tablesdb.d.ts.map +0 -1
  711. package/dist/lib/commands/services/tablesdb.js.map +0 -1
  712. package/dist/scripts/generate-commands.d.ts +0 -2
  713. package/dist/scripts/generate-commands.d.ts.map +0 -1
  714. package/dist/scripts/generate-commands.js +0 -398
  715. package/dist/scripts/generate-commands.js.map +0 -1
  716. package/lib/commands/services/avatars.ts +0 -400
  717. package/lib/commands/services/tablesdb.ts +0 -1928
  718. package/scripts/generate-commands.ts +0 -539
@@ -3,6 +3,8 @@ import { sdkForProject } from "../../sdks.js";
3
3
  import {
4
4
  actionRunner,
5
5
  commandDescriptions,
6
+ success,
7
+ parse,
6
8
  parseBool,
7
9
  parseInteger,
8
10
  } from "../../parser.js";
@@ -31,14 +33,8 @@ export const messaging = new Command("messaging")
31
33
  messaging
32
34
  .command(`list-messages`)
33
35
  .description(`Get a list of all messages from the current Appwrite project.`)
34
- .option(
35
- `--queries [queries...]`,
36
- `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`,
37
- )
38
- .option(
39
- `--search <search>`,
40
- `Search term to filter your list results. Max length: 256 chars.`,
41
- )
36
+ .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`)
37
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
42
38
  .option(
43
39
  `--total [value]`,
44
40
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -48,17 +44,14 @@ messaging
48
44
  .action(
49
45
  actionRunner(
50
46
  async ({ queries, search, total }) =>
51
- await (await getMessagingClient()).listMessages(queries, search, total),
47
+ parse(await (await getMessagingClient()).listMessages(queries, search, total)),
52
48
  ),
53
49
  );
54
50
 
55
51
  messaging
56
52
  .command(`create-email`)
57
53
  .description(`Create a new email message.`)
58
- .requiredOption(
59
- `--message-id <message-id>`,
60
- `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.`,
61
- )
54
+ .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.`)
62
55
  .requiredOption(`--subject <subject>`, `Email Subject.`)
63
56
  .requiredOption(`--content <content>`, `Email Content.`)
64
57
  .option(`--topics [topics...]`, `List of Topic IDs.`)
@@ -66,10 +59,7 @@ messaging
66
59
  .option(`--targets [targets...]`, `List of Targets IDs.`)
67
60
  .option(`--cc [cc...]`, `Array of target IDs to be added as CC.`)
68
61
  .option(`--bcc [bcc...]`, `Array of target IDs to be added as BCC.`)
69
- .option(
70
- `--attachments [attachments...]`,
71
- `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>.`,
72
- )
62
+ .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>.`)
73
63
  .option(
74
64
  `--draft [value]`,
75
65
  `Is message a draft`,
@@ -82,51 +72,18 @@ messaging
82
72
  (value: string | undefined) =>
83
73
  value === undefined ? true : parseBool(value),
84
74
  )
85
- .option(
86
- `--scheduled-at <scheduled-at>`,
87
- `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.`,
88
- )
75
+ .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.`)
89
76
  .action(
90
77
  actionRunner(
91
- async ({
92
- messageId,
93
- subject,
94
- content,
95
- topics,
96
- users,
97
- targets,
98
- cc,
99
- bcc,
100
- attachments,
101
- draft,
102
- html,
103
- scheduledAt,
104
- }) =>
105
- await (
106
- await getMessagingClient()
107
- ).createEmail(
108
- messageId,
109
- subject,
110
- content,
111
- topics,
112
- users,
113
- targets,
114
- cc,
115
- bcc,
116
- attachments,
117
- draft,
118
- html,
119
- scheduledAt,
120
- ),
78
+ async ({ messageId, subject, content, topics, users, targets, cc, bcc, attachments, draft, html, scheduledAt }) =>
79
+ parse(await (await getMessagingClient()).createEmail(messageId, subject, content, topics, users, targets, cc, bcc, attachments, draft, html, scheduledAt)),
121
80
  ),
122
81
  );
123
82
 
124
83
  messaging
125
84
  .command(`update-email`)
126
- .description(
127
- `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.
128
- `,
129
- )
85
+ .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.
86
+ `)
130
87
  .requiredOption(`--message-id <message-id>`, `Message ID.`)
131
88
  .option(`--topics [topics...]`, `List of Topic IDs.`)
132
89
  .option(`--users [users...]`, `List of User IDs.`)
@@ -147,101 +104,39 @@ messaging
147
104
  )
148
105
  .option(`--cc [cc...]`, `Array of target IDs to be added as CC.`)
149
106
  .option(`--bcc [bcc...]`, `Array of target IDs to be added as BCC.`)
150
- .option(
151
- `--scheduled-at <scheduled-at>`,
152
- `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.`,
153
- )
154
- .option(
155
- `--attachments [attachments...]`,
156
- `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>.`,
157
- )
107
+ .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.`)
108
+ .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>.`)
158
109
  .action(
159
110
  actionRunner(
160
- async ({
161
- messageId,
162
- topics,
163
- users,
164
- targets,
165
- subject,
166
- content,
167
- draft,
168
- html,
169
- cc,
170
- bcc,
171
- scheduledAt,
172
- attachments,
173
- }) =>
174
- await (
175
- await getMessagingClient()
176
- ).updateEmail(
177
- messageId,
178
- topics,
179
- users,
180
- targets,
181
- subject,
182
- content,
183
- draft,
184
- html,
185
- cc,
186
- bcc,
187
- scheduledAt,
188
- attachments,
189
- ),
111
+ async ({ messageId, topics, users, targets, subject, content, draft, html, cc, bcc, scheduledAt, attachments }) =>
112
+ parse(await (await getMessagingClient()).updateEmail(messageId, topics, users, targets, subject, content, draft, html, cc, bcc, scheduledAt, attachments)),
190
113
  ),
191
114
  );
192
115
 
193
116
  messaging
194
117
  .command(`create-push`)
195
118
  .description(`Create a new push notification.`)
196
- .requiredOption(
197
- `--message-id <message-id>`,
198
- `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.`,
199
- )
119
+ .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.`)
200
120
  .option(`--title <title>`, `Title for push notification.`)
201
121
  .option(`--body <body>`, `Body for push notification.`)
202
122
  .option(`--topics [topics...]`, `List of Topic IDs.`)
203
123
  .option(`--users [users...]`, `List of User IDs.`)
204
124
  .option(`--targets [targets...]`, `List of Targets IDs.`)
205
- .option(
206
- `--data <data>`,
207
- `Additional key-value pair data for push notification.`,
208
- )
125
+ .option(`--data <data>`, `Additional key-value pair data for push notification.`)
209
126
  .option(`--action <action>`, `Action for push notification.`)
210
- .option(
211
- `--image <image>`,
212
- `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>.`,
213
- )
214
- .option(
215
- `--icon <icon>`,
216
- `Icon for push notification. Available only for Android and Web Platform.`,
217
- )
218
- .option(
219
- `--sound <sound>`,
220
- `Sound for push notification. Available only for Android and iOS Platform.`,
221
- )
222
- .option(
223
- `--color <color>`,
224
- `Color for push notification. Available only for Android Platform.`,
225
- )
226
- .option(
227
- `--tag <tag>`,
228
- `Tag for push notification. Available only for Android Platform.`,
229
- )
230
- .option(
231
- `--badge <badge>`,
232
- `Badge for push notification. Available only for iOS Platform.`,
233
- parseInteger,
234
- )
127
+ .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>.`)
128
+ .option(`--icon <icon>`, `Icon for push notification. Available only for Android and Web Platform.`)
129
+ .option(`--sound <sound>`, `Sound for push notification. Available only for Android and iOS Platform.`)
130
+ .option(`--color <color>`, `Color for push notification. Available only for Android Platform.`)
131
+ .option(`--tag <tag>`, `Tag for push notification. Available only for Android Platform.`)
132
+ .option(`--badge <badge>`, `Badge for push notification. Available only for iOS Platform.`, parseInteger)
235
133
  .option(
236
134
  `--draft [value]`,
237
135
  `Is message a draft`,
238
136
  (value: string | undefined) =>
239
137
  value === undefined ? true : parseBool(value),
240
138
  )
241
- .option(
242
- `--scheduled-at <scheduled-at>`,
243
- `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.`,
244
- )
139
+ .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.`)
245
140
  .option(
246
141
  `--content-available [value]`,
247
142
  `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`,
@@ -254,65 +149,18 @@ messaging
254
149
  (value: string | undefined) =>
255
150
  value === undefined ? true : parseBool(value),
256
151
  )
257
- .option(
258
- `--priority <priority>`,
259
- `Set the notification priority. "normal" will consider device state and may not deliver notifications immediately. "high" will always attempt to immediately deliver the notification.`,
260
- )
152
+ .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.`)
261
153
  .action(
262
154
  actionRunner(
263
- async ({
264
- messageId,
265
- title,
266
- body,
267
- topics,
268
- users,
269
- targets,
270
- data,
271
- action,
272
- image,
273
- icon,
274
- sound,
275
- color,
276
- tag,
277
- badge,
278
- draft,
279
- scheduledAt,
280
- contentAvailable,
281
- critical,
282
- priority,
283
- }) =>
284
- await (
285
- await getMessagingClient()
286
- ).createPush(
287
- messageId,
288
- title,
289
- body,
290
- topics,
291
- users,
292
- targets,
293
- JSON.parse(data),
294
- action,
295
- image,
296
- icon,
297
- sound,
298
- color,
299
- tag,
300
- badge,
301
- draft,
302
- scheduledAt,
303
- contentAvailable,
304
- critical,
305
- priority as MessagePriority,
306
- ),
155
+ async ({ messageId, title, body, topics, users, targets, data, action, image, icon, sound, color, tag, badge, draft, scheduledAt, contentAvailable, critical, priority }) =>
156
+ parse(await (await getMessagingClient()).createPush(messageId, title, body, topics, users, targets, JSON.parse(data), action, image, icon, sound, color, tag, badge, draft, scheduledAt, contentAvailable, critical, priority as MessagePriority)),
307
157
  ),
308
158
  );
309
159
 
310
160
  messaging
311
161
  .command(`update-push`)
312
- .description(
313
- `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.
314
- `,
315
- )
162
+ .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.
163
+ `)
316
164
  .requiredOption(`--message-id <message-id>`, `Message ID.`)
317
165
  .option(`--topics [topics...]`, `List of Topic IDs.`)
318
166
  .option(`--users [users...]`, `List of User IDs.`)
@@ -321,41 +169,19 @@ messaging
321
169
  .option(`--body <body>`, `Body for push notification.`)
322
170
  .option(`--data <data>`, `Additional Data for push notification.`)
323
171
  .option(`--action <action>`, `Action for push notification.`)
324
- .option(
325
- `--image <image>`,
326
- `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>.`,
327
- )
328
- .option(
329
- `--icon <icon>`,
330
- `Icon for push notification. Available only for Android and Web platforms.`,
331
- )
332
- .option(
333
- `--sound <sound>`,
334
- `Sound for push notification. Available only for Android and iOS platforms.`,
335
- )
336
- .option(
337
- `--color <color>`,
338
- `Color for push notification. Available only for Android platforms.`,
339
- )
340
- .option(
341
- `--tag <tag>`,
342
- `Tag for push notification. Available only for Android platforms.`,
343
- )
344
- .option(
345
- `--badge <badge>`,
346
- `Badge for push notification. Available only for iOS platforms.`,
347
- parseInteger,
348
- )
172
+ .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>.`)
173
+ .option(`--icon <icon>`, `Icon for push notification. Available only for Android and Web platforms.`)
174
+ .option(`--sound <sound>`, `Sound for push notification. Available only for Android and iOS platforms.`)
175
+ .option(`--color <color>`, `Color for push notification. Available only for Android platforms.`)
176
+ .option(`--tag <tag>`, `Tag for push notification. Available only for Android platforms.`)
177
+ .option(`--badge <badge>`, `Badge for push notification. Available only for iOS platforms.`, parseInteger)
349
178
  .option(
350
179
  `--draft [value]`,
351
180
  `Is message a draft`,
352
181
  (value: string | undefined) =>
353
182
  value === undefined ? true : parseBool(value),
354
183
  )
355
- .option(
356
- `--scheduled-at <scheduled-at>`,
357
- `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.`,
358
- )
184
+ .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.`)
359
185
  .option(
360
186
  `--content-available [value]`,
361
187
  `If set to true, the notification will be delivered in the background. Available only for iOS Platform.`,
@@ -368,68 +194,18 @@ messaging
368
194
  (value: string | undefined) =>
369
195
  value === undefined ? true : parseBool(value),
370
196
  )
371
- .option(
372
- `--priority <priority>`,
373
- `Set the notification priority. "normal" will consider device battery state and may send notifications later. "high" will always attempt to immediately deliver the notification.`,
374
- )
197
+ .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.`)
375
198
  .action(
376
199
  actionRunner(
377
- async ({
378
- messageId,
379
- topics,
380
- users,
381
- targets,
382
- title,
383
- body,
384
- data,
385
- action,
386
- image,
387
- icon,
388
- sound,
389
- color,
390
- tag,
391
- badge,
392
- draft,
393
- scheduledAt,
394
- contentAvailable,
395
- critical,
396
- priority,
397
- }) =>
398
- await (
399
- await getMessagingClient()
400
- ).updatePush(
401
- messageId,
402
- topics,
403
- users,
404
- targets,
405
- title,
406
- body,
407
- JSON.parse(data),
408
- action,
409
- image,
410
- icon,
411
- sound,
412
- color,
413
- tag,
414
- badge,
415
- draft,
416
- scheduledAt,
417
- contentAvailable,
418
- critical,
419
- priority as MessagePriority,
420
- ),
200
+ async ({ messageId, topics, users, targets, title, body, data, action, image, icon, sound, color, tag, badge, draft, scheduledAt, contentAvailable, critical, priority }) =>
201
+ parse(await (await getMessagingClient()).updatePush(messageId, topics, users, targets, title, body, JSON.parse(data), action, image, icon, sound, color, tag, badge, draft, scheduledAt, contentAvailable, critical, priority as MessagePriority)),
421
202
  ),
422
203
  );
423
204
 
424
205
  messaging
425
206
  .command(`create-sms`)
426
- .description(
427
- `[**DEPRECATED** - This command is deprecated. Please use 'messaging createSms' instead] Create a new SMS message.`,
428
- )
429
- .requiredOption(
430
- `--message-id <message-id>`,
431
- `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.`,
432
- )
207
+ .description(`Create a new SMS message.`)
208
+ .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.`)
433
209
  .requiredOption(`--content <content>`, `SMS Content.`)
434
210
  .option(`--topics [topics...]`, `List of Topic IDs.`)
435
211
  .option(`--users [users...]`, `List of User IDs.`)
@@ -440,41 +216,18 @@ messaging
440
216
  (value: string | undefined) =>
441
217
  value === undefined ? true : parseBool(value),
442
218
  )
443
- .option(
444
- `--scheduled-at <scheduled-at>`,
445
- `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.`,
446
- )
219
+ .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.`)
447
220
  .action(
448
221
  actionRunner(
449
- async ({
450
- messageId,
451
- content,
452
- topics,
453
- users,
454
- targets,
455
- draft,
456
- scheduledAt,
457
- }) =>
458
- await (
459
- await getMessagingClient()
460
- ).createSms(
461
- messageId,
462
- content,
463
- topics,
464
- users,
465
- targets,
466
- draft,
467
- scheduledAt,
468
- ),
222
+ async ({ messageId, content, topics, users, targets, draft, scheduledAt }) =>
223
+ parse(await (await getMessagingClient()).createSms(messageId, content, topics, users, targets, draft, scheduledAt)),
469
224
  ),
470
225
  );
471
226
 
472
227
  messaging
473
228
  .command(`update-sms`)
474
- .description(
475
- `[**DEPRECATED** - This command is deprecated. Please use 'messaging updateSms' instead] 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.
476
- `,
477
- )
229
+ .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.
230
+ `)
478
231
  .requiredOption(`--message-id <message-id>`, `Message ID.`)
479
232
  .option(`--topics [topics...]`, `List of Topic IDs.`)
480
233
  .option(`--users [users...]`, `List of User IDs.`)
@@ -486,59 +239,34 @@ messaging
486
239
  (value: string | undefined) =>
487
240
  value === undefined ? true : parseBool(value),
488
241
  )
489
- .option(
490
- `--scheduled-at <scheduled-at>`,
491
- `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.`,
492
- )
242
+ .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.`)
493
243
  .action(
494
244
  actionRunner(
495
- async ({
496
- messageId,
497
- topics,
498
- users,
499
- targets,
500
- content,
501
- draft,
502
- scheduledAt,
503
- }) =>
504
- await (
505
- await getMessagingClient()
506
- ).updateSms(
507
- messageId,
508
- topics,
509
- users,
510
- targets,
511
- content,
512
- draft,
513
- scheduledAt,
514
- ),
245
+ async ({ messageId, topics, users, targets, content, draft, scheduledAt }) =>
246
+ parse(await (await getMessagingClient()).updateSms(messageId, topics, users, targets, content, draft, scheduledAt)),
515
247
  ),
516
248
  );
517
249
 
518
250
  messaging
519
251
  .command(`get-message`)
520
- .description(
521
- `Get a message by its unique ID.
522
- `,
523
- )
252
+ .description(`Get a message by its unique ID.
253
+ `)
524
254
  .requiredOption(`--message-id <message-id>`, `Message ID.`)
525
255
  .action(
526
256
  actionRunner(
527
257
  async ({ messageId }) =>
528
- await (await getMessagingClient()).getMessage(messageId),
258
+ parse(await (await getMessagingClient()).getMessage(messageId)),
529
259
  ),
530
260
  );
531
261
 
532
262
  messaging
533
263
  .command(`delete`)
534
- .description(
535
- `Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.`,
536
- )
264
+ .description(`Delete a message. If the message is not a draft or scheduled, but has been sent, this will not recall the message.`)
537
265
  .requiredOption(`--message-id <message-id>`, `Message ID.`)
538
266
  .action(
539
267
  actionRunner(
540
268
  async ({ messageId }) =>
541
- await (await getMessagingClient()).delete(messageId),
269
+ parse(await (await getMessagingClient()).delete(messageId)),
542
270
  ),
543
271
  );
544
272
 
@@ -546,10 +274,7 @@ messaging
546
274
  .command(`list-message-logs`)
547
275
  .description(`Get the message activity logs listed by its unique ID.`)
548
276
  .requiredOption(`--message-id <message-id>`, `Message ID.`)
549
- .option(
550
- `--queries [queries...]`,
551
- `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`,
552
- )
277
+ .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`)
553
278
  .option(
554
279
  `--total [value]`,
555
280
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -559,9 +284,7 @@ messaging
559
284
  .action(
560
285
  actionRunner(
561
286
  async ({ messageId, queries, total }) =>
562
- await (
563
- await getMessagingClient()
564
- ).listMessageLogs(messageId, queries, total),
287
+ parse(await (await getMessagingClient()).listMessageLogs(messageId, queries, total)),
565
288
  ),
566
289
  );
567
290
 
@@ -569,10 +292,7 @@ messaging
569
292
  .command(`list-targets`)
570
293
  .description(`Get a list of the targets associated with a message.`)
571
294
  .requiredOption(`--message-id <message-id>`, `Message ID.`)
572
- .option(
573
- `--queries [queries...]`,
574
- `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`,
575
- )
295
+ .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`)
576
296
  .option(
577
297
  `--total [value]`,
578
298
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -582,23 +302,15 @@ messaging
582
302
  .action(
583
303
  actionRunner(
584
304
  async ({ messageId, queries, total }) =>
585
- await (
586
- await getMessagingClient()
587
- ).listTargets(messageId, queries, total),
305
+ parse(await (await getMessagingClient()).listTargets(messageId, queries, total)),
588
306
  ),
589
307
  );
590
308
 
591
309
  messaging
592
310
  .command(`list-providers`)
593
311
  .description(`Get a list of all providers from the current Appwrite project.`)
594
- .option(
595
- `--queries [queries...]`,
596
- `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`,
597
- )
598
- .option(
599
- `--search <search>`,
600
- `Search term to filter your list results. Max length: 256 chars.`,
601
- )
312
+ .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`)
313
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
602
314
  .option(
603
315
  `--total [value]`,
604
316
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -608,21 +320,14 @@ messaging
608
320
  .action(
609
321
  actionRunner(
610
322
  async ({ queries, search, total }) =>
611
- await (
612
- await getMessagingClient()
613
- ).listProviders(queries, search, total),
323
+ parse(await (await getMessagingClient()).listProviders(queries, search, total)),
614
324
  ),
615
325
  );
616
326
 
617
327
  messaging
618
328
  .command(`create-apns-provider`)
619
- .description(
620
- `[**DEPRECATED** - This command is deprecated. Please use 'messaging createApnsProvider' instead] Create a new Apple Push Notification service provider.`,
621
- )
622
- .requiredOption(
623
- `--provider-id <provider-id>`,
624
- `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.`,
625
- )
329
+ .description(`Create a new Apple Push Notification service provider.`)
330
+ .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.`)
626
331
  .requiredOption(`--name <name>`, `Provider name.`)
627
332
  .option(`--auth-key <auth-key>`, `APNS authentication key.`)
628
333
  .option(`--auth-key-id <auth-key-id>`, `APNS authentication key ID.`)
@@ -642,36 +347,14 @@ messaging
642
347
  )
643
348
  .action(
644
349
  actionRunner(
645
- async ({
646
- providerId,
647
- name,
648
- authKey,
649
- authKeyId,
650
- teamId,
651
- bundleId,
652
- sandbox,
653
- enabled,
654
- }) =>
655
- await (
656
- await getMessagingClient()
657
- ).createApnsProvider(
658
- providerId,
659
- name,
660
- authKey,
661
- authKeyId,
662
- teamId,
663
- bundleId,
664
- sandbox,
665
- enabled,
666
- ),
350
+ async ({ providerId, name, authKey, authKeyId, teamId, bundleId, sandbox, enabled }) =>
351
+ parse(await (await getMessagingClient()).createApnsProvider(providerId, name, authKey, authKeyId, teamId, bundleId, sandbox, enabled)),
667
352
  ),
668
353
  );
669
354
 
670
355
  messaging
671
356
  .command(`update-apns-provider`)
672
- .description(
673
- `[**DEPRECATED** - This command is deprecated. Please use 'messaging updateApnsProvider' instead] Update a Apple Push Notification service provider by its unique ID.`,
674
- )
357
+ .description(`Update a Apple Push Notification service provider by its unique ID.`)
675
358
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
676
359
  .option(`--name <name>`, `Provider name.`)
677
360
  .option(
@@ -692,45 +375,17 @@ messaging
692
375
  )
693
376
  .action(
694
377
  actionRunner(
695
- async ({
696
- providerId,
697
- name,
698
- enabled,
699
- authKey,
700
- authKeyId,
701
- teamId,
702
- bundleId,
703
- sandbox,
704
- }) =>
705
- await (
706
- await getMessagingClient()
707
- ).updateApnsProvider(
708
- providerId,
709
- name,
710
- enabled,
711
- authKey,
712
- authKeyId,
713
- teamId,
714
- bundleId,
715
- sandbox,
716
- ),
378
+ async ({ providerId, name, enabled, authKey, authKeyId, teamId, bundleId, sandbox }) =>
379
+ parse(await (await getMessagingClient()).updateApnsProvider(providerId, name, enabled, authKey, authKeyId, teamId, bundleId, sandbox)),
717
380
  ),
718
381
  );
719
382
 
720
383
  messaging
721
384
  .command(`create-fcm-provider`)
722
- .description(
723
- `[**DEPRECATED** - This command is deprecated. Please use 'messaging createFcmProvider' instead] Create a new Firebase Cloud Messaging provider.`,
724
- )
725
- .requiredOption(
726
- `--provider-id <provider-id>`,
727
- `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.`,
728
- )
385
+ .description(`Create a new Firebase Cloud Messaging provider.`)
386
+ .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.`)
729
387
  .requiredOption(`--name <name>`, `Provider name.`)
730
- .option(
731
- `--service-account-json <service-account-json>`,
732
- `FCM service account JSON.`,
733
- )
388
+ .option(`--service-account-json <service-account-json>`, `FCM service account JSON.`)
734
389
  .option(
735
390
  `--enabled [value]`,
736
391
  `Set as enabled.`,
@@ -739,23 +394,14 @@ messaging
739
394
  )
740
395
  .action(
741
396
  actionRunner(
742
- async ({ providerId, name, serviceAccountJSON, enabled }) =>
743
- await (
744
- await getMessagingClient()
745
- ).createFcmProvider(
746
- providerId,
747
- name,
748
- JSON.parse(serviceAccountJSON),
749
- enabled,
750
- ),
397
+ async ({ providerId, name, serviceAccountJson, enabled }) =>
398
+ parse(await (await getMessagingClient()).createFcmProvider(providerId, name, JSON.parse(serviceAccountJson), enabled)),
751
399
  ),
752
400
  );
753
401
 
754
402
  messaging
755
403
  .command(`update-fcm-provider`)
756
- .description(
757
- `[**DEPRECATED** - This command is deprecated. Please use 'messaging updateFcmProvider' instead] Update a Firebase Cloud Messaging provider by its unique ID.`,
758
- )
404
+ .description(`Update a Firebase Cloud Messaging provider by its unique ID.`)
759
405
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
760
406
  .option(`--name <name>`, `Provider name.`)
761
407
  .option(
@@ -764,31 +410,18 @@ messaging
764
410
  (value: string | undefined) =>
765
411
  value === undefined ? true : parseBool(value),
766
412
  )
767
- .option(
768
- `--service-account-json <service-account-json>`,
769
- `FCM service account JSON.`,
770
- )
413
+ .option(`--service-account-json <service-account-json>`, `FCM service account JSON.`)
771
414
  .action(
772
415
  actionRunner(
773
- async ({ providerId, name, enabled, serviceAccountJSON }) =>
774
- await (
775
- await getMessagingClient()
776
- ).updateFcmProvider(
777
- providerId,
778
- name,
779
- enabled,
780
- JSON.parse(serviceAccountJSON),
781
- ),
416
+ async ({ providerId, name, enabled, serviceAccountJson }) =>
417
+ parse(await (await getMessagingClient()).updateFcmProvider(providerId, name, enabled, JSON.parse(serviceAccountJson))),
782
418
  ),
783
419
  );
784
420
 
785
421
  messaging
786
422
  .command(`create-mailgun-provider`)
787
423
  .description(`Create a new Mailgun provider.`)
788
- .requiredOption(
789
- `--provider-id <provider-id>`,
790
- `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.`,
791
- )
424
+ .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.`)
792
425
  .requiredOption(`--name <name>`, `Provider name.`)
793
426
  .option(`--api-key <api-key>`, `Mailgun API Key.`)
794
427
  .option(`--domain <domain>`, `Mailgun Domain.`)
@@ -800,14 +433,8 @@ messaging
800
433
  )
801
434
  .option(`--from-name <from-name>`, `Sender Name.`)
802
435
  .option(`--from-email <from-email>`, `Sender email address.`)
803
- .option(
804
- `--reply-to-name <reply-to-name>`,
805
- `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.`,
806
- )
807
- .option(
808
- `--reply-to-email <reply-to-email>`,
809
- `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.`,
810
- )
436
+ .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.`)
437
+ .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.`)
811
438
  .option(
812
439
  `--enabled [value]`,
813
440
  `Set as enabled.`,
@@ -816,32 +443,8 @@ messaging
816
443
  )
817
444
  .action(
818
445
  actionRunner(
819
- async ({
820
- providerId,
821
- name,
822
- apiKey,
823
- domain,
824
- isEuRegion,
825
- fromName,
826
- fromEmail,
827
- replyToName,
828
- replyToEmail,
829
- enabled,
830
- }) =>
831
- await (
832
- await getMessagingClient()
833
- ).createMailgunProvider(
834
- providerId,
835
- name,
836
- apiKey,
837
- domain,
838
- isEuRegion,
839
- fromName,
840
- fromEmail,
841
- replyToName,
842
- replyToEmail,
843
- enabled,
844
- ),
446
+ async ({ providerId, name, apiKey, domain, isEuRegion, fromName, fromEmail, replyToName, replyToEmail, enabled }) =>
447
+ parse(await (await getMessagingClient()).createMailgunProvider(providerId, name, apiKey, domain, isEuRegion, fromName, fromEmail, replyToName, replyToEmail, enabled)),
845
448
  ),
846
449
  );
847
450
 
@@ -866,52 +469,19 @@ messaging
866
469
  )
867
470
  .option(`--from-name <from-name>`, `Sender Name.`)
868
471
  .option(`--from-email <from-email>`, `Sender email address.`)
869
- .option(
870
- `--reply-to-name <reply-to-name>`,
871
- `Name set in the reply to field for the mail. Default value is sender name.`,
872
- )
873
- .option(
874
- `--reply-to-email <reply-to-email>`,
875
- `Email set in the reply to field for the mail. Default value is sender email.`,
876
- )
472
+ .option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name.`)
473
+ .option(`--reply-to-email <reply-to-email>`, `Email set in the reply to field for the mail. Default value is sender email.`)
877
474
  .action(
878
475
  actionRunner(
879
- async ({
880
- providerId,
881
- name,
882
- apiKey,
883
- domain,
884
- isEuRegion,
885
- enabled,
886
- fromName,
887
- fromEmail,
888
- replyToName,
889
- replyToEmail,
890
- }) =>
891
- await (
892
- await getMessagingClient()
893
- ).updateMailgunProvider(
894
- providerId,
895
- name,
896
- apiKey,
897
- domain,
898
- isEuRegion,
899
- enabled,
900
- fromName,
901
- fromEmail,
902
- replyToName,
903
- replyToEmail,
904
- ),
476
+ async ({ providerId, name, apiKey, domain, isEuRegion, enabled, fromName, fromEmail, replyToName, replyToEmail }) =>
477
+ parse(await (await getMessagingClient()).updateMailgunProvider(providerId, name, apiKey, domain, isEuRegion, enabled, fromName, fromEmail, replyToName, replyToEmail)),
905
478
  ),
906
479
  );
907
480
 
908
481
  messaging
909
- .command(`create-msg91-provider`)
482
+ .command(`create-msg-91-provider`)
910
483
  .description(`Create a new MSG91 provider.`)
911
- .requiredOption(
912
- `--provider-id <provider-id>`,
913
- `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.`,
914
- )
484
+ .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.`)
915
485
  .requiredOption(`--name <name>`, `Provider name.`)
916
486
  .option(`--template-id <template-id>`, `Msg91 template ID`)
917
487
  .option(`--sender-id <sender-id>`, `Msg91 sender ID.`)
@@ -925,21 +495,12 @@ messaging
925
495
  .action(
926
496
  actionRunner(
927
497
  async ({ providerId, name, templateId, senderId, authKey, enabled }) =>
928
- await (
929
- await getMessagingClient()
930
- ).createMsg91Provider(
931
- providerId,
932
- name,
933
- templateId,
934
- senderId,
935
- authKey,
936
- enabled,
937
- ),
498
+ parse(await (await getMessagingClient()).createMsg91Provider(providerId, name, templateId, senderId, authKey, enabled)),
938
499
  ),
939
500
  );
940
501
 
941
502
  messaging
942
- .command(`update-msg91-provider`)
503
+ .command(`update-msg-91-provider`)
943
504
  .description(`Update a MSG91 provider by its unique ID.`)
944
505
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
945
506
  .option(`--name <name>`, `Provider name.`)
@@ -955,38 +516,20 @@ messaging
955
516
  .action(
956
517
  actionRunner(
957
518
  async ({ providerId, name, enabled, templateId, senderId, authKey }) =>
958
- await (
959
- await getMessagingClient()
960
- ).updateMsg91Provider(
961
- providerId,
962
- name,
963
- enabled,
964
- templateId,
965
- senderId,
966
- authKey,
967
- ),
519
+ parse(await (await getMessagingClient()).updateMsg91Provider(providerId, name, enabled, templateId, senderId, authKey)),
968
520
  ),
969
521
  );
970
522
 
971
523
  messaging
972
524
  .command(`create-resend-provider`)
973
525
  .description(`Create a new Resend provider.`)
974
- .requiredOption(
975
- `--provider-id <provider-id>`,
976
- `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.`,
977
- )
526
+ .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.`)
978
527
  .requiredOption(`--name <name>`, `Provider name.`)
979
528
  .option(`--api-key <api-key>`, `Resend API key.`)
980
529
  .option(`--from-name <from-name>`, `Sender Name.`)
981
530
  .option(`--from-email <from-email>`, `Sender email address.`)
982
- .option(
983
- `--reply-to-name <reply-to-name>`,
984
- `Name set in the reply to field for the mail. Default value is sender name.`,
985
- )
986
- .option(
987
- `--reply-to-email <reply-to-email>`,
988
- `Email set in the reply to field for the mail. Default value is sender email.`,
989
- )
531
+ .option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name.`)
532
+ .option(`--reply-to-email <reply-to-email>`, `Email set in the reply to field for the mail. Default value is sender email.`)
990
533
  .option(
991
534
  `--enabled [value]`,
992
535
  `Set as enabled.`,
@@ -995,28 +538,8 @@ messaging
995
538
  )
996
539
  .action(
997
540
  actionRunner(
998
- async ({
999
- providerId,
1000
- name,
1001
- apiKey,
1002
- fromName,
1003
- fromEmail,
1004
- replyToName,
1005
- replyToEmail,
1006
- enabled,
1007
- }) =>
1008
- await (
1009
- await getMessagingClient()
1010
- ).createResendProvider(
1011
- providerId,
1012
- name,
1013
- apiKey,
1014
- fromName,
1015
- fromEmail,
1016
- replyToName,
1017
- replyToEmail,
1018
- enabled,
1019
- ),
541
+ async ({ providerId, name, apiKey, fromName, fromEmail, replyToName, replyToEmail, enabled }) =>
542
+ parse(await (await getMessagingClient()).createResendProvider(providerId, name, apiKey, fromName, fromEmail, replyToName, replyToEmail, enabled)),
1020
543
  ),
1021
544
  );
1022
545
 
@@ -1034,60 +557,25 @@ messaging
1034
557
  .option(`--api-key <api-key>`, `Resend API key.`)
1035
558
  .option(`--from-name <from-name>`, `Sender Name.`)
1036
559
  .option(`--from-email <from-email>`, `Sender email address.`)
1037
- .option(
1038
- `--reply-to-name <reply-to-name>`,
1039
- `Name set in the Reply To field for the mail. Default value is Sender Name.`,
1040
- )
1041
- .option(
1042
- `--reply-to-email <reply-to-email>`,
1043
- `Email set in the Reply To field for the mail. Default value is Sender Email.`,
1044
- )
560
+ .option(`--reply-to-name <reply-to-name>`, `Name set in the Reply To field for the mail. Default value is Sender Name.`)
561
+ .option(`--reply-to-email <reply-to-email>`, `Email set in the Reply To field for the mail. Default value is Sender Email.`)
1045
562
  .action(
1046
563
  actionRunner(
1047
- async ({
1048
- providerId,
1049
- name,
1050
- enabled,
1051
- apiKey,
1052
- fromName,
1053
- fromEmail,
1054
- replyToName,
1055
- replyToEmail,
1056
- }) =>
1057
- await (
1058
- await getMessagingClient()
1059
- ).updateResendProvider(
1060
- providerId,
1061
- name,
1062
- enabled,
1063
- apiKey,
1064
- fromName,
1065
- fromEmail,
1066
- replyToName,
1067
- replyToEmail,
1068
- ),
564
+ async ({ providerId, name, enabled, apiKey, fromName, fromEmail, replyToName, replyToEmail }) =>
565
+ parse(await (await getMessagingClient()).updateResendProvider(providerId, name, enabled, apiKey, fromName, fromEmail, replyToName, replyToEmail)),
1069
566
  ),
1070
567
  );
1071
568
 
1072
569
  messaging
1073
570
  .command(`create-sendgrid-provider`)
1074
571
  .description(`Create a new Sendgrid provider.`)
1075
- .requiredOption(
1076
- `--provider-id <provider-id>`,
1077
- `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.`,
1078
- )
572
+ .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.`)
1079
573
  .requiredOption(`--name <name>`, `Provider name.`)
1080
574
  .option(`--api-key <api-key>`, `Sendgrid API key.`)
1081
575
  .option(`--from-name <from-name>`, `Sender Name.`)
1082
576
  .option(`--from-email <from-email>`, `Sender email address.`)
1083
- .option(
1084
- `--reply-to-name <reply-to-name>`,
1085
- `Name set in the reply to field for the mail. Default value is sender name.`,
1086
- )
1087
- .option(
1088
- `--reply-to-email <reply-to-email>`,
1089
- `Email set in the reply to field for the mail. Default value is sender email.`,
1090
- )
577
+ .option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name.`)
578
+ .option(`--reply-to-email <reply-to-email>`, `Email set in the reply to field for the mail. Default value is sender email.`)
1091
579
  .option(
1092
580
  `--enabled [value]`,
1093
581
  `Set as enabled.`,
@@ -1096,28 +584,8 @@ messaging
1096
584
  )
1097
585
  .action(
1098
586
  actionRunner(
1099
- async ({
1100
- providerId,
1101
- name,
1102
- apiKey,
1103
- fromName,
1104
- fromEmail,
1105
- replyToName,
1106
- replyToEmail,
1107
- enabled,
1108
- }) =>
1109
- await (
1110
- await getMessagingClient()
1111
- ).createSendgridProvider(
1112
- providerId,
1113
- name,
1114
- apiKey,
1115
- fromName,
1116
- fromEmail,
1117
- replyToName,
1118
- replyToEmail,
1119
- enabled,
1120
- ),
587
+ async ({ providerId, name, apiKey, fromName, fromEmail, replyToName, replyToEmail, enabled }) =>
588
+ parse(await (await getMessagingClient()).createSendgridProvider(providerId, name, apiKey, fromName, fromEmail, replyToName, replyToEmail, enabled)),
1121
589
  ),
1122
590
  );
1123
591
 
@@ -1135,62 +603,25 @@ messaging
1135
603
  .option(`--api-key <api-key>`, `Sendgrid API key.`)
1136
604
  .option(`--from-name <from-name>`, `Sender Name.`)
1137
605
  .option(`--from-email <from-email>`, `Sender email address.`)
1138
- .option(
1139
- `--reply-to-name <reply-to-name>`,
1140
- `Name set in the Reply To field for the mail. Default value is Sender Name.`,
1141
- )
1142
- .option(
1143
- `--reply-to-email <reply-to-email>`,
1144
- `Email set in the Reply To field for the mail. Default value is Sender Email.`,
1145
- )
606
+ .option(`--reply-to-name <reply-to-name>`, `Name set in the Reply To field for the mail. Default value is Sender Name.`)
607
+ .option(`--reply-to-email <reply-to-email>`, `Email set in the Reply To field for the mail. Default value is Sender Email.`)
1146
608
  .action(
1147
609
  actionRunner(
1148
- async ({
1149
- providerId,
1150
- name,
1151
- enabled,
1152
- apiKey,
1153
- fromName,
1154
- fromEmail,
1155
- replyToName,
1156
- replyToEmail,
1157
- }) =>
1158
- await (
1159
- await getMessagingClient()
1160
- ).updateSendgridProvider(
1161
- providerId,
1162
- name,
1163
- enabled,
1164
- apiKey,
1165
- fromName,
1166
- fromEmail,
1167
- replyToName,
1168
- replyToEmail,
1169
- ),
610
+ async ({ providerId, name, enabled, apiKey, fromName, fromEmail, replyToName, replyToEmail }) =>
611
+ parse(await (await getMessagingClient()).updateSendgridProvider(providerId, name, enabled, apiKey, fromName, fromEmail, replyToName, replyToEmail)),
1170
612
  ),
1171
613
  );
1172
614
 
1173
615
  messaging
1174
616
  .command(`create-smtp-provider`)
1175
- .description(
1176
- `[**DEPRECATED** - This command is deprecated. Please use 'messaging createSmtpProvider' instead] Create a new SMTP provider.`,
1177
- )
1178
- .requiredOption(
1179
- `--provider-id <provider-id>`,
1180
- `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.`,
1181
- )
617
+ .description(`Create a new SMTP provider.`)
618
+ .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.`)
1182
619
  .requiredOption(`--name <name>`, `Provider name.`)
1183
- .requiredOption(
1184
- `--host <host>`,
1185
- `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.`,
1186
- )
620
+ .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.`)
1187
621
  .option(`--port <port>`, `The default SMTP server port.`, parseInteger)
1188
622
  .option(`--username <username>`, `Authentication username.`)
1189
623
  .option(`--password <password>`, `Authentication password.`)
1190
- .option(
1191
- `--encryption <encryption>`,
1192
- `Encryption type. Can be omitted, 'ssl', or 'tls'`,
1193
- )
624
+ .option(`--encryption <encryption>`, `Encryption type. Can be omitted, 'ssl', or 'tls'`)
1194
625
  .option(
1195
626
  `--auto-tls [value]`,
1196
627
  `Enable SMTP AutoTLS feature.`,
@@ -1200,14 +631,8 @@ messaging
1200
631
  .option(`--mailer <mailer>`, `The value to use for the X-Mailer header.`)
1201
632
  .option(`--from-name <from-name>`, `Sender Name.`)
1202
633
  .option(`--from-email <from-email>`, `Sender email address.`)
1203
- .option(
1204
- `--reply-to-name <reply-to-name>`,
1205
- `Name set in the reply to field for the mail. Default value is sender name.`,
1206
- )
1207
- .option(
1208
- `--reply-to-email <reply-to-email>`,
1209
- `Email set in the reply to field for the mail. Default value is sender email.`,
1210
- )
634
+ .option(`--reply-to-name <reply-to-name>`, `Name set in the reply to field for the mail. Default value is sender name.`)
635
+ .option(`--reply-to-email <reply-to-email>`, `Email set in the reply to field for the mail. Default value is sender email.`)
1211
636
  .option(
1212
637
  `--enabled [value]`,
1213
638
  `Set as enabled.`,
@@ -1216,54 +641,17 @@ messaging
1216
641
  )
1217
642
  .action(
1218
643
  actionRunner(
1219
- async ({
1220
- providerId,
1221
- name,
1222
- host,
1223
- port,
1224
- username,
1225
- password,
1226
- encryption,
1227
- autoTLS,
1228
- mailer,
1229
- fromName,
1230
- fromEmail,
1231
- replyToName,
1232
- replyToEmail,
1233
- enabled,
1234
- }) =>
1235
- await (
1236
- await getMessagingClient()
1237
- ).createSmtpProvider(
1238
- providerId,
1239
- name,
1240
- host,
1241
- port,
1242
- username,
1243
- password,
1244
- encryption as SmtpEncryption,
1245
- autoTLS,
1246
- mailer,
1247
- fromName,
1248
- fromEmail,
1249
- replyToName,
1250
- replyToEmail,
1251
- enabled,
1252
- ),
644
+ async ({ providerId, name, host, port, username, password, encryption, autoTls, mailer, fromName, fromEmail, replyToName, replyToEmail, enabled }) =>
645
+ parse(await (await getMessagingClient()).createSmtpProvider(providerId, name, host, port, username, password, encryption as SmtpEncryption, autoTls, mailer, fromName, fromEmail, replyToName, replyToEmail, enabled)),
1253
646
  ),
1254
647
  );
1255
648
 
1256
649
  messaging
1257
650
  .command(`update-smtp-provider`)
1258
- .description(
1259
- `[**DEPRECATED** - This command is deprecated. Please use 'messaging updateSmtpProvider' instead] Update a SMTP provider by its unique ID.`,
1260
- )
651
+ .description(`Update a SMTP provider by its unique ID.`)
1261
652
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
1262
653
  .option(`--name <name>`, `Provider name.`)
1263
- .option(
1264
- `--host <host>`,
1265
- `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.`,
1266
- )
654
+ .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.`)
1267
655
  .option(`--port <port>`, `SMTP port.`, parseInteger)
1268
656
  .option(`--username <username>`, `Authentication username.`)
1269
657
  .option(`--password <password>`, `Authentication password.`)
@@ -1277,14 +665,8 @@ messaging
1277
665
  .option(`--mailer <mailer>`, `The value to use for the X-Mailer header.`)
1278
666
  .option(`--from-name <from-name>`, `Sender Name.`)
1279
667
  .option(`--from-email <from-email>`, `Sender email address.`)
1280
- .option(
1281
- `--reply-to-name <reply-to-name>`,
1282
- `Name set in the Reply To field for the mail. Default value is Sender Name.`,
1283
- )
1284
- .option(
1285
- `--reply-to-email <reply-to-email>`,
1286
- `Email set in the Reply To field for the mail. Default value is Sender Email.`,
1287
- )
668
+ .option(`--reply-to-name <reply-to-name>`, `Name set in the Reply To field for the mail. Default value is Sender Name.`)
669
+ .option(`--reply-to-email <reply-to-email>`, `Email set in the Reply To field for the mail. Default value is Sender Email.`)
1288
670
  .option(
1289
671
  `--enabled [value]`,
1290
672
  `Set as enabled.`,
@@ -1293,55 +675,17 @@ messaging
1293
675
  )
1294
676
  .action(
1295
677
  actionRunner(
1296
- async ({
1297
- providerId,
1298
- name,
1299
- host,
1300
- port,
1301
- username,
1302
- password,
1303
- encryption,
1304
- autoTLS,
1305
- mailer,
1306
- fromName,
1307
- fromEmail,
1308
- replyToName,
1309
- replyToEmail,
1310
- enabled,
1311
- }) =>
1312
- await (
1313
- await getMessagingClient()
1314
- ).updateSmtpProvider(
1315
- providerId,
1316
- name,
1317
- host,
1318
- port,
1319
- username,
1320
- password,
1321
- encryption as SmtpEncryption,
1322
- autoTLS,
1323
- mailer,
1324
- fromName,
1325
- fromEmail,
1326
- replyToName,
1327
- replyToEmail,
1328
- enabled,
1329
- ),
678
+ async ({ providerId, name, host, port, username, password, encryption, autoTls, mailer, fromName, fromEmail, replyToName, replyToEmail, enabled }) =>
679
+ parse(await (await getMessagingClient()).updateSmtpProvider(providerId, name, host, port, username, password, encryption as SmtpEncryption, autoTls, mailer, fromName, fromEmail, replyToName, replyToEmail, enabled)),
1330
680
  ),
1331
681
  );
1332
682
 
1333
683
  messaging
1334
684
  .command(`create-telesign-provider`)
1335
685
  .description(`Create a new Telesign provider.`)
1336
- .requiredOption(
1337
- `--provider-id <provider-id>`,
1338
- `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.`,
1339
- )
686
+ .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.`)
1340
687
  .requiredOption(`--name <name>`, `Provider name.`)
1341
- .option(
1342
- `--from <from>`,
1343
- `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`,
1344
- )
688
+ .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
1345
689
  .option(`--customer-id <customer-id>`, `Telesign customer ID.`)
1346
690
  .option(`--api-key <api-key>`, `Telesign API key.`)
1347
691
  .option(
@@ -1353,16 +697,7 @@ messaging
1353
697
  .action(
1354
698
  actionRunner(
1355
699
  async ({ providerId, name, from, customerId, apiKey, enabled }) =>
1356
- await (
1357
- await getMessagingClient()
1358
- ).createTelesignProvider(
1359
- providerId,
1360
- name,
1361
- from,
1362
- customerId,
1363
- apiKey,
1364
- enabled,
1365
- ),
700
+ parse(await (await getMessagingClient()).createTelesignProvider(providerId, name, from, customerId, apiKey, enabled)),
1366
701
  ),
1367
702
  );
1368
703
 
@@ -1383,31 +718,16 @@ messaging
1383
718
  .action(
1384
719
  actionRunner(
1385
720
  async ({ providerId, name, enabled, customerId, apiKey, from }) =>
1386
- await (
1387
- await getMessagingClient()
1388
- ).updateTelesignProvider(
1389
- providerId,
1390
- name,
1391
- enabled,
1392
- customerId,
1393
- apiKey,
1394
- from,
1395
- ),
721
+ parse(await (await getMessagingClient()).updateTelesignProvider(providerId, name, enabled, customerId, apiKey, from)),
1396
722
  ),
1397
723
  );
1398
724
 
1399
725
  messaging
1400
726
  .command(`create-textmagic-provider`)
1401
727
  .description(`Create a new Textmagic provider.`)
1402
- .requiredOption(
1403
- `--provider-id <provider-id>`,
1404
- `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.`,
1405
- )
728
+ .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.`)
1406
729
  .requiredOption(`--name <name>`, `Provider name.`)
1407
- .option(
1408
- `--from <from>`,
1409
- `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`,
1410
- )
730
+ .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
1411
731
  .option(`--username <username>`, `Textmagic username.`)
1412
732
  .option(`--api-key <api-key>`, `Textmagic apiKey.`)
1413
733
  .option(
@@ -1419,16 +739,7 @@ messaging
1419
739
  .action(
1420
740
  actionRunner(
1421
741
  async ({ providerId, name, from, username, apiKey, enabled }) =>
1422
- await (
1423
- await getMessagingClient()
1424
- ).createTextmagicProvider(
1425
- providerId,
1426
- name,
1427
- from,
1428
- username,
1429
- apiKey,
1430
- enabled,
1431
- ),
742
+ parse(await (await getMessagingClient()).createTextmagicProvider(providerId, name, from, username, apiKey, enabled)),
1432
743
  ),
1433
744
  );
1434
745
 
@@ -1449,31 +760,16 @@ messaging
1449
760
  .action(
1450
761
  actionRunner(
1451
762
  async ({ providerId, name, enabled, username, apiKey, from }) =>
1452
- await (
1453
- await getMessagingClient()
1454
- ).updateTextmagicProvider(
1455
- providerId,
1456
- name,
1457
- enabled,
1458
- username,
1459
- apiKey,
1460
- from,
1461
- ),
763
+ parse(await (await getMessagingClient()).updateTextmagicProvider(providerId, name, enabled, username, apiKey, from)),
1462
764
  ),
1463
765
  );
1464
766
 
1465
767
  messaging
1466
768
  .command(`create-twilio-provider`)
1467
769
  .description(`Create a new Twilio provider.`)
1468
- .requiredOption(
1469
- `--provider-id <provider-id>`,
1470
- `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.`,
1471
- )
770
+ .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.`)
1472
771
  .requiredOption(`--name <name>`, `Provider name.`)
1473
- .option(
1474
- `--from <from>`,
1475
- `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`,
1476
- )
772
+ .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
1477
773
  .option(`--account-sid <account-sid>`, `Twilio account secret ID.`)
1478
774
  .option(`--auth-token <auth-token>`, `Twilio authentication token.`)
1479
775
  .option(
@@ -1485,16 +781,7 @@ messaging
1485
781
  .action(
1486
782
  actionRunner(
1487
783
  async ({ providerId, name, from, accountSid, authToken, enabled }) =>
1488
- await (
1489
- await getMessagingClient()
1490
- ).createTwilioProvider(
1491
- providerId,
1492
- name,
1493
- from,
1494
- accountSid,
1495
- authToken,
1496
- enabled,
1497
- ),
784
+ parse(await (await getMessagingClient()).createTwilioProvider(providerId, name, from, accountSid, authToken, enabled)),
1498
785
  ),
1499
786
  );
1500
787
 
@@ -1515,31 +802,16 @@ messaging
1515
802
  .action(
1516
803
  actionRunner(
1517
804
  async ({ providerId, name, enabled, accountSid, authToken, from }) =>
1518
- await (
1519
- await getMessagingClient()
1520
- ).updateTwilioProvider(
1521
- providerId,
1522
- name,
1523
- enabled,
1524
- accountSid,
1525
- authToken,
1526
- from,
1527
- ),
805
+ parse(await (await getMessagingClient()).updateTwilioProvider(providerId, name, enabled, accountSid, authToken, from)),
1528
806
  ),
1529
807
  );
1530
808
 
1531
809
  messaging
1532
810
  .command(`create-vonage-provider`)
1533
811
  .description(`Create a new Vonage provider.`)
1534
- .requiredOption(
1535
- `--provider-id <provider-id>`,
1536
- `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.`,
1537
- )
812
+ .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.`)
1538
813
  .requiredOption(`--name <name>`, `Provider name.`)
1539
- .option(
1540
- `--from <from>`,
1541
- `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`,
1542
- )
814
+ .option(`--from <from>`, `Sender Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.`)
1543
815
  .option(`--api-key <api-key>`, `Vonage API key.`)
1544
816
  .option(`--api-secret <api-secret>`, `Vonage API secret.`)
1545
817
  .option(
@@ -1551,16 +823,7 @@ messaging
1551
823
  .action(
1552
824
  actionRunner(
1553
825
  async ({ providerId, name, from, apiKey, apiSecret, enabled }) =>
1554
- await (
1555
- await getMessagingClient()
1556
- ).createVonageProvider(
1557
- providerId,
1558
- name,
1559
- from,
1560
- apiKey,
1561
- apiSecret,
1562
- enabled,
1563
- ),
826
+ parse(await (await getMessagingClient()).createVonageProvider(providerId, name, from, apiKey, apiSecret, enabled)),
1564
827
  ),
1565
828
  );
1566
829
 
@@ -1581,30 +844,19 @@ messaging
1581
844
  .action(
1582
845
  actionRunner(
1583
846
  async ({ providerId, name, enabled, apiKey, apiSecret, from }) =>
1584
- await (
1585
- await getMessagingClient()
1586
- ).updateVonageProvider(
1587
- providerId,
1588
- name,
1589
- enabled,
1590
- apiKey,
1591
- apiSecret,
1592
- from,
1593
- ),
847
+ parse(await (await getMessagingClient()).updateVonageProvider(providerId, name, enabled, apiKey, apiSecret, from)),
1594
848
  ),
1595
849
  );
1596
850
 
1597
851
  messaging
1598
852
  .command(`get-provider`)
1599
- .description(
1600
- `Get a provider by its unique ID.
1601
- `,
1602
- )
853
+ .description(`Get a provider by its unique ID.
854
+ `)
1603
855
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
1604
856
  .action(
1605
857
  actionRunner(
1606
858
  async ({ providerId }) =>
1607
- await (await getMessagingClient()).getProvider(providerId),
859
+ parse(await (await getMessagingClient()).getProvider(providerId)),
1608
860
  ),
1609
861
  );
1610
862
 
@@ -1615,7 +867,7 @@ messaging
1615
867
  .action(
1616
868
  actionRunner(
1617
869
  async ({ providerId }) =>
1618
- await (await getMessagingClient()).deleteProvider(providerId),
870
+ parse(await (await getMessagingClient()).deleteProvider(providerId)),
1619
871
  ),
1620
872
  );
1621
873
 
@@ -1623,10 +875,7 @@ messaging
1623
875
  .command(`list-provider-logs`)
1624
876
  .description(`Get the provider activity logs listed by its unique ID.`)
1625
877
  .requiredOption(`--provider-id <provider-id>`, `Provider ID.`)
1626
- .option(
1627
- `--queries [queries...]`,
1628
- `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`,
1629
- )
878
+ .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`)
1630
879
  .option(
1631
880
  `--total [value]`,
1632
881
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -1636,9 +885,7 @@ messaging
1636
885
  .action(
1637
886
  actionRunner(
1638
887
  async ({ providerId, queries, total }) =>
1639
- await (
1640
- await getMessagingClient()
1641
- ).listProviderLogs(providerId, queries, total),
888
+ parse(await (await getMessagingClient()).listProviderLogs(providerId, queries, total)),
1642
889
  ),
1643
890
  );
1644
891
 
@@ -1646,10 +893,7 @@ messaging
1646
893
  .command(`list-subscriber-logs`)
1647
894
  .description(`Get the subscriber activity logs listed by its unique ID.`)
1648
895
  .requiredOption(`--subscriber-id <subscriber-id>`, `Subscriber ID.`)
1649
- .option(
1650
- `--queries [queries...]`,
1651
- `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`,
1652
- )
896
+ .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`)
1653
897
  .option(
1654
898
  `--total [value]`,
1655
899
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -1659,23 +903,15 @@ messaging
1659
903
  .action(
1660
904
  actionRunner(
1661
905
  async ({ subscriberId, queries, total }) =>
1662
- await (
1663
- await getMessagingClient()
1664
- ).listSubscriberLogs(subscriberId, queries, total),
906
+ parse(await (await getMessagingClient()).listSubscriberLogs(subscriberId, queries, total)),
1665
907
  ),
1666
908
  );
1667
909
 
1668
910
  messaging
1669
911
  .command(`list-topics`)
1670
912
  .description(`Get a list of all topics from the current Appwrite project.`)
1671
- .option(
1672
- `--queries [queries...]`,
1673
- `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`,
1674
- )
1675
- .option(
1676
- `--search <search>`,
1677
- `Search term to filter your list results. Max length: 256 chars.`,
1678
- )
913
+ .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`)
914
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1679
915
  .option(
1680
916
  `--total [value]`,
1681
917
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -1685,63 +921,46 @@ messaging
1685
921
  .action(
1686
922
  actionRunner(
1687
923
  async ({ queries, search, total }) =>
1688
- await (await getMessagingClient()).listTopics(queries, search, total),
924
+ parse(await (await getMessagingClient()).listTopics(queries, search, total)),
1689
925
  ),
1690
926
  );
1691
927
 
1692
928
  messaging
1693
929
  .command(`create-topic`)
1694
930
  .description(`Create a new topic.`)
1695
- .requiredOption(
1696
- `--topic-id <topic-id>`,
1697
- `Topic ID. Choose a custom Topic ID or a new Topic ID.`,
1698
- )
931
+ .requiredOption(`--topic-id <topic-id>`, `Topic ID. Choose a custom Topic ID or a new Topic ID.`)
1699
932
  .requiredOption(`--name <name>`, `Topic Name.`)
1700
- .option(
1701
- `--subscribe [subscribe...]`,
1702
- `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.`,
1703
- )
933
+ .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.`)
1704
934
  .action(
1705
935
  actionRunner(
1706
936
  async ({ topicId, name, subscribe }) =>
1707
- await (
1708
- await getMessagingClient()
1709
- ).createTopic(topicId, name, subscribe),
937
+ parse(await (await getMessagingClient()).createTopic(topicId, name, subscribe)),
1710
938
  ),
1711
939
  );
1712
940
 
1713
941
  messaging
1714
942
  .command(`get-topic`)
1715
- .description(
1716
- `Get a topic by its unique ID.
1717
- `,
1718
- )
943
+ .description(`Get a topic by its unique ID.
944
+ `)
1719
945
  .requiredOption(`--topic-id <topic-id>`, `Topic ID.`)
1720
946
  .action(
1721
947
  actionRunner(
1722
948
  async ({ topicId }) =>
1723
- await (await getMessagingClient()).getTopic(topicId),
949
+ parse(await (await getMessagingClient()).getTopic(topicId)),
1724
950
  ),
1725
951
  );
1726
952
 
1727
953
  messaging
1728
954
  .command(`update-topic`)
1729
- .description(
1730
- `Update a topic by its unique ID.
1731
- `,
1732
- )
955
+ .description(`Update a topic by its unique ID.
956
+ `)
1733
957
  .requiredOption(`--topic-id <topic-id>`, `Topic ID.`)
1734
958
  .option(`--name <name>`, `Topic Name.`)
1735
- .option(
1736
- `--subscribe [subscribe...]`,
1737
- `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.`,
1738
- )
959
+ .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.`)
1739
960
  .action(
1740
961
  actionRunner(
1741
962
  async ({ topicId, name, subscribe }) =>
1742
- await (
1743
- await getMessagingClient()
1744
- ).updateTopic(topicId, name, subscribe),
963
+ parse(await (await getMessagingClient()).updateTopic(topicId, name, subscribe)),
1745
964
  ),
1746
965
  );
1747
966
 
@@ -1752,7 +971,7 @@ messaging
1752
971
  .action(
1753
972
  actionRunner(
1754
973
  async ({ topicId }) =>
1755
- await (await getMessagingClient()).deleteTopic(topicId),
974
+ parse(await (await getMessagingClient()).deleteTopic(topicId)),
1756
975
  ),
1757
976
  );
1758
977
 
@@ -1760,10 +979,7 @@ messaging
1760
979
  .command(`list-topic-logs`)
1761
980
  .description(`Get the topic activity logs listed by its unique ID.`)
1762
981
  .requiredOption(`--topic-id <topic-id>`, `Topic ID.`)
1763
- .option(
1764
- `--queries [queries...]`,
1765
- `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`,
1766
- )
982
+ .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`)
1767
983
  .option(
1768
984
  `--total [value]`,
1769
985
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -1773,29 +989,16 @@ messaging
1773
989
  .action(
1774
990
  actionRunner(
1775
991
  async ({ topicId, queries, total }) =>
1776
- await (
1777
- await getMessagingClient()
1778
- ).listTopicLogs(topicId, queries, total),
992
+ parse(await (await getMessagingClient()).listTopicLogs(topicId, queries, total)),
1779
993
  ),
1780
994
  );
1781
995
 
1782
996
  messaging
1783
997
  .command(`list-subscribers`)
1784
- .description(
1785
- `Get a list of all subscribers from the current Appwrite project.`,
1786
- )
1787
- .requiredOption(
1788
- `--topic-id <topic-id>`,
1789
- `Topic ID. The topic ID subscribed to.`,
1790
- )
1791
- .option(
1792
- `--queries [queries...]`,
1793
- `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`,
1794
- )
1795
- .option(
1796
- `--search <search>`,
1797
- `Search term to filter your list results. Max length: 256 chars.`,
1798
- )
998
+ .description(`Get a list of all subscribers from the current Appwrite project.`)
999
+ .requiredOption(`--topic-id <topic-id>`, `Topic ID. The topic ID subscribed to.`)
1000
+ .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`)
1001
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1799
1002
  .option(
1800
1003
  `--total [value]`,
1801
1004
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -1805,67 +1008,45 @@ messaging
1805
1008
  .action(
1806
1009
  actionRunner(
1807
1010
  async ({ topicId, queries, search, total }) =>
1808
- await (
1809
- await getMessagingClient()
1810
- ).listSubscribers(topicId, queries, search, total),
1011
+ parse(await (await getMessagingClient()).listSubscribers(topicId, queries, search, total)),
1811
1012
  ),
1812
1013
  );
1813
1014
 
1814
1015
  messaging
1815
1016
  .command(`create-subscriber`)
1816
1017
  .description(`Create a new subscriber.`)
1817
- .requiredOption(
1818
- `--topic-id <topic-id>`,
1819
- `Topic ID. The topic ID to subscribe to.`,
1820
- )
1821
- .requiredOption(
1822
- `--subscriber-id <subscriber-id>`,
1823
- `Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.`,
1824
- )
1825
- .requiredOption(
1826
- `--target-id <target-id>`,
1827
- `Target ID. The target ID to link to the specified Topic ID.`,
1828
- )
1018
+ .requiredOption(`--topic-id <topic-id>`, `Topic ID. The topic ID to subscribe to.`)
1019
+ .requiredOption(`--subscriber-id <subscriber-id>`, `Subscriber ID. Choose a custom Subscriber ID or a new Subscriber ID.`)
1020
+ .requiredOption(`--target-id <target-id>`, `Target ID. The target ID to link to the specified Topic ID.`)
1829
1021
  .action(
1830
1022
  actionRunner(
1831
1023
  async ({ topicId, subscriberId, targetId }) =>
1832
- await (
1833
- await getMessagingClient()
1834
- ).createSubscriber(topicId, subscriberId, targetId),
1024
+ parse(await (await getMessagingClient()).createSubscriber(topicId, subscriberId, targetId)),
1835
1025
  ),
1836
1026
  );
1837
1027
 
1838
1028
  messaging
1839
1029
  .command(`get-subscriber`)
1840
- .description(
1841
- `Get a subscriber by its unique ID.
1842
- `,
1843
- )
1844
- .requiredOption(
1845
- `--topic-id <topic-id>`,
1846
- `Topic ID. The topic ID subscribed to.`,
1847
- )
1030
+ .description(`Get a subscriber by its unique ID.
1031
+ `)
1032
+ .requiredOption(`--topic-id <topic-id>`, `Topic ID. The topic ID subscribed to.`)
1848
1033
  .requiredOption(`--subscriber-id <subscriber-id>`, `Subscriber ID.`)
1849
1034
  .action(
1850
1035
  actionRunner(
1851
1036
  async ({ topicId, subscriberId }) =>
1852
- await (await getMessagingClient()).getSubscriber(topicId, subscriberId),
1037
+ parse(await (await getMessagingClient()).getSubscriber(topicId, subscriberId)),
1853
1038
  ),
1854
1039
  );
1855
1040
 
1856
1041
  messaging
1857
1042
  .command(`delete-subscriber`)
1858
1043
  .description(`Delete a subscriber by its unique ID.`)
1859
- .requiredOption(
1860
- `--topic-id <topic-id>`,
1861
- `Topic ID. The topic ID subscribed to.`,
1862
- )
1044
+ .requiredOption(`--topic-id <topic-id>`, `Topic ID. The topic ID subscribed to.`)
1863
1045
  .requiredOption(`--subscriber-id <subscriber-id>`, `Subscriber ID.`)
1864
1046
  .action(
1865
1047
  actionRunner(
1866
1048
  async ({ topicId, subscriberId }) =>
1867
- await (
1868
- await getMessagingClient()
1869
- ).deleteSubscriber(topicId, subscriberId),
1049
+ parse(await (await getMessagingClient()).deleteSubscriber(topicId, subscriberId)),
1870
1050
  ),
1871
1051
  );
1052
+