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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (718) hide show
  1. package/.github/workflows/{npm-publish.yml → publish.yml} +1 -1
  2. package/CHANGELOG.md +106 -101
  3. package/LICENSE.md +2 -2
  4. package/README.md +36 -59
  5. package/cli.ts +152 -0
  6. package/dist/bundle.cjs +4613 -3653
  7. package/dist/cli.d.ts +3 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +145 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/index.d.ts +10 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +7 -142
  14. package/dist/index.js.map +1 -1
  15. package/dist/lib/client.d.ts.map +1 -1
  16. package/dist/lib/client.js +7 -6
  17. package/dist/lib/client.js.map +1 -1
  18. package/dist/lib/commands/config.d.ts +562 -0
  19. package/dist/lib/commands/config.d.ts.map +1 -0
  20. package/dist/lib/commands/config.js +416 -0
  21. package/dist/lib/commands/config.js.map +1 -0
  22. package/dist/lib/commands/db.d.ts +34 -0
  23. package/dist/lib/commands/db.d.ts.map +1 -0
  24. package/dist/lib/commands/db.js +247 -0
  25. package/dist/lib/commands/db.js.map +1 -0
  26. package/dist/lib/commands/errors.d.ts +68 -0
  27. package/dist/lib/commands/errors.d.ts.map +1 -0
  28. package/dist/lib/commands/errors.js +72 -0
  29. package/dist/lib/commands/errors.js.map +1 -0
  30. package/dist/lib/commands/init.d.ts.map +1 -1
  31. package/dist/lib/commands/init.js +15 -14
  32. package/dist/lib/commands/init.js.map +1 -1
  33. package/dist/lib/commands/pull.d.ts +104 -2
  34. package/dist/lib/commands/pull.d.ts.map +1 -1
  35. package/dist/lib/commands/pull.js +470 -281
  36. package/dist/lib/commands/pull.js.map +1 -1
  37. package/dist/lib/commands/push.d.ts +106 -0
  38. package/dist/lib/commands/push.d.ts.map +1 -1
  39. package/dist/lib/commands/push.js +1257 -1628
  40. package/dist/lib/commands/push.js.map +1 -1
  41. package/dist/lib/commands/run.js +1 -1
  42. package/dist/lib/commands/run.js.map +1 -1
  43. package/dist/lib/commands/schema.d.ts +59 -0
  44. package/dist/lib/commands/schema.d.ts.map +1 -0
  45. package/dist/lib/commands/schema.js +86 -0
  46. package/dist/lib/commands/schema.js.map +1 -0
  47. package/dist/lib/commands/services/account.d.ts.map +1 -1
  48. package/dist/lib/commands/services/account.js +86 -64
  49. package/dist/lib/commands/services/account.js.map +1 -1
  50. package/dist/lib/commands/services/console.d.ts.map +1 -1
  51. package/dist/lib/commands/services/console.js +4 -17
  52. package/dist/lib/commands/services/console.js.map +1 -1
  53. package/dist/lib/commands/services/databases.d.ts.map +1 -1
  54. package/dist/lib/commands/services/databases.js +160 -152
  55. package/dist/lib/commands/services/databases.js.map +1 -1
  56. package/dist/lib/commands/services/functions.d.ts.map +1 -1
  57. package/dist/lib/commands/services/functions.js +41 -33
  58. package/dist/lib/commands/services/functions.js.map +1 -1
  59. package/dist/lib/commands/services/graphql.d.ts.map +1 -1
  60. package/dist/lib/commands/services/graphql.js +3 -3
  61. package/dist/lib/commands/services/graphql.js.map +1 -1
  62. package/dist/lib/commands/services/health.d.ts.map +1 -1
  63. package/dist/lib/commands/services/health.js +24 -24
  64. package/dist/lib/commands/services/health.js.map +1 -1
  65. package/dist/lib/commands/services/locale.d.ts.map +1 -1
  66. package/dist/lib/commands/services/locale.js +9 -9
  67. package/dist/lib/commands/services/locale.js.map +1 -1
  68. package/dist/lib/commands/services/messaging.d.ts.map +1 -1
  69. package/dist/lib/commands/services/messaging.js +59 -59
  70. package/dist/lib/commands/services/messaging.js.map +1 -1
  71. package/dist/lib/commands/services/migrations.d.ts.map +1 -1
  72. package/dist/lib/commands/services/migrations.js +19 -19
  73. package/dist/lib/commands/services/migrations.js.map +1 -1
  74. package/dist/lib/commands/services/project.d.ts.map +1 -1
  75. package/dist/lib/commands/services/project.js +8 -8
  76. package/dist/lib/commands/services/project.js.map +1 -1
  77. package/dist/lib/commands/services/projects.d.ts.map +1 -1
  78. package/dist/lib/commands/services/projects.js +64 -64
  79. package/dist/lib/commands/services/projects.js.map +1 -1
  80. package/dist/lib/commands/services/proxy.d.ts.map +1 -1
  81. package/dist/lib/commands/services/proxy.js +11 -11
  82. package/dist/lib/commands/services/proxy.js.map +1 -1
  83. package/dist/lib/commands/services/sites.d.ts.map +1 -1
  84. package/dist/lib/commands/services/sites.js +41 -33
  85. package/dist/lib/commands/services/sites.js.map +1 -1
  86. package/dist/lib/commands/services/storage.d.ts.map +1 -1
  87. package/dist/lib/commands/services/storage.js +38 -16
  88. package/dist/lib/commands/services/storage.js.map +1 -1
  89. package/dist/lib/commands/services/tables-db.d.ts +3 -0
  90. package/dist/lib/commands/services/tables-db.d.ts.map +1 -0
  91. package/dist/lib/commands/services/{tablesdb.js → tables-db.js} +171 -163
  92. package/dist/lib/commands/services/tables-db.js.map +1 -0
  93. package/dist/lib/commands/services/teams.d.ts.map +1 -1
  94. package/dist/lib/commands/services/teams.js +16 -16
  95. package/dist/lib/commands/services/teams.js.map +1 -1
  96. package/dist/lib/commands/services/tokens.d.ts.map +1 -1
  97. package/dist/lib/commands/services/tokens.js +6 -6
  98. package/dist/lib/commands/services/tokens.js.map +1 -1
  99. package/dist/lib/commands/services/users.d.ts.map +1 -1
  100. package/dist/lib/commands/services/users.js +54 -54
  101. package/dist/lib/commands/services/users.js.map +1 -1
  102. package/dist/lib/commands/services/vcs.d.ts.map +1 -1
  103. package/dist/lib/commands/services/vcs.js +13 -13
  104. package/dist/lib/commands/services/vcs.js.map +1 -1
  105. package/dist/lib/commands/types.d.ts.map +1 -1
  106. package/dist/lib/commands/types.js +1 -1
  107. package/dist/lib/commands/types.js.map +1 -1
  108. package/dist/lib/commands/update.d.ts.map +1 -1
  109. package/dist/lib/commands/update.js +9 -8
  110. package/dist/lib/commands/update.js.map +1 -1
  111. package/dist/lib/commands/utils/attributes.d.ts +47 -0
  112. package/dist/lib/commands/utils/attributes.d.ts.map +1 -0
  113. package/dist/lib/commands/utils/attributes.js +514 -0
  114. package/dist/lib/commands/utils/attributes.js.map +1 -0
  115. package/dist/lib/commands/utils/change-approval.d.ts +25 -0
  116. package/dist/lib/commands/utils/change-approval.d.ts.map +1 -0
  117. package/dist/lib/commands/utils/change-approval.js +129 -0
  118. package/dist/lib/commands/utils/change-approval.js.map +1 -0
  119. package/dist/lib/commands/utils/database-sync.d.ts +10 -0
  120. package/dist/lib/commands/utils/database-sync.d.ts.map +1 -0
  121. package/dist/lib/commands/utils/database-sync.js +136 -0
  122. package/dist/lib/commands/utils/database-sync.js.map +1 -0
  123. package/dist/lib/commands/utils/deployment.d.ts +34 -0
  124. package/dist/lib/commands/utils/deployment.d.ts.map +1 -0
  125. package/dist/lib/commands/utils/deployment.js +109 -0
  126. package/dist/lib/commands/utils/deployment.js.map +1 -0
  127. package/dist/lib/commands/utils/error-formatter.d.ts +19 -0
  128. package/dist/lib/commands/utils/error-formatter.d.ts.map +1 -0
  129. package/dist/lib/commands/utils/error-formatter.js +333 -0
  130. package/dist/lib/commands/utils/error-formatter.js.map +1 -0
  131. package/dist/lib/commands/utils/pools.d.ts +16 -0
  132. package/dist/lib/commands/utils/pools.d.ts.map +1 -0
  133. package/dist/lib/commands/utils/pools.js +198 -0
  134. package/dist/lib/commands/utils/pools.js.map +1 -0
  135. package/dist/lib/config.d.ts +27 -26
  136. package/dist/lib/config.d.ts.map +1 -1
  137. package/dist/lib/config.js +8 -45
  138. package/dist/lib/config.js.map +1 -1
  139. package/dist/lib/constants.d.ts +14 -0
  140. package/dist/lib/constants.d.ts.map +1 -0
  141. package/dist/lib/constants.js +19 -0
  142. package/dist/lib/constants.js.map +1 -0
  143. package/dist/lib/emulation/docker.d.ts +4 -4
  144. package/dist/lib/emulation/docker.d.ts.map +1 -1
  145. package/dist/lib/emulation/docker.js +80 -67
  146. package/dist/lib/emulation/docker.js.map +1 -1
  147. package/dist/lib/parser.d.ts.map +1 -1
  148. package/dist/lib/parser.js +11 -10
  149. package/dist/lib/parser.js.map +1 -1
  150. package/dist/lib/questions.d.ts.map +1 -1
  151. package/dist/lib/questions.js +20 -20
  152. package/dist/lib/questions.js.map +1 -1
  153. package/dist/lib/sdks.d.ts.map +1 -1
  154. package/dist/lib/sdks.js +10 -11
  155. package/dist/lib/sdks.js.map +1 -1
  156. package/dist/lib/types.d.ts +0 -214
  157. package/dist/lib/types.d.ts.map +1 -1
  158. package/dist/lib/utils.d.ts +3 -0
  159. package/dist/lib/utils.d.ts.map +1 -1
  160. package/dist/lib/utils.js +42 -2
  161. package/dist/lib/utils.js.map +1 -1
  162. package/dist/package.json +12 -11
  163. package/docs/examples/account/create-anonymous-session.md +1 -0
  164. package/docs/examples/account/create-email-password-session.md +3 -0
  165. package/docs/examples/account/create-email-token.md +3 -0
  166. package/docs/examples/account/create-email-verification.md +2 -0
  167. package/docs/examples/account/create-jwt.md +1 -0
  168. package/docs/examples/account/create-magic-url-token.md +3 -0
  169. package/docs/examples/account/create-mfa-authenticator.md +2 -0
  170. package/docs/examples/account/create-mfa-challenge.md +2 -0
  171. package/docs/examples/account/create-mfa-recovery-codes.md +1 -0
  172. package/docs/examples/account/create-o-auth-2-session.md +2 -0
  173. package/docs/examples/account/create-o-auth-2-token.md +2 -0
  174. package/docs/examples/account/create-phone-token.md +3 -0
  175. package/docs/examples/account/create-phone-verification.md +1 -0
  176. package/docs/examples/account/create-push-target.md +3 -0
  177. package/docs/examples/account/create-recovery.md +3 -0
  178. package/docs/examples/account/create-session.md +3 -0
  179. package/docs/examples/account/create-verification.md +2 -0
  180. package/docs/examples/account/create.md +4 -0
  181. package/docs/examples/account/delete-identity.md +2 -0
  182. package/docs/examples/account/delete-mfa-authenticator.md +2 -0
  183. package/docs/examples/account/delete-push-target.md +2 -0
  184. package/docs/examples/account/delete-session.md +2 -0
  185. package/docs/examples/account/delete-sessions.md +1 -0
  186. package/docs/examples/account/delete.md +1 -0
  187. package/docs/examples/account/get-mfa-recovery-codes.md +1 -0
  188. package/docs/examples/account/get-prefs.md +1 -0
  189. package/docs/examples/account/get-session.md +2 -0
  190. package/docs/examples/account/get.md +1 -0
  191. package/docs/examples/account/list-identities.md +1 -0
  192. package/docs/examples/account/list-logs.md +1 -0
  193. package/docs/examples/account/list-mfa-factors.md +1 -0
  194. package/docs/examples/account/list-sessions.md +1 -0
  195. package/docs/examples/account/update-email-verification.md +3 -0
  196. package/docs/examples/account/update-email.md +3 -0
  197. package/docs/examples/account/update-magic-url-session.md +3 -0
  198. package/docs/examples/account/update-mfa-authenticator.md +3 -0
  199. package/docs/examples/account/update-mfa-challenge.md +3 -0
  200. package/docs/examples/account/update-mfa-recovery-codes.md +1 -0
  201. package/docs/examples/account/update-mfa.md +2 -0
  202. package/docs/examples/account/update-name.md +2 -0
  203. package/docs/examples/account/update-password.md +2 -0
  204. package/docs/examples/account/update-phone-session.md +3 -0
  205. package/docs/examples/account/update-phone-verification.md +3 -0
  206. package/docs/examples/account/update-phone.md +3 -0
  207. package/docs/examples/account/update-prefs.md +2 -0
  208. package/docs/examples/account/update-push-target.md +3 -0
  209. package/docs/examples/account/update-recovery.md +4 -0
  210. package/docs/examples/account/update-session.md +2 -0
  211. package/docs/examples/account/update-status.md +1 -0
  212. package/docs/examples/account/update-verification.md +3 -0
  213. package/docs/examples/console/get-resource.md +3 -0
  214. package/docs/examples/console/variables.md +1 -0
  215. package/docs/examples/databases/create-boolean-attribute.md +5 -0
  216. package/docs/examples/databases/create-collection.md +4 -0
  217. package/docs/examples/databases/create-datetime-attribute.md +5 -0
  218. package/docs/examples/databases/create-document.md +5 -0
  219. package/docs/examples/databases/create-documents.md +4 -0
  220. package/docs/examples/databases/create-email-attribute.md +5 -0
  221. package/docs/examples/databases/create-enum-attribute.md +6 -0
  222. package/docs/examples/databases/create-float-attribute.md +5 -0
  223. package/docs/examples/databases/create-index.md +6 -0
  224. package/docs/examples/databases/create-integer-attribute.md +5 -0
  225. package/docs/examples/databases/create-ip-attribute.md +5 -0
  226. package/docs/examples/databases/create-line-attribute.md +5 -0
  227. package/docs/examples/databases/create-operations.md +2 -0
  228. package/docs/examples/databases/create-point-attribute.md +5 -0
  229. package/docs/examples/databases/create-polygon-attribute.md +5 -0
  230. package/docs/examples/databases/create-relationship-attribute.md +5 -0
  231. package/docs/examples/databases/create-string-attribute.md +6 -0
  232. package/docs/examples/databases/create-transaction.md +1 -0
  233. package/docs/examples/databases/create-url-attribute.md +5 -0
  234. package/docs/examples/databases/create.md +3 -0
  235. package/docs/examples/databases/decrement-document-attribute.md +5 -0
  236. package/docs/examples/databases/delete-attribute.md +4 -0
  237. package/docs/examples/databases/delete-collection.md +3 -0
  238. package/docs/examples/databases/delete-document.md +4 -0
  239. package/docs/examples/databases/delete-documents.md +3 -0
  240. package/docs/examples/databases/delete-index.md +4 -0
  241. package/docs/examples/databases/delete-transaction.md +2 -0
  242. package/docs/examples/databases/delete.md +2 -0
  243. package/docs/examples/databases/get-attribute.md +4 -0
  244. package/docs/examples/databases/get-collection-usage.md +3 -0
  245. package/docs/examples/databases/get-collection.md +3 -0
  246. package/docs/examples/databases/get-document.md +4 -0
  247. package/docs/examples/databases/get-index.md +4 -0
  248. package/docs/examples/databases/get-transaction.md +2 -0
  249. package/docs/examples/databases/get-usage.md +2 -0
  250. package/docs/examples/databases/get.md +2 -0
  251. package/docs/examples/databases/increment-document-attribute.md +5 -0
  252. package/docs/examples/databases/list-attributes.md +3 -0
  253. package/docs/examples/databases/list-collection-logs.md +3 -0
  254. package/docs/examples/databases/list-collections.md +2 -0
  255. package/docs/examples/databases/list-document-logs.md +4 -0
  256. package/docs/examples/databases/list-documents.md +3 -0
  257. package/docs/examples/databases/list-indexes.md +3 -0
  258. package/docs/examples/databases/list-logs.md +2 -0
  259. package/docs/examples/databases/list-transactions.md +1 -0
  260. package/docs/examples/databases/list-usage.md +1 -0
  261. package/docs/examples/databases/list.md +1 -0
  262. package/docs/examples/databases/update-boolean-attribute.md +6 -0
  263. package/docs/examples/databases/update-collection.md +4 -0
  264. package/docs/examples/databases/update-datetime-attribute.md +6 -0
  265. package/docs/examples/databases/update-document.md +4 -0
  266. package/docs/examples/databases/update-documents.md +3 -0
  267. package/docs/examples/databases/update-email-attribute.md +6 -0
  268. package/docs/examples/databases/update-enum-attribute.md +7 -0
  269. package/docs/examples/databases/update-float-attribute.md +6 -0
  270. package/docs/examples/databases/update-integer-attribute.md +6 -0
  271. package/docs/examples/databases/update-ip-attribute.md +6 -0
  272. package/docs/examples/databases/update-line-attribute.md +5 -0
  273. package/docs/examples/databases/update-point-attribute.md +5 -0
  274. package/docs/examples/databases/update-polygon-attribute.md +5 -0
  275. package/docs/examples/databases/update-relationship-attribute.md +4 -0
  276. package/docs/examples/databases/update-string-attribute.md +6 -0
  277. package/docs/examples/databases/update-transaction.md +2 -0
  278. package/docs/examples/databases/update-url-attribute.md +6 -0
  279. package/docs/examples/databases/update.md +3 -0
  280. package/docs/examples/databases/upsert-document.md +4 -0
  281. package/docs/examples/databases/upsert-documents.md +4 -0
  282. package/docs/examples/functions/create-deployment.md +4 -0
  283. package/docs/examples/functions/create-duplicate-deployment.md +3 -0
  284. package/docs/examples/functions/create-execution.md +2 -0
  285. package/docs/examples/functions/create-template-deployment.md +7 -0
  286. package/docs/examples/functions/create-variable.md +4 -0
  287. package/docs/examples/functions/create-vcs-deployment.md +4 -0
  288. package/docs/examples/functions/create.md +4 -0
  289. package/docs/examples/functions/delete-deployment.md +3 -0
  290. package/docs/examples/functions/delete-execution.md +3 -0
  291. package/docs/examples/functions/delete-variable.md +3 -0
  292. package/docs/examples/functions/delete.md +2 -0
  293. package/docs/examples/functions/get-deployment-download.md +3 -0
  294. package/docs/examples/functions/get-deployment.md +3 -0
  295. package/docs/examples/functions/get-execution.md +3 -0
  296. package/docs/examples/functions/get-template.md +2 -0
  297. package/docs/examples/functions/get-usage.md +2 -0
  298. package/docs/examples/functions/get-variable.md +3 -0
  299. package/docs/examples/functions/get.md +2 -0
  300. package/docs/examples/functions/list-deployments.md +2 -0
  301. package/docs/examples/functions/list-executions.md +2 -0
  302. package/docs/examples/functions/list-runtimes.md +1 -0
  303. package/docs/examples/functions/list-specifications.md +1 -0
  304. package/docs/examples/functions/list-templates.md +1 -0
  305. package/docs/examples/functions/list-usage.md +1 -0
  306. package/docs/examples/functions/list-variables.md +2 -0
  307. package/docs/examples/functions/list.md +1 -0
  308. package/docs/examples/functions/update-deployment-status.md +3 -0
  309. package/docs/examples/functions/update-function-deployment.md +3 -0
  310. package/docs/examples/functions/update-variable.md +4 -0
  311. package/docs/examples/functions/update.md +3 -0
  312. package/docs/examples/graphql/mutation.md +2 -0
  313. package/docs/examples/graphql/query.md +2 -0
  314. package/docs/examples/health/get-antivirus.md +1 -0
  315. package/docs/examples/health/get-cache.md +1 -0
  316. package/docs/examples/health/get-certificate.md +1 -0
  317. package/docs/examples/health/get-db.md +1 -0
  318. package/docs/examples/health/get-failed-jobs.md +2 -0
  319. package/docs/examples/health/get-pub-sub.md +1 -0
  320. package/docs/examples/health/get-queue-builds.md +1 -0
  321. package/docs/examples/health/get-queue-certificates.md +1 -0
  322. package/docs/examples/health/get-queue-databases.md +1 -0
  323. package/docs/examples/health/get-queue-deletes.md +1 -0
  324. package/docs/examples/health/get-queue-functions.md +1 -0
  325. package/docs/examples/health/get-queue-logs.md +1 -0
  326. package/docs/examples/health/get-queue-mails.md +1 -0
  327. package/docs/examples/health/get-queue-messaging.md +1 -0
  328. package/docs/examples/health/get-queue-migrations.md +1 -0
  329. package/docs/examples/health/get-queue-stats-resources.md +1 -0
  330. package/docs/examples/health/get-queue-usage.md +1 -0
  331. package/docs/examples/health/get-queue-webhooks.md +1 -0
  332. package/docs/examples/health/get-storage-local.md +1 -0
  333. package/docs/examples/health/get-storage.md +1 -0
  334. package/docs/examples/health/get-time.md +1 -0
  335. package/docs/examples/health/get.md +1 -0
  336. package/docs/examples/locale/get.md +1 -0
  337. package/docs/examples/locale/list-codes.md +1 -0
  338. package/docs/examples/locale/list-continents.md +1 -0
  339. package/docs/examples/locale/list-countries-eu.md +1 -0
  340. package/docs/examples/locale/list-countries-phones.md +1 -0
  341. package/docs/examples/locale/list-countries.md +1 -0
  342. package/docs/examples/locale/list-currencies.md +1 -0
  343. package/docs/examples/locale/list-languages.md +1 -0
  344. package/docs/examples/messaging/create-apns-provider.md +3 -0
  345. package/docs/examples/messaging/create-email.md +4 -0
  346. package/docs/examples/messaging/create-fcm-provider.md +3 -0
  347. package/docs/examples/messaging/create-mailgun-provider.md +3 -0
  348. package/docs/examples/messaging/create-msg-91-provider.md +3 -0
  349. package/docs/examples/messaging/create-push.md +2 -0
  350. package/docs/examples/messaging/create-resend-provider.md +3 -0
  351. package/docs/examples/messaging/create-sendgrid-provider.md +3 -0
  352. package/docs/examples/messaging/create-sms.md +3 -0
  353. package/docs/examples/messaging/create-smtp-provider.md +4 -0
  354. package/docs/examples/messaging/create-subscriber.md +4 -0
  355. package/docs/examples/messaging/create-telesign-provider.md +3 -0
  356. package/docs/examples/messaging/create-textmagic-provider.md +3 -0
  357. package/docs/examples/messaging/create-topic.md +3 -0
  358. package/docs/examples/messaging/create-twilio-provider.md +3 -0
  359. package/docs/examples/messaging/create-vonage-provider.md +3 -0
  360. package/docs/examples/messaging/delete-provider.md +2 -0
  361. package/docs/examples/messaging/delete-subscriber.md +3 -0
  362. package/docs/examples/messaging/delete-topic.md +2 -0
  363. package/docs/examples/messaging/delete.md +2 -0
  364. package/docs/examples/messaging/get-message.md +2 -0
  365. package/docs/examples/messaging/get-provider.md +2 -0
  366. package/docs/examples/messaging/get-subscriber.md +3 -0
  367. package/docs/examples/messaging/get-topic.md +2 -0
  368. package/docs/examples/messaging/list-message-logs.md +2 -0
  369. package/docs/examples/messaging/list-messages.md +1 -0
  370. package/docs/examples/messaging/list-provider-logs.md +2 -0
  371. package/docs/examples/messaging/list-providers.md +1 -0
  372. package/docs/examples/messaging/list-subscriber-logs.md +2 -0
  373. package/docs/examples/messaging/list-subscribers.md +2 -0
  374. package/docs/examples/messaging/list-targets.md +2 -0
  375. package/docs/examples/messaging/list-topic-logs.md +2 -0
  376. package/docs/examples/messaging/list-topics.md +1 -0
  377. package/docs/examples/messaging/update-apns-provider.md +2 -0
  378. package/docs/examples/messaging/update-email.md +2 -0
  379. package/docs/examples/messaging/update-fcm-provider.md +2 -0
  380. package/docs/examples/messaging/update-mailgun-provider.md +2 -0
  381. package/docs/examples/messaging/update-msg-91-provider.md +2 -0
  382. package/docs/examples/messaging/update-push.md +2 -0
  383. package/docs/examples/messaging/update-resend-provider.md +2 -0
  384. package/docs/examples/messaging/update-sendgrid-provider.md +2 -0
  385. package/docs/examples/messaging/update-sms.md +2 -0
  386. package/docs/examples/messaging/update-smtp-provider.md +2 -0
  387. package/docs/examples/messaging/update-telesign-provider.md +2 -0
  388. package/docs/examples/messaging/update-textmagic-provider.md +2 -0
  389. package/docs/examples/messaging/update-topic.md +2 -0
  390. package/docs/examples/messaging/update-twilio-provider.md +2 -0
  391. package/docs/examples/messaging/update-vonage-provider.md +2 -0
  392. package/docs/examples/migrations/create-appwrite-migration.md +5 -0
  393. package/docs/examples/migrations/create-csv-export.md +3 -0
  394. package/docs/examples/migrations/create-csv-import.md +4 -0
  395. package/docs/examples/migrations/create-firebase-migration.md +3 -0
  396. package/docs/examples/migrations/create-n-host-migration.md +8 -0
  397. package/docs/examples/migrations/create-supabase-migration.md +7 -0
  398. package/docs/examples/migrations/delete.md +2 -0
  399. package/docs/examples/migrations/get-appwrite-report.md +5 -0
  400. package/docs/examples/migrations/get-firebase-report.md +3 -0
  401. package/docs/examples/migrations/get-n-host-report.md +8 -0
  402. package/docs/examples/migrations/get-supabase-report.md +7 -0
  403. package/docs/examples/migrations/get.md +2 -0
  404. package/docs/examples/migrations/list.md +1 -0
  405. package/docs/examples/migrations/retry.md +2 -0
  406. package/docs/examples/project/create-variable.md +3 -0
  407. package/docs/examples/project/delete-variable.md +2 -0
  408. package/docs/examples/project/get-usage.md +3 -0
  409. package/docs/examples/project/get-variable.md +2 -0
  410. package/docs/examples/project/list-variables.md +1 -0
  411. package/docs/examples/project/update-variable.md +3 -0
  412. package/docs/examples/projects/create-dev-key.md +4 -0
  413. package/docs/examples/projects/create-jwt.md +3 -0
  414. package/docs/examples/projects/create-key.md +4 -0
  415. package/docs/examples/projects/create-platform.md +4 -0
  416. package/docs/examples/projects/create-smtp-test.md +6 -0
  417. package/docs/examples/projects/create-webhook.md +6 -0
  418. package/docs/examples/projects/create.md +4 -0
  419. package/docs/examples/projects/delete-dev-key.md +3 -0
  420. package/docs/examples/projects/delete-email-template.md +4 -0
  421. package/docs/examples/projects/delete-key.md +3 -0
  422. package/docs/examples/projects/delete-platform.md +3 -0
  423. package/docs/examples/projects/delete-sms-template.md +4 -0
  424. package/docs/examples/projects/delete-webhook.md +3 -0
  425. package/docs/examples/projects/delete.md +2 -0
  426. package/docs/examples/projects/get-dev-key.md +3 -0
  427. package/docs/examples/projects/get-email-template.md +4 -0
  428. package/docs/examples/projects/get-key.md +3 -0
  429. package/docs/examples/projects/get-platform.md +3 -0
  430. package/docs/examples/projects/get-sms-template.md +4 -0
  431. package/docs/examples/projects/get-webhook.md +3 -0
  432. package/docs/examples/projects/get.md +2 -0
  433. package/docs/examples/projects/list-dev-keys.md +2 -0
  434. package/docs/examples/projects/list-keys.md +2 -0
  435. package/docs/examples/projects/list-platforms.md +2 -0
  436. package/docs/examples/projects/list-webhooks.md +2 -0
  437. package/docs/examples/projects/list.md +1 -0
  438. package/docs/examples/projects/update-api-status-all.md +3 -0
  439. package/docs/examples/projects/update-api-status.md +4 -0
  440. package/docs/examples/projects/update-auth-duration.md +3 -0
  441. package/docs/examples/projects/update-auth-limit.md +3 -0
  442. package/docs/examples/projects/update-auth-password-dictionary.md +3 -0
  443. package/docs/examples/projects/update-auth-password-history.md +3 -0
  444. package/docs/examples/projects/update-auth-sessions-limit.md +3 -0
  445. package/docs/examples/projects/update-auth-status.md +4 -0
  446. package/docs/examples/projects/update-dev-key.md +5 -0
  447. package/docs/examples/projects/update-email-template.md +6 -0
  448. package/docs/examples/projects/update-key.md +5 -0
  449. package/docs/examples/projects/update-memberships-privacy.md +5 -0
  450. package/docs/examples/projects/update-mock-numbers.md +3 -0
  451. package/docs/examples/projects/update-o-auth-2.md +3 -0
  452. package/docs/examples/projects/update-personal-data-check.md +3 -0
  453. package/docs/examples/projects/update-platform.md +4 -0
  454. package/docs/examples/projects/update-service-status-all.md +3 -0
  455. package/docs/examples/projects/update-service-status.md +4 -0
  456. package/docs/examples/projects/update-session-alerts.md +3 -0
  457. package/docs/examples/projects/update-session-invalidation.md +3 -0
  458. package/docs/examples/projects/update-sms-template.md +5 -0
  459. package/docs/examples/projects/update-smtp.md +3 -0
  460. package/docs/examples/projects/update-team.md +3 -0
  461. package/docs/examples/projects/update-webhook-signature.md +3 -0
  462. package/docs/examples/projects/update-webhook.md +7 -0
  463. package/docs/examples/projects/update.md +3 -0
  464. package/docs/examples/proxy/create-api-rule.md +2 -0
  465. package/docs/examples/proxy/create-function-rule.md +3 -0
  466. package/docs/examples/proxy/create-redirect-rule.md +6 -0
  467. package/docs/examples/proxy/create-site-rule.md +3 -0
  468. package/docs/examples/proxy/delete-rule.md +2 -0
  469. package/docs/examples/proxy/get-rule.md +2 -0
  470. package/docs/examples/proxy/list-rules.md +1 -0
  471. package/docs/examples/proxy/update-rule-verification.md +2 -0
  472. package/docs/examples/sites/create-deployment.md +4 -0
  473. package/docs/examples/sites/create-duplicate-deployment.md +3 -0
  474. package/docs/examples/sites/create-template-deployment.md +7 -0
  475. package/docs/examples/sites/create-variable.md +4 -0
  476. package/docs/examples/sites/create-vcs-deployment.md +4 -0
  477. package/docs/examples/sites/create.md +5 -0
  478. package/docs/examples/sites/delete-deployment.md +3 -0
  479. package/docs/examples/sites/delete-log.md +3 -0
  480. package/docs/examples/sites/delete-variable.md +3 -0
  481. package/docs/examples/sites/delete.md +2 -0
  482. package/docs/examples/sites/get-deployment-download.md +3 -0
  483. package/docs/examples/sites/get-deployment.md +3 -0
  484. package/docs/examples/sites/get-log.md +3 -0
  485. package/docs/examples/sites/get-template.md +2 -0
  486. package/docs/examples/sites/get-usage.md +2 -0
  487. package/docs/examples/sites/get-variable.md +3 -0
  488. package/docs/examples/sites/get.md +2 -0
  489. package/docs/examples/sites/list-deployments.md +2 -0
  490. package/docs/examples/sites/list-frameworks.md +1 -0
  491. package/docs/examples/sites/list-logs.md +2 -0
  492. package/docs/examples/sites/list-specifications.md +1 -0
  493. package/docs/examples/sites/list-templates.md +1 -0
  494. package/docs/examples/sites/list-usage.md +1 -0
  495. package/docs/examples/sites/list-variables.md +2 -0
  496. package/docs/examples/sites/list.md +1 -0
  497. package/docs/examples/sites/update-deployment-status.md +3 -0
  498. package/docs/examples/sites/update-site-deployment.md +3 -0
  499. package/docs/examples/sites/update-variable.md +4 -0
  500. package/docs/examples/sites/update.md +4 -0
  501. package/docs/examples/storage/create-bucket.md +3 -0
  502. package/docs/examples/storage/create-file.md +4 -0
  503. package/docs/examples/storage/delete-bucket.md +2 -0
  504. package/docs/examples/storage/delete-file.md +3 -0
  505. package/docs/examples/storage/get-bucket-usage.md +2 -0
  506. package/docs/examples/storage/get-bucket.md +2 -0
  507. package/docs/examples/storage/get-file-download.md +3 -0
  508. package/docs/examples/storage/get-file-preview.md +3 -0
  509. package/docs/examples/storage/get-file-view.md +3 -0
  510. package/docs/examples/storage/get-file.md +3 -0
  511. package/docs/examples/storage/get-usage.md +1 -0
  512. package/docs/examples/storage/list-buckets.md +1 -0
  513. package/docs/examples/storage/list-files.md +2 -0
  514. package/docs/examples/storage/update-bucket.md +3 -0
  515. package/docs/examples/storage/update-file.md +3 -0
  516. package/docs/examples/tablesdb/create-boolean-column.md +5 -0
  517. package/docs/examples/tablesdb/create-datetime-column.md +5 -0
  518. package/docs/examples/tablesdb/create-email-column.md +5 -0
  519. package/docs/examples/tablesdb/create-enum-column.md +6 -0
  520. package/docs/examples/tablesdb/create-float-column.md +5 -0
  521. package/docs/examples/tablesdb/create-index.md +6 -0
  522. package/docs/examples/tablesdb/create-integer-column.md +5 -0
  523. package/docs/examples/tablesdb/create-ip-column.md +5 -0
  524. package/docs/examples/tablesdb/create-line-column.md +5 -0
  525. package/docs/examples/tablesdb/create-operations.md +2 -0
  526. package/docs/examples/tablesdb/create-point-column.md +5 -0
  527. package/docs/examples/tablesdb/create-polygon-column.md +5 -0
  528. package/docs/examples/tablesdb/create-relationship-column.md +5 -0
  529. package/docs/examples/tablesdb/create-row.md +5 -0
  530. package/docs/examples/tablesdb/create-rows.md +4 -0
  531. package/docs/examples/tablesdb/create-string-column.md +6 -0
  532. package/docs/examples/tablesdb/create-table.md +4 -0
  533. package/docs/examples/tablesdb/create-transaction.md +1 -0
  534. package/docs/examples/tablesdb/create-url-column.md +5 -0
  535. package/docs/examples/tablesdb/create.md +3 -0
  536. package/docs/examples/tablesdb/decrement-row-column.md +5 -0
  537. package/docs/examples/tablesdb/delete-column.md +4 -0
  538. package/docs/examples/tablesdb/delete-index.md +4 -0
  539. package/docs/examples/tablesdb/delete-row.md +4 -0
  540. package/docs/examples/tablesdb/delete-rows.md +3 -0
  541. package/docs/examples/tablesdb/delete-table.md +3 -0
  542. package/docs/examples/tablesdb/delete-transaction.md +2 -0
  543. package/docs/examples/tablesdb/delete.md +2 -0
  544. package/docs/examples/tablesdb/get-column.md +4 -0
  545. package/docs/examples/tablesdb/get-index.md +4 -0
  546. package/docs/examples/tablesdb/get-row.md +4 -0
  547. package/docs/examples/tablesdb/get-table-usage.md +3 -0
  548. package/docs/examples/tablesdb/get-table.md +3 -0
  549. package/docs/examples/tablesdb/get-transaction.md +2 -0
  550. package/docs/examples/tablesdb/get-usage.md +2 -0
  551. package/docs/examples/tablesdb/get.md +2 -0
  552. package/docs/examples/tablesdb/increment-row-column.md +5 -0
  553. package/docs/examples/tablesdb/list-columns.md +3 -0
  554. package/docs/examples/tablesdb/list-indexes.md +3 -0
  555. package/docs/examples/tablesdb/list-row-logs.md +4 -0
  556. package/docs/examples/tablesdb/list-rows.md +3 -0
  557. package/docs/examples/tablesdb/list-table-logs.md +3 -0
  558. package/docs/examples/tablesdb/list-tables.md +2 -0
  559. package/docs/examples/tablesdb/list-transactions.md +1 -0
  560. package/docs/examples/tablesdb/list-usage.md +1 -0
  561. package/docs/examples/tablesdb/list.md +1 -0
  562. package/docs/examples/tablesdb/update-boolean-column.md +6 -0
  563. package/docs/examples/tablesdb/update-datetime-column.md +6 -0
  564. package/docs/examples/tablesdb/update-email-column.md +6 -0
  565. package/docs/examples/tablesdb/update-enum-column.md +7 -0
  566. package/docs/examples/tablesdb/update-float-column.md +6 -0
  567. package/docs/examples/tablesdb/update-integer-column.md +6 -0
  568. package/docs/examples/tablesdb/update-ip-column.md +6 -0
  569. package/docs/examples/tablesdb/update-line-column.md +5 -0
  570. package/docs/examples/tablesdb/update-point-column.md +5 -0
  571. package/docs/examples/tablesdb/update-polygon-column.md +5 -0
  572. package/docs/examples/tablesdb/update-relationship-column.md +4 -0
  573. package/docs/examples/tablesdb/update-row.md +4 -0
  574. package/docs/examples/tablesdb/update-rows.md +3 -0
  575. package/docs/examples/tablesdb/update-string-column.md +6 -0
  576. package/docs/examples/tablesdb/update-table.md +4 -0
  577. package/docs/examples/tablesdb/update-transaction.md +2 -0
  578. package/docs/examples/tablesdb/update-url-column.md +6 -0
  579. package/docs/examples/tablesdb/update.md +3 -0
  580. package/docs/examples/tablesdb/upsert-row.md +4 -0
  581. package/docs/examples/tablesdb/upsert-rows.md +4 -0
  582. package/docs/examples/teams/create-membership.md +3 -0
  583. package/docs/examples/teams/create.md +3 -0
  584. package/docs/examples/teams/delete-membership.md +3 -0
  585. package/docs/examples/teams/delete.md +2 -0
  586. package/docs/examples/teams/get-membership.md +3 -0
  587. package/docs/examples/teams/get-prefs.md +2 -0
  588. package/docs/examples/teams/get.md +2 -0
  589. package/docs/examples/teams/list-logs.md +2 -0
  590. package/docs/examples/teams/list-memberships.md +2 -0
  591. package/docs/examples/teams/list.md +1 -0
  592. package/docs/examples/teams/update-membership-status.md +5 -0
  593. package/docs/examples/teams/update-membership.md +4 -0
  594. package/docs/examples/teams/update-name.md +3 -0
  595. package/docs/examples/teams/update-prefs.md +3 -0
  596. package/docs/examples/tokens/create-file-token.md +3 -0
  597. package/docs/examples/tokens/delete.md +2 -0
  598. package/docs/examples/tokens/get.md +2 -0
  599. package/docs/examples/tokens/list.md +3 -0
  600. package/docs/examples/tokens/update.md +2 -0
  601. package/docs/examples/users/create-argon-2-user.md +4 -0
  602. package/docs/examples/users/create-bcrypt-user.md +4 -0
  603. package/docs/examples/users/create-jwt.md +2 -0
  604. package/docs/examples/users/create-md-5-user.md +4 -0
  605. package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
  606. package/docs/examples/users/create-ph-pass-user.md +4 -0
  607. package/docs/examples/users/create-scrypt-modified-user.md +7 -0
  608. package/docs/examples/users/create-scrypt-user.md +9 -0
  609. package/docs/examples/users/create-session.md +2 -0
  610. package/docs/examples/users/create-sha-user.md +4 -0
  611. package/docs/examples/users/create-target.md +5 -0
  612. package/docs/examples/users/create-token.md +2 -0
  613. package/docs/examples/users/create.md +2 -0
  614. package/docs/examples/users/delete-identity.md +2 -0
  615. package/docs/examples/users/delete-mfa-authenticator.md +3 -0
  616. package/docs/examples/users/delete-session.md +3 -0
  617. package/docs/examples/users/delete-sessions.md +2 -0
  618. package/docs/examples/users/delete-target.md +3 -0
  619. package/docs/examples/users/delete.md +2 -0
  620. package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
  621. package/docs/examples/users/get-prefs.md +2 -0
  622. package/docs/examples/users/get-target.md +3 -0
  623. package/docs/examples/users/get-usage.md +1 -0
  624. package/docs/examples/users/get.md +2 -0
  625. package/docs/examples/users/list-identities.md +1 -0
  626. package/docs/examples/users/list-logs.md +2 -0
  627. package/docs/examples/users/list-memberships.md +2 -0
  628. package/docs/examples/users/list-mfa-factors.md +2 -0
  629. package/docs/examples/users/list-sessions.md +2 -0
  630. package/docs/examples/users/list-targets.md +2 -0
  631. package/docs/examples/users/list.md +1 -0
  632. package/docs/examples/users/update-email-verification.md +3 -0
  633. package/docs/examples/users/update-email.md +3 -0
  634. package/docs/examples/users/update-labels.md +3 -0
  635. package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
  636. package/docs/examples/users/update-mfa.md +3 -0
  637. package/docs/examples/users/update-name.md +3 -0
  638. package/docs/examples/users/update-password.md +3 -0
  639. package/docs/examples/users/update-phone-verification.md +3 -0
  640. package/docs/examples/users/update-phone.md +3 -0
  641. package/docs/examples/users/update-prefs.md +3 -0
  642. package/docs/examples/users/update-status.md +3 -0
  643. package/docs/examples/users/update-target.md +3 -0
  644. package/docs/examples/vcs/create-repository-detection.md +4 -0
  645. package/docs/examples/vcs/create-repository.md +4 -0
  646. package/docs/examples/vcs/delete-installation.md +2 -0
  647. package/docs/examples/vcs/get-installation.md +2 -0
  648. package/docs/examples/vcs/get-repository-contents.md +3 -0
  649. package/docs/examples/vcs/get-repository.md +3 -0
  650. package/docs/examples/vcs/list-installations.md +1 -0
  651. package/docs/examples/vcs/list-repositories.md +3 -0
  652. package/docs/examples/vcs/list-repository-branches.md +3 -0
  653. package/docs/examples/vcs/update-external-deployments.md +4 -0
  654. package/index.ts +25 -165
  655. package/install.ps1 +2 -2
  656. package/install.sh +1 -1
  657. package/lib/client.ts +14 -6
  658. package/lib/commands/config.ts +494 -0
  659. package/lib/commands/db.ts +324 -0
  660. package/lib/commands/errors.ts +93 -0
  661. package/lib/commands/init.ts +25 -14
  662. package/lib/commands/pull.ts +683 -420
  663. package/lib/commands/push.ts +1677 -2404
  664. package/lib/commands/run.ts +1 -1
  665. package/lib/commands/schema.ts +122 -0
  666. package/lib/commands/services/account.ts +200 -385
  667. package/lib/commands/services/console.ts +13 -34
  668. package/lib/commands/services/databases.ts +298 -1215
  669. package/lib/commands/services/functions.ts +115 -434
  670. package/lib/commands/services/graphql.ts +5 -2
  671. package/lib/commands/services/health.ts +87 -149
  672. package/lib/commands/services/locale.ts +36 -33
  673. package/lib/commands/services/messaging.ts +180 -999
  674. package/lib/commands/services/migrations.ts +54 -226
  675. package/lib/commands/services/project.ts +19 -23
  676. package/lib/commands/services/projects.ts +182 -714
  677. package/lib/commands/services/proxy.ts +30 -58
  678. package/lib/commands/services/sites.ts +107 -379
  679. package/lib/commands/services/storage.ts +93 -302
  680. package/lib/commands/services/tables-db.ts +1150 -0
  681. package/lib/commands/services/teams.ts +48 -110
  682. package/lib/commands/services/tokens.ts +16 -28
  683. package/lib/commands/services/users.ts +133 -403
  684. package/lib/commands/services/vcs.ts +48 -151
  685. package/lib/commands/types.ts +1 -1
  686. package/lib/commands/update.ts +13 -22
  687. package/lib/commands/utils/attributes.ts +719 -0
  688. package/lib/commands/utils/change-approval.ts +186 -0
  689. package/lib/commands/utils/database-sync.ts +180 -0
  690. package/lib/commands/utils/deployment.ts +184 -0
  691. package/lib/commands/utils/error-formatter.ts +417 -0
  692. package/lib/commands/utils/pools.ts +355 -0
  693. package/lib/config.ts +46 -82
  694. package/lib/constants.ts +22 -0
  695. package/lib/emulation/docker.ts +101 -87
  696. package/lib/parser.ts +16 -11
  697. package/lib/questions.ts +20 -21
  698. package/lib/sdks.ts +15 -11
  699. package/lib/types.ts +0 -229
  700. package/lib/utils.ts +45 -4
  701. package/package.json +12 -11
  702. package/scoop/appwrite.config.json +29 -19
  703. package/.github/workflows/build-verify.yml +0 -71
  704. package/bun.lock +0 -625
  705. package/dist/lib/commands/services/avatars.d.ts +0 -3
  706. package/dist/lib/commands/services/avatars.d.ts.map +0 -1
  707. package/dist/lib/commands/services/avatars.js +0 -118
  708. package/dist/lib/commands/services/avatars.js.map +0 -1
  709. package/dist/lib/commands/services/tablesdb.d.ts +0 -3
  710. package/dist/lib/commands/services/tablesdb.d.ts.map +0 -1
  711. package/dist/lib/commands/services/tablesdb.js.map +0 -1
  712. package/dist/scripts/generate-commands.d.ts +0 -2
  713. package/dist/scripts/generate-commands.d.ts.map +0 -1
  714. package/dist/scripts/generate-commands.js +0 -398
  715. package/dist/scripts/generate-commands.js.map +0 -1
  716. package/lib/commands/services/avatars.ts +0 -400
  717. package/lib/commands/services/tablesdb.ts +0 -1928
  718. package/scripts/generate-commands.ts +0 -539
