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,11 +3,15 @@ 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";
9
11
  import {
10
12
  Projects,
13
+ Region,
14
+ Api,
11
15
  AuthMethod,
12
16
  OAuthProvider,
13
17
  PlatformType,
@@ -37,17 +41,9 @@ export const projects = new Command("projects")
37
41
 
38
42
  projects
39
43
  .command(`list`)
40
- .description(
41
- `Get a list of all projects. You can use the query params to filter your results. `,
42
- )
43
- .option(
44
- `--queries [queries...]`,
45
- `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, teamId`,
46
- )
47
- .option(
48
- `--search <search>`,
49
- `Search term to filter your list results. Max length: 256 chars.`,
50
- )
44
+ .description(`Get a list of all projects. You can use the query params to filter your results. `)
45
+ .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, teamId`)
46
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
51
47
  .option(
52
48
  `--total [value]`,
53
49
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -57,98 +53,41 @@ projects
57
53
  .action(
58
54
  actionRunner(
59
55
  async ({ queries, search, total }) =>
60
- await (await getProjectsClient()).list(queries, search, total),
56
+ parse(await (await getProjectsClient()).list(queries, search, total)),
61
57
  ),
62
58
  );
63
59
 
64
60
  projects
65
61
  .command(`create`)
66
- .description(
67
- `Create a new project. You can create a maximum of 100 projects per account. `,
68
- )
69
- .requiredOption(
70
- `--project-id <project-id>`,
71
- `Unique Id. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.`,
72
- )
62
+ .description(`Create a new project. You can create a maximum of 100 projects per account. `)
63
+ .requiredOption(`--project-id <project-id>`, `Unique Id. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.`)
73
64
  .requiredOption(`--name <name>`, `Project name. Max length: 128 chars.`)
74
65
  .requiredOption(`--team-id <team-id>`, `Team unique ID.`)
75
66
  .option(`--region <region>`, `Project Region.`)
76
- .option(
77
- `--description <description>`,
78
- `Project description. Max length: 256 chars.`,
79
- )
67
+ .option(`--description <description>`, `Project description. Max length: 256 chars.`)
80
68
  .option(`--logo <logo>`, `Project logo.`)
81
69
  .option(`--url <url>`, `Project URL.`)
82
- .option(
83
- `--legal-name <legal-name>`,
84
- `Project legal Name. Max length: 256 chars.`,
85
- )
86
- .option(
87
- `--legal-country <legal-country>`,
88
- `Project legal Country. Max length: 256 chars.`,
89
- )
90
- .option(
91
- `--legal-state <legal-state>`,
92
- `Project legal State. Max length: 256 chars.`,
93
- )
94
- .option(
95
- `--legal-city <legal-city>`,
96
- `Project legal City. Max length: 256 chars.`,
97
- )
98
- .option(
99
- `--legal-address <legal-address>`,
100
- `Project legal Address. Max length: 256 chars.`,
101
- )
102
- .option(
103
- `--legal-tax-id <legal-tax-id>`,
104
- `Project legal Tax ID. Max length: 256 chars.`,
105
- )
70
+ .option(`--legal-name <legal-name>`, `Project legal Name. Max length: 256 chars.`)
71
+ .option(`--legal-country <legal-country>`, `Project legal Country. Max length: 256 chars.`)
72
+ .option(`--legal-state <legal-state>`, `Project legal State. Max length: 256 chars.`)
73
+ .option(`--legal-city <legal-city>`, `Project legal City. Max length: 256 chars.`)
74
+ .option(`--legal-address <legal-address>`, `Project legal Address. Max length: 256 chars.`)
75
+ .option(`--legal-tax-id <legal-tax-id>`, `Project legal Tax ID. Max length: 256 chars.`)
106
76
  .action(
107
77
  actionRunner(
108
- async ({
109
- projectId,
110
- name,
111
- teamId,
112
- region,
113
- description,
114
- logo,
115
- url,
116
- legalName,
117
- legalCountry,
118
- legalState,
119
- legalCity,
120
- legalAddress,
121
- legalTaxId,
122
- }) =>
123
- await (
124
- await getProjectsClient()
125
- ).create(
126
- projectId,
127
- name,
128
- teamId,
129
- region,
130
- description,
131
- logo,
132
- url,
133
- legalName,
134
- legalCountry,
135
- legalState,
136
- legalCity,
137
- legalAddress,
138
- legalTaxId,
139
- ),
78
+ async ({ projectId, name, teamId, region, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId }) =>
79
+ parse(await (await getProjectsClient()).create(projectId, name, teamId, region as Region, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId)),
140
80
  ),
141
81
  );
142
82
 
143
83
  projects
144
84
  .command(`get`)
145
- .description(
146
- `Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. `,
147
- )
85
+ .description(`Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. `)
148
86
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
149
87
  .action(
150
88
  actionRunner(
151
- async ({ projectId }) => await (await getProjectsClient()).get(projectId),
89
+ async ({ projectId }) =>
90
+ parse(await (await getProjectsClient()).get(projectId)),
152
91
  ),
153
92
  );
154
93
 
@@ -157,66 +96,19 @@ projects
157
96
  .description(`Update a project by its unique ID.`)
158
97
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
159
98
  .requiredOption(`--name <name>`, `Project name. Max length: 128 chars.`)
160
- .option(
161
- `--description <description>`,
162
- `Project description. Max length: 256 chars.`,
163
- )
99
+ .option(`--description <description>`, `Project description. Max length: 256 chars.`)
164
100
  .option(`--logo <logo>`, `Project logo.`)
165
101
  .option(`--url <url>`, `Project URL.`)
166
- .option(
167
- `--legal-name <legal-name>`,
168
- `Project legal name. Max length: 256 chars.`,
169
- )
170
- .option(
171
- `--legal-country <legal-country>`,
172
- `Project legal country. Max length: 256 chars.`,
173
- )
174
- .option(
175
- `--legal-state <legal-state>`,
176
- `Project legal state. Max length: 256 chars.`,
177
- )
178
- .option(
179
- `--legal-city <legal-city>`,
180
- `Project legal city. Max length: 256 chars.`,
181
- )
182
- .option(
183
- `--legal-address <legal-address>`,
184
- `Project legal address. Max length: 256 chars.`,
185
- )
186
- .option(
187
- `--legal-tax-id <legal-tax-id>`,
188
- `Project legal tax ID. Max length: 256 chars.`,
189
- )
102
+ .option(`--legal-name <legal-name>`, `Project legal name. Max length: 256 chars.`)
103
+ .option(`--legal-country <legal-country>`, `Project legal country. Max length: 256 chars.`)
104
+ .option(`--legal-state <legal-state>`, `Project legal state. Max length: 256 chars.`)
105
+ .option(`--legal-city <legal-city>`, `Project legal city. Max length: 256 chars.`)
106
+ .option(`--legal-address <legal-address>`, `Project legal address. Max length: 256 chars.`)
107
+ .option(`--legal-tax-id <legal-tax-id>`, `Project legal tax ID. Max length: 256 chars.`)
190
108
  .action(
191
109
  actionRunner(
192
- async ({
193
- projectId,
194
- name,
195
- description,
196
- logo,
197
- url,
198
- legalName,
199
- legalCountry,
200
- legalState,
201
- legalCity,
202
- legalAddress,
203
- legalTaxId,
204
- }) =>
205
- await (
206
- await getProjectsClient()
207
- ).update(
208
- projectId,
209
- name,
210
- description,
211
- logo,
212
- url,
213
- legalName,
214
- legalCountry,
215
- legalState,
216
- legalCity,
217
- legalAddress,
218
- legalTaxId,
219
- ),
110
+ async ({ projectId, name, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId }) =>
111
+ parse(await (await getProjectsClient()).update(projectId, name, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId)),
220
112
  ),
221
113
  );
222
114
 
@@ -227,375 +119,243 @@ projects
227
119
  .action(
228
120
  actionRunner(
229
121
  async ({ projectId }) =>
230
- await (await getProjectsClient()).delete(projectId),
122
+ parse(await (await getProjectsClient()).delete(projectId)),
231
123
  ),
232
124
  );
233
125
 
234
126
  projects
235
127
  .command(`update-api-status`)
236
- .description(
237
- `[**DEPRECATED** - This command is deprecated. Please use 'projects updateApiStatus' instead] Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.`,
238
- )
128
+ .description(`Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.`)
239
129
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
240
130
  .requiredOption(`--api <api>`, `API name.`)
241
131
  .requiredOption(`--status <status>`, `API status.`, parseBool)
242
132
  .action(
243
133
  actionRunner(
244
134
  async ({ projectId, api, status }) =>
245
- await (
246
- await getProjectsClient()
247
- ).updateApiStatus(projectId, api, status),
135
+ parse(await (await getProjectsClient()).updateApiStatus(projectId, api as Api, status)),
248
136
  ),
249
137
  );
250
138
 
251
139
  projects
252
140
  .command(`update-api-status-all`)
253
- .description(
254
- `[**DEPRECATED** - This command is deprecated. Please use 'projects updateApiStatusAll' instead] Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.`,
255
- )
141
+ .description(`Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.`)
256
142
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
257
143
  .requiredOption(`--status <status>`, `API status.`, parseBool)
258
144
  .action(
259
145
  actionRunner(
260
146
  async ({ projectId, status }) =>
261
- await (await getProjectsClient()).updateApiStatusAll(projectId, status),
147
+ parse(await (await getProjectsClient()).updateApiStatusAll(projectId, status)),
262
148
  ),
263
149
  );
264
150
 
265
151
  projects
266
152
  .command(`update-auth-duration`)
267
- .description(
268
- `Update how long sessions created within a project should stay active for.`,
269
- )
153
+ .description(`Update how long sessions created within a project should stay active for.`)
270
154
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
271
- .requiredOption(
272
- `--duration <duration>`,
273
- `Project session length in seconds. Max length: 31536000 seconds.`,
274
- parseInteger,
275
- )
155
+ .requiredOption(`--duration <duration>`, `Project session length in seconds. Max length: 31536000 seconds.`, parseInteger)
276
156
  .action(
277
157
  actionRunner(
278
158
  async ({ projectId, duration }) =>
279
- await (
280
- await getProjectsClient()
281
- ).updateAuthDuration(projectId, duration),
159
+ parse(await (await getProjectsClient()).updateAuthDuration(projectId, duration)),
282
160
  ),
283
161
  );
284
162
 
285
163
  projects
286
164
  .command(`update-auth-limit`)
287
- .description(
288
- `Update the maximum number of users allowed in this project. Set to 0 for unlimited users. `,
289
- )
165
+ .description(`Update the maximum number of users allowed in this project. Set to 0 for unlimited users. `)
290
166
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
291
- .requiredOption(
292
- `--limit <limit>`,
293
- `Set the max number of users allowed in this project. Use 0 for unlimited.`,
294
- parseInteger,
295
- )
167
+ .requiredOption(`--limit <limit>`, `Set the max number of users allowed in this project. Use 0 for unlimited.`, parseInteger)
296
168
  .action(
297
169
  actionRunner(
298
170
  async ({ projectId, limit }) =>
299
- await (await getProjectsClient()).updateAuthLimit(projectId, limit),
171
+ parse(await (await getProjectsClient()).updateAuthLimit(projectId, limit)),
300
172
  ),
301
173
  );
302
174
 
303
175
  projects
304
176
  .command(`update-auth-sessions-limit`)
305
- .description(
306
- `Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.`,
307
- )
177
+ .description(`Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.`)
308
178
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
309
- .requiredOption(
310
- `--limit <limit>`,
311
- `Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10`,
312
- parseInteger,
313
- )
179
+ .requiredOption(`--limit <limit>`, `Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10`, parseInteger)
314
180
  .action(
315
181
  actionRunner(
316
182
  async ({ projectId, limit }) =>
317
- await (
318
- await getProjectsClient()
319
- ).updateAuthSessionsLimit(projectId, limit),
183
+ parse(await (await getProjectsClient()).updateAuthSessionsLimit(projectId, limit)),
320
184
  ),
321
185
  );
322
186
 
323
187
  projects
324
188
  .command(`update-memberships-privacy`)
325
- .description(
326
- `Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. `,
327
- )
189
+ .description(`Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. `)
328
190
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
329
- .requiredOption(
330
- `--user-name <user-name>`,
331
- `Set to true to show userName to members of a team.`,
332
- parseBool,
333
- )
334
- .requiredOption(
335
- `--user-email <user-email>`,
336
- `Set to true to show email to members of a team.`,
337
- parseBool,
338
- )
339
- .requiredOption(
340
- `--mfa <mfa>`,
341
- `Set to true to show mfa to members of a team.`,
342
- parseBool,
343
- )
191
+ .requiredOption(`--user-name <user-name>`, `Set to true to show userName to members of a team.`, parseBool)
192
+ .requiredOption(`--user-email <user-email>`, `Set to true to show email to members of a team.`, parseBool)
193
+ .requiredOption(`--mfa <mfa>`, `Set to true to show mfa to members of a team.`, parseBool)
344
194
  .action(
345
195
  actionRunner(
346
196
  async ({ projectId, userName, userEmail, mfa }) =>
347
- await (
348
- await getProjectsClient()
349
- ).updateMembershipsPrivacy(projectId, userName, userEmail, mfa),
197
+ parse(await (await getProjectsClient()).updateMembershipsPrivacy(projectId, userName, userEmail, mfa)),
350
198
  ),
351
199
  );
352
200
 
353
201
  projects
354
202
  .command(`update-mock-numbers`)
355
- .description(
356
- `Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. `,
357
- )
203
+ .description(`Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. `)
358
204
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
359
- .requiredOption(
360
- `--numbers [numbers...]`,
361
- `An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.`,
362
- )
205
+ .requiredOption(`--numbers [numbers...]`, `An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.`)
363
206
  .action(
364
207
  actionRunner(
365
208
  async ({ projectId, numbers }) =>
366
- await (await getProjectsClient()).updateMockNumbers(projectId, numbers),
209
+ parse(await (await getProjectsClient()).updateMockNumbers(projectId, numbers)),
367
210
  ),
368
211
  );
369
212
 
370
213
  projects
371
214
  .command(`update-auth-password-dictionary`)
372
- .description(
373
- `Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. `,
374
- )
215
+ .description(`Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. `)
375
216
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
376
- .requiredOption(
377
- `--enabled <enabled>`,
378
- `Set whether or not to enable checking user's password against most commonly used passwords. Default is false.`,
379
- parseBool,
380
- )
217
+ .requiredOption(`--enabled <enabled>`, `Set whether or not to enable checking user's password against most commonly used passwords. Default is false.`, parseBool)
381
218
  .action(
382
219
  actionRunner(
383
220
  async ({ projectId, enabled }) =>
384
- await (
385
- await getProjectsClient()
386
- ).updateAuthPasswordDictionary(projectId, enabled),
221
+ parse(await (await getProjectsClient()).updateAuthPasswordDictionary(projectId, enabled)),
387
222
  ),
388
223
  );
