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
@@ -1,1928 +0,0 @@
1
- import { Command } from "commander";
2
- import { sdkForProject } from "../../sdks.js";
3
- import {
4
- actionRunner,
5
- commandDescriptions,
6
- parseBool,
7
- parseInteger,
8
- } from "../../parser.js";
9
- import {
10
- TablesDB,
11
- UsageRange,
12
- RelationshipType,
13
- RelationMutate,
14
- IndexType,
15
- } from "@appwrite.io/console";
16
-
17
- let tablesdbClient: TablesDB | null = null;
18
-
19
- const getTablesDBClient = async (): Promise<TablesDB> => {
20
- if (!tablesdbClient) {
21
- const sdkClient = await sdkForProject();
22
- tablesdbClient = new TablesDB(sdkClient);
23
- }
24
- return tablesdbClient;
25
- };
26
-
27
- export const tablesdb = new Command("tablesdb")
28
- .description(commandDescriptions["tablesdb"] ?? "")
29
- .configureHelp({
30
- helpWidth: process.stdout.columns || 80,
31
- });
32
-
33
- tablesdb
34
- .command(`list`)
35
- .description(
36
- `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 columns: name`,
41
- )
42
- .option(
43
- `--search <search>`,
44
- `Search term to filter your list results. Max length: 256 chars.`,
45
- )
46
- .option(
47
- `--total [value]`,
48
- `When set to false, the total count returned will be 0 and will not be calculated.`,
49
- (value: string | undefined) =>
50
- value === undefined ? true : parseBool(value),
51
- )
52
- .action(
53
- actionRunner(
54
- async ({ queries, search, total }) =>
55
- await (await getTablesDBClient()).list(queries, search, total),
56
- ),
57
- );
58
-
59
- tablesdb
60
- .command(`create`)
61
- .description(
62
- `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
- )
69
- .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
70
- .option(
71
- `--enabled [value]`,
72
- `Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`,
73
- (value: string | undefined) =>
74
- value === undefined ? true : parseBool(value),
75
- )
76
- .action(
77
- actionRunner(
78
- async ({ databaseId, name, enabled }) =>
79
- await (await getTablesDBClient()).create(databaseId, name, enabled),
80
- ),
81
- );
82
-
83
- tablesdb
84
- .command(`list-transactions`)
85
- .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
- )
90
- .action(
91
- actionRunner(
92
- async ({ queries }) =>
93
- await (await getTablesDBClient()).listTransactions(queries),
94
- ),
95
- );
96
-
97
- tablesdb
98
- .command(`create-transaction`)
99
- .description(`Create a new transaction.`)
100
- .option(
101
- `--ttl <ttl>`,
102
- `Seconds before the transaction expires.`,
103
- parseInteger,
104
- )
105
- .action(
106
- actionRunner(
107
- async ({ ttl }) =>
108
- await (await getTablesDBClient()).createTransaction(ttl),
109
- ),
110
- );
111
-
112
- tablesdb
113
- .command(`get-transaction`)
114
- .description(`Get a transaction by its unique ID.`)
115
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
116
- .action(
117
- actionRunner(
118
- async ({ transactionId }) =>
119
- await (await getTablesDBClient()).getTransaction(transactionId),
120
- ),
121
- );
122
-
123
- tablesdb
124
- .command(`update-transaction`)
125
- .description(
126
- `Update a transaction, to either commit or roll back its operations.`,
127
- )
128
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
129
- .option(
130
- `--commit [value]`,
131
- `Commit transaction?`,
132
- (value: string | undefined) =>
133
- value === undefined ? true : parseBool(value),
134
- )
135
- .option(
136
- `--rollback [value]`,
137
- `Rollback transaction?`,
138
- (value: string | undefined) =>
139
- value === undefined ? true : parseBool(value),
140
- )
141
- .action(
142
- actionRunner(
143
- async ({ transactionId, commit, rollback }) =>
144
- await (
145
- await getTablesDBClient()
146
- ).updateTransaction(transactionId, commit, rollback),
147
- ),
148
- );
149
-
150
- tablesdb
151
- .command(`delete-transaction`)
152
- .description(`Delete a transaction by its unique ID.`)
153
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
154
- .action(
155
- actionRunner(
156
- async ({ transactionId }) =>
157
- await (await getTablesDBClient()).deleteTransaction(transactionId),
158
- ),
159
- );
160
-
161
- tablesdb
162
- .command(`create-operations`)
163
- .description(`Create multiple operations in a single transaction.`)
164
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
165
- .option(`--operations [operations...]`, `Array of staged operations.`)
166
- .action(
167
- actionRunner(
168
- async ({ transactionId, operations }) =>
169
- await (
170
- await getTablesDBClient()
171
- ).createOperations(transactionId, operations),
172
- ),
173
- );
174
-
175
- tablesdb
176
- .command(`list-usage`)
177
- .description(
178
- `List usage metrics and statistics for all databases in the project. You can view the total number of databases, tables, rows, 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
- )
180
- .option(`--range <range>`, `Date range.`)
181
- .action(
182
- actionRunner(
183
- async ({ range }) =>
184
- await (await getTablesDBClient()).listUsage(range as UsageRange),
185
- ),
186
- );
187
-
188
- tablesdb
189
- .command(`get`)
190
- .description(
191
- `Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`,
192
- )
193
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
194
- .action(
195
- actionRunner(
196
- async ({ databaseId }) =>
197
- await (await getTablesDBClient()).get(databaseId),
198
- ),
199
- );
200
-
201
- tablesdb
202
- .command(`update`)
203
- .description(`Update a database by its unique ID.`)
204
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
205
- .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
206
- .option(
207
- `--enabled [value]`,
208
- `Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`,
209
- (value: string | undefined) =>
210
- value === undefined ? true : parseBool(value),
211
- )
212
- .action(
213
- actionRunner(
214
- async ({ databaseId, name, enabled }) =>
215
- await (await getTablesDBClient()).update(databaseId, name, enabled),
216
- ),
217
- );
218
-
219
- tablesdb
220
- .command(`delete`)
221
- .description(
222
- `Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`,
223
- )
224
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
225
- .action(
226
- actionRunner(
227
- async ({ databaseId }) =>
228
- await (await getTablesDBClient()).delete(databaseId),
229
- ),
230
- );
231
-
232
- tablesdb
233
- .command(`list-tables`)
234
- .description(
235
- `Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.`,
236
- )
237
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
238
- .option(
239
- `--queries [queries...]`,
240
- `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 columns: name, enabled, rowSecurity`,
241
- )
242
- .option(
243
- `--search <search>`,
244
- `Search term to filter your list results. Max length: 256 chars.`,
245
- )
246
- .option(
247
- `--total [value]`,
248
- `When set to false, the total count returned will be 0 and will not be calculated.`,
249
- (value: string | undefined) =>
250
- value === undefined ? true : parseBool(value),
251
- )
252
- .action(
253
- actionRunner(
254
- async ({ databaseId, queries, search, total }) =>
255
- await (
256
- await getTablesDBClient()
257
- ).listTables(databaseId, queries, search, total),
258
- ),
259
- );
260
-
261
- tablesdb
262
- .command(`create-table`)
263
- .description(
264
- `Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.`,
265
- )
266
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
267
- .requiredOption(
268
- `--table-id <table-id>`,
269
- `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.`,
270
- )
271
- .requiredOption(`--name <name>`, `Table name. Max length: 128 chars.`)
272
- .option(
273
- `--permissions [permissions...]`,
274
- `An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
275
- )
276
- .option(
277
- `--row-security [value]`,
278
- `Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
279
- (value: string | undefined) =>
280
- value === undefined ? true : parseBool(value),
281
- )
282
- .option(
283
- `--enabled [value]`,
284
- `Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.`,
285
- (value: string | undefined) =>
286
- value === undefined ? true : parseBool(value),
287
- )
288
- .option(
289
- `--columns [columns...]`,
290
- `Array of column definitions to create. Each column should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.`,
291
- )
292
- .option(
293
- `--indexes [indexes...]`,
294
- `Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of column keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).`,
295
- )
296
- .action(
297
- actionRunner(
298
- async ({
299
- databaseId,
300
- tableId,
301
- name,
302
- permissions,
303
- rowSecurity,
304
- enabled,
305
- columns,
306
- indexes,
307
- }) =>
308
- await (
309
- await getTablesDBClient()
310
- ).createTable(
311
- databaseId,
312
- tableId,
313
- name,
314
- permissions,
315
- rowSecurity,
316
- enabled,
317
- columns,
318
- indexes,
319
- ),
320
- ),
321
- );
322
-
323
- tablesdb
324
- .command(`get-table`)
325
- .description(
326
- `Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.`,
327
- )
328
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
329
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
330
- .action(
331
- actionRunner(
332
- async ({ databaseId, tableId }) =>
333
- await (await getTablesDBClient()).getTable(databaseId, tableId),
334
- ),
335
- );
336
-
337
- tablesdb
338
- .command(`update-table`)
339
- .description(`Update a table by its unique ID.`)
340
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
341
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
342
- .requiredOption(`--name <name>`, `Table name. Max length: 128 chars.`)
343
- .option(
344
- `--permissions [permissions...]`,
345
- `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
346
- )
347
- .option(
348
- `--row-security [value]`,
349
- `Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
350
- (value: string | undefined) =>
351
- value === undefined ? true : parseBool(value),
352
- )
353
- .option(
354
- `--enabled [value]`,
355
- `Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.`,
356
- (value: string | undefined) =>
357
- value === undefined ? true : parseBool(value),
358
- )
359
- .action(
360
- actionRunner(
361
- async ({
362
- databaseId,
363
- tableId,
364
- name,
365
- permissions,
366
- rowSecurity,
367
- enabled,
368
- }) =>
369
- await (
370
- await getTablesDBClient()
371
- ).updateTable(
372
- databaseId,
373
- tableId,
374
- name,
375
- permissions,
376
- rowSecurity,
377
- enabled,
378
- ),
379
- ),
380
- );
381
-
382
- tablesdb
383
- .command(`delete-table`)
384
- .description(
385
- `Delete a table by its unique ID. Only users with write permissions have access to delete this resource.`,
386
- )
387
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
388
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
389
- .action(
390
- actionRunner(
391
- async ({ databaseId, tableId }) =>
392
- await (await getTablesDBClient()).deleteTable(databaseId, tableId),
393
- ),
394
- );
395
-
396
- tablesdb
397
- .command(`list-columns`)
398
- .description(`List columns in the table.`)
399
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
400
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
401
- .option(
402
- `--queries [queries...]`,
403
- `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 columns: key, type, size, required, array, status, error`,
404
- )
405
- .option(
406
- `--total [value]`,
407
- `When set to false, the total count returned will be 0 and will not be calculated.`,
408
- (value: string | undefined) =>
409
- value === undefined ? true : parseBool(value),
410
- )
411
- .action(
412
- actionRunner(
413
- async ({ databaseId, tableId, queries, total }) =>
414
- await (
415
- await getTablesDBClient()
416
- ).listColumns(databaseId, tableId, queries, total),
417
- ),
418
- );
419
-
420
- tablesdb
421
- .command(`create-boolean-column`)
422
- .description(
423
- `Create a boolean column.
424
- `,
425
- )
426
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
427
- .requiredOption(
428
- `--table-id <table-id>`,
429
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
430
- )
431
- .requiredOption(`--key <key>`, `Column Key.`)
432
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
433
- .option(
434
- `--default [value]`,
435
- `Default value for column when not provided. Cannot be set when column is required.`,
436
- (value: string | undefined) =>
437
- value === undefined ? true : parseBool(value),
438
- )
439
- .option(
440
- `--array [value]`,
441
- `Is column an array?`,
442
- (value: string | undefined) =>
443
- value === undefined ? true : parseBool(value),
444
- )
445
- .action(
446
- actionRunner(
447
- async ({ databaseId, tableId, key, required, xDefault, array }) =>
448
- await (
449
- await getTablesDBClient()
450
- ).createBooleanColumn(
451
- databaseId,
452
- tableId,
453
- key,
454
- required,
455
- xDefault,
456
- array,
457
- ),
458
- ),
459
- );
460
-
461
- tablesdb
462
- .command(`update-boolean-column`)
463
- .description(
464
- `Update a boolean column. Changing the \`default\` value will not update already existing rows.`,
465
- )
466
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
467
- .requiredOption(
468
- `--table-id <table-id>`,
469
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
470
- )
471
- .requiredOption(`--key <key>`, `Column Key.`)
472
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
473
- .requiredOption(
474
- `--default <default>`,
475
- `Default value for column when not provided. Cannot be set when column is required.`,
476
- parseBool,
477
- )
478
- .option(`--new-key <new-key>`, `New Column Key.`)
479
- .action(
480
- actionRunner(
481
- async ({ databaseId, tableId, key, required, xDefault, newKey }) =>
482
- await (
483
- await getTablesDBClient()
484
- ).updateBooleanColumn(
485
- databaseId,
486
- tableId,
487
- key,
488
- required,
489
- xDefault,
490
- newKey,
491
- ),
492
- ),
493
- );
494
-
495
- tablesdb
496
- .command(`create-datetime-column`)
497
- .description(`Create a date time column according to the ISO 8601 standard.`)
498
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
499
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
500
- .requiredOption(`--key <key>`, `Column Key.`)
501
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
502
- .option(
503
- `--default <default>`,
504
- `Default value for the column in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when column is required.`,
505
- )
506
- .option(
507
- `--array [value]`,
508
- `Is column an array?`,
509
- (value: string | undefined) =>
510
- value === undefined ? true : parseBool(value),
511
- )
512
- .action(
513
- actionRunner(
514
- async ({ databaseId, tableId, key, required, xDefault, array }) =>
515
- await (
516
- await getTablesDBClient()
517
- ).createDatetimeColumn(
518
- databaseId,
519
- tableId,
520
- key,
521
- required,
522
- xDefault,
523
- array,
524
- ),
525
- ),
526
- );
527
-
528
- tablesdb
529
- .command(`update-datetime-column`)
530
- .description(
531
- `Update a date time column. Changing the \`default\` value will not update already existing rows.`,
532
- )
533
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
534
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
535
- .requiredOption(`--key <key>`, `Column Key.`)
536
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
537
- .requiredOption(
538
- `--default <default>`,
539
- `Default value for column when not provided. Cannot be set when column is required.`,
540
- )
541
- .option(`--new-key <new-key>`, `New Column Key.`)
542
- .action(
543
- actionRunner(
544
- async ({ databaseId, tableId, key, required, xDefault, newKey }) =>
545
- await (
546
- await getTablesDBClient()
547
- ).updateDatetimeColumn(
548
- databaseId,
549
- tableId,
550
- key,
551
- required,
552
- xDefault,
553
- newKey,
554
- ),
555
- ),
556
- );
557
-
558
- tablesdb
559
- .command(`create-email-column`)
560
- .description(
561
- `Create an email column.
562
- `,
563
- )
564
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
565
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
566
- .requiredOption(`--key <key>`, `Column Key.`)
567
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
568
- .option(
569
- `--default <default>`,
570
- `Default value for column when not provided. Cannot be set when column is required.`,
571
- )
572
- .option(
573
- `--array [value]`,
574
- `Is column an array?`,
575
- (value: string | undefined) =>
576
- value === undefined ? true : parseBool(value),
577
- )
578
- .action(
579
- actionRunner(
580
- async ({ databaseId, tableId, key, required, xDefault, array }) =>
581
- await (
582
- await getTablesDBClient()
583
- ).createEmailColumn(
584
- databaseId,
585
- tableId,
586
- key,
587
- required,
588
- xDefault,
589
- array,
590
- ),
591
- ),
592
- );
593
-
594
- tablesdb
595
- .command(`update-email-column`)
596
- .description(
597
- `Update an email column. Changing the \`default\` value will not update already existing rows.
598
- `,
599
- )
600
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
601
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
602
- .requiredOption(`--key <key>`, `Column Key.`)
603
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
604
- .requiredOption(
605
- `--default <default>`,
606
- `Default value for column when not provided. Cannot be set when column is required.`,
607
- )
608
- .option(`--new-key <new-key>`, `New Column Key.`)
609
- .action(
610
- actionRunner(
611
- async ({ databaseId, tableId, key, required, xDefault, newKey }) =>
612
- await (
613
- await getTablesDBClient()
614
- ).updateEmailColumn(
615
- databaseId,
616
- tableId,
617
- key,
618
- required,
619
- xDefault,
620
- newKey,
621
- ),
622
- ),
623
- );
624
-
625
- tablesdb
626
- .command(`create-enum-column`)
627
- .description(
628
- `Create an enumeration column. The \`elements\` param acts as a white-list of accepted values for this column.`,
629
- )
630
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
631
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
632
- .requiredOption(`--key <key>`, `Column Key.`)
633
- .requiredOption(`--elements [elements...]`, `Array of enum values.`)
634
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
635
- .option(
636
- `--default <default>`,
637
- `Default value for column when not provided. Cannot be set when column is required.`,
638
- )
639
- .option(
640
- `--array [value]`,
641
- `Is column an array?`,
642
- (value: string | undefined) =>
643
- value === undefined ? true : parseBool(value),
644
- )
645
- .action(
646
- actionRunner(
647
- async ({
648
- databaseId,
649
- tableId,
650
- key,
651
- elements,
652
- required,
653
- xDefault,
654
- array,
655
- }) =>
656
- await (
657
- await getTablesDBClient()
658
- ).createEnumColumn(
659
- databaseId,
660
- tableId,
661
- key,
662
- elements,
663
- required,
664
- xDefault,
665
- array,
666
- ),
667
- ),
668
- );
669
-
670
- tablesdb
671
- .command(`update-enum-column`)
672
- .description(
673
- `Update an enum column. Changing the \`default\` value will not update already existing rows.
674
- `,
675
- )
676
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
677
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
678
- .requiredOption(`--key <key>`, `Column Key.`)
679
- .requiredOption(`--elements [elements...]`, `Updated list of enum values.`)
680
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
681
- .requiredOption(
682
- `--default <default>`,
683
- `Default value for column when not provided. Cannot be set when column is required.`,
684
- )
685
- .option(`--new-key <new-key>`, `New Column Key.`)
686
- .action(
687
- actionRunner(
688
- async ({
689
- databaseId,
690
- tableId,
691
- key,
692
- elements,
693
- required,
694
- xDefault,
695
- newKey,
696
- }) =>
697
- await (
698
- await getTablesDBClient()
699
- ).updateEnumColumn(
700
- databaseId,
701
- tableId,
702
- key,
703
- elements,
704
- required,
705
- xDefault,
706
- newKey,
707
- ),
708
- ),
709
- );
710
-
711
- tablesdb
712
- .command(`create-float-column`)
713
- .description(
714
- `Create a float column. Optionally, minimum and maximum values can be provided.
715
- `,
716
- )
717
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
718
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
719
- .requiredOption(`--key <key>`, `Column Key.`)
720
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
721
- .option(`--min <min>`, `Minimum value`, parseInteger)
722
- .option(`--max <max>`, `Maximum value`, parseInteger)
723
- .option(
724
- `--default <default>`,
725
- `Default value. Cannot be set when required.`,
726
- parseInteger,
727
- )
728
- .option(
729
- `--array [value]`,
730
- `Is column an array?`,
731
- (value: string | undefined) =>
732
- value === undefined ? true : parseBool(value),
733
- )
734
- .action(
735
- actionRunner(
736
- async ({
737
- databaseId,
738
- tableId,
739
- key,
740
- required,
741
- min,
742
- max,
743
- xDefault,
744
- array,
745
- }) =>
746
- await (
747
- await getTablesDBClient()
748
- ).createFloatColumn(
749
- databaseId,
750
- tableId,
751
- key,
752
- required,
753
- min,
754
- max,
755
- xDefault,
756
- array,
757
- ),
758
- ),
759
- );
760
-
761
- tablesdb
762
- .command(`update-float-column`)
763
- .description(
764
- `Update a float column. Changing the \`default\` value will not update already existing rows.
765
- `,
766
- )
767
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
768
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
769
- .requiredOption(`--key <key>`, `Column Key.`)
770
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
771
- .option(`--min <min>`, `Minimum value`, parseInteger)
772
- .option(`--max <max>`, `Maximum value`, parseInteger)
773
- .requiredOption(
774
- `--default <default>`,
775
- `Default value. Cannot be set when required.`,
776
- parseInteger,
777
- )
778
- .option(`--new-key <new-key>`, `New Column Key.`)
779
- .action(
780
- actionRunner(
781
- async ({
782
- databaseId,
783
- tableId,
784
- key,
785
- required,
786
- min,
787
- max,
788
- xDefault,
789
- newKey,
790
- }) =>
791
- await (
792
- await getTablesDBClient()
793
- ).updateFloatColumn(
794
- databaseId,
795
- tableId,
796
- key,
797
- required,
798
- min,
799
- max,
800
- xDefault,
801
- newKey,
802
- ),
803
- ),
804
- );
805
-
806
- tablesdb
807
- .command(`create-integer-column`)
808
- .description(
809
- `Create an integer column. Optionally, minimum and maximum values can be provided.
810
- `,
811
- )
812
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
813
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
814
- .requiredOption(`--key <key>`, `Column Key.`)
815
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
816
- .option(`--min <min>`, `Minimum value`, parseInteger)
817
- .option(`--max <max>`, `Maximum value`, parseInteger)
818
- .option(
819
- `--default <default>`,
820
- `Default value. Cannot be set when column is required.`,
821
- parseInteger,
822
- )
823
- .option(
824
- `--array [value]`,
825
- `Is column an array?`,
826
- (value: string | undefined) =>
827
- value === undefined ? true : parseBool(value),
828
- )
829
- .action(
830
- actionRunner(
831
- async ({
832
- databaseId,
833
- tableId,
834
- key,
835
- required,
836
- min,
837
- max,
838
- xDefault,
839
- array,
840
- }) =>
841
- await (
842
- await getTablesDBClient()
843
- ).createIntegerColumn(
844
- databaseId,
845
- tableId,
846
- key,
847
- required,
848
- min,
849
- max,
850
- xDefault,
851
- array,
852
- ),
853
- ),
854
- );
855
-
856
- tablesdb
857
- .command(`update-integer-column`)
858
- .description(
859
- `Update an integer column. Changing the \`default\` value will not update already existing rows.
860
- `,
861
- )
862
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
863
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
864
- .requiredOption(`--key <key>`, `Column Key.`)
865
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
866
- .option(`--min <min>`, `Minimum value`, parseInteger)
867
- .option(`--max <max>`, `Maximum value`, parseInteger)
868
- .requiredOption(
869
- `--default <default>`,
870
- `Default value. Cannot be set when column is required.`,
871
- parseInteger,
872
- )
873
- .option(`--new-key <new-key>`, `New Column Key.`)
874
- .action(
875
- actionRunner(
876
- async ({
877
- databaseId,
878
- tableId,
879
- key,
880
- required,
881
- min,
882
- max,
883
- xDefault,
884
- newKey,
885
- }) =>
886
- await (
887
- await getTablesDBClient()
888
- ).updateIntegerColumn(
889
- databaseId,
890
- tableId,
891
- key,
892
- required,
893
- min,
894
- max,
895
- xDefault,
896
- newKey,
897
- ),
898
- ),
899
- );
900
-
901
- tablesdb
902
- .command(`create-ip-column`)
903
- .description(
904
- `Create IP address column.
905
- `,
906
- )
907
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
908
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
909
- .requiredOption(`--key <key>`, `Column Key.`)
910
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
911
- .option(
912
- `--default <default>`,
913
- `Default value. Cannot be set when column is required.`,
914
- )
915
- .option(
916
- `--array [value]`,
917
- `Is column an array?`,
918
- (value: string | undefined) =>
919
- value === undefined ? true : parseBool(value),
920
- )
921
- .action(
922
- actionRunner(
923
- async ({ databaseId, tableId, key, required, xDefault, array }) =>
924
- await (
925
- await getTablesDBClient()
926
- ).createIpColumn(databaseId, tableId, key, required, xDefault, array),
927
- ),
928
- );
929
-
930
- tablesdb
931
- .command(`update-ip-column`)
932
- .description(
933
- `Update an ip column. Changing the \`default\` value will not update already existing rows.
934
- `,
935
- )
936
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
937
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
938
- .requiredOption(`--key <key>`, `Column Key.`)
939
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
940
- .requiredOption(
941
- `--default <default>`,
942
- `Default value. Cannot be set when column is required.`,
943
- )
944
- .option(`--new-key <new-key>`, `New Column Key.`)
945
- .action(
946
- actionRunner(
947
- async ({ databaseId, tableId, key, required, xDefault, newKey }) =>
948
- await (
949
- await getTablesDBClient()
950
- ).updateIpColumn(databaseId, tableId, key, required, xDefault, newKey),
951
- ),
952
- );
953
-
954
- tablesdb
955
- .command(`create-line-column`)
956
- .description(`Create a geometric line column.`)
957
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
958
- .requiredOption(
959
- `--table-id <table-id>`,
960
- `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
961
- )
962
- .requiredOption(`--key <key>`, `Column Key.`)
963
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
964
- .option(
965
- `--default [default...]`,
966
- `Default value for column 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 column is required.`,
967
- )
968
- .action(
969
- actionRunner(
970
- async ({ databaseId, tableId, key, required, xDefault }) =>
971
- await (
972
- await getTablesDBClient()
973
- ).createLineColumn(databaseId, tableId, key, required, xDefault),
974
- ),
975
- );
976
-
977
- tablesdb
978
- .command(`update-line-column`)
979
- .description(
980
- `Update a line column. Changing the \`default\` value will not update already existing rows.`,
981
- )
982
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
983
- .requiredOption(
984
- `--table-id <table-id>`,
985
- `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
986
- )
987
- .requiredOption(`--key <key>`, `Column Key.`)
988
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
989
- .option(
990
- `--default [default...]`,
991
- `Default value for column 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 column is required.`,
992
- )
993
- .option(`--new-key <new-key>`, `New Column Key.`)
994
- .action(
995
- actionRunner(
996
- async ({ databaseId, tableId, key, required, xDefault, newKey }) =>
997
- await (
998
- await getTablesDBClient()
999
- ).updateLineColumn(
1000
- databaseId,
1001
- tableId,
1002
- key,
1003
- required,
1004
- xDefault,
1005
- newKey,
1006
- ),
1007
- ),
1008
- );
1009
-
1010
- tablesdb
1011
- .command(`create-point-column`)
1012
- .description(`Create a geometric point column.`)
1013
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1014
- .requiredOption(
1015
- `--table-id <table-id>`,
1016
- `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1017
- )
1018
- .requiredOption(`--key <key>`, `Column Key.`)
1019
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
1020
- .option(
1021
- `--default [default...]`,
1022
- `Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.`,
1023
- )
1024
- .action(
1025
- actionRunner(
1026
- async ({ databaseId, tableId, key, required, xDefault }) =>
1027
- await (
1028
- await getTablesDBClient()
1029
- ).createPointColumn(databaseId, tableId, key, required, xDefault),
1030
- ),
1031
- );
1032
-
1033
- tablesdb
1034
- .command(`update-point-column`)
1035
- .description(
1036
- `Update a point column. Changing the \`default\` value will not update already existing rows.`,
1037
- )
1038
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1039
- .requiredOption(
1040
- `--table-id <table-id>`,
1041
- `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1042
- )
1043
- .requiredOption(`--key <key>`, `Column Key.`)
1044
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
1045
- .option(
1046
- `--default [default...]`,
1047
- `Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.`,
1048
- )
1049
- .option(`--new-key <new-key>`, `New Column Key.`)
1050
- .action(
1051
- actionRunner(
1052
- async ({ databaseId, tableId, key, required, xDefault, newKey }) =>
1053
- await (
1054
- await getTablesDBClient()
1055
- ).updatePointColumn(
1056
- databaseId,
1057
- tableId,
1058
- key,
1059
- required,
1060
- xDefault,
1061
- newKey,
1062
- ),
1063
- ),
1064
- );
1065
-
1066
- tablesdb
1067
- .command(`create-polygon-column`)
1068
- .description(`Create a geometric polygon column.`)
1069
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1070
- .requiredOption(
1071
- `--table-id <table-id>`,
1072
- `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1073
- )
1074
- .requiredOption(`--key <key>`, `Column Key.`)
1075
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
1076
- .option(
1077
- `--default [default...]`,
1078
- `Default value for column 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 column is required.`,
1079
- )
1080
- .action(
1081
- actionRunner(
1082
- async ({ databaseId, tableId, key, required, xDefault }) =>
1083
- await (
1084
- await getTablesDBClient()
1085
- ).createPolygonColumn(databaseId, tableId, key, required, xDefault),
1086
- ),
1087
- );
1088
-
1089
- tablesdb
1090
- .command(`update-polygon-column`)
1091
- .description(
1092
- `Update a polygon column. Changing the \`default\` value will not update already existing rows.`,
1093
- )
1094
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1095
- .requiredOption(
1096
- `--table-id <table-id>`,
1097
- `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1098
- )
1099
- .requiredOption(`--key <key>`, `Column Key.`)
1100
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
1101
- .option(
1102
- `--default [default...]`,
1103
- `Default value for column 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 column is required.`,
1104
- )
1105
- .option(`--new-key <new-key>`, `New Column Key.`)
1106
- .action(
1107
- actionRunner(
1108
- async ({ databaseId, tableId, key, required, xDefault, newKey }) =>
1109
- await (
1110
- await getTablesDBClient()
1111
- ).updatePolygonColumn(
1112
- databaseId,
1113
- tableId,
1114
- key,
1115
- required,
1116
- xDefault,
1117
- newKey,
1118
- ),
1119
- ),
1120
- );
1121
-
1122
- tablesdb
1123
- .command(`create-relationship-column`)
1124
- .description(
1125
- `Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns).
1126
- `,
1127
- )
1128
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1129
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1130
- .requiredOption(`--related-table-id <related-table-id>`, `Related Table ID.`)
1131
- .requiredOption(`--type <type>`, `Relation type`)
1132
- .option(`--two-way [value]`, `Is Two Way?`, (value: string | undefined) =>
1133
- value === undefined ? true : parseBool(value),
1134
- )
1135
- .option(`--key <key>`, `Column Key.`)
1136
- .option(`--two-way-key <two-way-key>`, `Two Way Column Key.`)
1137
- .option(`--on-delete <on-delete>`, `Constraints option`)
1138
- .action(
1139
- actionRunner(
1140
- async ({
1141
- databaseId,
1142
- tableId,
1143
- relatedTableId,
1144
- xType,
1145
- twoWay,
1146
- key,
1147
- twoWayKey,
1148
- onDelete,
1149
- }) =>
1150
- await (
1151
- await getTablesDBClient()
1152
- ).createRelationshipColumn(
1153
- databaseId,
1154
- tableId,
1155
- relatedTableId,
1156
- xType as RelationshipType,
1157
- twoWay,
1158
- key,
1159
- twoWayKey,
1160
- onDelete as RelationMutate,
1161
- ),
1162
- ),
1163
- );
1164
-
1165
- tablesdb
1166
- .command(`create-string-column`)
1167
- .description(
1168
- `Create a string column.
1169
- `,
1170
- )
1171
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1172
- .requiredOption(
1173
- `--table-id <table-id>`,
1174
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1175
- )
1176
- .requiredOption(`--key <key>`, `Column Key.`)
1177
- .requiredOption(
1178
- `--size <size>`,
1179
- `Column size for text columns, in number of characters.`,
1180
- parseInteger,
1181
- )
1182
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
1183
- .option(
1184
- `--default <default>`,
1185
- `Default value for column when not provided. Cannot be set when column is required.`,
1186
- )
1187
- .option(
1188
- `--array [value]`,
1189
- `Is column an array?`,
1190
- (value: string | undefined) =>
1191
- value === undefined ? true : parseBool(value),
1192
- )
1193
- .option(
1194
- `--encrypt [value]`,
1195
- `Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.`,
1196
- (value: string | undefined) =>
1197
- value === undefined ? true : parseBool(value),
1198
- )
1199
- .action(
1200
- actionRunner(
1201
- async ({
1202
- databaseId,
1203
- tableId,
1204
- key,
1205
- size,
1206
- required,
1207
- xDefault,
1208
- array,
1209
- encrypt,
1210
- }) =>
1211
- await (
1212
- await getTablesDBClient()
1213
- ).createStringColumn(
1214
- databaseId,
1215
- tableId,
1216
- key,
1217
- size,
1218
- required,
1219
- xDefault,
1220
- array,
1221
- encrypt,
1222
- ),
1223
- ),
1224
- );
1225
-
1226
- tablesdb
1227
- .command(`update-string-column`)
1228
- .description(
1229
- `Update a string column. Changing the \`default\` value will not update already existing rows.
1230
- `,
1231
- )
1232
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1233
- .requiredOption(
1234
- `--table-id <table-id>`,
1235
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1236
- )
1237
- .requiredOption(`--key <key>`, `Column Key.`)
1238
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
1239
- .requiredOption(
1240
- `--default <default>`,
1241
- `Default value for column when not provided. Cannot be set when column is required.`,
1242
- )
1243
- .option(`--size <size>`, `Maximum size of the string column.`, parseInteger)
1244
- .option(`--new-key <new-key>`, `New Column Key.`)
1245
- .action(
1246
- actionRunner(
1247
- async ({ databaseId, tableId, key, required, xDefault, size, newKey }) =>
1248
- await (
1249
- await getTablesDBClient()
1250
- ).updateStringColumn(
1251
- databaseId,
1252
- tableId,
1253
- key,
1254
- required,
1255
- xDefault,
1256
- size,
1257
- newKey,
1258
- ),
1259
- ),
1260
- );
1261
-
1262
- tablesdb
1263
- .command(`create-url-column`)
1264
- .description(
1265
- `Create a URL column.
1266
- `,
1267
- )
1268
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1269
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1270
- .requiredOption(`--key <key>`, `Column Key.`)
1271
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
1272
- .option(
1273
- `--default <default>`,
1274
- `Default value for column when not provided. Cannot be set when column is required.`,
1275
- )
1276
- .option(
1277
- `--array [value]`,
1278
- `Is column an array?`,
1279
- (value: string | undefined) =>
1280
- value === undefined ? true : parseBool(value),
1281
- )
1282
- .action(
1283
- actionRunner(
1284
- async ({ databaseId, tableId, key, required, xDefault, array }) =>
1285
- await (
1286
- await getTablesDBClient()
1287
- ).createUrlColumn(databaseId, tableId, key, required, xDefault, array),
1288
- ),
1289
- );
1290
-
1291
- tablesdb
1292
- .command(`update-url-column`)
1293
- .description(
1294
- `Update an url column. Changing the \`default\` value will not update already existing rows.
1295
- `,
1296
- )
1297
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1298
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1299
- .requiredOption(`--key <key>`, `Column Key.`)
1300
- .requiredOption(`--required <required>`, `Is column required?`, parseBool)
1301
- .requiredOption(
1302
- `--default <default>`,
1303
- `Default value for column when not provided. Cannot be set when column is required.`,
1304
- )
1305
- .option(`--new-key <new-key>`, `New Column Key.`)
1306
- .action(
1307
- actionRunner(
1308
- async ({ databaseId, tableId, key, required, xDefault, newKey }) =>
1309
- await (
1310
- await getTablesDBClient()
1311
- ).updateUrlColumn(databaseId, tableId, key, required, xDefault, newKey),
1312
- ),
1313
- );
1314
-
1315
- tablesdb
1316
- .command(`get-column`)
1317
- .description(`Get column by ID.`)
1318
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1319
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1320
- .requiredOption(`--key <key>`, `Column Key.`)
1321
- .action(
1322
- actionRunner(
1323
- async ({ databaseId, tableId, key }) =>
1324
- await (await getTablesDBClient()).getColumn(databaseId, tableId, key),
1325
- ),
1326
- );
1327
-
1328
- tablesdb
1329
- .command(`delete-column`)
1330
- .description(`Deletes a column.`)
1331
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1332
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1333
- .requiredOption(`--key <key>`, `Column Key.`)
1334
- .action(
1335
- actionRunner(
1336
- async ({ databaseId, tableId, key }) =>
1337
- await (
1338
- await getTablesDBClient()
1339
- ).deleteColumn(databaseId, tableId, key),
1340
- ),
1341
- );
1342
-
1343
- tablesdb
1344
- .command(`update-relationship-column`)
1345
- .description(
1346
- `Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns).
1347
- `,
1348
- )
1349
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1350
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1351
- .requiredOption(`--key <key>`, `Column Key.`)
1352
- .option(`--on-delete <on-delete>`, `Constraints option`)
1353
- .option(`--new-key <new-key>`, `New Column Key.`)
1354
- .action(
1355
- actionRunner(
1356
- async ({ databaseId, tableId, key, onDelete, newKey }) =>
1357
- await (
1358
- await getTablesDBClient()
1359
- ).updateRelationshipColumn(
1360
- databaseId,
1361
- tableId,
1362
- key,
1363
- onDelete as RelationMutate,
1364
- newKey,
1365
- ),
1366
- ),
1367
- );
1368
-
1369
- tablesdb
1370
- .command(`list-indexes`)
1371
- .description(`List indexes on the table.`)
1372
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1373
- .requiredOption(
1374
- `--table-id <table-id>`,
1375
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1376
- )
1377
- .option(
1378
- `--queries [queries...]`,
1379
- `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 columns: key, type, status, attributes, error`,
1380
- )
1381
- .option(
1382
- `--total [value]`,
1383
- `When set to false, the total count returned will be 0 and will not be calculated.`,
1384
- (value: string | undefined) =>
1385
- value === undefined ? true : parseBool(value),
1386
- )
1387
- .action(
1388
- actionRunner(
1389
- async ({ databaseId, tableId, queries, total }) =>
1390
- await (
1391
- await getTablesDBClient()
1392
- ).listIndexes(databaseId, tableId, queries, total),
1393
- ),
1394
- );
1395
-
1396
- tablesdb
1397
- .command(`create-index`)
1398
- .description(
1399
- `Creates an index on the columns listed. Your index should include all the columns you will query in a single request.
1400
- Type can be \`key\`, \`fulltext\`, or \`unique\`.`,
1401
- )
1402
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1403
- .requiredOption(
1404
- `--table-id <table-id>`,
1405
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1406
- )
1407
- .requiredOption(`--key <key>`, `Index Key.`)
1408
- .requiredOption(`--type <type>`, `Index type.`)
1409
- .requiredOption(
1410
- `--columns [columns...]`,
1411
- `Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.`,
1412
- )
1413
- .option(
1414
- `--orders [orders...]`,
1415
- `Array of index orders. Maximum of 100 orders are allowed.`,
1416
- )
1417
- .option(`--lengths [lengths...]`, `Length of index. Maximum of 100`)
1418
- .action(
1419
- actionRunner(
1420
- async ({ databaseId, tableId, key, xType, columns, orders, lengths }) =>
1421
- await (
1422
- await getTablesDBClient()
1423
- ).createIndex(
1424
- databaseId,
1425
- tableId,
1426
- key,
1427
- xType as IndexType,
1428
- columns,
1429
- orders,
1430
- lengths,
1431
- ),
1432
- ),
1433
- );
1434
-
1435
- tablesdb
1436
- .command(`get-index`)
1437
- .description(`Get index by ID.`)
1438
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1439
- .requiredOption(
1440
- `--table-id <table-id>`,
1441
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1442
- )
1443
- .requiredOption(`--key <key>`, `Index Key.`)
1444
- .action(
1445
- actionRunner(
1446
- async ({ databaseId, tableId, key }) =>
1447
- await (await getTablesDBClient()).getIndex(databaseId, tableId, key),
1448
- ),
1449
- );
1450
-
1451
- tablesdb
1452
- .command(`delete-index`)
1453
- .description(`Delete an index.`)
1454
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1455
- .requiredOption(
1456
- `--table-id <table-id>`,
1457
- `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1458
- )
1459
- .requiredOption(`--key <key>`, `Index Key.`)
1460
- .action(
1461
- actionRunner(
1462
- async ({ databaseId, tableId, key }) =>
1463
- await (await getTablesDBClient()).deleteIndex(databaseId, tableId, key),
1464
- ),
1465
- );
1466
-
1467
- tablesdb
1468
- .command(`list-table-logs`)
1469
- .description(`Get the table activity logs list by its unique ID.`)
1470
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1471
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1472
- .option(
1473
- `--queries [queries...]`,
1474
- `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`,
1475
- )
1476
- .action(
1477
- actionRunner(
1478
- async ({ databaseId, tableId, queries }) =>
1479
- await (
1480
- await getTablesDBClient()
1481
- ).listTableLogs(databaseId, tableId, queries),
1482
- ),
1483
- );
1484
-
1485
- tablesdb
1486
- .command(`list-rows`)
1487
- .description(
1488
- `Get a list of all the user's rows in a given table. You can use the query params to filter your results.`,
1489
- )
1490
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1491
- .requiredOption(
1492
- `--table-id <table-id>`,
1493
- `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table).`,
1494
- )
1495
- .option(
1496
- `--queries [queries...]`,
1497
- `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.`,
1498
- )
1499
- .option(
1500
- `--transaction-id <transaction-id>`,
1501
- `Transaction ID to read uncommitted changes within the transaction.`,
1502
- )
1503
- .option(
1504
- `--total [value]`,
1505
- `When set to false, the total count returned will be 0 and will not be calculated.`,
1506
- (value: string | undefined) =>
1507
- value === undefined ? true : parseBool(value),
1508
- )
1509
- .action(
1510
- actionRunner(
1511
- async ({ databaseId, tableId, queries, transactionId, total }) =>
1512
- await (
1513
- await getTablesDBClient()
1514
- ).listRows(databaseId, tableId, queries, transactionId, total),
1515
- ),
1516
- );
1517
-
1518
- tablesdb
1519
- .command(`create-row`)
1520
- .description(
1521
- `Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.`,
1522
- )
1523
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1524
- .requiredOption(
1525
- `--table-id <table-id>`,
1526
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows.`,
1527
- )
1528
- .requiredOption(
1529
- `--row-id <row-id>`,
1530
- `Row 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.`,
1531
- )
1532
- .requiredOption(`--data <data>`, `Row data as JSON object.`)
1533
- .option(
1534
- `--permissions [permissions...]`,
1535
- `An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
1536
- )
1537
- .option(
1538
- `--transaction-id <transaction-id>`,
1539
- `Transaction ID for staging the operation.`,
1540
- )
1541
- .action(
1542
- actionRunner(
1543
- async ({
1544
- databaseId,
1545
- tableId,
1546
- rowId,
1547
- data,
1548
- permissions,
1549
- transactionId,
1550
- }) =>
1551
- await (
1552
- await getTablesDBClient()
1553
- ).createRow(
1554
- databaseId,
1555
- tableId,
1556
- rowId,
1557
- JSON.parse(data),
1558
- permissions,
1559
- transactionId,
1560
- ),
1561
- ),
1562
- );
1563
-
1564
- tablesdb
1565
- .command(`upsert-rows`)
1566
- .description(
1567
- `Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.
1568
- `,
1569
- )
1570
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1571
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1572
- .requiredOption(
1573
- `--rows [rows...]`,
1574
- `Array of row data as JSON objects. May contain partial rows.`,
1575
- )
1576
- .option(
1577
- `--transaction-id <transaction-id>`,
1578
- `Transaction ID for staging the operation.`,
1579
- )
1580
- .action(
1581
- actionRunner(
1582
- async ({ databaseId, tableId, rows, transactionId }) =>
1583
- await (
1584
- await getTablesDBClient()
1585
- ).upsertRows(databaseId, tableId, rows, transactionId),
1586
- ),
1587
- );
1588
-
1589
- tablesdb
1590
- .command(`update-rows`)
1591
- .description(
1592
- `Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.`,
1593
- )
1594
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1595
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1596
- .option(
1597
- `--data <data>`,
1598
- `Row data as JSON object. Include only column and value pairs to be updated.`,
1599
- )
1600
- .option(
1601
- `--queries [queries...]`,
1602
- `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.`,
1603
- )
1604
- .option(
1605
- `--transaction-id <transaction-id>`,
1606
- `Transaction ID for staging the operation.`,
1607
- )
1608
- .action(
1609
- actionRunner(
1610
- async ({ databaseId, tableId, data, queries, transactionId }) =>
1611
- await (
1612
- await getTablesDBClient()
1613
- ).updateRows(
1614
- databaseId,
1615
- tableId,
1616
- JSON.parse(data),
1617
- queries,
1618
- transactionId,
1619
- ),
1620
- ),
1621
- );
1622
-
1623
- tablesdb
1624
- .command(`delete-rows`)
1625
- .description(
1626
- `Bulk delete rows using queries, if no queries are passed then all rows are deleted.`,
1627
- )
1628
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1629
- .requiredOption(
1630
- `--table-id <table-id>`,
1631
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1632
- )
1633
- .option(
1634
- `--queries [queries...]`,
1635
- `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.`,
1636
- )
1637
- .option(
1638
- `--transaction-id <transaction-id>`,
1639
- `Transaction ID for staging the operation.`,
1640
- )
1641
- .action(
1642
- actionRunner(
1643
- async ({ databaseId, tableId, queries, transactionId }) =>
1644
- await (
1645
- await getTablesDBClient()
1646
- ).deleteRows(databaseId, tableId, queries, transactionId),
1647
- ),
1648
- );
1649
-
1650
- tablesdb
1651
- .command(`get-row`)
1652
- .description(
1653
- `Get a row by its unique ID. This endpoint response returns a JSON object with the row data.`,
1654
- )
1655
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1656
- .requiredOption(
1657
- `--table-id <table-id>`,
1658
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1659
- )
1660
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
1661
- .option(
1662
- `--queries [queries...]`,
1663
- `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.`,
1664
- )
1665
- .option(
1666
- `--transaction-id <transaction-id>`,
1667
- `Transaction ID to read uncommitted changes within the transaction.`,
1668
- )
1669
- .action(
1670
- actionRunner(
1671
- async ({ databaseId, tableId, rowId, queries, transactionId }) =>
1672
- await (
1673
- await getTablesDBClient()
1674
- ).getRow(databaseId, tableId, rowId, queries, transactionId),
1675
- ),
1676
- );
1677
-
1678
- tablesdb
1679
- .command(`upsert-row`)
1680
- .description(
1681
- `Create or update a Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.`,
1682
- )
1683
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1684
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1685
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
1686
- .option(
1687
- `--data <data>`,
1688
- `Row data as JSON object. Include all required columns of the row to be created or updated.`,
1689
- )
1690
- .option(
1691
- `--permissions [permissions...]`,
1692
- `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
1693
- )
1694
- .option(
1695
- `--transaction-id <transaction-id>`,
1696
- `Transaction ID for staging the operation.`,
1697
- )
1698
- .action(
1699
- actionRunner(
1700
- async ({
1701
- databaseId,
1702
- tableId,
1703
- rowId,
1704
- data,
1705
- permissions,
1706
- transactionId,
1707
- }) =>
1708
- await (
1709
- await getTablesDBClient()
1710
- ).upsertRow(
1711
- databaseId,
1712
- tableId,
1713
- rowId,
1714
- JSON.parse(data),
1715
- permissions,
1716
- transactionId,
1717
- ),
1718
- ),
1719
- );
1720
-
1721
- tablesdb
1722
- .command(`update-row`)
1723
- .description(
1724
- `Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.`,
1725
- )
1726
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1727
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1728
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
1729
- .option(
1730
- `--data <data>`,
1731
- `Row data as JSON object. Include only columns and value pairs to be updated.`,
1732
- )
1733
- .option(
1734
- `--permissions [permissions...]`,
1735
- `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`,
1736
- )
1737
- .option(
1738
- `--transaction-id <transaction-id>`,
1739
- `Transaction ID for staging the operation.`,
1740
- )
1741
- .action(
1742
- actionRunner(
1743
- async ({
1744
- databaseId,
1745
- tableId,
1746
- rowId,
1747
- data,
1748
- permissions,
1749
- transactionId,
1750
- }) =>
1751
- await (
1752
- await getTablesDBClient()
1753
- ).updateRow(
1754
- databaseId,
1755
- tableId,
1756
- rowId,
1757
- JSON.parse(data),
1758
- permissions,
1759
- transactionId,
1760
- ),
1761
- ),
1762
- );
1763
-
1764
- tablesdb
1765
- .command(`delete-row`)
1766
- .description(`Delete a row by its unique ID.`)
1767
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1768
- .requiredOption(
1769
- `--table-id <table-id>`,
1770
- `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`,
1771
- )
1772
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
1773
- .option(
1774
- `--transaction-id <transaction-id>`,
1775
- `Transaction ID for staging the operation.`,
1776
- )
1777
- .action(
1778
- actionRunner(
1779
- async ({ databaseId, tableId, rowId, transactionId }) =>
1780
- await (
1781
- await getTablesDBClient()
1782
- ).deleteRow(databaseId, tableId, rowId, transactionId),
1783
- ),
1784
- );
1785
-
1786
- tablesdb
1787
- .command(`list-row-logs`)
1788
- .description(`Get the row activity logs list by its unique ID.`)
1789
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1790
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1791
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
1792
- .option(
1793
- `--queries [queries...]`,
1794
- `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`,
1795
- )
1796
- .action(
1797
- actionRunner(
1798
- async ({ databaseId, tableId, rowId, queries }) =>
1799
- await (
1800
- await getTablesDBClient()
1801
- ).listRowLogs(databaseId, tableId, rowId, queries),
1802
- ),
1803
- );
1804
-
1805
- tablesdb
1806
- .command(`decrement-row-column`)
1807
- .description(`Decrement a specific column of a row by a given value.`)
1808
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1809
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1810
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
1811
- .requiredOption(`--column <column>`, `Column key.`)
1812
- .option(
1813
- `--value <value>`,
1814
- `Value to increment the column by. The value must be a number.`,
1815
- parseInteger,
1816
- )
1817
- .option(
1818
- `--min <min>`,
1819
- `Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.`,
1820
- parseInteger,
1821
- )
1822
- .option(
1823
- `--transaction-id <transaction-id>`,
1824
- `Transaction ID for staging the operation.`,
1825
- )
1826
- .action(
1827
- actionRunner(
1828
- async ({
1829
- databaseId,
1830
- tableId,
1831
- rowId,
1832
- column,
1833
- value,
1834
- min,
1835
- transactionId,
1836
- }) =>
1837
- await (
1838
- await getTablesDBClient()
1839
- ).decrementRowColumn(
1840
- databaseId,
1841
- tableId,
1842
- rowId,
1843
- column,
1844
- value,
1845
- min,
1846
- transactionId,
1847
- ),
1848
- ),
1849
- );
1850
-
1851
- tablesdb
1852
- .command(`increment-row-column`)
1853
- .description(`Increment a specific column of a row by a given value.`)
1854
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1855
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1856
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
1857
- .requiredOption(`--column <column>`, `Column key.`)
1858
- .option(
1859
- `--value <value>`,
1860
- `Value to increment the column by. The value must be a number.`,
1861
- parseInteger,
1862
- )
1863
- .option(
1864
- `--max <max>`,
1865
- `Maximum value for the column. If the current value is greater than this value, an error will be thrown.`,
1866
- parseInteger,
1867
- )
1868
- .option(
1869
- `--transaction-id <transaction-id>`,
1870
- `Transaction ID for staging the operation.`,
1871
- )
1872
- .action(
1873
- actionRunner(
1874
- async ({
1875
- databaseId,
1876
- tableId,
1877
- rowId,
1878
- column,
1879
- value,
1880
- max,
1881
- transactionId,
1882
- }) =>
1883
- await (
1884
- await getTablesDBClient()
1885
- ).incrementRowColumn(
1886
- databaseId,
1887
- tableId,
1888
- rowId,
1889
- column,
1890
- value,
1891
- max,
1892
- transactionId,
1893
- ),
1894
- ),
1895
- );
1896
-
1897
- tablesdb
1898
- .command(`get-table-usage`)
1899
- .description(
1900
- `Get usage metrics and statistics for a table. Returning the total number of rows. 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.`,
1901
- )
1902
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1903
- .option(`--range <range>`, `Date range.`)
1904
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
1905
- .action(
1906
- actionRunner(
1907
- async ({ databaseId, range, tableId }) =>
1908
- await (
1909
- await getTablesDBClient()
1910
- ).getTableUsage(databaseId, range as UsageRange, tableId),
1911
- ),
1912
- );
1913
-
1914
- tablesdb
1915
- .command(`get-usage`)
1916
- .description(
1917
- `Get usage metrics and statistics for a database. You can view the total number of tables, rows, 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.`,
1918
- )
1919
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
1920
- .option(`--range <range>`, `Date range.`)
1921
- .action(
1922
- actionRunner(
1923
- async ({ databaseId, range }) =>
1924
- await (
1925
- await getTablesDBClient()
1926
- ).getUsage(databaseId, range as UsageRange),
1927
- ),
1928
- );