@@ -3,6 +3,8 @@ import { sdkForProject } from "../../sdks.js";
3
3
  import {
4
4
  actionRunner,
5
5
  commandDescriptions,
6
+ success,
7
+ parse,
6
8
  parseBool,
7
9
  parseInteger,
8
10
  } from "../../parser.js";
@@ -32,17 +34,9 @@ export const databases = new Command("databases")
32
34
 
33
35
  databases
34
36
  .command(`list`)
35
- .description(
36
- `[**DEPRECATED** - This command is deprecated. Please use 'databases list' instead] Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`,
37
- )
38
- .option(
39
- `--queries [queries...]`,
40
- `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`,
41
- )
42
- .option(
43
- `--search <search>`,
44
- `Search term to filter your list results. Max length: 256 chars.`,
45
- )
37
+ .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`)
38
+ .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`)
39
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
46
40
  .option(
47
41
  `--total [value]`,
48
42
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -52,20 +46,15 @@ databases
52
46
  .action(
53
47
  actionRunner(
54
48
  async ({ queries, search, total }) =>
55
- await (await getDatabasesClient()).list(queries, search, total),
49
+ parse(await (await getDatabasesClient()).list(queries, search, total)),
56
50
  ),
57
51
  );
58
52
 
59
53
  databases
60
54
  .command(`create`)
61
- .description(
62
- `[**DEPRECATED** - This command is deprecated. Please use 'databases create' instead] Create a new Database.
63
- `,
64
- )
65
- .requiredOption(
66
- `--database-id <database-id>`,
67
- `Unique Id. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
68
- )
55
+ .description(`Create a new Database.
56
+ `)
57
+ .requiredOption(`--database-id <database-id>`, `Unique Id. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
69
58
  .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
70
59
  .option(
71
60
  `--enabled [value]`,
@@ -76,36 +65,29 @@ databases
76
65
  .action(
77
66
  actionRunner(
78
67
  async ({ databaseId, name, enabled }) =>
79
- await (await getDatabasesClient()).create(databaseId, name, enabled),
68
+ parse(await (await getDatabasesClient()).create(databaseId, name, enabled)),
80
69
  ),
81
70
  );
82
71
 
83
72
  databases
84
73
  .command(`list-transactions`)
85
74
  .description(`List transactions across all databases.`)
86
- .option(
87
- `--queries [queries...]`,
88
- `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries).`,
89
- )
75
+ .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).`)
90
76
  .action(
91
77
  actionRunner(
92
78
  async ({ queries }) =>
93
- await (await getDatabasesClient()).listTransactions(queries),
79
+ parse(await (await getDatabasesClient()).listTransactions(queries)),
94
80
  ),
95
81
  );
96
82
 
97
83
  databases
98
84
  .command(`create-transaction`)
99
85
  .description(`Create a new transaction.`)
100
- .option(
101
- `--ttl <ttl>`,
102
- `Seconds before the transaction expires.`,
103
- parseInteger,
104
- )
86
+ .option(`--ttl <ttl>`, `Seconds before the transaction expires.`, parseInteger)
105
87
  .action(
106
88
  actionRunner(
107
89
  async ({ ttl }) =>
108
- await (await getDatabasesClient()).createTransaction(ttl),
90
+ parse(await (await getDatabasesClient()).createTransaction(ttl)),
109
91
  ),
110
92
  );
111
93
 
@@ -116,15 +98,13 @@ databases
116
98
  .action(
117
99
  actionRunner(
118
100
  async ({ transactionId }) =>
119
- await (await getDatabasesClient()).getTransaction(transactionId),
101
+ parse(await (await getDatabasesClient()).getTransaction(transactionId)),
120
102
  ),
121
103
  );
122
104
 
123
105
  databases
124
106
  .command(`update-transaction`)
125
- .description(
126
- `Update a transaction, to either commit or roll back its operations.`,
127
- )
107
+ .description(`Update a transaction, to either commit or roll back its operations.`)
128
108
  .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
129
109
  .option(
130
110
  `--commit [value]`,
@@ -141,9 +121,7 @@ databases
141
121
  .action(
142
122
  actionRunner(
143
123
  async ({ transactionId, commit, rollback }) =>
144
- await (
145
- await getDatabasesClient()
146
- ).updateTransaction(transactionId, commit, rollback),
124
+ parse(await (await getDatabasesClient()).updateTransaction(transactionId, commit, rollback)),
147
125
  ),
148
126
  );
149
127
 
@@ -154,7 +132,7 @@ databases
154
132
  .action(
155
133
  actionRunner(
156
134
  async ({ transactionId }) =>
157
- await (await getDatabasesClient()).deleteTransaction(transactionId),
135
+ parse(await (await getDatabasesClient()).deleteTransaction(transactionId)),
158
136
  ),
159
137
  );
160
138
 
@@ -166,43 +144,35 @@ databases
166
144
  .action(
167
145
  actionRunner(
168
146
  async ({ transactionId, operations }) =>
169
- await (
170
- await getDatabasesClient()
171
- ).createOperations(transactionId, operations),
147
+ parse(await (await getDatabasesClient()).createOperations(transactionId, operations)),
172
148
  ),
173
149
  );
174
150
 
175
151
  databases
176
152
  .command(`list-usage`)
177
- .description(
178
- `[**DEPRECATED** - This command is deprecated. Please use 'databases listUsage' instead] List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`,
179
- )
153
+ .description(`List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`)
180
154
  .option(`--range <range>`, `Date range.`)
181
155
  .action(
182
156
  actionRunner(
183
157
  async ({ range }) =>
184
- await (await getDatabasesClient()).listUsage(range as UsageRange),
158
+ parse(await (await getDatabasesClient()).listUsage(range as UsageRange)),
185
159
  ),
186
160
  );
187
161
 
188
162
  databases
189
163
  .command(`get`)
190
- .description(
191
- `[**DEPRECATED** - This command is deprecated. Please use 'databases get' instead] Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`,
192
- )
164
+ .description(`Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`)
193
165
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
194
166
  .action(
195
167
  actionRunner(
196
168
  async ({ databaseId }) =>
197
- await (await getDatabasesClient()).get(databaseId),
169
+ parse(await (await getDatabasesClient()).get(databaseId)),
198
170
  ),
199
171
  );
200
172
 
201
173
  databases
202
174
  .command(`update`)
203
- .description(
204
- `[**DEPRECATED** - This command is deprecated. Please use 'databases update' instead] Update a database by its unique ID.`,
205
- )
175
+ .description(`Update a database by its unique ID.`)
206
176
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
207
177
  .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
208
178
  .option(
@@ -214,37 +184,27 @@ databases
214
184
  .action(
215
185
  actionRunner(
216
186
  async ({ databaseId, name, enabled }) =>
217
- await (await getDatabasesClient()).update(databaseId, name, enabled),
187
+ parse(await (await getDatabasesClient()).update(databaseId, name, enabled)),
218
188
  ),
219
189
  );
220
190
 
221
191
  databases
222
192
  .command(`delete`)
223
- .description(
224
- `[**DEPRECATED** - This command is deprecated. Please use 'databases delete' instead] Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`,
225
- )
193
+ .description(`Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`)
226
194
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
227
195
  .action(
228
196
  actionRunner(
229
197
  async ({ databaseId }) =>
230
- await (await getDatabasesClient()).delete(databaseId),
198
+ parse(await (await getDatabasesClient()).delete(databaseId)),
231
199
  ),
232
200
  );
233
201
 
234
202
  databases
235
203
  .command(`list-collections`)
236
- .description(
237
- `[**DEPRECATED** - This command is deprecated. Please use 'databases listCollections' instead] Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.`,
238
- )
204
+ .description(`Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.`)
239
205
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
240
- .option(
241
- `--queries [queries...]`,
242
- `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, enabled, documentSecurity`,
243
- )
244
- .option(
245
- `--search <search>`,
246
- `Search term to filter your list results. Max length: 256 chars.`,
247
- )
206
+ .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, enabled, documentSecurity`)
207
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
248
208
  .option(
249
209
  `--total [value]`,
250
210
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -254,27 +214,17 @@ databases
254
214
  .action(
255
215
  actionRunner(
256
216
  async ({ databaseId, queries, search, total }) =>
257
- await (
258
- await getDatabasesClient()
259
- ).listCollections(databaseId, queries, search, total),
217
+ parse(await (await getDatabasesClient()).listCollections(databaseId, queries, search, total)),
260
218
  ),
261
219
  );
262
220
 
263
221
  databases
264
222
  .command(`create-collection`)
265
- .description(
266
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createCollection' instead] Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`,
267
- )
223
+ .description(`Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
268
224
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
269
- .requiredOption(
270
- `--collection-id <collection-id>`,
271
- `Unique Id. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
272
- )
225
+ .requiredOption(`--collection-id <collection-id>`, `Unique Id. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
273
226
  .requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
274
- .option(
275
- `--permissions [permissions...]`,
276
- `An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
277
- )
227
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
278
228
  .option(
279
229
  `--document-security [value]`,
280
230
  `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
@@ -287,69 +237,34 @@ databases
287
237
  (value: string | undefined) =>
288
238
  value === undefined ? true : parseBool(value),
289
239
  )
290
- .option(
291
- `--attributes [attributes...]`,
292
- `Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.`,
293
- )
294
- .option(
295
- `--indexes [indexes...]`,
296
- `Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).`,
297
- )
240
+ .option(`--attributes [attributes...]`, `Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.`)
241
+ .option(`--indexes [indexes...]`, `Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).`)
298
242
  .action(
299
243
  actionRunner(
300
- async ({
301
- databaseId,
302
- collectionId,
303
- name,
304
- permissions,
305
- documentSecurity,
306
- enabled,
307
- attributes,
308
- indexes,
309
- }) =>
310
- await (
311
- await getDatabasesClient()
312
- ).createCollection(
313
- databaseId,
314
- collectionId,
315
- name,
316
- permissions,
317
- documentSecurity,
318
- enabled,
319
- attributes,
320
- indexes,
321
- ),
244
+ async ({ databaseId, collectionId, name, permissions, documentSecurity, enabled, attributes, indexes }) =>
245
+ parse(await (await getDatabasesClient()).createCollection(databaseId, collectionId, name, permissions, documentSecurity, enabled, attributes, indexes)),
322
246
  ),
323
247
  );
324
248
 
325
249
  databases
326
250
  .command(`get-collection`)
327
- .description(
328
- `[**DEPRECATED** - This command is deprecated. Please use 'databases getCollection' instead] Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.`,
329
- )
251
+ .description(`Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.`)
330
252
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
331
253
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
332
254
  .action(
333
255
  actionRunner(
334
256
  async ({ databaseId, collectionId }) =>
335
- await (
336
- await getDatabasesClient()
337
- ).getCollection(databaseId, collectionId),
257
+ parse(await (await getDatabasesClient()).getCollection(databaseId, collectionId)),
338
258
  ),
339
259
  );
340
260
 
341
261
  databases
342
262
  .command(`update-collection`)
343
- .description(
344
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateCollection' instead] Update a collection by its unique ID.`,
345
- )
263
+ .description(`Update a collection by its unique ID.`)
346
264
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
347
265
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
348
266
  .requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