389
224
 
390
225
  projects
391
226
  .command(`update-auth-password-history`)
392
- .description(
393
- `Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.`,
394
- )
227
+ .description(`Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.`)
395
228
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
396
- .requiredOption(
397
- `--limit <limit>`,
398
- `Set the max number of passwords to store in user history. User can't choose a new password that is already stored in the password history list. Max number of passwords allowed in history is20. Default value is 0`,
399
- parseInteger,
400
- )
229
+ .requiredOption(`--limit <limit>`, `Set the max number of passwords to store in user history. User can't choose a new password that is already stored in the password history list. Max number of passwords allowed in history is20. Default value is 0`, parseInteger)
401
230
  .action(
402
231
  actionRunner(
403
232
  async ({ projectId, limit }) =>
404
- await (
405
- await getProjectsClient()
406
- ).updateAuthPasswordHistory(projectId, limit),
233
+ parse(await (await getProjectsClient()).updateAuthPasswordHistory(projectId, limit)),
407
234
  ),
408
235
  );
409
236
 
410
237
  projects
411
238
  .command(`update-personal-data-check`)
412
- .description(
413
- `Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. `,
414
- )
239
+ .description(`Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. `)
415
240
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
416
- .requiredOption(
417
- `--enabled <enabled>`,
418
- `Set whether or not to check a password for similarity with personal data. Default is false.`,
419
- parseBool,
420
- )
241
+ .requiredOption(`--enabled <enabled>`, `Set whether or not to check a password for similarity with personal data. Default is false.`, parseBool)
421
242
  .action(
422
243
  actionRunner(
423
244
  async ({ projectId, enabled }) =>
424
- await (
425
- await getProjectsClient()
426
- ).updatePersonalDataCheck(projectId, enabled),
245
+ parse(await (await getProjectsClient()).updatePersonalDataCheck(projectId, enabled)),
427
246
  ),
428
247
  );
429
248
 
430
249
  projects
431
250
  .command(`update-session-alerts`)
432
- .description(
433
- `Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.`,
434
- )
251
+ .description(`Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.`)
435
252
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
436
- .requiredOption(
437
- `--alerts <alerts>`,
438
- `Set to true to enable session emails.`,
439
- parseBool,
440
- )
253
+ .requiredOption(`--alerts <alerts>`, `Set to true to enable session emails.`, parseBool)
441
254
  .action(
442
255
  actionRunner(
443
256
  async ({ projectId, alerts }) =>
444
- await (
445
- await getProjectsClient()
446
- ).updateSessionAlerts(projectId, alerts),
257
+ parse(await (await getProjectsClient()).updateSessionAlerts(projectId, alerts)),
447
258
  ),
448
259
  );
449
260
 
450
261
  projects
451
262
  .command(`update-session-invalidation`)
452
- .description(
453
- `Invalidate all existing sessions. An optional auth security setting for projects, and enabled by default for console project.`,
454
- )
263
+ .description(`Invalidate all existing sessions. An optional auth security setting for projects, and enabled by default for console project.`)
455
264
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
456
- .requiredOption(
457
- `--enabled <enabled>`,
458
- `Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change`,
459
- parseBool,
460
- )
265
+ .requiredOption(`--enabled <enabled>`, `Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change`, parseBool)
461
266
  .action(
462
267
  actionRunner(
463
268
  async ({ projectId, enabled }) =>
464
- await (
465
- await getProjectsClient()
466
- ).updateSessionInvalidation(projectId, enabled),
269
+ parse(await (await getProjectsClient()).updateSessionInvalidation(projectId, enabled)),
467
270
  ),
468
271
  );
469
272
 
470
273
  projects
471
274
  .command(`update-auth-status`)
472
- .description(
473
- `Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. `,
474
- )
275
+ .description(`Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. `)
475
276
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
476
- .requiredOption(
477
- `--method <method>`,
478
- `Auth Method. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone`,
479
- )
480
- .requiredOption(
481
- `--status <status>`,
482
- `Set the status of this auth method.`,
483
- parseBool,
484
- )
277
+ .requiredOption(`--method <method>`, `Auth Method. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone`)
278
+ .requiredOption(`--status <status>`, `Set the status of this auth method.`, parseBool)
485
279
  .action(
486
280
  actionRunner(
487
281
  async ({ projectId, method, status }) =>
488
- await (
489
- await getProjectsClient()
490
- ).updateAuthStatus(projectId, method as AuthMethod, status),
282
+ parse(await (await getProjectsClient()).updateAuthStatus(projectId, method as AuthMethod, status)),
491
283
  ),
492
284
  );
493
285
 
494
286
  projects
495
287
  .command(`list-dev-keys`)