349
- .option(
350
- `--permissions [permissions...]`,
351
- `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
352
- )
267
+ .option(`--permissions [permissions...]`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
353
268
  .option(
354
269
  `--document-security [value]`,
355
270
  `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
@@ -364,54 +279,29 @@ databases
364
279
  )
365
280
  .action(
366
281
  actionRunner(
367
- async ({
368
- databaseId,
369
- collectionId,
370
- name,
371
- permissions,
372
- documentSecurity,
373
- enabled,
374
- }) =>
375
- await (
376
- await getDatabasesClient()
377
- ).updateCollection(
378
- databaseId,
379
- collectionId,
380
- name,
381
- permissions,
382
- documentSecurity,
383
- enabled,
384
- ),
282
+ async ({ databaseId, collectionId, name, permissions, documentSecurity, enabled }) =>
283
+ parse(await (await getDatabasesClient()).updateCollection(databaseId, collectionId, name, permissions, documentSecurity, enabled)),
385
284
  ),
386
285
  );
387
286
 
388
287
  databases
389
288
  .command(`delete-collection`)
390
- .description(
391
- `[**DEPRECATED** - This command is deprecated. Please use 'databases deleteCollection' instead] Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.`,
392
- )
289
+ .description(`Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.`)
393
290
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
394
291
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
395
292
  .action(
396
293
  actionRunner(
397
294
  async ({ databaseId, collectionId }) =>
398
- await (
399
- await getDatabasesClient()
400
- ).deleteCollection(databaseId, collectionId),
295
+ parse(await (await getDatabasesClient()).deleteCollection(databaseId, collectionId)),
401
296
  ),
402
297
  );