496
- .description(
497
- `List all the project\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'`,
498
- )
288
+ .description(`List all the project\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'`)
499
289
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
500
- .option(
501
- `--queries [queries...]`,
502
- `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: accessedAt, expire`,
503
- )
290
+ .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: accessedAt, expire`)
504
291
  .action(
505
292
  actionRunner(
506
293
  async ({ projectId, queries }) =>
507
- await (await getProjectsClient()).listDevKeys(projectId, queries),
294
+ parse(await (await getProjectsClient()).listDevKeys(projectId, queries)),
508
295
  ),
509
296
  );
510
297
 
511
298
  projects
512
299
  .command(`create-dev-key`)
513
- .description(
514
- `Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.`,
515
- )
300
+ .description(`Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.`)
516
301
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
517
302
  .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
518
- .requiredOption(
519
- `--expire <expire>`,
520
- `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.`,
521
- )
303
+ .requiredOption(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.`)
522
304
  .action(
523
305
  actionRunner(
524
306
  async ({ projectId, name, expire }) =>
525
- await (await getProjectsClient()).createDevKey(projectId, name, expire),
307
+ parse(await (await getProjectsClient()).createDevKey(projectId, name, expire)),
526
308
  ),
527
309
  );
528
310
 
529
311
  projects
530
312
  .command(`get-dev-key`)
531
- .description(
532
- `Get a project\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.`,
533
- )
313
+ .description(`Get a project\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.`)
534
314
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
535
315
  .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
536
316
  .action(
537
317
  actionRunner(
538
318
  async ({ projectId, keyId }) =>
539
- await (await getProjectsClient()).getDevKey(projectId, keyId),
319
+ parse(await (await getProjectsClient()).getDevKey(projectId, keyId)),
540
320
  ),
541
321
  );
542
322
 
543
323
  projects
544
324
  .command(`update-dev-key`)
545
- .description(
546
- `Update a project\'s dev key by its unique ID. Use this endpoint to update a project\'s dev key name or expiration time.'`,
547
- )
325
+ .description(`Update a project\'s dev key by its unique ID. Use this endpoint to update a project\'s dev key name or expiration time.'`)
548
326
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
549
327
  .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
550
328
  .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
551
- .requiredOption(
552
- `--expire <expire>`,
553
- `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.`,
554
- )
329
+ .requiredOption(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.`)
555
330
  .action(
556
331
  actionRunner(
557
332
  async ({ projectId, keyId, name, expire }) =>
558
- await (
559
- await getProjectsClient()
560
- ).updateDevKey(projectId, keyId, name, expire),
333
+ parse(await (await getProjectsClient()).updateDevKey(projectId, keyId, name, expire)),
561
334
  ),
562
335
  );
563
336
 
564
337
  projects
565
338
  .command(`delete-dev-key`)
566
- .description(
567
- `Delete a project\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.`,
568
- )
339
+ .description(`Delete a project\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.`)
569
340
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
570
341
  .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
571
342
  .action(
572
343
  actionRunner(
573
344
  async ({ projectId, keyId }) =>
574
- await (await getProjectsClient()).deleteDevKey(projectId, keyId),
345
+ parse(await (await getProjectsClient()).deleteDevKey(projectId, keyId)),
575
346
  ),
576
347
  );
577
348
 
578
349
  projects
579
350
  .command(`create-jwt`)
580
- .description(
581
- `Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. `,
582
- )
351
+ .description(`Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. `)
583
352
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
584
- .requiredOption(
585
- `--scopes [scopes...]`,
586
- `List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.`,
587
- )
588
- .option(
589
- `--duration <duration>`,
590
- `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`,
591
- parseInteger,
592
- )
353
+ .requiredOption(`--scopes [scopes...]`, `List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.`)
354
+ .option(`--duration <duration>`, `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`, parseInteger)
593
355
  .action(
594
356
  actionRunner(
595
357
  async ({ projectId, scopes, duration }) =>
596
- await (
597
- await getProjectsClient()
598
- ).createJWT(projectId, scopes, duration),
358
+ parse(await (await getProjectsClient()).createJWT(projectId, scopes, duration)),
599
359
  ),
600
360
  );
601
361
 
@@ -612,92 +372,66 @@ projects
612
372
  .action(
613
373
  actionRunner(
614
374
  async ({ projectId, total }) =>
615
- await (await getProjectsClient()).listKeys(projectId, total),
375
+ parse(await (await getProjectsClient()).listKeys(projectId, total)),
616
376
  ),
617
377
  );
618
378
 
619
379
  projects
620
380
  .command(`create-key`)
621
- .description(
622
- `Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.`,
623
- )
381
+ .description(`Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.`)
624
382
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
625
383
  .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
626
- .requiredOption(
627
- `--scopes [scopes...]`,
628
- `Key scopes list. Maximum of 100 scopes are allowed.`,
629
- )
630
- .option(
631
- `--expire <expire>`,
632
- `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`,
633
- )
384
+ .requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 scopes are allowed.`)
385
+ .option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`)
634
386
  .action(
635
387
  actionRunner(
636
388
  async ({ projectId, name, scopes, expire }) =>
637
- await (
638
- await getProjectsClient()
639
- ).createKey(projectId, name, scopes, expire),
389
+ parse(await (await getProjectsClient()).createKey(projectId, name, scopes, expire)),
640
390
  ),
641
391
  );
642
392
 
643
393
  projects
644
394
  .command(`get-key`)
645
- .description(
646
- `Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.`,
647
- )
395
+ .description(`Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.`)
648
396
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
649
397
  .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
650
398
  .action(
651
399
  actionRunner(
652
400
  async ({ projectId, keyId }) =>
653
- await (await getProjectsClient()).getKey(projectId, keyId),
401
+ parse(await (await getProjectsClient()).getKey(projectId, keyId)),
654
402
  ),
655
403
  );
656
404
 
657
405
  projects
658
406
  .command(`update-key`)
659
- .description(
660
- `Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. `,
661
- )
407
+ .description(`Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. `)
662
408
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
663
409
  .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
664
410
  .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
665
- .requiredOption(
666
- `--scopes [scopes...]`,
667
- `Key scopes list. Maximum of 100 events are allowed.`,
668
- )
669
- .option(
670
- `--expire <expire>`,
671
- `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`,
672
- )
411
+ .requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 events are allowed.`)
412
+ .option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`)
673
413
  .action(
674
414
  actionRunner(
675
415
  async ({ projectId, keyId, name, scopes, expire }) =>
676
- await (
677
- await getProjectsClient()
678
- ).updateKey(projectId, keyId, name, scopes, expire),
416
+ parse(await (await getProjectsClient()).updateKey(projectId, keyId, name, scopes, expire)),
679
417
  ),
680
418
  );
681
419
 
682
420
  projects
683
421
  .command(`delete-key`)
684
- .description(
685
- `Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. `,
686
- )
422
+ .description(`Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. `)
687
423
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
688
424
  .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
689
425
  .action(
690
426
  actionRunner(
691
427
  async ({ projectId, keyId }) =>
692
- await (await getProjectsClient()).deleteKey(projectId, keyId),
428
+ parse(await (await getProjectsClient()).deleteKey(projectId, keyId)),
693
429
  ),
694
430
  );
695
431
 
696
432
  projects
697
- .command(`update-oauth2`)
698
- .description(
699
- `Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable/disable providers. `,
700
- )
433
+ .command(`update-o-auth-2`)
434
+ .description(`Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable/disable providers. `)
701
435
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
702
436
  .requiredOption(`--provider <provider>`, `Provider Name`)
703
437
  .option(`--app-id <app-id>`, `Provider app ID. Max length: 256 chars.`)
@@ -711,23 +445,13 @@ projects
711
445
  .action(
712
446
  actionRunner(
713
447
  async ({ projectId, provider, appId, secret, enabled }) =>
714
- await (
715
- await getProjectsClient()
716
- ).updateOAuth2(
717
- projectId,
718
- provider as OAuthProvider,
719
- appId,
720
- secret,
721
- enabled,
722
- ),
448
+ parse(await (await getProjectsClient()).updateOAuth2(projectId, provider as OAuthProvider, appId, secret, enabled)),
723
449
  ),
724
450
  );
725
451
 
726
452
  projects
727
453
  .command(`list-platforms`)
728
- .description(
729
- `Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. `,
730
- )
454
+ .description(`Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. `)
731
455
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
732
456
  .option(
733
457
  `--total [value]`,
@@ -738,150 +462,96 @@ projects
738
462
  .action(
739
463
  actionRunner(
740
464
  async ({ projectId, total }) =>
741
- await (await getProjectsClient()).listPlatforms(projectId, total),
465
+ parse(await (await getProjectsClient()).listPlatforms(projectId, total)),
742
466
  ),
743
467
  );
744
468
 
745
469
  projects
746
470
  .command(`create-platform`)
747
- .description(
748
- `Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.`,
749
- )
471
+ .description(`Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.`)
750
472
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
751
- .requiredOption(
752
- `--type <type>`,
753
- `Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.`,
754
- )
473
+ .requiredOption(`--type <type>`, `Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.`)
755
474
  .requiredOption(`--name <name>`, `Platform name. Max length: 128 chars.`)
756
- .option(
757
- `--key <key>`,
758
- `Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.`,
759
- )
760
- .option(
761
- `--store <store>`,
762
- `App store or Google Play store ID. Max length: 256 chars.`,
763
- )
764
- .option(
765
- `--hostname <hostname>`,
766
- `Platform client hostname. Max length: 256 chars.`,
767
- )
475
+ .option(`--key <key>`, `Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.`)
476
+ .option(`--store <store>`, `App store or Google Play store ID. Max length: 256 chars.`)
477
+ .option(`--hostname <hostname>`, `Platform client hostname. Max length: 256 chars.`)
768
478
  .action(
769
479
  actionRunner(
770
- async ({ projectId, xType, name, key, store, hostname }) =>
771
- await (
772
- await getProjectsClient()
773
- ).createPlatform(
774
- projectId,
775
- xType as PlatformType,
776
- name,
777
- key,
778
- store,
779
- hostname,
780
- ),
480
+ async ({ projectId, type, name, key, store, hostname }) =>
481
+ parse(await (await getProjectsClient()).createPlatform(projectId, type as PlatformType, name, key, store, hostname)),
781
482
  ),
782
483
  );
783
484
 
784
485
  projects
785
486
  .command(`get-platform`)
786
- .description(
787
- `Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. `,
788
- )
487
+ .description(`Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. `)
789
488
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
790
489
  .requiredOption(`--platform-id <platform-id>`, `Platform unique ID.`)
791
490
  .action(
792
491
  actionRunner(
793
492
  async ({ projectId, platformId }) =>
794
- await (await getProjectsClient()).getPlatform(projectId, platformId),
493
+ parse(await (await getProjectsClient()).getPlatform(projectId, platformId)),
795
494
  ),
796
495
  );
797
496
 
798
497
  projects
799
498
  .command(`update-platform`)
800
- .description(
801
- `Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. `,
802
- )
499
+ .description(`Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. `)
803
500
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
804
501
  .requiredOption(`--platform-id <platform-id>`, `Platform unique ID.`)
805
502
  .requiredOption(`--name <name>`, `Platform name. Max length: 128 chars.`)
806
- .option(
807
- `--key <key>`,
808
- `Package name for android or bundle ID for iOS. Max length: 256 chars.`,
809
- )
810
- .option(
811
- `--store <store>`,
812
- `App store or Google Play store ID. Max length: 256 chars.`,
813
- )
814
- .option(
815
- `--hostname <hostname>`,
816
- `Platform client URL. Max length: 256 chars.`,
817
- )
503
+ .option(`--key <key>`, `Package name for android or bundle ID for iOS. Max length: 256 chars.`)
504
+ .option(`--store <store>`, `App store or Google Play store ID. Max length: 256 chars.`)
505
+ .option(`--hostname <hostname>`, `Platform client URL. Max length: 256 chars.`)
818
506
  .action(
819
507
  actionRunner(
820
508
  async ({ projectId, platformId, name, key, store, hostname }) =>
821
- await (
822
- await getProjectsClient()
823
- ).updatePlatform(projectId, platformId, name, key, store, hostname),
509
+ parse(await (await getProjectsClient()).updatePlatform(projectId, platformId, name, key, store, hostname)),
824
510
  ),
825
511
  );
826
512
 
827
513
  projects
828
514
  .command(`delete-platform`)
829
- .description(
830
- `Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. `,
831
- )
515
+ .description(`Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. `)
832
516
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
833
517
  .requiredOption(`--platform-id <platform-id>`, `Platform unique ID.`)
834
518
  .action(
835
519
  actionRunner(
836
520
  async ({ projectId, platformId }) =>
837
- await (await getProjectsClient()).deletePlatform(projectId, platformId),
521
+ parse(await (await getProjectsClient()).deletePlatform(projectId, platformId)),
838
522
  ),
839
523
  );
840
524
 
841
525
  projects
842
526
  .command(`update-service-status`)
843
- .description(
844
- `Update the status of a specific service. Use this endpoint to enable or disable a service in your project. `,
845
- )
527
+ .description(`Update the status of a specific service. Use this endpoint to enable or disable a service in your project. `)
846
528
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
847
529
  .requiredOption(`--service <service>`, `Service name.`)
848
530
  .requiredOption(`--status <status>`, `Service status.`, parseBool)
849
531
  .action(
850
532
  actionRunner(
851
533
  async ({ projectId, service, status }) =>
852
- await (
853
- await getProjectsClient()
854
- ).updateServiceStatus(projectId, service as ApiService, status),
534
+ parse(await (await getProjectsClient()).updateServiceStatus(projectId, service as ApiService, status)),
855
535
  ),
856
536
  );
857
537
 
858
538
  projects
859
539
  .command(`update-service-status-all`)
860
- .description(
861
- `Update the status of all services. Use this endpoint to enable or disable all optional services at once. `,
862
- )
540
+ .description(`Update the status of all services. Use this endpoint to enable or disable all optional services at once. `)
863
541
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
864
542
  .requiredOption(`--status <status>`, `Service status.`, parseBool)
865
543
  .action(
866
544
  actionRunner(
867
545
  async ({ projectId, status }) =>
868
- await (
869
- await getProjectsClient()
870
- ).updateServiceStatusAll(projectId, status),
546
+ parse(await (await getProjectsClient()).updateServiceStatusAll(projectId, status)),
871
547
  ),
872
548
  );
873
549
 
874
550
  projects
875
551
  .command(`update-smtp`)
876
- .description(
877
- `[**DEPRECATED** - This command is deprecated. Please use 'projects updateSmtp' instead] Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. `,
878
- )
552
+ .description(`Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. `)
879
553
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
880
- .requiredOption(
881
- `--enabled <enabled>`,
882
- `Enable custom SMTP service`,
883
- parseBool,
884
- )
554
+ .requiredOption(`--enabled <enabled>`, `Enable custom SMTP service`, parseBool)
885
555
  .option(`--sender-name <sender-name>`, `Name of the email sender`)
886
556
  .option(`--sender-email <sender-email>`, `Email of the sender`)
887
557
  .option(`--reply-to <reply-to>`, `Reply to email`)
@@ -892,127 +562,59 @@ projects
892
562
  .option(`--secure <secure>`, `Does SMTP server use secure connection`)
893
563
  .action(
894
564
  actionRunner(
895
- async ({
896
- projectId,
897
- enabled,
898
- senderName,
899
- senderEmail,
900
- replyTo,
901
- host,
902
- port,
903
- username,
904
- password,
905
- secure,
906
- }) =>
907
- await (
908
- await getProjectsClient()
909
- ).updateSmtp(
910
- projectId,
911
- enabled,
912
- senderName,
913
- senderEmail,
914
- replyTo,
915
- host,
916
- port,
917
- username,
918
- password,
919
- secure as SMTPSecure,
920
- ),
565
+ async ({ projectId, enabled, senderName, senderEmail, replyTo, host, port, username, password, secure }) =>
566
+ parse(await (await getProjectsClient()).updateSmtp(projectId, enabled, senderName, senderEmail, replyTo, host, port, username, password, secure as SMTPSecure)),
921
567
  ),
922
568
  );
923
569
 
924
570
  projects
925
571
  .command(`create-smtp-test`)
926
- .description(
927
- `[**DEPRECATED** - This command is deprecated. Please use 'projects createSmtpTest' instead] Send a test email to verify SMTP configuration. `,
928
- )
572
+ .description(`Send a test email to verify SMTP configuration. `)
929
573
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
930
- .requiredOption(
931
- `--emails [emails...]`,
932
- `Array of emails to send test email to. Maximum of 10 emails are allowed.`,
933
- )
574
+ .requiredOption(`--emails [emails...]`, `Array of emails to send test email to. Maximum of 10 emails are allowed.`)
934
575
  .requiredOption(`--sender-name <sender-name>`, `Name of the email sender`)
935
576
  .requiredOption(`--sender-email <sender-email>`, `Email of the sender`)
936
- .option(`--reply-to <reply-to>`, `Reply to email`)
937
577
  .requiredOption(`--host <host>`, `SMTP server host name`)
578
+ .option(`--reply-to <reply-to>`, `Reply to email`)
938
579
  .option(`--port <port>`, `SMTP server port`, parseInteger)
939
580
  .option(`--username <username>`, `SMTP server username`)
940
581
  .option(`--password <password>`, `SMTP server password`)
941
582
  .option(`--secure <secure>`, `Does SMTP server use secure connection`)
942
583
  .action(
943
584
  actionRunner(
944
- async ({
945
- projectId,
946
- emails,
947
- senderName,
948
- senderEmail,
949
- replyTo,
950
- host,
951
- port,
952
- username,
953
- password,
954
- secure,
955
- }) =>
956
- await (
957
- await getProjectsClient()
958
- ).createSmtpTest(
959
- projectId,
960
- emails,
961
- senderName,
962
- senderEmail,
963
- replyTo,
964
- host,
965
- port,
966
- username,
967
- password,
968
- secure as SMTPSecure,
969
- ),
585
+ async ({ projectId, emails, senderName, senderEmail, host, replyTo, port, username, password, secure }) =>
586
+ parse(await (await getProjectsClient()).createSmtpTest(projectId, emails, senderName, senderEmail, host, replyTo, port, username, password, secure as SMTPSecure)),
970
587
  ),
971
588
  );
972
589
 
973
590
  projects
974
591
  .command(`update-team`)
975
- .description(
976
- `Update the team ID of a project allowing for it to be transferred to another team.`,
977
- )
592
+ .description(`Update the team ID of a project allowing for it to be transferred to another team.`)
978
593
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
979
- .requiredOption(
980
- `--team-id <team-id>`,
981
- `Team ID of the team to transfer project to.`,
982
- )
594
+ .requiredOption(`--team-id <team-id>`, `Team ID of the team to transfer project to.`)
983
595
  .action(
984
596
  actionRunner(
985
597
  async ({ projectId, teamId }) =>
986
- await (await getProjectsClient()).updateTeam(projectId, teamId),
598
+ parse(await (await getProjectsClient()).updateTeam(projectId, teamId)),
987
599
  ),
988
600
  );
989
601
 
990
602
  projects
991
603
  .command(`get-email-template`)
992
- .description(
993
- `Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. `,
994
- )
604
+ .description(`Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. `)
995
605
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
996
606
  .requiredOption(`--type <type>`, `Template type`)
997
607
  .requiredOption(`--locale <locale>`, `Template locale`)
998
608
  .action(
999
609
  actionRunner(
1000
- async ({ projectId, xType, locale }) =>
1001
- await (
1002
- await getProjectsClient()
1003
- ).getEmailTemplate(
1004
- projectId,
1005
- xType as EmailTemplateType,
1006
- locale as EmailTemplateLocale,
1007
- ),
610
+ async ({ projectId, type, locale }) =>
611
+ parse(await (await getProjectsClient()).getEmailTemplate(projectId, type as EmailTemplateType, locale as EmailTemplateLocale)),
1008
612
  ),
1009
613
  );
1010
614
 
1011
615
  projects
1012
616
  .command(`update-email-template`)
1013
- .description(
1014
- `Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.`,
1015
- )
617
+ .description(`Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.`)
1016
618
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1017
619
  .requiredOption(`--type <type>`, `Template type`)
1018
620
  .requiredOption(`--locale <locale>`, `Template locale`)
@@ -1023,122 +625,67 @@ projects
1023
625
  .option(`--reply-to <reply-to>`, `Reply to email`)
1024
626
  .action(
1025
627
  actionRunner(
1026
- async ({
1027
- projectId,
1028
- xType,
1029
- locale,
1030
- subject,
1031
- message,
1032
- senderName,
1033
- senderEmail,
1034
- replyTo,
1035
- }) =>
1036
- await (
1037
- await getProjectsClient()
1038
- ).updateEmailTemplate(
1039
- projectId,
1040
- xType as EmailTemplateType,
1041
- locale as EmailTemplateLocale,
1042
- subject,
1043
- message,
1044
- senderName,
1045
- senderEmail,
1046
- replyTo,
1047
- ),
628
+ async ({ projectId, type, locale, subject, message, senderName, senderEmail, replyTo }) =>
629
+ parse(await (await getProjectsClient()).updateEmailTemplate(projectId, type as EmailTemplateType, locale as EmailTemplateLocale, subject, message, senderName, senderEmail, replyTo)),
1048
630
  ),
1049
631
  );
1050
632
 
1051
633
  projects
1052
634
  .command(`delete-email-template`)
1053
- .description(
1054
- `Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. `,
1055
- )
635
+ .description(`Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. `)
1056
636
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1057
637
  .requiredOption(`--type <type>`, `Template type`)
1058
638
  .requiredOption(`--locale <locale>`, `Template locale`)
1059
639
  .action(
1060
640
  actionRunner(
1061
- async ({ projectId, xType, locale }) =>
1062
- await (
1063
- await getProjectsClient()
1064
- ).deleteEmailTemplate(
1065
- projectId,
1066
- xType as EmailTemplateType,
1067
- locale as EmailTemplateLocale,
1068
- ),
641
+ async ({ projectId, type, locale }) =>
642
+ parse(await (await getProjectsClient()).deleteEmailTemplate(projectId, type as EmailTemplateType, locale as EmailTemplateLocale)),
1069
643
  ),
1070
644
  );
1071
645
 
1072
646
  projects
1073
647
  .command(`get-sms-template`)
1074
- .description(
1075
- `[**DEPRECATED** - This command is deprecated. Please use 'projects getSmsTemplate' instead] Get a custom SMS template for the specified locale and type returning it's contents.`,
1076
- )
648
+ .description(`Get a custom SMS template for the specified locale and type returning it's contents.`)
1077
649
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1078
650
  .requiredOption(`--type <type>`, `Template type`)