403
298
 
404
299
  databases
405
300
  .command(`list-attributes`)
406
- .description(
407
- `[**DEPRECATED** - This command is deprecated. Please use 'databases listAttributes' instead] List attributes in the collection.`,
408
- )
301
+ .description(`List attributes in the collection.`)
409
302
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
410
303
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
411
- .option(
412
- `--queries [queries...]`,
413
- `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: key, type, size, required, array, status, error`,
414
- )
304
+ .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: key, type, size, required, array, status, error`)
415
305
  .option(
416
306
  `--total [value]`,
417
307
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -421,27 +311,20 @@ databases
421
311
  .action(
422
312
  actionRunner(
423
313
  async ({ databaseId, collectionId, queries, total }) =>
424
- await (
425
- await getDatabasesClient()
426
- ).listAttributes(databaseId, collectionId, queries, total),
314
+ parse(await (await getDatabasesClient()).listAttributes(databaseId, collectionId, queries, total)),
427
315
  ),
428
316
  );
429
317
 
430
318
  databases
431
319
  .command(`create-boolean-attribute`)
432
- .description(
433
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createBooleanAttribute' instead] Create a boolean attribute.
434
- `,
435
- )
320
+ .description(`Create a boolean attribute.
321
+ `)
436
322
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
437
- .requiredOption(
438
- `--collection-id <collection-id>`,
439
- `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
440
- )
323
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
441
324
  .requiredOption(`--key <key>`, `Attribute Key.`)
442
325
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
443
326
  .option(
444
- `--default [value]`,
327
+ `--xdefault [value]`,
445
328
  `Default value for attribute when not provided. Cannot be set when attribute is required.`,
446
329
  (value: string | undefined) =>
447
330
  value === undefined ? true : parseBool(value),
@@ -454,70 +337,35 @@ databases
454
337
  )
455
338
  .action(
456
339
  actionRunner(
457
- async ({ databaseId, collectionId, key, required, xDefault, array }) =>
458
- await (
459
- await getDatabasesClient()
460
- ).createBooleanAttribute(
461
- databaseId,
462
- collectionId,
463
- key,
464
- required,
465
- xDefault,
466
- array,
467
- ),
340
+ async ({ databaseId, collectionId, key, required, xdefault, array }) =>
341
+ parse(await (await getDatabasesClient()).createBooleanAttribute(databaseId, collectionId, key, required, xdefault, array)),
468
342
  ),
469
343
  );
470
344
 
471
345
  databases
472
346
  .command(`update-boolean-attribute`)
473
- .description(
474
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateBooleanAttribute' instead] Update a boolean attribute. Changing the \`default\` value will not update already existing documents.`,
475
- )
347
+ .description(`Update a boolean attribute. Changing the \`default\` value will not update already existing documents.`)
476
348
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
477
- .requiredOption(
478
- `--collection-id <collection-id>`,
479
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`,
480
- )
349
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
481
350
  .requiredOption(`--key <key>`, `Attribute Key.`)
482
351
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
483
- .requiredOption(
484
- `--default <default>`,
485
- `Default value for attribute when not provided. Cannot be set when attribute is required.`,
486
- parseBool,
487
- )
352
+ .requiredOption(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, parseBool)
488
353
  .option(`--new-key <new-key>`, `New attribute key.`)
489
354
  .action(
490
355
  actionRunner(
491
- async ({ databaseId, collectionId, key, required, xDefault, newKey }) =>
492
- await (
493
- await getDatabasesClient()
494
- ).updateBooleanAttribute(
495
- databaseId,
496
- collectionId,
497
- key,
498
- required,
499
- xDefault,
500
- newKey,
501
- ),
356
+ async ({ databaseId, collectionId, key, required, xdefault, newKey }) =>
357
+ parse(await (await getDatabasesClient()).updateBooleanAttribute(databaseId, collectionId, key, required, xdefault, newKey)),
502
358
  ),
503
359
  );
504
360
 
505
361
  databases
506
362
  .command(`create-datetime-attribute`)
507
- .description(
508
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createDatetimeAttribute' instead] Create a date time attribute according to the ISO 8601 standard.`,
509
- )
363
+ .description(`Create a date time attribute according to the ISO 8601 standard.`)
510
364
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
511
- .requiredOption(
512
- `--collection-id <collection-id>`,
513
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`,
514
- )
365
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
515
366
  .requiredOption(`--key <key>`, `Attribute Key.`)
516
367
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
517
- .option(
518
- `--default <default>`,
519
- `Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.`,
520
- )
368
+ .option(`--xdefault <xdefault>`, `Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.`)
521
369
  .option(
522
370
  `--array [value]`,
523
371
  `Is attribute an array?`,
@@ -526,64 +374,36 @@ databases
526
374
  )
527
375
  .action(
528
376
  actionRunner(
529
- async ({ databaseId, collectionId, key, required, xDefault, array }) =>
530
- await (
531
- await getDatabasesClient()
532
- ).createDatetimeAttribute(
533
- databaseId,
534
- collectionId,
535
- key,
536
- required,
537
- xDefault,
538
- array,
539
- ),
377
+ async ({ databaseId, collectionId, key, required, xdefault, array }) =>
378
+ parse(await (await getDatabasesClient()).createDatetimeAttribute(databaseId, collectionId, key, required, xdefault, array)),
540
379
  ),
541
380
  );
542
381
 
543
382
  databases
544
383
  .command(`update-datetime-attribute`)
545
- .description(
546
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateDatetimeAttribute' instead] Update a date time attribute. Changing the \`default\` value will not update already existing documents.`,
547
- )
384
+ .description(`Update a date time attribute. Changing the \`default\` value will not update already existing documents.`)
548
385
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
549
386
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
550
387
  .requiredOption(`--key <key>`, `Attribute Key.`)
551
388
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
552
- .requiredOption(
553
- `--default <default>`,
554
- `Default value for attribute when not provided. Cannot be set when attribute is required.`,
555
- )
389
+ .requiredOption(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
556
390
  .option(`--new-key <new-key>`, `New attribute key.`)
557
391
  .action(
558
392
  actionRunner(
559
- async ({ databaseId, collectionId, key, required, xDefault, newKey }) =>
560
- await (
561
- await getDatabasesClient()
562
- ).updateDatetimeAttribute(
563
- databaseId,
564
- collectionId,
565
- key,
566
- required,
567
- xDefault,
568
- newKey,
569
- ),
393
+ async ({ databaseId, collectionId, key, required, xdefault, newKey }) =>
394
+ parse(await (await getDatabasesClient()).updateDatetimeAttribute(databaseId, collectionId, key, required, xdefault, newKey)),
570
395
  ),
571
396
  );
572
397
 
573
398
  databases
574
399
  .command(`create-email-attribute`)
575
- .description(
576
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createEmailAttribute' instead] Create an email attribute.
577
- `,
578
- )
400
+ .description(`Create an email attribute.
401
+ `)
579
402
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
580
403
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
581
404
  .requiredOption(`--key <key>`, `Attribute Key.`)
582
405
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
583
- .option(
584
- `--default <default>`,
585
- `Default value for attribute when not provided. Cannot be set when attribute is required.`,
586
- )
406
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
587
407
  .option(
588
408
  `--array [value]`,
589
409
  `Is attribute an array?`,
@@ -592,66 +412,38 @@ databases
592
412
  )
593
413
  .action(
594
414
  actionRunner(
595
- async ({ databaseId, collectionId, key, required, xDefault, array }) =>
596
- await (
597
- await getDatabasesClient()
598
- ).createEmailAttribute(
599
- databaseId,
600
- collectionId,
601
- key,
602
- required,
603
- xDefault,
604
- array,
605
- ),
415
+ async ({ databaseId, collectionId, key, required, xdefault, array }) =>
416
+ parse(await (await getDatabasesClient()).createEmailAttribute(databaseId, collectionId, key, required, xdefault, array)),
606
417
  ),
607
418
  );
608
419
 
609
420
  databases
610
421
  .command(`update-email-attribute`)
611
- .description(
612
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateEmailAttribute' instead] Update an email attribute. Changing the \`default\` value will not update already existing documents.
613
- `,
614
- )
422
+ .description(`Update an email attribute. Changing the \`default\` value will not update already existing documents.
423
+ `)
615
424
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
616
425
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
617
426
  .requiredOption(`--key <key>`, `Attribute Key.`)
618
427
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
619
- .requiredOption(
620
- `--default <default>`,
621
- `Default value for attribute when not provided. Cannot be set when attribute is required.`,
622
- )
428
+ .requiredOption(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
623
429
  .option(`--new-key <new-key>`, `New Attribute Key.`)
624
430
  .action(
625
431
  actionRunner(
626
- async ({ databaseId, collectionId, key, required, xDefault, newKey }) =>
627
- await (
628
- await getDatabasesClient()
629
- ).updateEmailAttribute(
630
- databaseId,
631
- collectionId,
632
- key,
633
- required,
634
- xDefault,
635
- newKey,
636
- ),
432
+ async ({ databaseId, collectionId, key, required, xdefault, newKey }) =>
433
+ parse(await (await getDatabasesClient()).updateEmailAttribute(databaseId, collectionId, key, required, xdefault, newKey)),
637
434
  ),
638
435
  );
639
436
 
640
437
  databases
641
438
  .command(`create-enum-attribute`)
642
- .description(
643
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createEnumAttribute' instead] Create an enum attribute. The \`elements\` param acts as a white-list of accepted values for this attribute.
644
- `,
645
- )
439
+ .description(`Create an enum attribute. The \`elements\` param acts as a white-list of accepted values for this attribute.
440
+ `)
646
441
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
647
442
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
648
443
  .requiredOption(`--key <key>`, `Attribute Key.`)
649
444
  .requiredOption(`--elements [elements...]`, `Array of enum values.`)
650
445
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
651
- .option(
652
- `--default <default>`,
653
- `Default value for attribute when not provided. Cannot be set when attribute is required.`,
654
- )
446
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
655
447
  .option(
656
448
  `--array [value]`,
657
449
  `Is attribute an array?`,
@@ -660,87 +452,40 @@ databases
660
452
  )
661
453
  .action(
662
454
  actionRunner(
663
- async ({
664
- databaseId,
665
- collectionId,
666
- key,
667
- elements,
668
- required,
669
- xDefault,
670
- array,
671
- }) =>
672
- await (
673
- await getDatabasesClient()
674
- ).createEnumAttribute(
675
- databaseId,
676
- collectionId,
677
- key,
678
- elements,
679
- required,
680
- xDefault,
681
- array,
682
- ),
455
+ async ({ databaseId, collectionId, key, elements, required, xdefault, array }) =>
456
+ parse(await (await getDatabasesClient()).createEnumAttribute(databaseId, collectionId, key, elements, required, xdefault, array)),
683
457
  ),
684
458
  );
685
459
 
686
460
  databases
687
461
  .command(`update-enum-attribute`)
688
- .description(
689
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateEnumAttribute' instead] Update an enum attribute. Changing the \`default\` value will not update already existing documents.
690
- `,
691
- )
462
+ .description(`Update an enum attribute. Changing the \`default\` value will not update already existing documents.
463
+ `)
692
464
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
693
465
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
694
466
  .requiredOption(`--key <key>`, `Attribute Key.`)
695
467
  .requiredOption(`--elements [elements...]`, `Updated list of enum values.`)
696
468
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
697
- .requiredOption(
698
- `--default <default>`,
699
- `Default value for attribute when not provided. Cannot be set when attribute is required.`,
700
- )
469
+ .requiredOption(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
701
470
  .option(`--new-key <new-key>`, `New Attribute Key.`)
702
471
  .action(
703
472
  actionRunner(
704
- async ({
705
- databaseId,
706
- collectionId,
707
- key,
708
- elements,
709
- required,
710
- xDefault,
711
- newKey,
712
- }) =>
713
- await (
714
- await getDatabasesClient()
715
- ).updateEnumAttribute(
716
- databaseId,
717
- collectionId,
718
- key,
719
- elements,
720
- required,
721
- xDefault,
722
- newKey,
723
- ),
473
+ async ({ databaseId, collectionId, key, elements, required, xdefault, newKey }) =>
474
+ parse(await (await getDatabasesClient()).updateEnumAttribute(databaseId, collectionId, key, elements, required, xdefault, newKey)),
724
475
  ),
725
476
  );
726
477
 
727
478
  databases
728
479
  .command(`create-float-attribute`)
729
- .description(
730
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createFloatAttribute' instead] Create a float attribute. Optionally, minimum and maximum values can be provided.
731
- `,
732
- )
480
+ .description(`Create a float attribute. Optionally, minimum and maximum values can be provided.
481
+ `)
733
482
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
734
483
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
735
484
  .requiredOption(`--key <key>`, `Attribute Key.`)
736
485
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
737
486
  .option(`--min <min>`, `Minimum value.`, parseInteger)
738
487
  .option(`--max <max>`, `Maximum value.`, parseInteger)
739
- .option(
740
- `--default <default>`,
741
- `Default value. Cannot be set when required.`,
742
- parseInteger,
743
- )
488
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parseInteger)
744
489
  .option(
745
490
  `--array [value]`,
746
491
  `Is attribute an array?`,
@@ -749,93 +494,41 @@ databases
749
494
  )
750
495
  .action(
751
496
  actionRunner(
752
- async ({
753
- databaseId,
754
- collectionId,
755
- key,
756
- required,
757
- min,
758
- max,
759
- xDefault,
760
- array,
761
- }) =>
762
- await (
763
- await getDatabasesClient()
764
- ).createFloatAttribute(
765
- databaseId,
766
- collectionId,
767
- key,
768
- required,
769
- min,
770
- max,
771
- xDefault,
772
- array,
773
- ),
497
+ async ({ databaseId, collectionId, key, required, min, max, xdefault, array }) =>
498
+ parse(await (await getDatabasesClient()).createFloatAttribute(databaseId, collectionId, key, required, min, max, xdefault, array)),
774
499
  ),
775
500
  );
776
501
 
777
502
  databases
778
503
  .command(`update-float-attribute`)
779
- .description(
780
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateFloatAttribute' instead] Update a float attribute. Changing the \`default\` value will not update already existing documents.
781
- `,
782
- )
504
+ .description(`Update a float attribute. Changing the \`default\` value will not update already existing documents.
505
+ `)
783
506
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
784
507
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
785
508
  .requiredOption(`--key <key>`, `Attribute Key.`)
786
509
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
510
+ .requiredOption(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parseInteger)
787
511
  .option(`--min <min>`, `Minimum value.`, parseInteger)
788
512
  .option(`--max <max>`, `Maximum value.`, parseInteger)
789
- .requiredOption(
790
- `--default <default>`,
791
- `Default value. Cannot be set when required.`,
792
- parseInteger,
793
- )
794
513
  .option(`--new-key <new-key>`, `New Attribute Key.`)
795
514
  .action(
796
515
  actionRunner(
797
- async ({
798
- databaseId,
799
- collectionId,
800
- key,
801
- required,
802
- min,
803
- max,
804
- xDefault,
805
- newKey,
806
- }) =>
807
- await (
808
- await getDatabasesClient()
809
- ).updateFloatAttribute(
810
- databaseId,
811
- collectionId,
812
- key,
813
- required,
814
- min,
815
- max,
816
- xDefault,
817
- newKey,
818
- ),
516
+ async ({ databaseId, collectionId, key, required, xdefault, min, max, newKey }) =>
517
+ parse(await (await getDatabasesClient()).updateFloatAttribute(databaseId, collectionId, key, required, xdefault, min, max, newKey)),
819
518
  ),
820
519
  );
821
520
 
822
521
  databases
823
522
  .command(`create-integer-attribute`)
824
- .description(
825
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createIntegerAttribute' instead] Create an integer attribute. Optionally, minimum and maximum values can be provided.
826
- `,
827
- )
523
+ .description(`Create an integer attribute. Optionally, minimum and maximum values can be provided.
524
+ `)
828
525
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
829
526
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
830
527
  .requiredOption(`--key <key>`, `Attribute Key.`)
831
528
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
832
529
  .option(`--min <min>`, `Minimum value`, parseInteger)
833
530
  .option(`--max <max>`, `Maximum value`, parseInteger)
834
- .option(
835
- `--default <default>`,
836
- `Default value. Cannot be set when attribute is required.`,
837
- parseInteger,
838
- )
531
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`, parseInteger)
839
532
  .option(
840
533
  `--array [value]`,
841
534
  `Is attribute an array?`,
@@ -844,90 +537,39 @@ databases
844
537
  )
845
538
  .action(
846
539
  actionRunner(
847
- async ({
848
- databaseId,
849
- collectionId,
850
- key,
851
- required,
852
- min,
853
- max,
854
- xDefault,
855
- array,
856
- }) =>
857
- await (
858
- await getDatabasesClient()
859
- ).createIntegerAttribute(
860
- databaseId,
861
- collectionId,
862
- key,
863
- required,
864
- min,
865
- max,
866
- xDefault,
867
- array,
868
- ),
540
+ async ({ databaseId, collectionId, key, required, min, max, xdefault, array }) =>
541
+ parse(await (await getDatabasesClient()).createIntegerAttribute(databaseId, collectionId, key, required, min, max, xdefault, array)),
869
542
  ),
870
543
  );
871
544
 
872
545
  databases
873
546
  .command(`update-integer-attribute`)
874
- .description(
875
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateIntegerAttribute' instead] Update an integer attribute. Changing the \`default\` value will not update already existing documents.
876
- `,
877
- )
547
+ .description(`Update an integer attribute. Changing the \`default\` value will not update already existing documents.
548
+ `)
878
549
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
879
550
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
880
551
  .requiredOption(`--key <key>`, `Attribute Key.`)
881
552
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
553
+ .requiredOption(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`, parseInteger)
882
554
  .option(`--min <min>`, `Minimum value`, parseInteger)
883
555
  .option(`--max <max>`, `Maximum value`, parseInteger)
884
- .requiredOption(
885
- `--default <default>`,
886
- `Default value. Cannot be set when attribute is required.`,
887
- parseInteger,
888
- )
889
556
  .option(`--new-key <new-key>`, `New Attribute Key.`)
890
557
  .action(
891
558
  actionRunner(
892
- async ({
893
- databaseId,
894
- collectionId,
895
- key,
896
- required,
897
- min,
898
- max,
899
- xDefault,
900
- newKey,
901
- }) =>
902
- await (
903
- await getDatabasesClient()
904
- ).updateIntegerAttribute(
905
- databaseId,
906
- collectionId,
907
- key,
908
- required,
909
- min,
910
- max,
911
- xDefault,
912
- newKey,
913
- ),
559
+ async ({ databaseId, collectionId, key, required, xdefault, min, max, newKey }) =>
560
+ parse(await (await getDatabasesClient()).updateIntegerAttribute(databaseId, collectionId, key, required, xdefault, min, max, newKey)),
914
561
  ),
915
562
  );
916
563
 
917
564
  databases
918
565
  .command(`create-ip-attribute`)
919
- .description(
920
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createIpAttribute' instead] Create IP address attribute.
921
- `,
922
- )
566
+ .description(`Create IP address attribute.
567
+ `)
923
568
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
924
569
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
925
570
  .requiredOption(`--key <key>`, `Attribute Key.`)
926
571
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
927
- .option(
928
- `--default <default>`,
929
- `Default value. Cannot be set when attribute is required.`,
930
- )
572
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`)
931
573
  .option(
932
574
  `--array [value]`,
933
575
  `Is attribute an array?`,
@@ -936,311 +578,155 @@ databases
936
578
  )
937
579
  .action(
938
580
  actionRunner(
939
- async ({ databaseId, collectionId, key, required, xDefault, array }) =>
940
- await (
941
- await getDatabasesClient()
942
- ).createIpAttribute(
943
- databaseId,
944
- collectionId,
945
- key,
946
- required,
947
- xDefault,
948
- array,
949
- ),
581
+ async ({ databaseId, collectionId, key, required, xdefault, array }) =>
582
+ parse(await (await getDatabasesClient()).createIpAttribute(databaseId, collectionId, key, required, xdefault, array)),
950
583
  ),
951
584
  );
952
585
 
953
586
  databases
954
587
  .command(`update-ip-attribute`)
955
- .description(
956
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateIpAttribute' instead] Update an ip attribute. Changing the \`default\` value will not update already existing documents.
957
- `,
958
- )
588
+ .description(`Update an ip attribute. Changing the \`default\` value will not update already existing documents.
589
+ `)
959
590
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
960
591
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
961
592
  .requiredOption(`--key <key>`, `Attribute Key.`)
962
593
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
963
- .requiredOption(
964
- `--default <default>`,
965
- `Default value. Cannot be set when attribute is required.`,
966
- )
594
+ .requiredOption(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`)
967
595
  .option(`--new-key <new-key>`, `New Attribute Key.`)
968
596
  .action(
969
597
  actionRunner(
970
- async ({ databaseId, collectionId, key, required, xDefault, newKey }) =>
971
- await (
972
- await getDatabasesClient()
973
- ).updateIpAttribute(
974
- databaseId,
975
- collectionId,
976
- key,
977
- required,
978
- xDefault,
979
- newKey,
980
- ),
598
+ async ({ databaseId, collectionId, key, required, xdefault, newKey }) =>
599
+ parse(await (await getDatabasesClient()).updateIpAttribute(databaseId, collectionId, key, required, xdefault, newKey)),
981
600
  ),
982
601
  );
983
602
 
984
603
  databases
985
604
  .command(`create-line-attribute`)
986
- .description(
987
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createLineAttribute' instead] Create a geometric line attribute.`,
988
- )
605
+ .description(`Create a geometric line attribute.`)
989
606
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
990
- .requiredOption(
991
- `--collection-id <collection-id>`,
992
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
993
- )
607
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
994
608
  .requiredOption(`--key <key>`, `Attribute Key.`)
995
609
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
996
- .option(
997
- `--default [default...]`,
998
- `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`,
999
- )
610
+ .option(`--xdefault [xdefault...]`, `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`)
1000
611
  .action(
1001
612
  actionRunner(
1002
- async ({ databaseId, collectionId, key, required, xDefault }) =>
1003
- await (
1004
- await getDatabasesClient()
1005
- ).createLineAttribute(
1006
- databaseId,
1007
- collectionId,
1008
- key,
1009
- required,
1010
- xDefault,
1011
- ),
613
+ async ({ databaseId, collectionId, key, required, xdefault }) =>
614
+ parse(await (await getDatabasesClient()).createLineAttribute(databaseId, collectionId, key, required, xdefault)),
1012
615
  ),
1013
616
  );
1014
617
 
1015
618
  databases
1016
619
  .command(`update-line-attribute`)
1017
- .description(
1018
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateLineAttribute' instead] Update a line attribute. Changing the \`default\` value will not update already existing documents.`,
1019
- )
620
+ .description(`Update a line attribute. Changing the \`default\` value will not update already existing documents.`)
1020
621
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1021
- .requiredOption(
1022
- `--collection-id <collection-id>`,
1023
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`,
1024
- )
622
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
1025
623
  .requiredOption(`--key <key>`, `Attribute Key.`)
1026
624
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1027
- .option(
1028
- `--default [default...]`,
1029
- `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`,
1030
- )
625
+ .option(`--xdefault [xdefault...]`, `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`)
1031
626
  .option(`--new-key <new-key>`, `New attribute key.`)
1032
627
  .action(
1033
628
  actionRunner(
1034
- async ({ databaseId, collectionId, key, required, xDefault, newKey }) =>
1035
- await (
1036
- await getDatabasesClient()
1037
- ).updateLineAttribute(
1038
- databaseId,
1039
- collectionId,
1040
- key,
1041
- required,
1042
- xDefault,
1043
- newKey,
1044
- ),
629
+ async ({ databaseId, collectionId, key, required, xdefault, newKey }) =>
630
+ parse(await (await getDatabasesClient()).updateLineAttribute(databaseId, collectionId, key, required, xdefault, newKey)),
1045
631
  ),
1046
632
  );
1047
633
 
1048
634
  databases
1049
635
  .command(`create-point-attribute`)
1050
- .description(
1051
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createPointAttribute' instead] Create a geometric point attribute.`,
1052
- )
636
+ .description(`Create a geometric point attribute.`)
1053
637
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1054
- .requiredOption(
1055
- `--collection-id <collection-id>`,
1056
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1057
- )
638
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1058
639
  .requiredOption(`--key <key>`, `Attribute Key.`)
1059
640
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1060
- .option(
1061
- `--default [default...]`,
1062
- `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`,
1063
- )
641
+ .option(`--xdefault [xdefault...]`, `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`)
1064
642
  .action(
1065
643
  actionRunner(
1066
- async ({ databaseId, collectionId, key, required, xDefault }) =>
1067
- await (
1068
- await getDatabasesClient()
1069
- ).createPointAttribute(
1070
- databaseId,
1071
- collectionId,
1072
- key,
1073
- required,
1074
- xDefault,
1075
- ),
644
+ async ({ databaseId, collectionId, key, required, xdefault }) =>
645
+ parse(await (await getDatabasesClient()).createPointAttribute(databaseId, collectionId, key, required, xdefault)),
1076
646
  ),
1077
647
  );
1078
648
 
1079
649
  databases
1080
650
  .command(`update-point-attribute`)
1081
- .description(
1082
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updatePointAttribute' instead] Update a point attribute. Changing the \`default\` value will not update already existing documents.`,
1083
- )
651
+ .description(`Update a point attribute. Changing the \`default\` value will not update already existing documents.`)
1084
652
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1085
- .requiredOption(
1086
- `--collection-id <collection-id>`,
1087
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`,
1088
- )
653
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
1089
654
  .requiredOption(`--key <key>`, `Attribute Key.`)
1090
655
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1091
- .option(
1092
- `--default [default...]`,
1093
- `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`,
1094
- )
656
+ .option(`--xdefault [xdefault...]`, `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`)
1095
657
  .option(`--new-key <new-key>`, `New attribute key.`)
1096
658
  .action(
1097
659
  actionRunner(
1098
- async ({ databaseId, collectionId, key, required, xDefault, newKey }) =>
1099
- await (
1100
- await getDatabasesClient()
1101
- ).updatePointAttribute(
1102
- databaseId,
1103
- collectionId,
1104
- key,
1105
- required,
1106
- xDefault,
1107
- newKey,
1108
- ),
660
+ async ({ databaseId, collectionId, key, required, xdefault, newKey }) =>
661
+ parse(await (await getDatabasesClient()).updatePointAttribute(databaseId, collectionId, key, required, xdefault, newKey)),
1109
662
  ),
1110
663
  );
1111
664
 
1112
665
  databases
1113
666
  .command(`create-polygon-attribute`)
1114
- .description(
1115
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createPolygonAttribute' instead] Create a geometric polygon attribute.`,
1116
- )
667
+ .description(`Create a geometric polygon attribute.`)
1117
668
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1118
- .requiredOption(
1119
- `--collection-id <collection-id>`,
1120
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1121
- )
669
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1122
670
  .requiredOption(`--key <key>`, `Attribute Key.`)
1123
671
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1124
- .option(
1125
- `--default [default...]`,
1126
- `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`,
1127
- )
672
+ .option(`--xdefault [xdefault...]`, `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`)
1128
673
  .action(
1129
674
  actionRunner(
1130
- async ({ databaseId, collectionId, key, required, xDefault }) =>
1131
- await (
1132
- await getDatabasesClient()
1133
- ).createPolygonAttribute(
1134
- databaseId,
1135
- collectionId,
1136
- key,
1137
- required,
1138
- xDefault,
1139
- ),
675
+ async ({ databaseId, collectionId, key, required, xdefault }) =>
676
+ parse(await (await getDatabasesClient()).createPolygonAttribute(databaseId, collectionId, key, required, xdefault)),
1140
677
  ),
1141
678
  );
1142
679
 
1143
680
  databases
1144
681
  .command(`update-polygon-attribute`)
1145
- .description(
1146
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updatePolygonAttribute' instead] Update a polygon attribute. Changing the \`default\` value will not update already existing documents.`,
1147
- )
682
+ .description(`Update a polygon attribute. Changing the \`default\` value will not update already existing documents.`)
1148
683
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1149
- .requiredOption(
1150
- `--collection-id <collection-id>`,
1151
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`,
1152
- )
684
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
1153
685
  .requiredOption(`--key <key>`, `Attribute Key.`)
1154
686
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1155
- .option(
1156
- `--default [default...]`,
1157
- `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`,
1158
- )
687
+ .option(`--xdefault [xdefault...]`, `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`)
1159
688
  .option(`--new-key <new-key>`, `New attribute key.`)
1160
689
  .action(
1161
690
  actionRunner(
1162
- async ({ databaseId, collectionId, key, required, xDefault, newKey }) =>
1163
- await (
1164
- await getDatabasesClient()
1165
- ).updatePolygonAttribute(
1166
- databaseId,
1167
- collectionId,
1168
- key,
1169
- required,
1170
- xDefault,
1171
- newKey,
1172
- ),
691
+ async ({ databaseId, collectionId, key, required, xdefault, newKey }) =>
692
+ parse(await (await getDatabasesClient()).updatePolygonAttribute(databaseId, collectionId, key, required, xdefault, newKey)),
1173
693
  ),
1174
694
  );
1175
695
 
1176
696
  databases
1177
697
  .command(`create-relationship-attribute`)
1178
- .description(
1179
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createRelationshipAttribute' instead] Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
1180
- `,
1181
- )
698
+ .description(`Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
699
+ `)
1182
700
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1183
701
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1184
- .requiredOption(
1185
- `--related-collection-id <related-collection-id>`,
1186
- `Related Collection ID.`,
1187
- )
702
+ .requiredOption(`--related-collection-id <related-collection-id>`, `Related Collection ID.`)
1188
703
  .requiredOption(`--type <type>`, `Relation type`)
1189
- .option(`--two-way [value]`, `Is Two Way?`, (value: string | undefined) =>
1190
- value === undefined ? true : parseBool(value),
704
+ .option(
705
+ `--two-way [value]`,
706
+ `Is Two Way?`,
707
+ (value: string | undefined) =>
708
+ value === undefined ? true : parseBool(value),
1191
709
  )
1192
710
  .option(`--key <key>`, `Attribute Key.`)
1193
711
  .option(`--two-way-key <two-way-key>`, `Two Way Attribute Key.`)
1194
712
  .option(`--on-delete <on-delete>`, `Constraints option`)
1195
713
  .action(
1196
714
  actionRunner(
1197
- async ({
1198
- databaseId,
1199
- collectionId,
1200
- relatedCollectionId,
1201
- xType,
1202
- twoWay,
1203
- key,
1204
- twoWayKey,
1205
- onDelete,
1206
- }) =>
1207
- await (
1208
- await getDatabasesClient()
1209
- ).createRelationshipAttribute(
1210
- databaseId,
1211
- collectionId,
1212
- relatedCollectionId,
1213
- xType as RelationshipType,
1214
- twoWay,
1215
- key,
1216
- twoWayKey,
1217
- onDelete as RelationMutate,
1218
- ),
715
+ async ({ databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete }) =>
716
+ parse(await (await getDatabasesClient()).createRelationshipAttribute(databaseId, collectionId, relatedCollectionId, type as RelationshipType, twoWay, key, twoWayKey, onDelete as RelationMutate)),
1219
717
  ),
1220
718
  );
1221
719
 
1222
720
  databases
1223
721
  .command(`create-string-attribute`)
1224
- .description(
1225
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createStringAttribute' instead] Create a string attribute.
1226
- `,
1227
- )
722
+ .description(`Create a string attribute.
723
+ `)
1228
724
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1229
- .requiredOption(
1230
- `--collection-id <collection-id>`,
1231
- `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1232
- )
725
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1233
726
  .requiredOption(`--key <key>`, `Attribute Key.`)
1234
- .requiredOption(
1235
- `--size <size>`,
1236
- `Attribute size for text attributes, in number of characters.`,
1237
- parseInteger,
1238
- )
727
+ .requiredOption(`--size <size>`, `Attribute size for text attributes, in number of characters.`, parseInteger)
1239
728
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1240
- .option(
1241
- `--default <default>`,
1242
- `Default value for attribute when not provided. Cannot be set when attribute is required.`,
1243
- )
729
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
1244
730
  .option(
1245
731
  `--array [value]`,
1246
732
  `Is attribute an array?`,
@@ -1255,93 +741,38 @@ databases
1255
741
  )
1256
742
  .action(
1257
743
  actionRunner(
1258
- async ({
1259
- databaseId,
1260
- collectionId,
1261
- key,
1262
- size,
1263
- required,
1264
- xDefault,
1265
- array,
1266
- encrypt,
1267
- }) =>
1268
- await (
1269
- await getDatabasesClient()
1270
- ).createStringAttribute(
1271
- databaseId,
1272
- collectionId,
1273
- key,
1274
- size,
1275
- required,
1276
- xDefault,
1277
- array,
1278
- encrypt,
1279
- ),
744
+ async ({ databaseId, collectionId, key, size, required, xdefault, array, encrypt }) =>
745
+ parse(await (await getDatabasesClient()).createStringAttribute(databaseId, collectionId, key, size, required, xdefault, array, encrypt)),
1280
746
  ),
1281
747
  );
1282
748
 
1283
749
  databases
1284
750
  .command(`update-string-attribute`)
1285
- .description(
1286
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateStringAttribute' instead] Update a string attribute. Changing the \`default\` value will not update already existing documents.
1287
- `,
1288
- )
751
+ .description(`Update a string attribute. Changing the \`default\` value will not update already existing documents.
752
+ `)
1289
753
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1290
- .requiredOption(
1291
- `--collection-id <collection-id>`,
1292
- `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1293
- )
754
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1294
755
  .requiredOption(`--key <key>`, `Attribute Key.`)
1295
756
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1296
- .requiredOption(
1297
- `--default <default>`,
1298
- `Default value for attribute when not provided. Cannot be set when attribute is required.`,
1299
- )
1300
- .option(
1301
- `--size <size>`,
1302
- `Maximum size of the string attribute.`,
1303
- parseInteger,
1304
- )
757
+ .requiredOption(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
758
+ .option(`--size <size>`, `Maximum size of the string attribute.`, parseInteger)
1305
759
  .option(`--new-key <new-key>`, `New Attribute Key.`)
1306
760
  .action(
1307
761
  actionRunner(
1308
- async ({
1309
- databaseId,
1310
- collectionId,
1311
- key,
1312
- required,
1313
- xDefault,
1314
- size,
1315
- newKey,
1316
- }) =>
1317
- await (
1318
- await getDatabasesClient()
1319
- ).updateStringAttribute(
1320
- databaseId,
1321
- collectionId,
1322
- key,
1323
- required,
1324
- xDefault,
1325
- size,
1326
- newKey,
1327
- ),
762
+ async ({ databaseId, collectionId, key, required, xdefault, size, newKey }) =>
763
+ parse(await (await getDatabasesClient()).updateStringAttribute(databaseId, collectionId, key, required, xdefault, size, newKey)),
1328
764
  ),
1329
765
  );
1330
766
 
1331
767
  databases
1332
768
  .command(`create-url-attribute`)
1333
- .description(
1334
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createUrlAttribute' instead] Create a URL attribute.
1335
- `,
1336
- )
769
+ .description(`Create a URL attribute.
770
+ `)
1337
771
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1338
772
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1339
773
  .requiredOption(`--key <key>`, `Attribute Key.`)
1340
774
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1341
- .option(
1342
- `--default <default>`,
1343
- `Default value for attribute when not provided. Cannot be set when attribute is required.`,
1344
- )
775
+ .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
1345
776
  .option(
1346
777
  `--array [value]`,
1347
778
  `Is attribute an array?`,
@@ -1350,91 +781,58 @@ databases
1350
781
  )
1351
782
  .action(
1352
783
  actionRunner(
1353
- async ({ databaseId, collectionId, key, required, xDefault, array }) =>
1354
- await (
1355
- await getDatabasesClient()
1356
- ).createUrlAttribute(
1357
- databaseId,
1358
- collectionId,
1359
- key,
1360
- required,
1361
- xDefault,
1362
- array,
1363
- ),
784
+ async ({ databaseId, collectionId, key, required, xdefault, array }) =>
785
+ parse(await (await getDatabasesClient()).createUrlAttribute(databaseId, collectionId, key, required, xdefault, array)),
1364
786
  ),
1365
787
  );
1366
788
 
1367
789
  databases
1368
790
  .command(`update-url-attribute`)
1369
- .description(
1370
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateUrlAttribute' instead] Update an url attribute. Changing the \`default\` value will not update already existing documents.
1371
- `,
1372
- )
791
+ .description(`Update an url attribute. Changing the \`default\` value will not update already existing documents.
792
+ `)
1373
793
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1374
794
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1375
795
  .requiredOption(`--key <key>`, `Attribute Key.`)
1376
796
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
1377
- .requiredOption(
1378
- `--default <default>`,
1379
- `Default value for attribute when not provided. Cannot be set when attribute is required.`,
1380
- )
797
+ .requiredOption(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
1381
798
  .option(`--new-key <new-key>`, `New Attribute Key.`)
1382
799
  .action(
1383
800
  actionRunner(
1384
- async ({ databaseId, collectionId, key, required, xDefault, newKey }) =>
1385
- await (
1386
- await getDatabasesClient()
1387
- ).updateUrlAttribute(
1388
- databaseId,
1389
- collectionId,
1390
- key,
1391
- required,
1392
- xDefault,
1393
- newKey,
1394
- ),
801
+ async ({ databaseId, collectionId, key, required, xdefault, newKey }) =>
802
+ parse(await (await getDatabasesClient()).updateUrlAttribute(databaseId, collectionId, key, required, xdefault, newKey)),
1395
803
  ),
1396
804
  );
1397
805
 
1398
806
  databases
1399
807
  .command(`get-attribute`)
1400
- .description(
1401
- `[**DEPRECATED** - This command is deprecated. Please use 'databases getAttribute' instead] Get attribute by ID.`,
1402
- )
808
+ .description(`Get attribute by ID.`)
1403
809
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1404
810
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1405
811
  .requiredOption(`--key <key>`, `Attribute Key.`)
1406
812
  .action(
1407
813
  actionRunner(
1408
814
  async ({ databaseId, collectionId, key }) =>
1409
- await (
1410
- await getDatabasesClient()
1411
- ).getAttribute(databaseId, collectionId, key),
815
+ parse(await (await getDatabasesClient()).getAttribute(databaseId, collectionId, key)),
1412
816
  ),
1413
817
  );
1414
818
 
1415
819
  databases
1416
820
  .command(`delete-attribute`)
1417
- .description(
1418
- `[**DEPRECATED** - This command is deprecated. Please use 'databases deleteAttribute' instead] Deletes an attribute.`,
1419
- )
821
+ .description(`Deletes an attribute.`)
1420
822
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1421
823
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1422
824
  .requiredOption(`--key <key>`, `Attribute Key.`)
1423
825
  .action(
1424
826
  actionRunner(
1425
827
  async ({ databaseId, collectionId, key }) =>
1426
- await (
1427
- await getDatabasesClient()
1428
- ).deleteAttribute(databaseId, collectionId, key),
828
+ parse(await (await getDatabasesClient()).deleteAttribute(databaseId, collectionId, key)),
1429
829
  ),
1430
830
  );
1431
831
 
1432
832
  databases
1433
833
  .command(`update-relationship-attribute`)
1434
- .description(
1435
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateRelationshipAttribute' instead] Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
1436
- `,
1437
- )
834
+ .description(`Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
835
+ `)
1438
836
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1439
837
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1440
838
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -1443,36 +841,17 @@ databases
1443
841
  .action(
1444
842
  actionRunner(
1445
843
  async ({ databaseId, collectionId, key, onDelete, newKey }) =>
1446
- await (
1447
- await getDatabasesClient()
1448
- ).updateRelationshipAttribute(
1449
- databaseId,
1450
- collectionId,
1451
- key,
1452
- onDelete as RelationMutate,
1453
- newKey,
1454
- ),
844
+ parse(await (await getDatabasesClient()).updateRelationshipAttribute(databaseId, collectionId, key, onDelete as RelationMutate, newKey)),
1455
845
  ),
1456
846
  );
1457
847
 
1458
848
  databases
1459
849
  .command(`list-documents`)
1460
- .description(
1461
- `[**DEPRECATED** - This command is deprecated. Please use 'databases listDocuments' instead] Get a list of all the user's documents in a given collection. You can use the query params to filter your results.`,
1462
- )
850
+ .description(`Get a list of all the user's documents in a given collection. You can use the query params to filter your results.`)
1463
851
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1464
- .requiredOption(
1465
- `--collection-id <collection-id>`,
1466
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1467
- )
1468
- .option(
1469
- `--queries [queries...]`,
1470
- `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.`,
1471
- )
1472
- .option(
1473
- `--transaction-id <transaction-id>`,
1474
- `Transaction ID to read uncommitted changes within the transaction.`,
1475
- )
852
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
853
+ .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.`)
854
+ .option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`)
1476
855
  .option(
1477
856
  `--total [value]`,
1478
857
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -1482,431 +861,199 @@ databases
1482
861
  .action(
1483
862
  actionRunner(
1484
863
  async ({ databaseId, collectionId, queries, transactionId, total }) =>
1485
- await (
1486
- await getDatabasesClient()
1487
- ).listDocuments(
1488
- databaseId,
1489
- collectionId,
1490
- queries,
1491
- transactionId,
1492
- total,
1493
- ),
864
+ parse(await (await getDatabasesClient()).listDocuments(databaseId, collectionId, queries, transactionId, total)),
1494
865
  ),
1495
866
  );
1496
867
 
1497
868
  databases
1498
869
  .command(`create-document`)
1499
- .description(
1500
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createDocument' instead] Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`,
1501
- )
870
+ .description(`Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
1502
871
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1503
- .requiredOption(
1504
- `--collection-id <collection-id>`,
1505
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`,
1506
- )
1507
- .requiredOption(
1508
- `--document-id <document-id>`,
1509
- `Document ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`,
1510
- )
872
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`)
873
+ .requiredOption(`--document-id <document-id>`, `Document ID. Choose a custom ID or generate a random ID with \`ID.unique()\`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1511
874
  .requiredOption(`--data <data>`, `Document data as JSON object.`)
1512
- .option(
1513
- `--permissions [permissions...]`,
1514
- `An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
1515
- )
1516
- .option(
1517
- `--transaction-id <transaction-id>`,
1518
- `Transaction ID for staging the operation.`,
1519
- )
875
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
876
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
877
+ .action(
878
+ actionRunner(
879
+ async ({ databaseId, collectionId, documentId, data, permissions, transactionId }) =>
880
+ parse(await (await getDatabasesClient()).createDocument(databaseId, collectionId, documentId, JSON.parse(data), permissions, transactionId)),
881
+ ),
882
+ );
883
+
884
+ databases
885
+ .command(`create-documents`)
886
+ .description(`Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
887
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
888
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`)
889
+ .requiredOption(`--documents [documents...]`, `Array of documents data as JSON objects.`)
890
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
1520
891
  .action(
1521
892
  actionRunner(
1522
- async ({
1523
- databaseId,
1524
- collectionId,
1525
- documentId,
1526
- data,
1527
- permissions,
1528
- transactionId,
1529
- }) =>
1530
- await (
1531
- await getDatabasesClient()
1532
- ).createDocument(
1533
- databaseId,
1534
- collectionId,
1535
- documentId,
1536
- JSON.parse(data),
1537
- permissions,
1538
- transactionId,
1539
- ),
893
+ async ({ databaseId, collectionId, documents, transactionId }) =>
894
+ parse(await (await getDatabasesClient()).createDocuments(databaseId, collectionId, documents, transactionId)),
1540
895
  ),
1541
896
  );
1542
897
 
1543
898
  databases
1544
899
  .command(`upsert-documents`)
1545
- .description(
1546
- `[**DEPRECATED** - This command is deprecated. Please use 'databases upsertDocuments' instead] Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
1547
- `,
1548
- )
900
+ .description(`Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
901
+ `)
1549
902
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1550
903
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1551
- .requiredOption(
1552
- `--documents [documents...]`,
1553
- `Array of document data as JSON objects. May contain partial documents.`,
1554
- )
1555
- .option(
1556
- `--transaction-id <transaction-id>`,
1557
- `Transaction ID for staging the operation.`,
1558
- )
904
+ .requiredOption(`--documents [documents...]`, `Array of document data as JSON objects. May contain partial documents.`)
905
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
1559
906
  .action(
1560
907
  actionRunner(
1561
908
  async ({ databaseId, collectionId, documents, transactionId }) =>
1562
- await (
1563
- await getDatabasesClient()
1564
- ).upsertDocuments(databaseId, collectionId, documents, transactionId),
909
+ parse(await (await getDatabasesClient()).upsertDocuments(databaseId, collectionId, documents, transactionId)),
1565
910
  ),
1566
911
  );
1567
912
 
1568
913
  databases
1569
914
  .command(`update-documents`)
1570
- .description(
1571
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateDocuments' instead] Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.`,
1572
- )
915
+ .description(`Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.`)
1573
916
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1574
917
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1575
- .option(
1576
- `--data <data>`,
1577
- `Document data as JSON object. Include only attribute and value pairs to be updated.`,
1578
- )
1579
- .option(
1580
- `--queries [queries...]`,
1581
- `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.`,
1582
- )
1583
- .option(
1584
- `--transaction-id <transaction-id>`,
1585
- `Transaction ID for staging the operation.`,
1586
- )
918
+ .option(`--data <data>`, `Document data as JSON object. Include only attribute and value pairs to be updated.`)
919
+ .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.`)
920
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
1587
921
  .action(
1588
922
  actionRunner(
1589
923
  async ({ databaseId, collectionId, data, queries, transactionId }) =>
1590
- await (
1591
- await getDatabasesClient()
1592
- ).updateDocuments(
1593
- databaseId,
1594
- collectionId,
1595
- JSON.parse(data),
1596
- queries,
1597
- transactionId,
1598
- ),
924
+ parse(await (await getDatabasesClient()).updateDocuments(databaseId, collectionId, JSON.parse(data), queries, transactionId)),
1599
925
  ),
1600
926
  );
1601
927
 
1602
928
  databases
1603
929
  .command(`delete-documents`)
1604
- .description(
1605
- `[**DEPRECATED** - This command is deprecated. Please use 'databases deleteDocuments' instead] Bulk delete documents using queries, if no queries are passed then all documents are deleted.`,
1606
- )
930
+ .description(`Bulk delete documents using queries, if no queries are passed then all documents are deleted.`)
1607
931
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1608
- .requiredOption(
1609
- `--collection-id <collection-id>`,
1610
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1611
- )
1612
- .option(
1613
- `--queries [queries...]`,
1614
- `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.`,
1615
- )
1616
- .option(
1617
- `--transaction-id <transaction-id>`,
1618
- `Transaction ID for staging the operation.`,
1619
- )
932
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
933
+ .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.`)
934
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
1620
935
  .action(
1621
936
  actionRunner(
1622
937
  async ({ databaseId, collectionId, queries, transactionId }) =>
1623
- await (
1624
- await getDatabasesClient()
1625
- ).deleteDocuments(databaseId, collectionId, queries, transactionId),
938
+ parse(await (await getDatabasesClient()).deleteDocuments(databaseId, collectionId, queries, transactionId)),
1626
939
  ),
1627
940
  );
1628
941
 
1629
942
  databases
1630
943
  .command(`get-document`)
1631
- .description(
1632
- `[**DEPRECATED** - This command is deprecated. Please use 'databases getDocument' instead] Get a document by its unique ID. This endpoint response returns a JSON object with the document data.`,
1633
- )
944
+ .description(`Get a document by its unique ID. This endpoint response returns a JSON object with the document data.`)
1634
945
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1635
- .requiredOption(
1636
- `--collection-id <collection-id>`,
1637
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1638
- )
946
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1639
947
  .requiredOption(`--document-id <document-id>`, `Document ID.`)
1640
- .option(
1641
- `--queries [queries...]`,
1642
- `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.`,
1643
- )
1644
- .option(
1645
- `--transaction-id <transaction-id>`,
1646
- `Transaction ID to read uncommitted changes within the transaction.`,
1647
- )
948
+ .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.`)
949
+ .option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`)
1648
950
  .action(
1649
951
  actionRunner(
1650
- async ({
1651
- databaseId,
1652
- collectionId,
1653
- documentId,
1654
- queries,
1655
- transactionId,
1656
- }) =>
1657
- await (
1658
- await getDatabasesClient()
1659
- ).getDocument(
1660
- databaseId,
1661
- collectionId,
1662
- documentId,
1663
- queries,
1664
- transactionId,
1665
- ),
952
+ async ({ databaseId, collectionId, documentId, queries, transactionId }) =>
953
+ parse(await (await getDatabasesClient()).getDocument(databaseId, collectionId, documentId, queries, transactionId)),
1666
954
  ),
1667
955
  );
1668
956
 
1669
957
  databases
1670
958
  .command(`upsert-document`)
1671
- .description(
1672
- `[**DEPRECATED** - This command is deprecated. Please use 'databases upsertDocument' instead] Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`,
1673
- )
959
+ .description(`Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
1674
960
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1675
961
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1676
962
  .requiredOption(`--document-id <document-id>`, `Document ID.`)
1677
- .option(
1678
- `--data <data>`,
1679
- `Document data as JSON object. Include all required attributes of the document to be created or updated.`,
1680
- )
1681
- .option(
1682
- `--permissions [permissions...]`,
1683
- `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
1684
- )
1685
- .option(
1686
- `--transaction-id <transaction-id>`,
1687
- `Transaction ID for staging the operation.`,
1688
- )
963
+ .option(`--data <data>`, `Document data as JSON object. Include all required attributes of the document to be created or updated.`)
964
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
965
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
1689
966
  .action(
1690
967
  actionRunner(
1691
- async ({
1692
- databaseId,
1693
- collectionId,
1694
- documentId,
1695
- data,
1696
- permissions,
1697
- transactionId,
1698
- }) =>
1699
- await (
1700
- await getDatabasesClient()
1701
- ).upsertDocument(
1702
- databaseId,
1703
- collectionId,
1704
- documentId,
1705
- JSON.parse(data),
1706
- permissions,
1707
- transactionId,
1708
- ),
968
+ async ({ databaseId, collectionId, documentId, data, permissions, transactionId }) =>
969
+ parse(await (await getDatabasesClient()).upsertDocument(databaseId, collectionId, documentId, JSON.parse(data), permissions, transactionId)),
1709
970
  ),
1710
971
  );
1711
972
 
1712
973
  databases
1713
974
  .command(`update-document`)
1714
- .description(
1715
- `[**DEPRECATED** - This command is deprecated. Please use 'databases updateDocument' instead] Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.`,
1716
- )
975
+ .description(`Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.`)
1717
976
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1718
977
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1719
978
  .requiredOption(`--document-id <document-id>`, `Document ID.`)
1720
- .option(
1721
- `--data <data>`,
1722
- `Document data as JSON object. Include only attribute and value pairs to be updated.`,
1723
- )
1724
- .option(
1725
- `--permissions [permissions...]`,
1726
- `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
1727
- )
1728
- .option(
1729
- `--transaction-id <transaction-id>`,
1730
- `Transaction ID for staging the operation.`,
1731
- )
979
+ .option(`--data <data>`, `Document data as JSON object. Include only attribute and value pairs to be updated.`)
980
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
981
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
1732
982
  .action(
1733
983
  actionRunner(
1734
- async ({
1735
- databaseId,
1736
- collectionId,
1737
- documentId,
1738
- data,
1739
- permissions,
1740
- transactionId,
1741
- }) =>
1742
- await (
1743
- await getDatabasesClient()
1744
- ).updateDocument(
1745
- databaseId,
1746
- collectionId,
1747
- documentId,
1748
- JSON.parse(data),
1749
- permissions,
1750
- transactionId,
1751
- ),
984
+ async ({ databaseId, collectionId, documentId, data, permissions, transactionId }) =>
985
+ parse(await (await getDatabasesClient()).updateDocument(databaseId, collectionId, documentId, JSON.parse(data), permissions, transactionId)),
1752
986
  ),
1753
987
  );
1754
988
 
1755
989
  databases
1756
990
  .command(`delete-document`)
1757
- .description(
1758
- `[**DEPRECATED** - This command is deprecated. Please use 'databases deleteDocument' instead] Delete a document by its unique ID.`,
1759
- )
991
+ .description(`Delete a document by its unique ID.`)
1760
992
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1761
- .requiredOption(
1762
- `--collection-id <collection-id>`,
1763
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1764
- )
993
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1765
994
  .requiredOption(`--document-id <document-id>`, `Document ID.`)
1766
- .option(
1767
- `--transaction-id <transaction-id>`,
1768
- `Transaction ID for staging the operation.`,
1769
- )
995
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
1770
996
  .action(
1771
997
  actionRunner(
1772
998
  async ({ databaseId, collectionId, documentId, transactionId }) =>
1773
- await (
1774
- await getDatabasesClient()
1775
- ).deleteDocument(databaseId, collectionId, documentId, transactionId),
999
+ parse(await (await getDatabasesClient()).deleteDocument(databaseId, collectionId, documentId, transactionId)),
1776
1000
  ),
1777
1001
  );
1778
1002
 
1779
1003
  databases
1780
1004
  .command(`list-document-logs`)
1781
- .description(
1782
- `[**DEPRECATED** - This command is deprecated. Please use 'databases listDocumentLogs' instead] Get the document activity logs list by its unique ID.`,
1783
- )
1005
+ .description(`Get the document activity logs list by its unique ID.`)
1784
1006
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1785
1007
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1786
1008
  .requiredOption(`--document-id <document-id>`, `Document ID.`)
1787
- .option(
1788
- `--queries [queries...]`,
1789
- `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`,
1790
- )
1009
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
1791
1010
  .action(
1792
1011
  actionRunner(
1793
1012
  async ({ databaseId, collectionId, documentId, queries }) =>
1794
- await (
1795
- await getDatabasesClient()
1796
- ).listDocumentLogs(databaseId, collectionId, documentId, queries),
1013
+ parse(await (await getDatabasesClient()).listDocumentLogs(databaseId, collectionId, documentId, queries)),
1797
1014
  ),
1798
1015
  );
1799
1016
 
1800
1017
  databases
1801
1018
  .command(`decrement-document-attribute`)
1802
- .description(
1803
- `[**DEPRECATED** - This command is deprecated. Please use 'databases decrementDocumentAttribute' instead] Decrement a specific attribute of a document by a given value.`,
1804
- )
1019
+ .description(`Decrement a specific attribute of a document by a given value.`)
1805
1020
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1806
1021
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1807
1022
  .requiredOption(`--document-id <document-id>`, `Document ID.`)
1808
1023
  .requiredOption(`--attribute <attribute>`, `Attribute key.`)
1809
- .option(
1810
- `--value <value>`,
1811
- `Value to increment the attribute by. The value must be a number.`,
1812
- parseInteger,
1813
- )
1814
- .option(
1815
- `--min <min>`,
1816
- `Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.`,
1817
- parseInteger,
1818
- )
1819
- .option(
1820
- `--transaction-id <transaction-id>`,
1821
- `Transaction ID for staging the operation.`,
1822
- )
1024
+ .option(`--value <value>`, `Value to increment the attribute by. The value must be a number.`, parseInteger)
1025
+ .option(`--min <min>`, `Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.`, parseInteger)
1026
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
1823
1027
  .action(
1824
1028
  actionRunner(
1825
- async ({
1826
- databaseId,
1827
- collectionId,
1828
- documentId,
1829
- attribute,
1830
- value,
1831
- min,
1832
- transactionId,
1833
- }) =>
1834
- await (
1835
- await getDatabasesClient()
1836
- ).decrementDocumentAttribute(
1837
- databaseId,
1838
- collectionId,
1839
- documentId,
1840
- attribute,
1841
- value,
1842
- min,
1843
- transactionId,
1844
- ),
1029
+ async ({ databaseId, collectionId, documentId, attribute, value, min, transactionId }) =>
1030
+ parse(await (await getDatabasesClient()).decrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, min, transactionId)),
1845
1031
  ),
1846
1032
  );
1847
1033
 
1848
1034
  databases
1849
1035
  .command(`increment-document-attribute`)
1850
- .description(
1851
- `[**DEPRECATED** - This command is deprecated. Please use 'databases incrementDocumentAttribute' instead] Increment a specific attribute of a document by a given value.`,
1852
- )
1036
+ .description(`Increment a specific attribute of a document by a given value.`)
1853
1037
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1854
1038
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1855
1039
  .requiredOption(`--document-id <document-id>`, `Document ID.`)
1856
1040
  .requiredOption(`--attribute <attribute>`, `Attribute key.`)
1857
- .option(
1858
- `--value <value>`,
1859
- `Value to increment the attribute by. The value must be a number.`,
1860
- parseInteger,
1861
- )
1862
- .option(
1863
- `--max <max>`,
1864
- `Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.`,
1865
- parseInteger,
1866
- )
1867
- .option(
1868
- `--transaction-id <transaction-id>`,
1869
- `Transaction ID for staging the operation.`,
1870
- )
1041
+ .option(`--value <value>`, `Value to increment the attribute by. The value must be a number.`, parseInteger)
1042
+ .option(`--max <max>`, `Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.`, parseInteger)
1043
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
1871
1044
  .action(
1872
1045
  actionRunner(
1873
- async ({
1874
- databaseId,
1875
- collectionId,
1876
- documentId,
1877
- attribute,
1878
- value,
1879
- max,
1880
- transactionId,
1881
- }) =>
1882
- await (
1883
- await getDatabasesClient()
1884
- ).incrementDocumentAttribute(
1885
- databaseId,
1886
- collectionId,
1887
- documentId,
1888
- attribute,
1889
- value,
1890
- max,
1891
- transactionId,
1892
- ),
1046
+ async ({ databaseId, collectionId, documentId, attribute, value, max, transactionId }) =>
1047
+ parse(await (await getDatabasesClient()).incrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, max, transactionId)),
1893
1048
  ),
1894
1049
  );
1895
1050
 
1896
1051
  databases
1897
1052
  .command(`list-indexes`)
1898
- .description(
1899
- `[**DEPRECATED** - This command is deprecated. Please use 'databases listIndexes' instead] List indexes in the collection.`,
1900
- )
1053
+ .description(`List indexes in the collection.`)
1901
1054
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1902
- .requiredOption(
1903
- `--collection-id <collection-id>`,
1904
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1905
- )
1906
- .option(
1907
- `--queries [queries...]`,
1908
- `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: key, type, status, attributes, error`,
1909
- )
1055
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1056
+ .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: key, type, status, attributes, error`)
1910
1057
  .option(
1911
1058
  `--total [value]`,
1912
1059
  `When set to false, the total count returned will be 0 and will not be calculated.`,
@@ -1916,165 +1063,101 @@ databases
1916
1063
  .action(
1917
1064
  actionRunner(
1918
1065
  async ({ databaseId, collectionId, queries, total }) =>
1919
- await (
1920
- await getDatabasesClient()
1921
- ).listIndexes(databaseId, collectionId, queries, total),
1066
+ parse(await (await getDatabasesClient()).listIndexes(databaseId, collectionId, queries, total)),
1922
1067
  ),
1923
1068
  );
1924
1069
 
1925
1070
  databases
1926
1071
  .command(`create-index`)
1927
- .description(
1928
- `[**DEPRECATED** - This command is deprecated. Please use 'databases createIndex' instead] Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
1929
- Attributes can be \`key\`, \`fulltext\`, and \`unique\`.`,
1930
- )
1072
+ .description(`Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
1073
+ Attributes can be \`key\`, \`fulltext\`, and \`unique\`.`)
1931
1074
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1932
- .requiredOption(
1933
- `--collection-id <collection-id>`,
1934
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1935
- )
1075
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1936
1076
  .requiredOption(`--key <key>`, `Index Key.`)
1937
1077
  .requiredOption(`--type <type>`, `Index type.`)
1938
- .requiredOption(
1939
- `--attributes [attributes...]`,
1940
- `Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.`,
1941
- )
1942
- .option(
1943
- `--orders [orders...]`,
1944
- `Array of index orders. Maximum of 100 orders are allowed.`,
1945
- )
1078
+ .requiredOption(`--attributes [attributes...]`, `Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.`)
1079
+ .option(`--orders [orders...]`, `Array of index orders. Maximum of 100 orders are allowed.`)
1946
1080
  .option(`--lengths [lengths...]`, `Length of index. Maximum of 100`)
1947
1081
  .action(
1948
1082
  actionRunner(
1949
- async ({
1950
- databaseId,
1951
- collectionId,
1952
- key,
1953
- xType,
1954
- attributes,
1955
- orders,
1956
- lengths,
1957
- }) =>
1958
- await (
1959
- await getDatabasesClient()
1960
- ).createIndex(
1961
- databaseId,
1962
- collectionId,
1963
- key,
1964
- xType as IndexType,
1965
- attributes,
1966
- orders,
1967
- lengths,
1968
- ),
1083
+ async ({ databaseId, collectionId, key, type, attributes, orders, lengths }) =>
1084
+ parse(await (await getDatabasesClient()).createIndex(databaseId, collectionId, key, type as IndexType, attributes, orders, lengths)),
1969
1085
  ),
1970
1086
  );
1971
1087
 
1972
1088
  databases
1973
1089
  .command(`get-index`)
1974
- .description(
1975
- `[**DEPRECATED** - This command is deprecated. Please use 'databases getIndex' instead] Get an index by its unique ID.`,
1976
- )
1090
+ .description(`Get an index by its unique ID.`)
1977
1091
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1978
- .requiredOption(
1979
- `--collection-id <collection-id>`,
1980
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
1981
- )
1092
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
1982
1093
  .requiredOption(`--key <key>`, `Index Key.`)
1983
1094
  .action(
1984
1095
  actionRunner(
1985
1096
  async ({ databaseId, collectionId, key }) =>
1986
- await (
1987
- await getDatabasesClient()
1988
- ).getIndex(databaseId, collectionId, key),
1097
+ parse(await (await getDatabasesClient()).getIndex(databaseId, collectionId, key)),
1989
1098
  ),
1990
1099
  );
1991
1100
 
1992
1101
  databases
1993
1102
  .command(`delete-index`)
1994
- .description(
1995
- `[**DEPRECATED** - This command is deprecated. Please use 'databases deleteIndex' instead] Delete an index.`,
1996
- )
1103
+ .description(`Delete an index.`)
1997
1104
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
1998
- .requiredOption(
1999
- `--collection-id <collection-id>`,
2000
- `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`,
2001
- )
1105
+ .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2002
1106
  .requiredOption(`--key <key>`, `Index Key.`)
2003
1107
  .action(
2004
1108
  actionRunner(
2005
1109
  async ({ databaseId, collectionId, key }) =>
2006
- await (
2007
- await getDatabasesClient()
2008
- ).deleteIndex(databaseId, collectionId, key),
1110
+ parse(await (await getDatabasesClient()).deleteIndex(databaseId, collectionId, key)),
2009
1111
  ),
2010
1112
  );
2011
1113
 
2012
1114
  databases
2013
1115
  .command(`list-collection-logs`)
2014
- .description(
2015
- `[**DEPRECATED** - This command is deprecated. Please use 'databases listCollectionLogs' instead] Get the collection activity logs list by its unique ID.`,
2016
- )
1116
+ .description(`Get the collection activity logs list by its unique ID.`)
2017
1117
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2018
1118
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
2019
- .option(
2020
- `--queries [queries...]`,
2021
- `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`,
2022
- )
1119
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
2023
1120
  .action(
2024
1121
  actionRunner(
2025
1122
  async ({ databaseId, collectionId, queries }) =>
2026
- await (
2027
- await getDatabasesClient()
2028
- ).listCollectionLogs(databaseId, collectionId, queries),
1123
+ parse(await (await getDatabasesClient()).listCollectionLogs(databaseId, collectionId, queries)),
2029
1124
  ),
2030
1125
  );
2031
1126
 
2032
1127
  databases
2033
1128
  .command(`get-collection-usage`)
2034
- .description(
2035
- `[**DEPRECATED** - This command is deprecated. Please use 'databases getCollectionUsage' instead] Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`,
2036
- )
1129
+ .description(`Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`)
2037
1130
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2038
- .option(`--range <range>`, `Date range.`)
2039
1131
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
1132
+ .option(`--range <range>`, `Date range.`)
2040
1133
  .action(
2041
1134
  actionRunner(
2042
- async ({ databaseId, range, collectionId }) =>
2043
- await (
2044
- await getDatabasesClient()
2045
- ).getCollectionUsage(databaseId, range as UsageRange, collectionId),
1135
+ async ({ databaseId, collectionId, range }) =>
1136
+ parse(await (await getDatabasesClient()).getCollectionUsage(databaseId, collectionId, range as UsageRange)),
2046
1137
  ),
2047
1138
  );
2048
1139
 
2049
1140
  databases
2050
1141
  .command(`list-logs`)
2051
- .description(
2052
- `[**DEPRECATED** - This command is deprecated. Please use 'databases listLogs' instead] Get the database activity logs list by its unique ID.`,
2053
- )
1142
+ .description(`Get the database activity logs list by its unique ID.`)
2054
1143
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2055
- .option(
2056
- `--queries [queries...]`,
2057
- `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`,
2058
- )
1144
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
2059
1145
  .action(
2060
1146
  actionRunner(
2061
1147
  async ({ databaseId, queries }) =>
2062
- await (await getDatabasesClient()).listLogs(databaseId, queries),
1148
+ parse(await (await getDatabasesClient()).listLogs(databaseId, queries)),
2063
1149
  ),
2064
1150
  );
2065
1151
 
2066
1152
  databases
2067
1153
  .command(`get-usage`)
2068
- .description(
2069
- `[**DEPRECATED** - This command is deprecated. Please use 'databases getUsage' instead] Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`,
2070
- )
1154
+ .description(`Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`)
2071
1155
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2072
1156
  .option(`--range <range>`, `Date range.`)
2073
1157
  .action(
2074
1158
  actionRunner(
2075
1159
  async ({ databaseId, range }) =>
2076
- await (
2077
- await getDatabasesClient()
2078
- ).getUsage(databaseId, range as UsageRange),
1160
+ parse(await (await getDatabasesClient()).getUsage(databaseId, range as UsageRange)),
2079
1161
  ),
2080
1162
  );
1163
+