1079
651
  .requiredOption(`--locale <locale>`, `Template locale`)
1080
652
  .action(
1081
653
  actionRunner(
1082
- async ({ projectId, xType, locale }) =>
1083
- await (
1084
- await getProjectsClient()
1085
- ).getSmsTemplate(
1086
- projectId,
1087
- xType as SmsTemplateType,
1088
- locale as SmsTemplateLocale,
1089
- ),
654
+ async ({ projectId, type, locale }) =>
655
+ parse(await (await getProjectsClient()).getSmsTemplate(projectId, type as SmsTemplateType, locale as SmsTemplateLocale)),
1090
656
  ),
1091
657
  );
1092
658
 
1093
659
  projects
1094
660
  .command(`update-sms-template`)
1095
- .description(
1096
- `[**DEPRECATED** - This command is deprecated. Please use 'projects updateSmsTemplate' instead] Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. `,
1097
- )
661
+ .description(`Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. `)
1098
662
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1099
663
  .requiredOption(`--type <type>`, `Template type`)
1100
664
  .requiredOption(`--locale <locale>`, `Template locale`)
1101
665
  .requiredOption(`--message <message>`, `Template message`)
1102
666
  .action(
1103
667
  actionRunner(
1104
- async ({ projectId, xType, locale, message }) =>
1105
- await (
1106
- await getProjectsClient()
1107
- ).updateSmsTemplate(
1108
- projectId,
1109
- xType as SmsTemplateType,
1110
- locale as SmsTemplateLocale,
1111
- message,
1112
- ),
668
+ async ({ projectId, type, locale, message }) =>
669
+ parse(await (await getProjectsClient()).updateSmsTemplate(projectId, type as SmsTemplateType, locale as SmsTemplateLocale, message)),
1113
670
  ),
1114
671
  );
1115
672
 
1116
673
  projects
1117
674
  .command(`delete-sms-template`)
1118
- .description(
1119
- `[**DEPRECATED** - This command is deprecated. Please use 'projects deleteSmsTemplate' instead] Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. `,
1120
- )
675
+ .description(`Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. `)
1121
676
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1122
677
  .requiredOption(`--type <type>`, `Template type`)
1123
678
  .requiredOption(`--locale <locale>`, `Template locale`)
1124
679
  .action(
1125
680
  actionRunner(
1126
- async ({ projectId, xType, locale }) =>
1127
- await (
1128
- await getProjectsClient()
1129
- ).deleteSmsTemplate(
1130
- projectId,
1131
- xType as SmsTemplateType,
1132
- locale as SmsTemplateLocale,
1133
- ),
681
+ async ({ projectId, type, locale }) =>
682
+ parse(await (await getProjectsClient()).deleteSmsTemplate(projectId, type as SmsTemplateType, locale as SmsTemplateLocale)),
1134
683
  ),
1135
684
  );
1136
685
 
1137
686
  projects
1138
687
  .command(`list-webhooks`)
1139
- .description(
1140
- `Get a list of all webhooks belonging to the project. You can use the query params to filter your results. `,
1141
- )
688
+ .description(`Get a list of all webhooks belonging to the project. You can use the query params to filter your results. `)
1142
689
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1143
690
  .option(
1144
691
  `--total [value]`,
@@ -1149,169 +696,90 @@ projects
1149
696
  .action(
1150
697
  actionRunner(
1151
698
  async ({ projectId, total }) =>
1152
- await (await getProjectsClient()).listWebhooks(projectId, total),
699
+ parse(await (await getProjectsClient()).listWebhooks(projectId, total)),
1153
700
  ),
1154
701
  );
1155
702
 
1156
703
  projects
1157
704
  .command(`create-webhook`)
1158
- .description(
1159
- `Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. `,
1160
- )
705
+ .description(`Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. `)
1161
706
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1162
707
  .requiredOption(`--name <name>`, `Webhook name. Max length: 128 chars.`)
708
+ .requiredOption(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
709
+ .requiredOption(`--url <url>`, `Webhook URL.`)
710
+ .requiredOption(`--security <security>`, `Certificate verification, false for disabled or true for enabled.`, parseBool)
1163
711
  .option(
1164
712
  `--enabled [value]`,
1165
713
  `Enable or disable a webhook.`,
1166
714
  (value: string | undefined) =>
1167
715
  value === undefined ? true : parseBool(value),
1168
716
  )
1169
- .requiredOption(
1170
- `--events [events...]`,
1171
- `Events list. Maximum of 100 events are allowed.`,
1172
- )
1173
- .requiredOption(`--url <url>`, `Webhook URL.`)
1174
- .requiredOption(
1175
- `--security <security>`,
1176
- `Certificate verification, false for disabled or true for enabled.`,
1177
- parseBool,
1178
- )
1179
- .option(
1180
- `--http-user <http-user>`,
1181
- `Webhook HTTP user. Max length: 256 chars.`,
1182
- )
1183
- .option(
1184
- `--http-pass <http-pass>`,
1185
- `Webhook HTTP password. Max length: 256 chars.`,
1186
- )
717
+ .option(`--http-user <http-user>`, `Webhook HTTP user. Max length: 256 chars.`)
718
+ .option(`--http-pass <http-pass>`, `Webhook HTTP password. Max length: 256 chars.`)
1187
719
  .action(
1188
720
  actionRunner(
1189
- async ({
1190
- projectId,
1191
- name,
1192
- enabled,
1193
- events,
1194
- url,
1195
- security,
1196
- httpUser,
1197
- httpPass,
1198
- }) =>
1199
- await (
1200
- await getProjectsClient()
1201
- ).createWebhook(
1202
- projectId,
1203
- name,
1204
- enabled,
1205
- events,
1206
- url,
1207
- security,
1208
- httpUser,
1209
- httpPass,
1210
- ),
721
+ async ({ projectId, name, events, url, security, enabled, httpUser, httpPass }) =>
722
+ parse(await (await getProjectsClient()).createWebhook(projectId, name, events, url, security, enabled, httpUser, httpPass)),
1211
723
  ),
1212
724
  );
1213
725
 
1214
726
  projects
1215
727
  .command(`get-webhook`)
1216
- .description(
1217
- `Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. `,
1218
- )
728
+ .description(`Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. `)
1219
729
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1220
730
  .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
1221
731
  .action(
1222
732
  actionRunner(
1223
733
  async ({ projectId, webhookId }) =>
1224
- await (await getProjectsClient()).getWebhook(projectId, webhookId),
734
+ parse(await (await getProjectsClient()).getWebhook(projectId, webhookId)),
1225
735
  ),
1226
736
  );
1227
737
 
1228
738
  projects
1229
739
  .command(`update-webhook`)
1230
- .description(
1231
- `Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. `,
1232
- )
740
+ .description(`Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. `)
1233
741
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1234
742
  .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
1235
743
  .requiredOption(`--name <name>`, `Webhook name. Max length: 128 chars.`)
744
+ .requiredOption(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
745
+ .requiredOption(`--url <url>`, `Webhook URL.`)
746
+ .requiredOption(`--security <security>`, `Certificate verification, false for disabled or true for enabled.`, parseBool)
1236
747
  .option(
1237
748
  `--enabled [value]`,
1238
749
  `Enable or disable a webhook.`,
1239
750
  (value: string | undefined) =>
1240
751
  value === undefined ? true : parseBool(value),
1241
752
  )
1242
- .requiredOption(
1243
- `--events [events...]`,
1244
- `Events list. Maximum of 100 events are allowed.`,
1245
- )
1246
- .requiredOption(`--url <url>`, `Webhook URL.`)
1247
- .requiredOption(
1248
- `--security <security>`,
1249
- `Certificate verification, false for disabled or true for enabled.`,
1250
- parseBool,
1251
- )
1252
- .option(
1253
- `--http-user <http-user>`,
1254
- `Webhook HTTP user. Max length: 256 chars.`,
1255
- )
1256
- .option(
1257
- `--http-pass <http-pass>`,
1258
- `Webhook HTTP password. Max length: 256 chars.`,
1259
- )
753
+ .option(`--http-user <http-user>`, `Webhook HTTP user. Max length: 256 chars.`)
754
+ .option(`--http-pass <http-pass>`, `Webhook HTTP password. Max length: 256 chars.`)
1260
755
  .action(
1261
756
  actionRunner(
1262
- async ({
1263
- projectId,
1264
- webhookId,
1265
- name,
1266
- enabled,
1267
- events,
1268
- url,
1269
- security,
1270
- httpUser,
1271
- httpPass,
1272
- }) =>
1273
- await (
1274
- await getProjectsClient()
1275
- ).updateWebhook(
1276
- projectId,
1277
- webhookId,
1278
- name,
1279
- enabled,
1280
- events,
1281
- url,
1282
- security,
1283
- httpUser,
1284
- httpPass,
1285
- ),
757
+ async ({ projectId, webhookId, name, events, url, security, enabled, httpUser, httpPass }) =>
758
+ parse(await (await getProjectsClient()).updateWebhook(projectId, webhookId, name, events, url, security, enabled, httpUser, httpPass)),
1286
759
  ),
1287
760
  );
1288
761
 
1289
762
  projects
1290
763
  .command(`delete-webhook`)
1291
- .description(
1292
- `Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. `,
1293
- )
764
+ .description(`Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. `)
1294
765
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1295
766
  .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
1296
767
  .action(
1297
768
  actionRunner(
1298
769
  async ({ projectId, webhookId }) =>
1299
- await (await getProjectsClient()).deleteWebhook(projectId, webhookId),
770
+ parse(await (await getProjectsClient()).deleteWebhook(projectId, webhookId)),
1300
771
  ),
1301
772
  );
1302
773
 
1303
774
  projects
1304
775
  .command(`update-webhook-signature`)
1305
- .description(
1306
- `Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. `,
1307
- )
776
+ .description(`Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. `)
1308
777
  .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
1309
778
  .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
1310
779
  .action(
1311
780
  actionRunner(
1312
781
  async ({ projectId, webhookId }) =>
1313
- await (
1314
- await getProjectsClient()
1315
- ).updateWebhookSignature(projectId, webhookId),
782
+ parse(await (await getProjectsClient()).updateWebhookSignature(projectId, webhookId)),
1316
783
  ),
1317
784
  );
785
+