appwrite-cli 8.2.2 → 9.0.0

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 (529) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +5 -5
  3. package/docs/examples/account/create-anonymous-session.md +1 -1
  4. package/docs/examples/account/create-email-password-session.md +3 -3
  5. package/docs/examples/account/create-email-token.md +3 -4
  6. package/docs/examples/account/create-jwt.md +1 -0
  7. package/docs/examples/account/create-magic-url-token.md +3 -0
  8. package/docs/examples/account/create-mfa-authenticator.md +2 -2
  9. package/docs/examples/account/create-mfa-challenge.md +2 -2
  10. package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
  11. package/docs/examples/account/create-o-auth-2-session.md +2 -0
  12. package/docs/examples/account/create-o-auth-2-token.md +2 -0
  13. package/docs/examples/account/create-phone-token.md +3 -3
  14. package/docs/examples/account/create-phone-verification.md +1 -1
  15. package/docs/examples/account/create-push-target.md +3 -4
  16. package/docs/examples/account/create-recovery.md +3 -3
  17. package/docs/examples/account/create-session.md +3 -3
  18. package/docs/examples/account/create-verification.md +2 -2
  19. package/docs/examples/account/create.md +3 -4
  20. package/docs/examples/account/delete-identity.md +2 -2
  21. package/docs/examples/account/delete-mfa-authenticator.md +2 -2
  22. package/docs/examples/account/delete-push-target.md +2 -2
  23. package/docs/examples/account/delete-session.md +2 -2
  24. package/docs/examples/account/delete-sessions.md +1 -1
  25. package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
  26. package/docs/examples/account/get-prefs.md +1 -1
  27. package/docs/examples/account/get-session.md +2 -2
  28. package/docs/examples/account/list-identities.md +1 -2
  29. package/docs/examples/account/list-logs.md +1 -2
  30. package/docs/examples/account/list-mfa-factors.md +1 -1
  31. package/docs/examples/account/list-sessions.md +1 -1
  32. package/docs/examples/account/update-email.md +3 -3
  33. package/docs/examples/account/update-magic-url-session.md +3 -0
  34. package/docs/examples/account/update-mfa-authenticator.md +3 -3
  35. package/docs/examples/account/update-mfa-challenge.md +3 -3
  36. package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
  37. package/docs/examples/account/update-mfa.md +2 -0
  38. package/docs/examples/account/update-name.md +2 -2
  39. package/docs/examples/account/update-password.md +2 -3
  40. package/docs/examples/account/update-phone-session.md +3 -3
  41. package/docs/examples/account/update-phone-verification.md +3 -3
  42. package/docs/examples/account/update-phone.md +3 -3
  43. package/docs/examples/account/update-prefs.md +2 -2
  44. package/docs/examples/account/update-push-target.md +3 -3
  45. package/docs/examples/account/update-recovery.md +4 -4
  46. package/docs/examples/account/update-session.md +2 -2
  47. package/docs/examples/account/update-status.md +1 -1
  48. package/docs/examples/account/update-verification.md +3 -3
  49. package/docs/examples/avatars/get-browser.md +2 -5
  50. package/docs/examples/avatars/get-credit-card.md +2 -5
  51. package/docs/examples/avatars/get-favicon.md +2 -2
  52. package/docs/examples/avatars/get-flag.md +2 -5
  53. package/docs/examples/avatars/get-image.md +2 -4
  54. package/docs/examples/avatars/get-initials.md +1 -5
  55. package/docs/examples/avatars/get-qr.md +2 -0
  56. package/docs/examples/console/get-resource.md +3 -3
  57. package/docs/examples/databases/create-boolean-attribute.md +5 -7
  58. package/docs/examples/databases/create-collection.md +4 -7
  59. package/docs/examples/databases/create-datetime-attribute.md +5 -7
  60. package/docs/examples/databases/create-document.md +5 -6
  61. package/docs/examples/databases/create-documents.md +4 -4
  62. package/docs/examples/databases/create-email-attribute.md +5 -7
  63. package/docs/examples/databases/create-enum-attribute.md +6 -8
  64. package/docs/examples/databases/create-float-attribute.md +5 -9
  65. package/docs/examples/databases/create-index.md +6 -8
  66. package/docs/examples/databases/create-integer-attribute.md +5 -9
  67. package/docs/examples/databases/create-ip-attribute.md +5 -7
  68. package/docs/examples/databases/create-relationship-attribute.md +5 -9
  69. package/docs/examples/databases/create-string-attribute.md +6 -9
  70. package/docs/examples/databases/create-url-attribute.md +5 -7
  71. package/docs/examples/databases/create.md +2 -3
  72. package/docs/examples/databases/decrement-document-attribute.md +5 -0
  73. package/docs/examples/databases/delete-attribute.md +4 -4
  74. package/docs/examples/databases/delete-collection.md +3 -3
  75. package/docs/examples/databases/delete-document.md +4 -4
  76. package/docs/examples/databases/delete-documents.md +3 -4
  77. package/docs/examples/databases/delete-index.md +4 -4
  78. package/docs/examples/databases/delete.md +1 -1
  79. package/docs/examples/databases/get-attribute.md +4 -4
  80. package/docs/examples/databases/get-collection-usage.md +3 -4
  81. package/docs/examples/databases/get-collection.md +3 -3
  82. package/docs/examples/databases/get-document.md +4 -5
  83. package/docs/examples/databases/get-index.md +4 -4
  84. package/docs/examples/databases/get-usage.md +2 -2
  85. package/docs/examples/databases/get.md +1 -1
  86. package/docs/examples/databases/increment-document-attribute.md +5 -0
  87. package/docs/examples/databases/list-attributes.md +3 -4
  88. package/docs/examples/databases/list-collection-logs.md +3 -4
  89. package/docs/examples/databases/list-collections.md +2 -4
  90. package/docs/examples/databases/list-document-logs.md +4 -5
  91. package/docs/examples/databases/list-documents.md +3 -4
  92. package/docs/examples/databases/list-indexes.md +3 -4
  93. package/docs/examples/databases/list-logs.md +2 -3
  94. package/docs/examples/databases/list-usage.md +1 -0
  95. package/docs/examples/databases/list.md +1 -3
  96. package/docs/examples/databases/update-boolean-attribute.md +6 -7
  97. package/docs/examples/databases/update-collection.md +4 -7
  98. package/docs/examples/databases/update-datetime-attribute.md +6 -7
  99. package/docs/examples/databases/update-document.md +4 -6
  100. package/docs/examples/databases/update-documents.md +3 -5
  101. package/docs/examples/databases/update-email-attribute.md +6 -7
  102. package/docs/examples/databases/update-enum-attribute.md +7 -8
  103. package/docs/examples/databases/update-float-attribute.md +6 -9
  104. package/docs/examples/databases/update-integer-attribute.md +6 -9
  105. package/docs/examples/databases/update-ip-attribute.md +6 -7
  106. package/docs/examples/databases/update-relationship-attribute.md +4 -6
  107. package/docs/examples/databases/update-string-attribute.md +6 -8
  108. package/docs/examples/databases/update-url-attribute.md +6 -7
  109. package/docs/examples/databases/update.md +2 -3
  110. package/docs/examples/databases/upsert-document.md +5 -6
  111. package/docs/examples/databases/upsert-documents.md +4 -4
  112. package/docs/examples/functions/create-deployment.md +4 -6
  113. package/docs/examples/functions/create-duplicate-deployment.md +3 -4
  114. package/docs/examples/functions/create-execution.md +2 -8
  115. package/docs/examples/functions/create-template-deployment.md +6 -7
  116. package/docs/examples/functions/create-variable.md +4 -5
  117. package/docs/examples/functions/create-vcs-deployment.md +4 -5
  118. package/docs/examples/functions/create.md +3 -18
  119. package/docs/examples/functions/delete-deployment.md +3 -3
  120. package/docs/examples/functions/delete-execution.md +3 -3
  121. package/docs/examples/functions/delete-variable.md +3 -3
  122. package/docs/examples/functions/delete.md +1 -1
  123. package/docs/examples/functions/get-deployment-download.md +3 -4
  124. package/docs/examples/functions/get-deployment.md +3 -3
  125. package/docs/examples/functions/get-execution.md +3 -3
  126. package/docs/examples/functions/get-template.md +2 -2
  127. package/docs/examples/functions/get-usage.md +2 -3
  128. package/docs/examples/functions/get-variable.md +3 -3
  129. package/docs/examples/functions/get.md +1 -1
  130. package/docs/examples/functions/list-deployments.md +2 -4
  131. package/docs/examples/functions/list-executions.md +2 -3
  132. package/docs/examples/functions/list-runtimes.md +1 -1
  133. package/docs/examples/functions/list-specifications.md +1 -1
  134. package/docs/examples/functions/list-templates.md +1 -5
  135. package/docs/examples/functions/list-usage.md +1 -2
  136. package/docs/examples/functions/list-variables.md +2 -2
  137. package/docs/examples/functions/list.md +1 -3
  138. package/docs/examples/functions/update-deployment-status.md +3 -3
  139. package/docs/examples/functions/update-function-deployment.md +3 -3
  140. package/docs/examples/functions/update-variable.md +4 -6
  141. package/docs/examples/functions/update.md +2 -18
  142. package/docs/examples/graphql/mutation.md +1 -1
  143. package/docs/examples/graphql/query.md +1 -1
  144. package/docs/examples/health/get-antivirus.md +1 -1
  145. package/docs/examples/health/get-cache.md +1 -1
  146. package/docs/examples/health/get-certificate.md +1 -2
  147. package/docs/examples/health/get-db.md +1 -0
  148. package/docs/examples/health/get-failed-jobs.md +2 -3
  149. package/docs/examples/health/get-pub-sub.md +1 -1
  150. package/docs/examples/health/get-queue-builds.md +1 -2
  151. package/docs/examples/health/get-queue-certificates.md +1 -2
  152. package/docs/examples/health/get-queue-databases.md +1 -3
  153. package/docs/examples/health/get-queue-deletes.md +1 -2
  154. package/docs/examples/health/get-queue-functions.md +1 -2
  155. package/docs/examples/health/get-queue-logs.md +1 -2
  156. package/docs/examples/health/get-queue-mails.md +1 -2
  157. package/docs/examples/health/get-queue-messaging.md +1 -2
  158. package/docs/examples/health/get-queue-migrations.md +1 -2
  159. package/docs/examples/health/get-queue-stats-resources.md +1 -2
  160. package/docs/examples/health/get-queue-usage.md +1 -2
  161. package/docs/examples/health/get-queue-webhooks.md +1 -2
  162. package/docs/examples/health/get-storage-local.md +1 -1
  163. package/docs/examples/health/get-storage.md +1 -1
  164. package/docs/examples/health/get-time.md +1 -1
  165. package/docs/examples/locale/list-codes.md +1 -1
  166. package/docs/examples/locale/list-continents.md +1 -1
  167. package/docs/examples/locale/list-countries-eu.md +1 -0
  168. package/docs/examples/locale/list-countries-phones.md +1 -1
  169. package/docs/examples/locale/list-countries.md +1 -1
  170. package/docs/examples/locale/list-currencies.md +1 -1
  171. package/docs/examples/locale/list-languages.md +1 -1
  172. package/docs/examples/messaging/create-apns-provider.md +3 -9
  173. package/docs/examples/messaging/create-email.md +4 -13
  174. package/docs/examples/messaging/create-fcm-provider.md +3 -5
  175. package/docs/examples/messaging/create-mailgun-provider.md +3 -11
  176. package/docs/examples/messaging/create-msg-91-provider.md +3 -0
  177. package/docs/examples/messaging/create-push.md +2 -20
  178. package/docs/examples/messaging/create-sendgrid-provider.md +3 -9
  179. package/docs/examples/messaging/create-sms.md +3 -8
  180. package/docs/examples/messaging/create-smtp-provider.md +4 -15
  181. package/docs/examples/messaging/create-subscriber.md +4 -4
  182. package/docs/examples/messaging/create-telesign-provider.md +3 -7
  183. package/docs/examples/messaging/create-textmagic-provider.md +3 -7
  184. package/docs/examples/messaging/create-topic.md +3 -4
  185. package/docs/examples/messaging/create-twilio-provider.md +3 -7
  186. package/docs/examples/messaging/create-vonage-provider.md +3 -7
  187. package/docs/examples/messaging/delete-provider.md +2 -2
  188. package/docs/examples/messaging/delete-subscriber.md +3 -3
  189. package/docs/examples/messaging/delete-topic.md +2 -2
  190. package/docs/examples/messaging/delete.md +1 -1
  191. package/docs/examples/messaging/get-message.md +2 -2
  192. package/docs/examples/messaging/get-provider.md +2 -2
  193. package/docs/examples/messaging/get-subscriber.md +3 -3
  194. package/docs/examples/messaging/get-topic.md +2 -2
  195. package/docs/examples/messaging/list-message-logs.md +2 -3
  196. package/docs/examples/messaging/list-messages.md +1 -3
  197. package/docs/examples/messaging/list-provider-logs.md +2 -3
  198. package/docs/examples/messaging/list-providers.md +1 -3
  199. package/docs/examples/messaging/list-subscriber-logs.md +2 -3
  200. package/docs/examples/messaging/list-subscribers.md +2 -4
  201. package/docs/examples/messaging/list-targets.md +2 -3
  202. package/docs/examples/messaging/list-topic-logs.md +2 -3
  203. package/docs/examples/messaging/list-topics.md +1 -3
  204. package/docs/examples/messaging/update-apns-provider.md +2 -9
  205. package/docs/examples/messaging/update-email.md +2 -13
  206. package/docs/examples/messaging/update-fcm-provider.md +2 -5
  207. package/docs/examples/messaging/update-mailgun-provider.md +2 -11
  208. package/docs/examples/messaging/update-msg-91-provider.md +2 -0
  209. package/docs/examples/messaging/update-push.md +2 -20
  210. package/docs/examples/messaging/update-sendgrid-provider.md +2 -9
  211. package/docs/examples/messaging/update-sms.md +2 -8
  212. package/docs/examples/messaging/update-smtp-provider.md +2 -15
  213. package/docs/examples/messaging/update-telesign-provider.md +2 -7
  214. package/docs/examples/messaging/update-textmagic-provider.md +2 -7
  215. package/docs/examples/messaging/update-topic.md +2 -4
  216. package/docs/examples/messaging/update-twilio-provider.md +2 -7
  217. package/docs/examples/messaging/update-vonage-provider.md +2 -7
  218. package/docs/examples/migrations/create-appwrite-migration.md +5 -5
  219. package/docs/examples/migrations/create-csv-migration.md +4 -4
  220. package/docs/examples/migrations/create-firebase-migration.md +3 -3
  221. package/docs/examples/migrations/create-n-host-migration.md +8 -9
  222. package/docs/examples/migrations/create-supabase-migration.md +7 -8
  223. package/docs/examples/migrations/delete.md +1 -1
  224. package/docs/examples/migrations/get-appwrite-report.md +5 -5
  225. package/docs/examples/migrations/get-firebase-report.md +3 -3
  226. package/docs/examples/migrations/get-n-host-report.md +8 -9
  227. package/docs/examples/migrations/get-supabase-report.md +7 -8
  228. package/docs/examples/migrations/get.md +1 -1
  229. package/docs/examples/migrations/list.md +1 -3
  230. package/docs/examples/migrations/retry.md +1 -1
  231. package/docs/examples/project/create-variable.md +3 -4
  232. package/docs/examples/project/delete-variable.md +2 -2
  233. package/docs/examples/project/get-usage.md +3 -4
  234. package/docs/examples/project/get-variable.md +2 -2
  235. package/docs/examples/project/list-variables.md +1 -1
  236. package/docs/examples/project/update-variable.md +3 -5
  237. package/docs/examples/projects/create-dev-key.md +4 -4
  238. package/docs/examples/projects/create-jwt.md +3 -0
  239. package/docs/examples/projects/create-key.md +4 -5
  240. package/docs/examples/projects/create-platform.md +4 -7
  241. package/docs/examples/projects/create-smtp-test.md +6 -11
  242. package/docs/examples/projects/create-webhook.md +6 -9
  243. package/docs/examples/projects/create.md +3 -13
  244. package/docs/examples/projects/delete-dev-key.md +3 -3
  245. package/docs/examples/projects/delete-email-template.md +4 -4
  246. package/docs/examples/projects/delete-key.md +3 -3
  247. package/docs/examples/projects/delete-platform.md +3 -3
  248. package/docs/examples/projects/delete-sms-template.md +4 -4
  249. package/docs/examples/projects/delete-webhook.md +3 -3
  250. package/docs/examples/projects/delete.md +1 -1
  251. package/docs/examples/projects/get-dev-key.md +3 -3
  252. package/docs/examples/projects/get-email-template.md +4 -4
  253. package/docs/examples/projects/get-key.md +3 -3
  254. package/docs/examples/projects/get-platform.md +3 -3
  255. package/docs/examples/projects/get-sms-template.md +4 -4
  256. package/docs/examples/projects/get-webhook.md +3 -3
  257. package/docs/examples/projects/get.md +1 -1
  258. package/docs/examples/projects/list-dev-keys.md +2 -3
  259. package/docs/examples/projects/list-keys.md +2 -2
  260. package/docs/examples/projects/list-platforms.md +2 -2
  261. package/docs/examples/projects/list-webhooks.md +2 -2
  262. package/docs/examples/projects/list.md +1 -3
  263. package/docs/examples/projects/update-api-status-all.md +3 -3
  264. package/docs/examples/projects/update-api-status.md +4 -4
  265. package/docs/examples/projects/update-auth-duration.md +3 -3
  266. package/docs/examples/projects/update-auth-limit.md +3 -3
  267. package/docs/examples/projects/update-auth-password-dictionary.md +3 -3
  268. package/docs/examples/projects/update-auth-password-history.md +3 -3
  269. package/docs/examples/projects/update-auth-sessions-limit.md +3 -3
  270. package/docs/examples/projects/update-auth-status.md +4 -4
  271. package/docs/examples/projects/update-dev-key.md +5 -5
  272. package/docs/examples/projects/update-email-template.md +6 -9
  273. package/docs/examples/projects/update-key.md +5 -6
  274. package/docs/examples/projects/update-memberships-privacy.md +5 -5
  275. package/docs/examples/projects/update-mock-numbers.md +3 -3
  276. package/docs/examples/projects/update-o-auth-2.md +3 -0
  277. package/docs/examples/projects/update-personal-data-check.md +3 -3
  278. package/docs/examples/projects/update-platform.md +4 -7
  279. package/docs/examples/projects/update-service-status-all.md +3 -3
  280. package/docs/examples/projects/update-service-status.md +4 -4
  281. package/docs/examples/projects/update-session-alerts.md +3 -3
  282. package/docs/examples/projects/update-session-invalidation.md +3 -0
  283. package/docs/examples/projects/update-sms-template.md +5 -5
  284. package/docs/examples/projects/update-smtp.md +3 -11
  285. package/docs/examples/projects/update-team.md +3 -3
  286. package/docs/examples/projects/update-webhook-signature.md +3 -3
  287. package/docs/examples/projects/update-webhook.md +7 -10
  288. package/docs/examples/projects/update.md +2 -11
  289. package/docs/examples/proxy/create-api-rule.md +2 -0
  290. package/docs/examples/proxy/create-function-rule.md +3 -4
  291. package/docs/examples/proxy/create-redirect-rule.md +6 -6
  292. package/docs/examples/proxy/create-site-rule.md +3 -4
  293. package/docs/examples/proxy/delete-rule.md +2 -2
  294. package/docs/examples/proxy/get-rule.md +2 -2
  295. package/docs/examples/proxy/list-rules.md +1 -3
  296. package/docs/examples/proxy/update-rule-verification.md +2 -2
  297. package/docs/examples/sites/create-deployment.md +4 -7
  298. package/docs/examples/sites/create-duplicate-deployment.md +3 -3
  299. package/docs/examples/sites/create-template-deployment.md +6 -7
  300. package/docs/examples/sites/create-variable.md +4 -5
  301. package/docs/examples/sites/create-vcs-deployment.md +4 -5
  302. package/docs/examples/sites/create.md +4 -18
  303. package/docs/examples/sites/delete-deployment.md +3 -3
  304. package/docs/examples/sites/delete-log.md +3 -3
  305. package/docs/examples/sites/delete-variable.md +3 -3
  306. package/docs/examples/sites/delete.md +1 -1
  307. package/docs/examples/sites/get-deployment-download.md +3 -4
  308. package/docs/examples/sites/get-deployment.md +3 -3
  309. package/docs/examples/sites/get-log.md +3 -3
  310. package/docs/examples/sites/get-template.md +2 -2
  311. package/docs/examples/sites/get-usage.md +2 -3
  312. package/docs/examples/sites/get-variable.md +3 -3
  313. package/docs/examples/sites/get.md +1 -1
  314. package/docs/examples/sites/list-deployments.md +2 -4
  315. package/docs/examples/sites/list-frameworks.md +1 -1
  316. package/docs/examples/sites/list-logs.md +2 -3
  317. package/docs/examples/sites/list-specifications.md +1 -1
  318. package/docs/examples/sites/list-templates.md +1 -5
  319. package/docs/examples/sites/list-usage.md +1 -2
  320. package/docs/examples/sites/list-variables.md +2 -2
  321. package/docs/examples/sites/list.md +1 -3
  322. package/docs/examples/sites/update-deployment-status.md +3 -3
  323. package/docs/examples/sites/update-site-deployment.md +3 -3
  324. package/docs/examples/sites/update-variable.md +4 -6
  325. package/docs/examples/sites/update.md +3 -18
  326. package/docs/examples/storage/create-bucket.md +3 -11
  327. package/docs/examples/storage/create-file.md +4 -5
  328. package/docs/examples/storage/delete-bucket.md +2 -2
  329. package/docs/examples/storage/delete-file.md +3 -3
  330. package/docs/examples/storage/get-bucket-usage.md +2 -3
  331. package/docs/examples/storage/get-bucket.md +2 -2
  332. package/docs/examples/storage/get-file-download.md +3 -4
  333. package/docs/examples/storage/get-file-preview.md +3 -15
  334. package/docs/examples/storage/get-file-view.md +3 -4
  335. package/docs/examples/storage/get-file.md +3 -3
  336. package/docs/examples/storage/get-usage.md +1 -2
  337. package/docs/examples/storage/list-buckets.md +1 -3
  338. package/docs/examples/storage/list-files.md +2 -4
  339. package/docs/examples/storage/update-bucket.md +3 -11
  340. package/docs/examples/storage/update-file.md +3 -5
  341. package/docs/examples/tablesdb/create-boolean-column.md +5 -0
  342. package/docs/examples/tablesdb/create-datetime-column.md +5 -0
  343. package/docs/examples/tablesdb/create-email-column.md +5 -0
  344. package/docs/examples/tablesdb/create-enum-column.md +6 -0
  345. package/docs/examples/tablesdb/create-float-column.md +5 -0
  346. package/docs/examples/tablesdb/create-index.md +6 -0
  347. package/docs/examples/tablesdb/create-integer-column.md +5 -0
  348. package/docs/examples/tablesdb/create-ip-column.md +5 -0
  349. package/docs/examples/tablesdb/create-relationship-column.md +5 -0
  350. package/docs/examples/tablesdb/create-row.md +5 -0
  351. package/docs/examples/tablesdb/create-rows.md +4 -0
  352. package/docs/examples/tablesdb/create-string-column.md +6 -0
  353. package/docs/examples/tablesdb/create-table.md +4 -0
  354. package/docs/examples/tablesdb/create-url-column.md +5 -0
  355. package/docs/examples/tablesdb/create.md +3 -0
  356. package/docs/examples/tablesdb/decrement-row-column.md +5 -0
  357. package/docs/examples/tablesdb/delete-column.md +4 -0
  358. package/docs/examples/tablesdb/delete-index.md +4 -0
  359. package/docs/examples/tablesdb/delete-row.md +4 -0
  360. package/docs/examples/tablesdb/delete-rows.md +3 -0
  361. package/docs/examples/tablesdb/delete-table.md +3 -0
  362. package/docs/examples/tablesdb/delete.md +2 -0
  363. package/docs/examples/tablesdb/get-column.md +4 -0
  364. package/docs/examples/tablesdb/get-index.md +4 -0
  365. package/docs/examples/tablesdb/get-row.md +4 -0
  366. package/docs/examples/tablesdb/get-table-usage.md +3 -0
  367. package/docs/examples/tablesdb/get-table.md +3 -0
  368. package/docs/examples/tablesdb/get-usage.md +2 -0
  369. package/docs/examples/tablesdb/get.md +2 -0
  370. package/docs/examples/tablesdb/increment-row-column.md +5 -0
  371. package/docs/examples/tablesdb/list-columns.md +3 -0
  372. package/docs/examples/tablesdb/list-indexes.md +3 -0
  373. package/docs/examples/tablesdb/list-row-logs.md +4 -0
  374. package/docs/examples/tablesdb/list-rows.md +3 -0
  375. package/docs/examples/tablesdb/list-table-logs.md +3 -0
  376. package/docs/examples/tablesdb/list-tables.md +2 -0
  377. package/docs/examples/tablesdb/list-usage.md +1 -0
  378. package/docs/examples/tablesdb/list.md +1 -0
  379. package/docs/examples/tablesdb/update-boolean-column.md +6 -0
  380. package/docs/examples/tablesdb/update-datetime-column.md +6 -0
  381. package/docs/examples/tablesdb/update-email-column.md +6 -0
  382. package/docs/examples/tablesdb/update-enum-column.md +7 -0
  383. package/docs/examples/tablesdb/update-float-column.md +6 -0
  384. package/docs/examples/tablesdb/update-integer-column.md +6 -0
  385. package/docs/examples/tablesdb/update-ip-column.md +6 -0
  386. package/docs/examples/tablesdb/update-relationship-column.md +4 -0
  387. package/docs/examples/tablesdb/update-row.md +4 -0
  388. package/docs/examples/tablesdb/update-rows.md +3 -0
  389. package/docs/examples/tablesdb/update-string-column.md +6 -0
  390. package/docs/examples/tablesdb/update-table.md +4 -0
  391. package/docs/examples/tablesdb/update-url-column.md +6 -0
  392. package/docs/examples/tablesdb/update.md +3 -0
  393. package/docs/examples/tablesdb/upsert-row.md +4 -0
  394. package/docs/examples/tablesdb/upsert-rows.md +4 -0
  395. package/docs/examples/teams/create-membership.md +3 -8
  396. package/docs/examples/teams/create.md +2 -3
  397. package/docs/examples/teams/delete-membership.md +3 -3
  398. package/docs/examples/teams/delete.md +1 -1
  399. package/docs/examples/teams/get-membership.md +3 -3
  400. package/docs/examples/teams/get-prefs.md +2 -2
  401. package/docs/examples/teams/get.md +1 -1
  402. package/docs/examples/teams/list-logs.md +2 -3
  403. package/docs/examples/teams/list-memberships.md +2 -4
  404. package/docs/examples/teams/list.md +1 -3
  405. package/docs/examples/teams/update-membership-status.md +5 -5
  406. package/docs/examples/teams/update-membership.md +4 -4
  407. package/docs/examples/teams/update-name.md +3 -3
  408. package/docs/examples/teams/update-prefs.md +3 -3
  409. package/docs/examples/tokens/create-file-token.md +3 -4
  410. package/docs/examples/tokens/delete.md +1 -1
  411. package/docs/examples/tokens/get.md +1 -1
  412. package/docs/examples/tokens/list.md +2 -3
  413. package/docs/examples/tokens/update.md +1 -2
  414. package/docs/examples/users/create-argon-2-user.md +4 -0
  415. package/docs/examples/users/create-bcrypt-user.md +4 -5
  416. package/docs/examples/users/create-jwt.md +2 -0
  417. package/docs/examples/users/create-md-5-user.md +4 -0
  418. package/docs/examples/users/create-mfa-recovery-codes.md +2 -2
  419. package/docs/examples/users/create-ph-pass-user.md +4 -0
  420. package/docs/examples/users/create-scrypt-modified-user.md +7 -8
  421. package/docs/examples/users/create-scrypt-user.md +9 -10
  422. package/docs/examples/users/create-session.md +2 -2
  423. package/docs/examples/users/create-sha-user.md +4 -0
  424. package/docs/examples/users/create-target.md +5 -7
  425. package/docs/examples/users/create-token.md +2 -4
  426. package/docs/examples/users/create.md +1 -5
  427. package/docs/examples/users/delete-identity.md +2 -2
  428. package/docs/examples/users/delete-mfa-authenticator.md +3 -3
  429. package/docs/examples/users/delete-session.md +3 -3
  430. package/docs/examples/users/delete-sessions.md +2 -2
  431. package/docs/examples/users/delete-target.md +3 -3
  432. package/docs/examples/users/delete.md +1 -1
  433. package/docs/examples/users/get-mfa-recovery-codes.md +2 -2
  434. package/docs/examples/users/get-prefs.md +2 -2
  435. package/docs/examples/users/get-target.md +3 -3
  436. package/docs/examples/users/get-usage.md +1 -2
  437. package/docs/examples/users/get.md +1 -1
  438. package/docs/examples/users/list-identities.md +1 -3
  439. package/docs/examples/users/list-logs.md +2 -3
  440. package/docs/examples/users/list-memberships.md +2 -4
  441. package/docs/examples/users/list-mfa-factors.md +2 -2
  442. package/docs/examples/users/list-sessions.md +2 -2
  443. package/docs/examples/users/list-targets.md +2 -3
  444. package/docs/examples/users/list.md +1 -3
  445. package/docs/examples/users/update-email-verification.md +3 -3
  446. package/docs/examples/users/update-email.md +3 -3
  447. package/docs/examples/users/update-labels.md +3 -3
  448. package/docs/examples/users/update-mfa-recovery-codes.md +2 -2
  449. package/docs/examples/users/update-mfa.md +3 -3
  450. package/docs/examples/users/update-name.md +3 -3
  451. package/docs/examples/users/update-password.md +3 -3
  452. package/docs/examples/users/update-phone-verification.md +3 -3
  453. package/docs/examples/users/update-phone.md +3 -3
  454. package/docs/examples/users/update-prefs.md +3 -3
  455. package/docs/examples/users/update-status.md +3 -3
  456. package/docs/examples/users/update-target.md +3 -6
  457. package/docs/examples/vcs/create-repository-detection.md +4 -5
  458. package/docs/examples/vcs/create-repository.md +4 -4
  459. package/docs/examples/vcs/delete-installation.md +2 -2
  460. package/docs/examples/vcs/get-installation.md +2 -2
  461. package/docs/examples/vcs/get-repository-contents.md +3 -5
  462. package/docs/examples/vcs/get-repository.md +3 -3
  463. package/docs/examples/vcs/list-installations.md +1 -3
  464. package/docs/examples/vcs/list-repositories.md +3 -4
  465. package/docs/examples/vcs/list-repository-branches.md +3 -3
  466. package/docs/examples/vcs/update-external-deployments.md +4 -4
  467. package/index.js +40 -0
  468. package/install.ps1 +2 -2
  469. package/install.sh +1 -1
  470. package/lib/client.js +3 -8
  471. package/lib/commands/account.js +55 -103
  472. package/lib/commands/avatars.js +1 -8
  473. package/lib/commands/console.js +1 -3
  474. package/lib/commands/databases.js +279 -226
  475. package/lib/commands/functions.js +3 -33
  476. package/lib/commands/graphql.js +1 -3
  477. package/lib/commands/health.js +1 -23
  478. package/lib/commands/init.js +1 -1
  479. package/lib/commands/locale.js +1 -9
  480. package/lib/commands/messaging.js +41 -87
  481. package/lib/commands/migrations.js +7 -15
  482. package/lib/commands/project.js +1 -7
  483. package/lib/commands/projects.js +77 -86
  484. package/lib/commands/proxy.js +1 -9
  485. package/lib/commands/pull.js +62 -1
  486. package/lib/commands/push.js +163 -8
  487. package/lib/commands/run.js +1 -1
  488. package/lib/commands/sites.js +3 -32
  489. package/lib/commands/storage.js +3 -18
  490. package/lib/commands/tables-db.js +2896 -0
  491. package/lib/commands/teams.js +1 -15
  492. package/lib/commands/tokens.js +1 -6
  493. package/lib/commands/types.js +7 -9
  494. package/lib/commands/update.js +218 -0
  495. package/lib/commands/users.js +34 -77
  496. package/lib/commands/vcs.js +2 -12
  497. package/lib/config.js +99 -14
  498. package/lib/parser.js +2 -1
  499. package/lib/questions.js +32 -7
  500. package/lib/type-generation/languages/dart.js +13 -13
  501. package/lib/type-generation/languages/java.js +13 -13
  502. package/lib/type-generation/languages/javascript.js +14 -14
  503. package/lib/type-generation/languages/kotlin.js +11 -10
  504. package/lib/type-generation/languages/php.js +15 -14
  505. package/lib/type-generation/languages/swift.js +13 -13
  506. package/lib/type-generation/languages/typescript.js +8 -8
  507. package/lib/utils.js +39 -2
  508. package/package.json +1 -1
  509. package/scoop/{appwrite.json → appwrite.config.json} +3 -3
  510. package/docs/examples/account/create-j-w-t.md +0 -1
  511. package/docs/examples/account/create-magic-u-r-l-token.md +0 -5
  512. package/docs/examples/account/create-o-auth2session.md +0 -5
  513. package/docs/examples/account/create-o-auth2token.md +0 -5
  514. package/docs/examples/account/update-m-f-a.md +0 -2
  515. package/docs/examples/account/update-magic-u-r-l-session.md +0 -3
  516. package/docs/examples/avatars/get-q-r.md +0 -5
  517. package/docs/examples/databases/get-database-usage.md +0 -3
  518. package/docs/examples/health/get-d-b.md +0 -1
  519. package/docs/examples/locale/list-countries-e-u.md +0 -1
  520. package/docs/examples/messaging/create-msg91provider.md +0 -7
  521. package/docs/examples/messaging/update-msg91provider.md +0 -7
  522. package/docs/examples/projects/create-j-w-t.md +0 -4
  523. package/docs/examples/projects/update-o-auth2.md +0 -6
  524. package/docs/examples/proxy/create-a-p-i-rule.md +0 -2
  525. package/docs/examples/users/create-argon2user.md +0 -5
  526. package/docs/examples/users/create-j-w-t.md +0 -4
  527. package/docs/examples/users/create-m-d5user.md +0 -5
  528. package/docs/examples/users/create-p-h-pass-user.md +0 -5
  529. package/docs/examples/users/create-s-h-a-user.md +0 -6
@@ -0,0 +1,2896 @@
1
+ const fs = require('fs');
2
+ const pathLib = require('path');
3
+ const tar = require("tar");
4
+ const ignore = require("ignore");
5
+ const { promisify } = require('util');
6
+ const libClient = require('../client.js');
7
+ const { getAllFiles, showConsoleLink } = require('../utils.js');
8
+ const { Command } = require('commander');
9
+ const { sdkForProject, sdkForConsole } = require('../sdks')
10
+ const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser')
11
+ const { localConfig, globalConfig } = require("../config");
12
+ const { File } = require('undici');
13
+ const { ReadableStream } = require('stream/web');
14
+
15
+ /**
16
+ * @param {fs.ReadStream} readStream
17
+ * @returns {ReadableStream}
18
+ */
19
+ function convertReadStreamToReadableStream(readStream) {
20
+ return new ReadableStream({
21
+ start(controller) {
22
+ readStream.on("data", (chunk) => {
23
+ controller.enqueue(chunk);
24
+ });
25
+ readStream.on("end", () => {
26
+ controller.close();
27
+ });
28
+ readStream.on("error", (err) => {
29
+ controller.error(err);
30
+ });
31
+ },
32
+ cancel() {
33
+ readStream.destroy();
34
+ },
35
+ });
36
+ }
37
+
38
+ const tablesDB = new Command("tables-db").description(commandDescriptions['tables-db'] ?? '').configureHelp({
39
+ helpWidth: process.stdout.columns || 80
40
+ })
41
+
42
+ /**
43
+ * @typedef {Object} TablesDBListRequestParams
44
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name
45
+ * @property {string} search Search term to filter your list results. Max length: 256 chars.
46
+ * @property {boolean} overrideForCli
47
+ * @property {boolean} parseOutput
48
+ * @property {libClient | undefined} sdk
49
+ */
50
+
51
+ /**
52
+ * @param {TablesDBListRequestParams} params
53
+ */
54
+ const tablesDBList = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
55
+ let client = !sdk ? await sdkForProject() :
56
+ sdk;
57
+ let apiPath = '/tablesdb';
58
+ let payload = {};
59
+ if (typeof queries !== 'undefined') {
60
+ payload['queries'] = queries;
61
+ }
62
+ if (typeof search !== 'undefined') {
63
+ payload['search'] = search;
64
+ }
65
+
66
+ let response = undefined;
67
+
68
+ response = await client.call('get', apiPath, {
69
+ }, payload);
70
+
71
+ if (parseOutput) {
72
+ if(console) {
73
+ showConsoleLink('tablesDB', 'list');
74
+ } else {
75
+ parse(response)
76
+ }
77
+ }
78
+
79
+ return response;
80
+
81
+ }
82
+ /**
83
+ * @typedef {Object} TablesDBCreateRequestParams
84
+ * @property {string} databaseId 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.
85
+ * @property {string} name Database name. Max length: 128 chars.
86
+ * @property {boolean} enabled 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.
87
+ * @property {boolean} overrideForCli
88
+ * @property {boolean} parseOutput
89
+ * @property {libClient | undefined} sdk
90
+ */
91
+
92
+ /**
93
+ * @param {TablesDBCreateRequestParams} params
94
+ */
95
+ const tablesDBCreate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
96
+ let client = !sdk ? await sdkForProject() :
97
+ sdk;
98
+ let apiPath = '/tablesdb';
99
+ let payload = {};
100
+ if (typeof databaseId !== 'undefined') {
101
+ payload['databaseId'] = databaseId;
102
+ }
103
+ if (typeof name !== 'undefined') {
104
+ payload['name'] = name;
105
+ }
106
+ if (typeof enabled !== 'undefined') {
107
+ payload['enabled'] = enabled;
108
+ }
109
+
110
+ let response = undefined;
111
+
112
+ response = await client.call('post', apiPath, {
113
+ 'content-type': 'application/json',
114
+ }, payload);
115
+
116
+ if (parseOutput) {
117
+ parse(response)
118
+ }
119
+
120
+ return response;
121
+
122
+ }
123
+ /**
124
+ * @typedef {Object} TablesDBListUsageRequestParams
125
+ * @property {UsageRange} range Date range.
126
+ * @property {boolean} overrideForCli
127
+ * @property {boolean} parseOutput
128
+ * @property {libClient | undefined} sdk
129
+ */
130
+
131
+ /**
132
+ * @param {TablesDBListUsageRequestParams} params
133
+ */
134
+ const tablesDBListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
135
+ let client = !sdk ? await sdkForProject() :
136
+ sdk;
137
+ let apiPath = '/tablesdb/usage';
138
+ let payload = {};
139
+ if (typeof range !== 'undefined') {
140
+ payload['range'] = range;
141
+ }
142
+
143
+ let response = undefined;
144
+
145
+ response = await client.call('get', apiPath, {
146
+ }, payload);
147
+
148
+ if (parseOutput) {
149
+ if(console) {
150
+ showConsoleLink('tablesDB', 'listUsage');
151
+ } else {
152
+ parse(response)
153
+ }
154
+ }
155
+
156
+ return response;
157
+
158
+ }
159
+ /**
160
+ * @typedef {Object} TablesDBGetRequestParams
161
+ * @property {string} databaseId Database ID.
162
+ * @property {boolean} overrideForCli
163
+ * @property {boolean} parseOutput
164
+ * @property {libClient | undefined} sdk
165
+ */
166
+
167
+ /**
168
+ * @param {TablesDBGetRequestParams} params
169
+ */
170
+ const tablesDBGet = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
171
+ let client = !sdk ? await sdkForProject() :
172
+ sdk;
173
+ let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId);
174
+ let payload = {};
175
+
176
+ let response = undefined;
177
+
178
+ response = await client.call('get', apiPath, {
179
+ }, payload);
180
+
181
+ if (parseOutput) {
182
+ if(console) {
183
+ showConsoleLink('tablesDB', 'get', databaseId);
184
+ } else {
185
+ parse(response)
186
+ }
187
+ }
188
+
189
+ return response;
190
+
191
+ }
192
+ /**
193
+ * @typedef {Object} TablesDBUpdateRequestParams
194
+ * @property {string} databaseId Database ID.
195
+ * @property {string} name Database name. Max length: 128 chars.
196
+ * @property {boolean} enabled 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.
197
+ * @property {boolean} overrideForCli
198
+ * @property {boolean} parseOutput
199
+ * @property {libClient | undefined} sdk
200
+ */
201
+
202
+ /**
203
+ * @param {TablesDBUpdateRequestParams} params
204
+ */
205
+ const tablesDBUpdate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
206
+ let client = !sdk ? await sdkForProject() :
207
+ sdk;
208
+ let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId);
209
+ let payload = {};
210
+ if (typeof name !== 'undefined') {
211
+ payload['name'] = name;
212
+ }
213
+ if (typeof enabled !== 'undefined') {
214
+ payload['enabled'] = enabled;
215
+ }
216
+
217
+ let response = undefined;
218
+
219
+ response = await client.call('put', apiPath, {
220
+ 'content-type': 'application/json',
221
+ }, payload);
222
+
223
+ if (parseOutput) {
224
+ parse(response)
225
+ }
226
+
227
+ return response;
228
+
229
+ }
230
+ /**
231
+ * @typedef {Object} TablesDBDeleteRequestParams
232
+ * @property {string} databaseId Database ID.
233
+ * @property {boolean} overrideForCli
234
+ * @property {boolean} parseOutput
235
+ * @property {libClient | undefined} sdk
236
+ */
237
+
238
+ /**
239
+ * @param {TablesDBDeleteRequestParams} params
240
+ */
241
+ const tablesDBDelete = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
242
+ let client = !sdk ? await sdkForProject() :
243
+ sdk;
244
+ let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId);
245
+ let payload = {};
246
+
247
+ let response = undefined;
248
+
249
+ response = await client.call('delete', apiPath, {
250
+ 'content-type': 'application/json',
251
+ }, payload);
252
+
253
+ if (parseOutput) {
254
+ parse(response)
255
+ }
256
+
257
+ return response;
258
+
259
+ }
260
+ /**
261
+ * @typedef {Object} TablesDBListTablesRequestParams
262
+ * @property {string} databaseId Database ID.
263
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity
264
+ * @property {string} search Search term to filter your list results. Max length: 256 chars.
265
+ * @property {boolean} overrideForCli
266
+ * @property {boolean} parseOutput
267
+ * @property {libClient | undefined} sdk
268
+ */
269
+
270
+ /**
271
+ * @param {TablesDBListTablesRequestParams} params
272
+ */
273
+ const tablesDBListTables = async ({databaseId,queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
274
+ let client = !sdk ? await sdkForProject() :
275
+ sdk;
276
+ let apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId);
277
+ let payload = {};
278
+ if (typeof queries !== 'undefined') {
279
+ payload['queries'] = queries;
280
+ }
281
+ if (typeof search !== 'undefined') {
282
+ payload['search'] = search;
283
+ }
284
+
285
+ let response = undefined;
286
+
287
+ response = await client.call('get', apiPath, {
288
+ }, payload);
289
+
290
+ if (parseOutput) {
291
+ if(console) {
292
+ showConsoleLink('tablesDB', 'listTables', databaseId);
293
+ } else {
294
+ parse(response)
295
+ }
296
+ }
297
+
298
+ return response;
299
+
300
+ }
301
+ /**
302
+ * @typedef {Object} TablesDBCreateTableRequestParams
303
+ * @property {string} databaseId Database ID.
304
+ * @property {string} tableId 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.
305
+ * @property {string} name Table name. Max length: 128 chars.
306
+ * @property {string[]} permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
307
+ * @property {boolean} rowSecurity 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).
308
+ * @property {boolean} enabled 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.
309
+ * @property {boolean} overrideForCli
310
+ * @property {boolean} parseOutput
311
+ * @property {libClient | undefined} sdk
312
+ */
313
+
314
+ /**
315
+ * @param {TablesDBCreateTableRequestParams} params
316
+ */
317
+ const tablesDBCreateTable = async ({databaseId,tableId,name,permissions,rowSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
318
+ let client = !sdk ? await sdkForProject() :
319
+ sdk;
320
+ let apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId);
321
+ let payload = {};
322
+ if (typeof tableId !== 'undefined') {
323
+ payload['tableId'] = tableId;
324
+ }
325
+ if (typeof name !== 'undefined') {
326
+ payload['name'] = name;
327
+ }
328
+ permissions = permissions === true ? [] : permissions;
329
+ if (typeof permissions !== 'undefined') {
330
+ payload['permissions'] = permissions;
331
+ }
332
+ if (typeof rowSecurity !== 'undefined') {
333
+ payload['rowSecurity'] = rowSecurity;
334
+ }
335
+ if (typeof enabled !== 'undefined') {
336
+ payload['enabled'] = enabled;
337
+ }
338
+
339
+ let response = undefined;
340
+
341
+ response = await client.call('post', apiPath, {
342
+ 'content-type': 'application/json',
343
+ }, payload);
344
+
345
+ if (parseOutput) {
346
+ parse(response)
347
+ }
348
+
349
+ return response;
350
+
351
+ }
352
+ /**
353
+ * @typedef {Object} TablesDBGetTableRequestParams
354
+ * @property {string} databaseId Database ID.
355
+ * @property {string} tableId Table ID.
356
+ * @property {boolean} overrideForCli
357
+ * @property {boolean} parseOutput
358
+ * @property {libClient | undefined} sdk
359
+ */
360
+
361
+ /**
362
+ * @param {TablesDBGetTableRequestParams} params
363
+ */
364
+ const tablesDBGetTable = async ({databaseId,tableId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
365
+ let client = !sdk ? await sdkForProject() :
366
+ sdk;
367
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
368
+ let payload = {};
369
+
370
+ let response = undefined;
371
+
372
+ response = await client.call('get', apiPath, {
373
+ }, payload);
374
+
375
+ if (parseOutput) {
376
+ if(console) {
377
+ showConsoleLink('tablesDB', 'getTable', databaseId, tableId);
378
+ } else {
379
+ parse(response)
380
+ }
381
+ }
382
+
383
+ return response;
384
+
385
+ }
386
+ /**
387
+ * @typedef {Object} TablesDBUpdateTableRequestParams
388
+ * @property {string} databaseId Database ID.
389
+ * @property {string} tableId Table ID.
390
+ * @property {string} name Table name. Max length: 128 chars.
391
+ * @property {string[]} permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
392
+ * @property {boolean} rowSecurity Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
393
+ * @property {boolean} enabled 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.
394
+ * @property {boolean} overrideForCli
395
+ * @property {boolean} parseOutput
396
+ * @property {libClient | undefined} sdk
397
+ */
398
+
399
+ /**
400
+ * @param {TablesDBUpdateTableRequestParams} params
401
+ */
402
+ const tablesDBUpdateTable = async ({databaseId,tableId,name,permissions,rowSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
403
+ let client = !sdk ? await sdkForProject() :
404
+ sdk;
405
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
406
+ let payload = {};
407
+ if (typeof name !== 'undefined') {
408
+ payload['name'] = name;
409
+ }
410
+ permissions = permissions === true ? [] : permissions;
411
+ if (typeof permissions !== 'undefined') {
412
+ payload['permissions'] = permissions;
413
+ }
414
+ if (typeof rowSecurity !== 'undefined') {
415
+ payload['rowSecurity'] = rowSecurity;
416
+ }
417
+ if (typeof enabled !== 'undefined') {
418
+ payload['enabled'] = enabled;
419
+ }
420
+
421
+ let response = undefined;
422
+
423
+ response = await client.call('put', apiPath, {
424
+ 'content-type': 'application/json',
425
+ }, payload);
426
+
427
+ if (parseOutput) {
428
+ parse(response)
429
+ }
430
+
431
+ return response;
432
+
433
+ }
434
+ /**
435
+ * @typedef {Object} TablesDBDeleteTableRequestParams
436
+ * @property {string} databaseId Database ID.
437
+ * @property {string} tableId Table ID.
438
+ * @property {boolean} overrideForCli
439
+ * @property {boolean} parseOutput
440
+ * @property {libClient | undefined} sdk
441
+ */
442
+
443
+ /**
444
+ * @param {TablesDBDeleteTableRequestParams} params
445
+ */
446
+ const tablesDBDeleteTable = async ({databaseId,tableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
447
+ let client = !sdk ? await sdkForProject() :
448
+ sdk;
449
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
450
+ let payload = {};
451
+
452
+ let response = undefined;
453
+
454
+ response = await client.call('delete', apiPath, {
455
+ 'content-type': 'application/json',
456
+ }, payload);
457
+
458
+ if (parseOutput) {
459
+ parse(response)
460
+ }
461
+
462
+ return response;
463
+
464
+ }
465
+ /**
466
+ * @typedef {Object} TablesDBListColumnsRequestParams
467
+ * @property {string} databaseId Database ID.
468
+ * @property {string} tableId Table ID.
469
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error
470
+ * @property {boolean} overrideForCli
471
+ * @property {boolean} parseOutput
472
+ * @property {libClient | undefined} sdk
473
+ */
474
+
475
+ /**
476
+ * @param {TablesDBListColumnsRequestParams} params
477
+ */
478
+ const tablesDBListColumns = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
479
+ let client = !sdk ? await sdkForProject() :
480
+ sdk;
481
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
482
+ let payload = {};
483
+ if (typeof queries !== 'undefined') {
484
+ payload['queries'] = queries;
485
+ }
486
+
487
+ let response = undefined;
488
+
489
+ response = await client.call('get', apiPath, {
490
+ }, payload);
491
+
492
+ if (parseOutput) {
493
+ if(console) {
494
+ showConsoleLink('tablesDB', 'listColumns', databaseId, tableId);
495
+ } else {
496
+ parse(response)
497
+ }
498
+ }
499
+
500
+ return response;
501
+
502
+ }
503
+ /**
504
+ * @typedef {Object} TablesDBCreateBooleanColumnRequestParams
505
+ * @property {string} databaseId Database ID.
506
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
507
+ * @property {string} key Column Key.
508
+ * @property {boolean} required Is column required?
509
+ * @property {boolean} xdefault Default value for column when not provided. Cannot be set when column is required.
510
+ * @property {boolean} array Is column an array?
511
+ * @property {boolean} overrideForCli
512
+ * @property {boolean} parseOutput
513
+ * @property {libClient | undefined} sdk
514
+ */
515
+
516
+ /**
517
+ * @param {TablesDBCreateBooleanColumnRequestParams} params
518
+ */
519
+ const tablesDBCreateBooleanColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
520
+ let client = !sdk ? await sdkForProject() :
521
+ sdk;
522
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
523
+ let payload = {};
524
+ if (typeof key !== 'undefined') {
525
+ payload['key'] = key;
526
+ }
527
+ if (typeof required !== 'undefined') {
528
+ payload['required'] = required;
529
+ }
530
+ if (typeof xdefault !== 'undefined') {
531
+ payload['default'] = xdefault;
532
+ }
533
+ if (typeof array !== 'undefined') {
534
+ payload['array'] = array;
535
+ }
536
+
537
+ let response = undefined;
538
+
539
+ response = await client.call('post', apiPath, {
540
+ 'content-type': 'application/json',
541
+ }, payload);
542
+
543
+ if (parseOutput) {
544
+ parse(response)
545
+ }
546
+
547
+ return response;
548
+
549
+ }
550
+ /**
551
+ * @typedef {Object} TablesDBUpdateBooleanColumnRequestParams
552
+ * @property {string} databaseId Database ID.
553
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
554
+ * @property {string} key Column Key.
555
+ * @property {boolean} required Is column required?
556
+ * @property {boolean} xdefault Default value for column when not provided. Cannot be set when column is required.
557
+ * @property {string} newKey New Column Key.
558
+ * @property {boolean} overrideForCli
559
+ * @property {boolean} parseOutput
560
+ * @property {libClient | undefined} sdk
561
+ */
562
+
563
+ /**
564
+ * @param {TablesDBUpdateBooleanColumnRequestParams} params
565
+ */
566
+ const tablesDBUpdateBooleanColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
567
+ let client = !sdk ? await sdkForProject() :
568
+ sdk;
569
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
570
+ let payload = {};
571
+ if (typeof required !== 'undefined') {
572
+ payload['required'] = required;
573
+ }
574
+ if (typeof xdefault !== 'undefined') {
575
+ payload['default'] = xdefault;
576
+ }
577
+ if (typeof newKey !== 'undefined') {
578
+ payload['newKey'] = newKey;
579
+ }
580
+
581
+ let response = undefined;
582
+
583
+ response = await client.call('patch', apiPath, {
584
+ 'content-type': 'application/json',
585
+ }, payload);
586
+
587
+ if (parseOutput) {
588
+ parse(response)
589
+ }
590
+
591
+ return response;
592
+
593
+ }
594
+ /**
595
+ * @typedef {Object} TablesDBCreateDatetimeColumnRequestParams
596
+ * @property {string} databaseId Database ID.
597
+ * @property {string} tableId Table ID.
598
+ * @property {string} key Column Key.
599
+ * @property {boolean} required Is column required?
600
+ * @property {string} xdefault 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.
601
+ * @property {boolean} array Is column an array?
602
+ * @property {boolean} overrideForCli
603
+ * @property {boolean} parseOutput
604
+ * @property {libClient | undefined} sdk
605
+ */
606
+
607
+ /**
608
+ * @param {TablesDBCreateDatetimeColumnRequestParams} params
609
+ */
610
+ const tablesDBCreateDatetimeColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
611
+ let client = !sdk ? await sdkForProject() :
612
+ sdk;
613
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
614
+ let payload = {};
615
+ if (typeof key !== 'undefined') {
616
+ payload['key'] = key;
617
+ }
618
+ if (typeof required !== 'undefined') {
619
+ payload['required'] = required;
620
+ }
621
+ if (typeof xdefault !== 'undefined') {
622
+ payload['default'] = xdefault;
623
+ }
624
+ if (typeof array !== 'undefined') {
625
+ payload['array'] = array;
626
+ }
627
+
628
+ let response = undefined;
629
+
630
+ response = await client.call('post', apiPath, {
631
+ 'content-type': 'application/json',
632
+ }, payload);
633
+
634
+ if (parseOutput) {
635
+ parse(response)
636
+ }
637
+
638
+ return response;
639
+
640
+ }
641
+ /**
642
+ * @typedef {Object} TablesDBUpdateDatetimeColumnRequestParams
643
+ * @property {string} databaseId Database ID.
644
+ * @property {string} tableId Table ID.
645
+ * @property {string} key Column Key.
646
+ * @property {boolean} required Is column required?
647
+ * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
648
+ * @property {string} newKey New Column Key.
649
+ * @property {boolean} overrideForCli
650
+ * @property {boolean} parseOutput
651
+ * @property {libClient | undefined} sdk
652
+ */
653
+
654
+ /**
655
+ * @param {TablesDBUpdateDatetimeColumnRequestParams} params
656
+ */
657
+ const tablesDBUpdateDatetimeColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
658
+ let client = !sdk ? await sdkForProject() :
659
+ sdk;
660
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
661
+ let payload = {};
662
+ if (typeof required !== 'undefined') {
663
+ payload['required'] = required;
664
+ }
665
+ if (typeof xdefault !== 'undefined') {
666
+ payload['default'] = xdefault;
667
+ }
668
+ if (typeof newKey !== 'undefined') {
669
+ payload['newKey'] = newKey;
670
+ }
671
+
672
+ let response = undefined;
673
+
674
+ response = await client.call('patch', apiPath, {
675
+ 'content-type': 'application/json',
676
+ }, payload);
677
+
678
+ if (parseOutput) {
679
+ parse(response)
680
+ }
681
+
682
+ return response;
683
+
684
+ }
685
+ /**
686
+ * @typedef {Object} TablesDBCreateEmailColumnRequestParams
687
+ * @property {string} databaseId Database ID.
688
+ * @property {string} tableId Table ID.
689
+ * @property {string} key Column Key.
690
+ * @property {boolean} required Is column required?
691
+ * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
692
+ * @property {boolean} array Is column an array?
693
+ * @property {boolean} overrideForCli
694
+ * @property {boolean} parseOutput
695
+ * @property {libClient | undefined} sdk
696
+ */
697
+
698
+ /**
699
+ * @param {TablesDBCreateEmailColumnRequestParams} params
700
+ */
701
+ const tablesDBCreateEmailColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
702
+ let client = !sdk ? await sdkForProject() :
703
+ sdk;
704
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
705
+ let payload = {};
706
+ if (typeof key !== 'undefined') {
707
+ payload['key'] = key;
708
+ }
709
+ if (typeof required !== 'undefined') {
710
+ payload['required'] = required;
711
+ }
712
+ if (typeof xdefault !== 'undefined') {
713
+ payload['default'] = xdefault;
714
+ }
715
+ if (typeof array !== 'undefined') {
716
+ payload['array'] = array;
717
+ }
718
+
719
+ let response = undefined;
720
+
721
+ response = await client.call('post', apiPath, {
722
+ 'content-type': 'application/json',
723
+ }, payload);
724
+
725
+ if (parseOutput) {
726
+ parse(response)
727
+ }
728
+
729
+ return response;
730
+
731
+ }
732
+ /**
733
+ * @typedef {Object} TablesDBUpdateEmailColumnRequestParams
734
+ * @property {string} databaseId Database ID.
735
+ * @property {string} tableId Table ID.
736
+ * @property {string} key Column Key.
737
+ * @property {boolean} required Is column required?
738
+ * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
739
+ * @property {string} newKey New Column Key.
740
+ * @property {boolean} overrideForCli
741
+ * @property {boolean} parseOutput
742
+ * @property {libClient | undefined} sdk
743
+ */
744
+
745
+ /**
746
+ * @param {TablesDBUpdateEmailColumnRequestParams} params
747
+ */
748
+ const tablesDBUpdateEmailColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
749
+ let client = !sdk ? await sdkForProject() :
750
+ sdk;
751
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
752
+ let payload = {};
753
+ if (typeof required !== 'undefined') {
754
+ payload['required'] = required;
755
+ }
756
+ if (typeof xdefault !== 'undefined') {
757
+ payload['default'] = xdefault;
758
+ }
759
+ if (typeof newKey !== 'undefined') {
760
+ payload['newKey'] = newKey;
761
+ }
762
+
763
+ let response = undefined;
764
+
765
+ response = await client.call('patch', apiPath, {
766
+ 'content-type': 'application/json',
767
+ }, payload);
768
+
769
+ if (parseOutput) {
770
+ parse(response)
771
+ }
772
+
773
+ return response;
774
+
775
+ }
776
+ /**
777
+ * @typedef {Object} TablesDBCreateEnumColumnRequestParams
778
+ * @property {string} databaseId Database ID.
779
+ * @property {string} tableId Table ID.
780
+ * @property {string} key Column Key.
781
+ * @property {string[]} elements Array of enum values.
782
+ * @property {boolean} required Is column required?
783
+ * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
784
+ * @property {boolean} array Is column an array?
785
+ * @property {boolean} overrideForCli
786
+ * @property {boolean} parseOutput
787
+ * @property {libClient | undefined} sdk
788
+ */
789
+
790
+ /**
791
+ * @param {TablesDBCreateEnumColumnRequestParams} params
792
+ */
793
+ const tablesDBCreateEnumColumn = async ({databaseId,tableId,key,elements,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
794
+ let client = !sdk ? await sdkForProject() :
795
+ sdk;
796
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
797
+ let payload = {};
798
+ if (typeof key !== 'undefined') {
799
+ payload['key'] = key;
800
+ }
801
+ elements = elements === true ? [] : elements;
802
+ if (typeof elements !== 'undefined') {
803
+ payload['elements'] = elements;
804
+ }
805
+ if (typeof required !== 'undefined') {
806
+ payload['required'] = required;
807
+ }
808
+ if (typeof xdefault !== 'undefined') {
809
+ payload['default'] = xdefault;
810
+ }
811
+ if (typeof array !== 'undefined') {
812
+ payload['array'] = array;
813
+ }
814
+
815
+ let response = undefined;
816
+
817
+ response = await client.call('post', apiPath, {
818
+ 'content-type': 'application/json',
819
+ }, payload);
820
+
821
+ if (parseOutput) {
822
+ parse(response)
823
+ }
824
+
825
+ return response;
826
+
827
+ }
828
+ /**
829
+ * @typedef {Object} TablesDBUpdateEnumColumnRequestParams
830
+ * @property {string} databaseId Database ID.
831
+ * @property {string} tableId Table ID.
832
+ * @property {string} key Column Key.
833
+ * @property {string[]} elements Updated list of enum values.
834
+ * @property {boolean} required Is column required?
835
+ * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
836
+ * @property {string} newKey New Column Key.
837
+ * @property {boolean} overrideForCli
838
+ * @property {boolean} parseOutput
839
+ * @property {libClient | undefined} sdk
840
+ */
841
+
842
+ /**
843
+ * @param {TablesDBUpdateEnumColumnRequestParams} params
844
+ */
845
+ const tablesDBUpdateEnumColumn = async ({databaseId,tableId,key,elements,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
846
+ let client = !sdk ? await sdkForProject() :
847
+ sdk;
848
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
849
+ let payload = {};
850
+ elements = elements === true ? [] : elements;
851
+ if (typeof elements !== 'undefined') {
852
+ payload['elements'] = elements;
853
+ }
854
+ if (typeof required !== 'undefined') {
855
+ payload['required'] = required;
856
+ }
857
+ if (typeof xdefault !== 'undefined') {
858
+ payload['default'] = xdefault;
859
+ }
860
+ if (typeof newKey !== 'undefined') {
861
+ payload['newKey'] = newKey;
862
+ }
863
+
864
+ let response = undefined;
865
+
866
+ response = await client.call('patch', apiPath, {
867
+ 'content-type': 'application/json',
868
+ }, payload);
869
+
870
+ if (parseOutput) {
871
+ parse(response)
872
+ }
873
+
874
+ return response;
875
+
876
+ }
877
+ /**
878
+ * @typedef {Object} TablesDBCreateFloatColumnRequestParams
879
+ * @property {string} databaseId Database ID.
880
+ * @property {string} tableId Table ID.
881
+ * @property {string} key Column Key.
882
+ * @property {boolean} required Is column required?
883
+ * @property {number} min Minimum value
884
+ * @property {number} max Maximum value
885
+ * @property {number} xdefault Default value. Cannot be set when required.
886
+ * @property {boolean} array Is column an array?
887
+ * @property {boolean} overrideForCli
888
+ * @property {boolean} parseOutput
889
+ * @property {libClient | undefined} sdk
890
+ */
891
+
892
+ /**
893
+ * @param {TablesDBCreateFloatColumnRequestParams} params
894
+ */
895
+ const tablesDBCreateFloatColumn = async ({databaseId,tableId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
896
+ let client = !sdk ? await sdkForProject() :
897
+ sdk;
898
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
899
+ let payload = {};
900
+ if (typeof key !== 'undefined') {
901
+ payload['key'] = key;
902
+ }
903
+ if (typeof required !== 'undefined') {
904
+ payload['required'] = required;
905
+ }
906
+ if (typeof min !== 'undefined') {
907
+ payload['min'] = min;
908
+ }
909
+ if (typeof max !== 'undefined') {
910
+ payload['max'] = max;
911
+ }
912
+ if (typeof xdefault !== 'undefined') {
913
+ payload['default'] = xdefault;
914
+ }
915
+ if (typeof array !== 'undefined') {
916
+ payload['array'] = array;
917
+ }
918
+
919
+ let response = undefined;
920
+
921
+ response = await client.call('post', apiPath, {
922
+ 'content-type': 'application/json',
923
+ }, payload);
924
+
925
+ if (parseOutput) {
926
+ parse(response)
927
+ }
928
+
929
+ return response;
930
+
931
+ }
932
+ /**
933
+ * @typedef {Object} TablesDBUpdateFloatColumnRequestParams
934
+ * @property {string} databaseId Database ID.
935
+ * @property {string} tableId Table ID.
936
+ * @property {string} key Column Key.
937
+ * @property {boolean} required Is column required?
938
+ * @property {number} xdefault Default value. Cannot be set when required.
939
+ * @property {number} min Minimum value
940
+ * @property {number} max Maximum value
941
+ * @property {string} newKey New Column Key.
942
+ * @property {boolean} overrideForCli
943
+ * @property {boolean} parseOutput
944
+ * @property {libClient | undefined} sdk
945
+ */
946
+
947
+ /**
948
+ * @param {TablesDBUpdateFloatColumnRequestParams} params
949
+ */
950
+ const tablesDBUpdateFloatColumn = async ({databaseId,tableId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
951
+ let client = !sdk ? await sdkForProject() :
952
+ sdk;
953
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
954
+ let payload = {};
955
+ if (typeof required !== 'undefined') {
956
+ payload['required'] = required;
957
+ }
958
+ if (typeof min !== 'undefined') {
959
+ payload['min'] = min;
960
+ }
961
+ if (typeof max !== 'undefined') {
962
+ payload['max'] = max;
963
+ }
964
+ if (typeof xdefault !== 'undefined') {
965
+ payload['default'] = xdefault;
966
+ }
967
+ if (typeof newKey !== 'undefined') {
968
+ payload['newKey'] = newKey;
969
+ }
970
+
971
+ let response = undefined;
972
+
973
+ response = await client.call('patch', apiPath, {
974
+ 'content-type': 'application/json',
975
+ }, payload);
976
+
977
+ if (parseOutput) {
978
+ parse(response)
979
+ }
980
+
981
+ return response;
982
+
983
+ }
984
+ /**
985
+ * @typedef {Object} TablesDBCreateIntegerColumnRequestParams
986
+ * @property {string} databaseId Database ID.
987
+ * @property {string} tableId Table ID.
988
+ * @property {string} key Column Key.
989
+ * @property {boolean} required Is column required?
990
+ * @property {number} min Minimum value
991
+ * @property {number} max Maximum value
992
+ * @property {number} xdefault Default value. Cannot be set when column is required.
993
+ * @property {boolean} array Is column an array?
994
+ * @property {boolean} overrideForCli
995
+ * @property {boolean} parseOutput
996
+ * @property {libClient | undefined} sdk
997
+ */
998
+
999
+ /**
1000
+ * @param {TablesDBCreateIntegerColumnRequestParams} params
1001
+ */
1002
+ const tablesDBCreateIntegerColumn = async ({databaseId,tableId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1003
+ let client = !sdk ? await sdkForProject() :
1004
+ sdk;
1005
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1006
+ let payload = {};
1007
+ if (typeof key !== 'undefined') {
1008
+ payload['key'] = key;
1009
+ }
1010
+ if (typeof required !== 'undefined') {
1011
+ payload['required'] = required;
1012
+ }
1013
+ if (typeof min !== 'undefined') {
1014
+ payload['min'] = min;
1015
+ }
1016
+ if (typeof max !== 'undefined') {
1017
+ payload['max'] = max;
1018
+ }
1019
+ if (typeof xdefault !== 'undefined') {
1020
+ payload['default'] = xdefault;
1021
+ }
1022
+ if (typeof array !== 'undefined') {
1023
+ payload['array'] = array;
1024
+ }
1025
+
1026
+ let response = undefined;
1027
+
1028
+ response = await client.call('post', apiPath, {
1029
+ 'content-type': 'application/json',
1030
+ }, payload);
1031
+
1032
+ if (parseOutput) {
1033
+ parse(response)
1034
+ }
1035
+
1036
+ return response;
1037
+
1038
+ }
1039
+ /**
1040
+ * @typedef {Object} TablesDBUpdateIntegerColumnRequestParams
1041
+ * @property {string} databaseId Database ID.
1042
+ * @property {string} tableId Table ID.
1043
+ * @property {string} key Column Key.
1044
+ * @property {boolean} required Is column required?
1045
+ * @property {number} xdefault Default value. Cannot be set when column is required.
1046
+ * @property {number} min Minimum value
1047
+ * @property {number} max Maximum value
1048
+ * @property {string} newKey New Column Key.
1049
+ * @property {boolean} overrideForCli
1050
+ * @property {boolean} parseOutput
1051
+ * @property {libClient | undefined} sdk
1052
+ */
1053
+
1054
+ /**
1055
+ * @param {TablesDBUpdateIntegerColumnRequestParams} params
1056
+ */
1057
+ const tablesDBUpdateIntegerColumn = async ({databaseId,tableId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1058
+ let client = !sdk ? await sdkForProject() :
1059
+ sdk;
1060
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1061
+ let payload = {};
1062
+ if (typeof required !== 'undefined') {
1063
+ payload['required'] = required;
1064
+ }
1065
+ if (typeof min !== 'undefined') {
1066
+ payload['min'] = min;
1067
+ }
1068
+ if (typeof max !== 'undefined') {
1069
+ payload['max'] = max;
1070
+ }
1071
+ if (typeof xdefault !== 'undefined') {
1072
+ payload['default'] = xdefault;
1073
+ }
1074
+ if (typeof newKey !== 'undefined') {
1075
+ payload['newKey'] = newKey;
1076
+ }
1077
+
1078
+ let response = undefined;
1079
+
1080
+ response = await client.call('patch', apiPath, {
1081
+ 'content-type': 'application/json',
1082
+ }, payload);
1083
+
1084
+ if (parseOutput) {
1085
+ parse(response)
1086
+ }
1087
+
1088
+ return response;
1089
+
1090
+ }
1091
+ /**
1092
+ * @typedef {Object} TablesDBCreateIpColumnRequestParams
1093
+ * @property {string} databaseId Database ID.
1094
+ * @property {string} tableId Table ID.
1095
+ * @property {string} key Column Key.
1096
+ * @property {boolean} required Is column required?
1097
+ * @property {string} xdefault Default value. Cannot be set when column is required.
1098
+ * @property {boolean} array Is column an array?
1099
+ * @property {boolean} overrideForCli
1100
+ * @property {boolean} parseOutput
1101
+ * @property {libClient | undefined} sdk
1102
+ */
1103
+
1104
+ /**
1105
+ * @param {TablesDBCreateIpColumnRequestParams} params
1106
+ */
1107
+ const tablesDBCreateIpColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1108
+ let client = !sdk ? await sdkForProject() :
1109
+ sdk;
1110
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1111
+ let payload = {};
1112
+ if (typeof key !== 'undefined') {
1113
+ payload['key'] = key;
1114
+ }
1115
+ if (typeof required !== 'undefined') {
1116
+ payload['required'] = required;
1117
+ }
1118
+ if (typeof xdefault !== 'undefined') {
1119
+ payload['default'] = xdefault;
1120
+ }
1121
+ if (typeof array !== 'undefined') {
1122
+ payload['array'] = array;
1123
+ }
1124
+
1125
+ let response = undefined;
1126
+
1127
+ response = await client.call('post', apiPath, {
1128
+ 'content-type': 'application/json',
1129
+ }, payload);
1130
+
1131
+ if (parseOutput) {
1132
+ parse(response)
1133
+ }
1134
+
1135
+ return response;
1136
+
1137
+ }
1138
+ /**
1139
+ * @typedef {Object} TablesDBUpdateIpColumnRequestParams
1140
+ * @property {string} databaseId Database ID.
1141
+ * @property {string} tableId Table ID.
1142
+ * @property {string} key Column Key.
1143
+ * @property {boolean} required Is column required?
1144
+ * @property {string} xdefault Default value. Cannot be set when column is required.
1145
+ * @property {string} newKey New Column Key.
1146
+ * @property {boolean} overrideForCli
1147
+ * @property {boolean} parseOutput
1148
+ * @property {libClient | undefined} sdk
1149
+ */
1150
+
1151
+ /**
1152
+ * @param {TablesDBUpdateIpColumnRequestParams} params
1153
+ */
1154
+ const tablesDBUpdateIpColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1155
+ let client = !sdk ? await sdkForProject() :
1156
+ sdk;
1157
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1158
+ let payload = {};
1159
+ if (typeof required !== 'undefined') {
1160
+ payload['required'] = required;
1161
+ }
1162
+ if (typeof xdefault !== 'undefined') {
1163
+ payload['default'] = xdefault;
1164
+ }
1165
+ if (typeof newKey !== 'undefined') {
1166
+ payload['newKey'] = newKey;
1167
+ }
1168
+
1169
+ let response = undefined;
1170
+
1171
+ response = await client.call('patch', apiPath, {
1172
+ 'content-type': 'application/json',
1173
+ }, payload);
1174
+
1175
+ if (parseOutput) {
1176
+ parse(response)
1177
+ }
1178
+
1179
+ return response;
1180
+
1181
+ }
1182
+ /**
1183
+ * @typedef {Object} TablesDBCreateRelationshipColumnRequestParams
1184
+ * @property {string} databaseId Database ID.
1185
+ * @property {string} tableId Table ID.
1186
+ * @property {string} relatedTableId Related Table ID.
1187
+ * @property {RelationshipType} type Relation type
1188
+ * @property {boolean} twoWay Is Two Way?
1189
+ * @property {string} key Column Key.
1190
+ * @property {string} twoWayKey Two Way Column Key.
1191
+ * @property {RelationMutate} onDelete Constraints option
1192
+ * @property {boolean} overrideForCli
1193
+ * @property {boolean} parseOutput
1194
+ * @property {libClient | undefined} sdk
1195
+ */
1196
+
1197
+ /**
1198
+ * @param {TablesDBCreateRelationshipColumnRequestParams} params
1199
+ */
1200
+ const tablesDBCreateRelationshipColumn = async ({databaseId,tableId,relatedTableId,type,twoWay,key,twoWayKey,onDelete,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1201
+ let client = !sdk ? await sdkForProject() :
1202
+ sdk;
1203
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1204
+ let payload = {};
1205
+ if (typeof relatedTableId !== 'undefined') {
1206
+ payload['relatedTableId'] = relatedTableId;
1207
+ }
1208
+ if (typeof type !== 'undefined') {
1209
+ payload['type'] = type;
1210
+ }
1211
+ if (typeof twoWay !== 'undefined') {
1212
+ payload['twoWay'] = twoWay;
1213
+ }
1214
+ if (typeof key !== 'undefined') {
1215
+ payload['key'] = key;
1216
+ }
1217
+ if (typeof twoWayKey !== 'undefined') {
1218
+ payload['twoWayKey'] = twoWayKey;
1219
+ }
1220
+ if (typeof onDelete !== 'undefined') {
1221
+ payload['onDelete'] = onDelete;
1222
+ }
1223
+
1224
+ let response = undefined;
1225
+
1226
+ response = await client.call('post', apiPath, {
1227
+ 'content-type': 'application/json',
1228
+ }, payload);
1229
+
1230
+ if (parseOutput) {
1231
+ parse(response)
1232
+ }
1233
+
1234
+ return response;
1235
+
1236
+ }
1237
+ /**
1238
+ * @typedef {Object} TablesDBCreateStringColumnRequestParams
1239
+ * @property {string} databaseId Database ID.
1240
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1241
+ * @property {string} key Column Key.
1242
+ * @property {number} size Column size for text columns, in number of characters.
1243
+ * @property {boolean} required Is column required?
1244
+ * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
1245
+ * @property {boolean} array Is column an array?
1246
+ * @property {boolean} encrypt Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.
1247
+ * @property {boolean} overrideForCli
1248
+ * @property {boolean} parseOutput
1249
+ * @property {libClient | undefined} sdk
1250
+ */
1251
+
1252
+ /**
1253
+ * @param {TablesDBCreateStringColumnRequestParams} params
1254
+ */
1255
+ const tablesDBCreateStringColumn = async ({databaseId,tableId,key,size,required,xdefault,array,encrypt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1256
+ let client = !sdk ? await sdkForProject() :
1257
+ sdk;
1258
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1259
+ let payload = {};
1260
+ if (typeof key !== 'undefined') {
1261
+ payload['key'] = key;
1262
+ }
1263
+ if (typeof size !== 'undefined') {
1264
+ payload['size'] = size;
1265
+ }
1266
+ if (typeof required !== 'undefined') {
1267
+ payload['required'] = required;
1268
+ }
1269
+ if (typeof xdefault !== 'undefined') {
1270
+ payload['default'] = xdefault;
1271
+ }
1272
+ if (typeof array !== 'undefined') {
1273
+ payload['array'] = array;
1274
+ }
1275
+ if (typeof encrypt !== 'undefined') {
1276
+ payload['encrypt'] = encrypt;
1277
+ }
1278
+
1279
+ let response = undefined;
1280
+
1281
+ response = await client.call('post', apiPath, {
1282
+ 'content-type': 'application/json',
1283
+ }, payload);
1284
+
1285
+ if (parseOutput) {
1286
+ parse(response)
1287
+ }
1288
+
1289
+ return response;
1290
+
1291
+ }
1292
+ /**
1293
+ * @typedef {Object} TablesDBUpdateStringColumnRequestParams
1294
+ * @property {string} databaseId Database ID.
1295
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1296
+ * @property {string} key Column Key.
1297
+ * @property {boolean} required Is column required?
1298
+ * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
1299
+ * @property {number} size Maximum size of the string column.
1300
+ * @property {string} newKey New Column Key.
1301
+ * @property {boolean} overrideForCli
1302
+ * @property {boolean} parseOutput
1303
+ * @property {libClient | undefined} sdk
1304
+ */
1305
+
1306
+ /**
1307
+ * @param {TablesDBUpdateStringColumnRequestParams} params
1308
+ */
1309
+ const tablesDBUpdateStringColumn = async ({databaseId,tableId,key,required,xdefault,size,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1310
+ let client = !sdk ? await sdkForProject() :
1311
+ sdk;
1312
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1313
+ let payload = {};
1314
+ if (typeof required !== 'undefined') {
1315
+ payload['required'] = required;
1316
+ }
1317
+ if (typeof xdefault !== 'undefined') {
1318
+ payload['default'] = xdefault;
1319
+ }
1320
+ if (typeof size !== 'undefined') {
1321
+ payload['size'] = size;
1322
+ }
1323
+ if (typeof newKey !== 'undefined') {
1324
+ payload['newKey'] = newKey;
1325
+ }
1326
+
1327
+ let response = undefined;
1328
+
1329
+ response = await client.call('patch', apiPath, {
1330
+ 'content-type': 'application/json',
1331
+ }, payload);
1332
+
1333
+ if (parseOutput) {
1334
+ parse(response)
1335
+ }
1336
+
1337
+ return response;
1338
+
1339
+ }
1340
+ /**
1341
+ * @typedef {Object} TablesDBCreateUrlColumnRequestParams
1342
+ * @property {string} databaseId Database ID.
1343
+ * @property {string} tableId Table ID.
1344
+ * @property {string} key Column Key.
1345
+ * @property {boolean} required Is column required?
1346
+ * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
1347
+ * @property {boolean} array Is column an array?
1348
+ * @property {boolean} overrideForCli
1349
+ * @property {boolean} parseOutput
1350
+ * @property {libClient | undefined} sdk
1351
+ */
1352
+
1353
+ /**
1354
+ * @param {TablesDBCreateUrlColumnRequestParams} params
1355
+ */
1356
+ const tablesDBCreateUrlColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1357
+ let client = !sdk ? await sdkForProject() :
1358
+ sdk;
1359
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1360
+ let payload = {};
1361
+ if (typeof key !== 'undefined') {
1362
+ payload['key'] = key;
1363
+ }
1364
+ if (typeof required !== 'undefined') {
1365
+ payload['required'] = required;
1366
+ }
1367
+ if (typeof xdefault !== 'undefined') {
1368
+ payload['default'] = xdefault;
1369
+ }
1370
+ if (typeof array !== 'undefined') {
1371
+ payload['array'] = array;
1372
+ }
1373
+
1374
+ let response = undefined;
1375
+
1376
+ response = await client.call('post', apiPath, {
1377
+ 'content-type': 'application/json',
1378
+ }, payload);
1379
+
1380
+ if (parseOutput) {
1381
+ parse(response)
1382
+ }
1383
+
1384
+ return response;
1385
+
1386
+ }
1387
+ /**
1388
+ * @typedef {Object} TablesDBUpdateUrlColumnRequestParams
1389
+ * @property {string} databaseId Database ID.
1390
+ * @property {string} tableId Table ID.
1391
+ * @property {string} key Column Key.
1392
+ * @property {boolean} required Is column required?
1393
+ * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
1394
+ * @property {string} newKey New Column Key.
1395
+ * @property {boolean} overrideForCli
1396
+ * @property {boolean} parseOutput
1397
+ * @property {libClient | undefined} sdk
1398
+ */
1399
+
1400
+ /**
1401
+ * @param {TablesDBUpdateUrlColumnRequestParams} params
1402
+ */
1403
+ const tablesDBUpdateUrlColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1404
+ let client = !sdk ? await sdkForProject() :
1405
+ sdk;
1406
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1407
+ let payload = {};
1408
+ if (typeof required !== 'undefined') {
1409
+ payload['required'] = required;
1410
+ }
1411
+ if (typeof xdefault !== 'undefined') {
1412
+ payload['default'] = xdefault;
1413
+ }
1414
+ if (typeof newKey !== 'undefined') {
1415
+ payload['newKey'] = newKey;
1416
+ }
1417
+
1418
+ let response = undefined;
1419
+
1420
+ response = await client.call('patch', apiPath, {
1421
+ 'content-type': 'application/json',
1422
+ }, payload);
1423
+
1424
+ if (parseOutput) {
1425
+ parse(response)
1426
+ }
1427
+
1428
+ return response;
1429
+
1430
+ }
1431
+ /**
1432
+ * @typedef {Object} TablesDBGetColumnRequestParams
1433
+ * @property {string} databaseId Database ID.
1434
+ * @property {string} tableId Table ID.
1435
+ * @property {string} key Column Key.
1436
+ * @property {boolean} overrideForCli
1437
+ * @property {boolean} parseOutput
1438
+ * @property {libClient | undefined} sdk
1439
+ */
1440
+
1441
+ /**
1442
+ * @param {TablesDBGetColumnRequestParams} params
1443
+ */
1444
+ const tablesDBGetColumn = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1445
+ let client = !sdk ? await sdkForProject() :
1446
+ sdk;
1447
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1448
+ let payload = {};
1449
+
1450
+ let response = undefined;
1451
+
1452
+ response = await client.call('get', apiPath, {
1453
+ }, payload);
1454
+
1455
+ if (parseOutput) {
1456
+ if(console) {
1457
+ showConsoleLink('tablesDB', 'getColumn', databaseId, tableId);
1458
+ } else {
1459
+ parse(response)
1460
+ }
1461
+ }
1462
+
1463
+ return response;
1464
+
1465
+ }
1466
+ /**
1467
+ * @typedef {Object} TablesDBDeleteColumnRequestParams
1468
+ * @property {string} databaseId Database ID.
1469
+ * @property {string} tableId Table ID.
1470
+ * @property {string} key Column Key.
1471
+ * @property {boolean} overrideForCli
1472
+ * @property {boolean} parseOutput
1473
+ * @property {libClient | undefined} sdk
1474
+ */
1475
+
1476
+ /**
1477
+ * @param {TablesDBDeleteColumnRequestParams} params
1478
+ */
1479
+ const tablesDBDeleteColumn = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1480
+ let client = !sdk ? await sdkForProject() :
1481
+ sdk;
1482
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1483
+ let payload = {};
1484
+
1485
+ let response = undefined;
1486
+
1487
+ response = await client.call('delete', apiPath, {
1488
+ 'content-type': 'application/json',
1489
+ }, payload);
1490
+
1491
+ if (parseOutput) {
1492
+ parse(response)
1493
+ }
1494
+
1495
+ return response;
1496
+
1497
+ }
1498
+ /**
1499
+ * @typedef {Object} TablesDBUpdateRelationshipColumnRequestParams
1500
+ * @property {string} databaseId Database ID.
1501
+ * @property {string} tableId Table ID.
1502
+ * @property {string} key Column Key.
1503
+ * @property {RelationMutate} onDelete Constraints option
1504
+ * @property {string} newKey New Column Key.
1505
+ * @property {boolean} overrideForCli
1506
+ * @property {boolean} parseOutput
1507
+ * @property {libClient | undefined} sdk
1508
+ */
1509
+
1510
+ /**
1511
+ * @param {TablesDBUpdateRelationshipColumnRequestParams} params
1512
+ */
1513
+ const tablesDBUpdateRelationshipColumn = async ({databaseId,tableId,key,onDelete,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1514
+ let client = !sdk ? await sdkForProject() :
1515
+ sdk;
1516
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1517
+ let payload = {};
1518
+ if (typeof onDelete !== 'undefined') {
1519
+ payload['onDelete'] = onDelete;
1520
+ }
1521
+ if (typeof newKey !== 'undefined') {
1522
+ payload['newKey'] = newKey;
1523
+ }
1524
+
1525
+ let response = undefined;
1526
+
1527
+ response = await client.call('patch', apiPath, {
1528
+ 'content-type': 'application/json',
1529
+ }, payload);
1530
+
1531
+ if (parseOutput) {
1532
+ parse(response)
1533
+ }
1534
+
1535
+ return response;
1536
+
1537
+ }
1538
+ /**
1539
+ * @typedef {Object} TablesDBListIndexesRequestParams
1540
+ * @property {string} databaseId Database ID.
1541
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1542
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error
1543
+ * @property {boolean} overrideForCli
1544
+ * @property {boolean} parseOutput
1545
+ * @property {libClient | undefined} sdk
1546
+ */
1547
+
1548
+ /**
1549
+ * @param {TablesDBListIndexesRequestParams} params
1550
+ */
1551
+ const tablesDBListIndexes = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1552
+ let client = !sdk ? await sdkForProject() :
1553
+ sdk;
1554
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1555
+ let payload = {};
1556
+ if (typeof queries !== 'undefined') {
1557
+ payload['queries'] = queries;
1558
+ }
1559
+
1560
+ let response = undefined;
1561
+
1562
+ response = await client.call('get', apiPath, {
1563
+ }, payload);
1564
+
1565
+ if (parseOutput) {
1566
+ if(console) {
1567
+ showConsoleLink('tablesDB', 'listIndexes', databaseId, tableId);
1568
+ } else {
1569
+ parse(response)
1570
+ }
1571
+ }
1572
+
1573
+ return response;
1574
+
1575
+ }
1576
+ /**
1577
+ * @typedef {Object} TablesDBCreateIndexRequestParams
1578
+ * @property {string} databaseId Database ID.
1579
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1580
+ * @property {string} key Index Key.
1581
+ * @property {IndexType} type Index type.
1582
+ * @property {string[]} columns Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.
1583
+ * @property {string[]} orders Array of index orders. Maximum of 100 orders are allowed.
1584
+ * @property {number[]} lengths Length of index. Maximum of 100
1585
+ * @property {boolean} overrideForCli
1586
+ * @property {boolean} parseOutput
1587
+ * @property {libClient | undefined} sdk
1588
+ */
1589
+
1590
+ /**
1591
+ * @param {TablesDBCreateIndexRequestParams} params
1592
+ */
1593
+ const tablesDBCreateIndex = async ({databaseId,tableId,key,type,columns,orders,lengths,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1594
+ let client = !sdk ? await sdkForProject() :
1595
+ sdk;
1596
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1597
+ let payload = {};
1598
+ if (typeof key !== 'undefined') {
1599
+ payload['key'] = key;
1600
+ }
1601
+ if (typeof type !== 'undefined') {
1602
+ payload['type'] = type;
1603
+ }
1604
+ columns = columns === true ? [] : columns;
1605
+ if (typeof columns !== 'undefined') {
1606
+ payload['columns'] = columns;
1607
+ }
1608
+ orders = orders === true ? [] : orders;
1609
+ if (typeof orders !== 'undefined') {
1610
+ payload['orders'] = orders;
1611
+ }
1612
+ lengths = lengths === true ? [] : lengths;
1613
+ if (typeof lengths !== 'undefined') {
1614
+ payload['lengths'] = lengths;
1615
+ }
1616
+
1617
+ let response = undefined;
1618
+
1619
+ response = await client.call('post', apiPath, {
1620
+ 'content-type': 'application/json',
1621
+ }, payload);
1622
+
1623
+ if (parseOutput) {
1624
+ parse(response)
1625
+ }
1626
+
1627
+ return response;
1628
+
1629
+ }
1630
+ /**
1631
+ * @typedef {Object} TablesDBGetIndexRequestParams
1632
+ * @property {string} databaseId Database ID.
1633
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1634
+ * @property {string} key Index Key.
1635
+ * @property {boolean} overrideForCli
1636
+ * @property {boolean} parseOutput
1637
+ * @property {libClient | undefined} sdk
1638
+ */
1639
+
1640
+ /**
1641
+ * @param {TablesDBGetIndexRequestParams} params
1642
+ */
1643
+ const tablesDBGetIndex = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1644
+ let client = !sdk ? await sdkForProject() :
1645
+ sdk;
1646
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1647
+ let payload = {};
1648
+
1649
+ let response = undefined;
1650
+
1651
+ response = await client.call('get', apiPath, {
1652
+ }, payload);
1653
+
1654
+ if (parseOutput) {
1655
+ parse(response)
1656
+ }
1657
+
1658
+ return response;
1659
+
1660
+ }
1661
+ /**
1662
+ * @typedef {Object} TablesDBDeleteIndexRequestParams
1663
+ * @property {string} databaseId Database ID.
1664
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1665
+ * @property {string} key Index Key.
1666
+ * @property {boolean} overrideForCli
1667
+ * @property {boolean} parseOutput
1668
+ * @property {libClient | undefined} sdk
1669
+ */
1670
+
1671
+ /**
1672
+ * @param {TablesDBDeleteIndexRequestParams} params
1673
+ */
1674
+ const tablesDBDeleteIndex = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1675
+ let client = !sdk ? await sdkForProject() :
1676
+ sdk;
1677
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1678
+ let payload = {};
1679
+
1680
+ let response = undefined;
1681
+
1682
+ response = await client.call('delete', apiPath, {
1683
+ 'content-type': 'application/json',
1684
+ }, payload);
1685
+
1686
+ if (parseOutput) {
1687
+ parse(response)
1688
+ }
1689
+
1690
+ return response;
1691
+
1692
+ }
1693
+ /**
1694
+ * @typedef {Object} TablesDBListTableLogsRequestParams
1695
+ * @property {string} databaseId Database ID.
1696
+ * @property {string} tableId Table ID.
1697
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
1698
+ * @property {boolean} overrideForCli
1699
+ * @property {boolean} parseOutput
1700
+ * @property {libClient | undefined} sdk
1701
+ */
1702
+
1703
+ /**
1704
+ * @param {TablesDBListTableLogsRequestParams} params
1705
+ */
1706
+ const tablesDBListTableLogs = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1707
+ let client = !sdk ? await sdkForProject() :
1708
+ sdk;
1709
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/logs'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1710
+ let payload = {};
1711
+ if (typeof queries !== 'undefined') {
1712
+ payload['queries'] = queries;
1713
+ }
1714
+
1715
+ let response = undefined;
1716
+
1717
+ response = await client.call('get', apiPath, {
1718
+ }, payload);
1719
+
1720
+ if (parseOutput) {
1721
+ if(console) {
1722
+ showConsoleLink('tablesDB', 'listTableLogs', databaseId, tableId);
1723
+ } else {
1724
+ parse(response)
1725
+ }
1726
+ }
1727
+
1728
+ return response;
1729
+
1730
+ }
1731
+ /**
1732
+ * @typedef {Object} TablesDBListRowsRequestParams
1733
+ * @property {string} databaseId Database ID.
1734
+ * @property {string} tableId Table ID. You can create a new table using the TableDB service [server integration](https://appwrite.io/docs/server/tablesdbdb#tablesdbCreate).
1735
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1736
+ * @property {boolean} overrideForCli
1737
+ * @property {boolean} parseOutput
1738
+ * @property {libClient | undefined} sdk
1739
+ */
1740
+
1741
+ /**
1742
+ * @param {TablesDBListRowsRequestParams} params
1743
+ */
1744
+ const tablesDBListRows = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1745
+ let client = !sdk ? await sdkForProject() :
1746
+ sdk;
1747
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1748
+ let payload = {};
1749
+ if (typeof queries !== 'undefined') {
1750
+ payload['queries'] = queries;
1751
+ }
1752
+
1753
+ let response = undefined;
1754
+
1755
+ response = await client.call('get', apiPath, {
1756
+ }, payload);
1757
+
1758
+ if (parseOutput) {
1759
+ if(console) {
1760
+ showConsoleLink('tablesDB', 'listRows', databaseId, tableId);
1761
+ } else {
1762
+ parse(response)
1763
+ }
1764
+ }
1765
+
1766
+ return response;
1767
+
1768
+ }
1769
+ /**
1770
+ * @typedef {Object} TablesDBCreateRowRequestParams
1771
+ * @property {string} databaseId Database ID.
1772
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.
1773
+ * @property {string} rowId 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.
1774
+ * @property {object} data Row data as JSON object.
1775
+ * @property {string[]} permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
1776
+ * @property {boolean} overrideForCli
1777
+ * @property {boolean} parseOutput
1778
+ * @property {libClient | undefined} sdk
1779
+ */
1780
+
1781
+ /**
1782
+ * @param {TablesDBCreateRowRequestParams} params
1783
+ */
1784
+ const tablesDBCreateRow = async ({databaseId,tableId,rowId,data,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1785
+ let client = !sdk ? await sdkForProject() :
1786
+ sdk;
1787
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1788
+ let payload = {};
1789
+ if (typeof rowId !== 'undefined') {
1790
+ payload['rowId'] = rowId;
1791
+ }
1792
+ if (typeof data !== 'undefined') {
1793
+ payload['data'] = JSON.parse(data);
1794
+ }
1795
+ permissions = permissions === true ? [] : permissions;
1796
+ if (typeof permissions !== 'undefined') {
1797
+ payload['permissions'] = permissions;
1798
+ }
1799
+
1800
+ let response = undefined;
1801
+
1802
+ response = await client.call('post', apiPath, {
1803
+ 'content-type': 'application/json',
1804
+ }, payload);
1805
+
1806
+ if (parseOutput) {
1807
+ parse(response)
1808
+ }
1809
+
1810
+ return response;
1811
+
1812
+ }
1813
+ /**
1814
+ * @typedef {Object} TablesDBCreateRowsRequestParams
1815
+ * @property {string} databaseId Database ID.
1816
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.
1817
+ * @property {object[]} rows Array of documents data as JSON objects.
1818
+ * @property {boolean} overrideForCli
1819
+ * @property {boolean} parseOutput
1820
+ * @property {libClient | undefined} sdk
1821
+ */
1822
+
1823
+ /**
1824
+ * @param {TablesDBCreateRowsRequestParams} params
1825
+ */
1826
+ const tablesDBCreateRows = async ({databaseId,tableId,rows,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1827
+ let client = !sdk ? await sdkForProject() :
1828
+ sdk;
1829
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1830
+ let payload = {};
1831
+ rows = rows === true ? [] : rows;
1832
+ if (typeof rows !== 'undefined') {
1833
+ payload['rows'] = rows;
1834
+ }
1835
+
1836
+ let response = undefined;
1837
+
1838
+ response = await client.call('post', apiPath, {
1839
+ 'content-type': 'application/json',
1840
+ }, payload);
1841
+
1842
+ if (parseOutput) {
1843
+ parse(response)
1844
+ }
1845
+
1846
+ return response;
1847
+
1848
+ }
1849
+ /**
1850
+ * @typedef {Object} TablesDBUpsertRowsRequestParams
1851
+ * @property {string} databaseId Database ID.
1852
+ * @property {string} tableId Table ID.
1853
+ * @property {object[]} rows Array of row data as JSON objects. May contain partial rows.
1854
+ * @property {boolean} overrideForCli
1855
+ * @property {boolean} parseOutput
1856
+ * @property {libClient | undefined} sdk
1857
+ */
1858
+
1859
+ /**
1860
+ * @param {TablesDBUpsertRowsRequestParams} params
1861
+ */
1862
+ const tablesDBUpsertRows = async ({databaseId,tableId,rows,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1863
+ let client = !sdk ? await sdkForProject() :
1864
+ sdk;
1865
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1866
+ let payload = {};
1867
+ rows = rows === true ? [] : rows;
1868
+ if (typeof rows !== 'undefined') {
1869
+ payload['rows'] = rows;
1870
+ }
1871
+
1872
+ let response = undefined;
1873
+
1874
+ response = await client.call('put', apiPath, {
1875
+ 'content-type': 'application/json',
1876
+ }, payload);
1877
+
1878
+ if (parseOutput) {
1879
+ parse(response)
1880
+ }
1881
+
1882
+ return response;
1883
+
1884
+ }
1885
+ /**
1886
+ * @typedef {Object} TablesDBUpdateRowsRequestParams
1887
+ * @property {string} databaseId Database ID.
1888
+ * @property {string} tableId Table ID.
1889
+ * @property {object} data Row data as JSON object. Include only column and value pairs to be updated.
1890
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1891
+ * @property {boolean} overrideForCli
1892
+ * @property {boolean} parseOutput
1893
+ * @property {libClient | undefined} sdk
1894
+ */
1895
+
1896
+ /**
1897
+ * @param {TablesDBUpdateRowsRequestParams} params
1898
+ */
1899
+ const tablesDBUpdateRows = async ({databaseId,tableId,data,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1900
+ let client = !sdk ? await sdkForProject() :
1901
+ sdk;
1902
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1903
+ let payload = {};
1904
+ if (typeof data !== 'undefined') {
1905
+ payload['data'] = JSON.parse(data);
1906
+ }
1907
+ queries = queries === true ? [] : queries;
1908
+ if (typeof queries !== 'undefined') {
1909
+ payload['queries'] = queries;
1910
+ }
1911
+
1912
+ let response = undefined;
1913
+
1914
+ response = await client.call('patch', apiPath, {
1915
+ 'content-type': 'application/json',
1916
+ }, payload);
1917
+
1918
+ if (parseOutput) {
1919
+ parse(response)
1920
+ }
1921
+
1922
+ return response;
1923
+
1924
+ }
1925
+ /**
1926
+ * @typedef {Object} TablesDBDeleteRowsRequestParams
1927
+ * @property {string} databaseId Database ID.
1928
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1929
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1930
+ * @property {boolean} overrideForCli
1931
+ * @property {boolean} parseOutput
1932
+ * @property {libClient | undefined} sdk
1933
+ */
1934
+
1935
+ /**
1936
+ * @param {TablesDBDeleteRowsRequestParams} params
1937
+ */
1938
+ const tablesDBDeleteRows = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1939
+ let client = !sdk ? await sdkForProject() :
1940
+ sdk;
1941
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1942
+ let payload = {};
1943
+ queries = queries === true ? [] : queries;
1944
+ if (typeof queries !== 'undefined') {
1945
+ payload['queries'] = queries;
1946
+ }
1947
+
1948
+ let response = undefined;
1949
+
1950
+ response = await client.call('delete', apiPath, {
1951
+ 'content-type': 'application/json',
1952
+ }, payload);
1953
+
1954
+ if (parseOutput) {
1955
+ parse(response)
1956
+ }
1957
+
1958
+ return response;
1959
+
1960
+ }
1961
+ /**
1962
+ * @typedef {Object} TablesDBGetRowRequestParams
1963
+ * @property {string} databaseId Database ID.
1964
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
1965
+ * @property {string} rowId Row ID.
1966
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1967
+ * @property {boolean} overrideForCli
1968
+ * @property {boolean} parseOutput
1969
+ * @property {libClient | undefined} sdk
1970
+ */
1971
+
1972
+ /**
1973
+ * @param {TablesDBGetRowRequestParams} params
1974
+ */
1975
+ const tablesDBGetRow = async ({databaseId,tableId,rowId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1976
+ let client = !sdk ? await sdkForProject() :
1977
+ sdk;
1978
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
1979
+ let payload = {};
1980
+ if (typeof queries !== 'undefined') {
1981
+ payload['queries'] = queries;
1982
+ }
1983
+
1984
+ let response = undefined;
1985
+
1986
+ response = await client.call('get', apiPath, {
1987
+ }, payload);
1988
+
1989
+ if (parseOutput) {
1990
+ if(console) {
1991
+ showConsoleLink('tablesDB', 'getRow', databaseId, tableId, rowId);
1992
+ } else {
1993
+ parse(response)
1994
+ }
1995
+ }
1996
+
1997
+ return response;
1998
+
1999
+ }
2000
+ /**
2001
+ * @typedef {Object} TablesDBUpsertRowRequestParams
2002
+ * @property {string} databaseId Database ID.
2003
+ * @property {string} tableId Table ID.
2004
+ * @property {string} rowId Row ID.
2005
+ * @property {object} data Row data as JSON object. Include all required columns of the row to be created or updated.
2006
+ * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2007
+ * @property {boolean} overrideForCli
2008
+ * @property {boolean} parseOutput
2009
+ * @property {libClient | undefined} sdk
2010
+ */
2011
+
2012
+ /**
2013
+ * @param {TablesDBUpsertRowRequestParams} params
2014
+ */
2015
+ const tablesDBUpsertRow = async ({databaseId,tableId,rowId,data,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2016
+ let client = !sdk ? await sdkForProject() :
2017
+ sdk;
2018
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
2019
+ let payload = {};
2020
+ if (typeof data !== 'undefined') {
2021
+ payload['data'] = JSON.parse(data);
2022
+ }
2023
+ permissions = permissions === true ? [] : permissions;
2024
+ if (typeof permissions !== 'undefined') {
2025
+ payload['permissions'] = permissions;
2026
+ }
2027
+
2028
+ let response = undefined;
2029
+
2030
+ response = await client.call('put', apiPath, {
2031
+ 'content-type': 'application/json',
2032
+ }, payload);
2033
+
2034
+ if (parseOutput) {
2035
+ parse(response)
2036
+ }
2037
+
2038
+ return response;
2039
+
2040
+ }
2041
+ /**
2042
+ * @typedef {Object} TablesDBUpdateRowRequestParams
2043
+ * @property {string} databaseId Database ID.
2044
+ * @property {string} tableId Table ID.
2045
+ * @property {string} rowId Row ID.
2046
+ * @property {object} data Row data as JSON object. Include only columns and value pairs to be updated.
2047
+ * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2048
+ * @property {boolean} overrideForCli
2049
+ * @property {boolean} parseOutput
2050
+ * @property {libClient | undefined} sdk
2051
+ */
2052
+
2053
+ /**
2054
+ * @param {TablesDBUpdateRowRequestParams} params
2055
+ */
2056
+ const tablesDBUpdateRow = async ({databaseId,tableId,rowId,data,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2057
+ let client = !sdk ? await sdkForProject() :
2058
+ sdk;
2059
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
2060
+ let payload = {};
2061
+ if (typeof data !== 'undefined') {
2062
+ payload['data'] = JSON.parse(data);
2063
+ }
2064
+ permissions = permissions === true ? [] : permissions;
2065
+ if (typeof permissions !== 'undefined') {
2066
+ payload['permissions'] = permissions;
2067
+ }
2068
+
2069
+ let response = undefined;
2070
+
2071
+ response = await client.call('patch', apiPath, {
2072
+ 'content-type': 'application/json',
2073
+ }, payload);
2074
+
2075
+ if (parseOutput) {
2076
+ parse(response)
2077
+ }
2078
+
2079
+ return response;
2080
+
2081
+ }
2082
+ /**
2083
+ * @typedef {Object} TablesDBDeleteRowRequestParams
2084
+ * @property {string} databaseId Database ID.
2085
+ * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).
2086
+ * @property {string} rowId Row ID.
2087
+ * @property {boolean} overrideForCli
2088
+ * @property {boolean} parseOutput
2089
+ * @property {libClient | undefined} sdk
2090
+ */
2091
+
2092
+ /**
2093
+ * @param {TablesDBDeleteRowRequestParams} params
2094
+ */
2095
+ const tablesDBDeleteRow = async ({databaseId,tableId,rowId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2096
+ let client = !sdk ? await sdkForProject() :
2097
+ sdk;
2098
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
2099
+ let payload = {};
2100
+
2101
+ let response = undefined;
2102
+
2103
+ response = await client.call('delete', apiPath, {
2104
+ 'content-type': 'application/json',
2105
+ }, payload);
2106
+
2107
+ if (parseOutput) {
2108
+ parse(response)
2109
+ }
2110
+
2111
+ return response;
2112
+
2113
+ }
2114
+ /**
2115
+ * @typedef {Object} TablesDBListRowLogsRequestParams
2116
+ * @property {string} databaseId Database ID.
2117
+ * @property {string} tableId Table ID.
2118
+ * @property {string} rowId Row ID.
2119
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
2120
+ * @property {boolean} overrideForCli
2121
+ * @property {boolean} parseOutput
2122
+ * @property {libClient | undefined} sdk
2123
+ */
2124
+
2125
+ /**
2126
+ * @param {TablesDBListRowLogsRequestParams} params
2127
+ */
2128
+ const tablesDBListRowLogs = async ({databaseId,tableId,rowId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2129
+ let client = !sdk ? await sdkForProject() :
2130
+ sdk;
2131
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/logs'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
2132
+ let payload = {};
2133
+ if (typeof queries !== 'undefined') {
2134
+ payload['queries'] = queries;
2135
+ }
2136
+
2137
+ let response = undefined;
2138
+
2139
+ response = await client.call('get', apiPath, {
2140
+ }, payload);
2141
+
2142
+ if (parseOutput) {
2143
+ if(console) {
2144
+ showConsoleLink('tablesDB', 'listRowLogs', databaseId, tableId, rowId);
2145
+ } else {
2146
+ parse(response)
2147
+ }
2148
+ }
2149
+
2150
+ return response;
2151
+
2152
+ }
2153
+ /**
2154
+ * @typedef {Object} TablesDBDecrementRowColumnRequestParams
2155
+ * @property {string} databaseId Database ID.
2156
+ * @property {string} tableId Table ID.
2157
+ * @property {string} rowId Row ID.
2158
+ * @property {string} column Column key.
2159
+ * @property {number} value Value to increment the column by. The value must be a number.
2160
+ * @property {number} min Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.
2161
+ * @property {boolean} overrideForCli
2162
+ * @property {boolean} parseOutput
2163
+ * @property {libClient | undefined} sdk
2164
+ */
2165
+
2166
+ /**
2167
+ * @param {TablesDBDecrementRowColumnRequestParams} params
2168
+ */
2169
+ const tablesDBDecrementRowColumn = async ({databaseId,tableId,rowId,column,value,min,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2170
+ let client = !sdk ? await sdkForProject() :
2171
+ sdk;
2172
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column);
2173
+ let payload = {};
2174
+ if (typeof value !== 'undefined') {
2175
+ payload['value'] = value;
2176
+ }
2177
+ if (typeof min !== 'undefined') {
2178
+ payload['min'] = min;
2179
+ }
2180
+
2181
+ let response = undefined;
2182
+
2183
+ response = await client.call('patch', apiPath, {
2184
+ 'content-type': 'application/json',
2185
+ }, payload);
2186
+
2187
+ if (parseOutput) {
2188
+ parse(response)
2189
+ }
2190
+
2191
+ return response;
2192
+
2193
+ }
2194
+ /**
2195
+ * @typedef {Object} TablesDBIncrementRowColumnRequestParams
2196
+ * @property {string} databaseId Database ID.
2197
+ * @property {string} tableId Table ID.
2198
+ * @property {string} rowId Row ID.
2199
+ * @property {string} column Column key.
2200
+ * @property {number} value Value to increment the column by. The value must be a number.
2201
+ * @property {number} max Maximum value for the column. If the current value is greater than this value, an error will be thrown.
2202
+ * @property {boolean} overrideForCli
2203
+ * @property {boolean} parseOutput
2204
+ * @property {libClient | undefined} sdk
2205
+ */
2206
+
2207
+ /**
2208
+ * @param {TablesDBIncrementRowColumnRequestParams} params
2209
+ */
2210
+ const tablesDBIncrementRowColumn = async ({databaseId,tableId,rowId,column,value,max,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2211
+ let client = !sdk ? await sdkForProject() :
2212
+ sdk;
2213
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column);
2214
+ let payload = {};
2215
+ if (typeof value !== 'undefined') {
2216
+ payload['value'] = value;
2217
+ }
2218
+ if (typeof max !== 'undefined') {
2219
+ payload['max'] = max;
2220
+ }
2221
+
2222
+ let response = undefined;
2223
+
2224
+ response = await client.call('patch', apiPath, {
2225
+ 'content-type': 'application/json',
2226
+ }, payload);
2227
+
2228
+ if (parseOutput) {
2229
+ parse(response)
2230
+ }
2231
+
2232
+ return response;
2233
+
2234
+ }
2235
+ /**
2236
+ * @typedef {Object} TablesDBGetTableUsageRequestParams
2237
+ * @property {string} databaseId Database ID.
2238
+ * @property {string} tableId Table ID.
2239
+ * @property {UsageRange} range Date range.
2240
+ * @property {boolean} overrideForCli
2241
+ * @property {boolean} parseOutput
2242
+ * @property {libClient | undefined} sdk
2243
+ */
2244
+
2245
+ /**
2246
+ * @param {TablesDBGetTableUsageRequestParams} params
2247
+ */
2248
+ const tablesDBGetTableUsage = async ({databaseId,tableId,range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2249
+ let client = !sdk ? await sdkForProject() :
2250
+ sdk;
2251
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/usage'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2252
+ let payload = {};
2253
+ if (typeof range !== 'undefined') {
2254
+ payload['range'] = range;
2255
+ }
2256
+
2257
+ let response = undefined;
2258
+
2259
+ response = await client.call('get', apiPath, {
2260
+ }, payload);
2261
+
2262
+ if (parseOutput) {
2263
+ if(console) {
2264
+ showConsoleLink('tablesDB', 'getTableUsage', databaseId, tableId);
2265
+ } else {
2266
+ parse(response)
2267
+ }
2268
+ }
2269
+
2270
+ return response;
2271
+
2272
+ }
2273
+ /**
2274
+ * @typedef {Object} TablesDBGetUsageRequestParams
2275
+ * @property {string} databaseId Database ID.
2276
+ * @property {UsageRange} range Date range.
2277
+ * @property {boolean} overrideForCli
2278
+ * @property {boolean} parseOutput
2279
+ * @property {libClient | undefined} sdk
2280
+ */
2281
+
2282
+ /**
2283
+ * @param {TablesDBGetUsageRequestParams} params
2284
+ */
2285
+ const tablesDBGetUsage = async ({databaseId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2286
+ let client = !sdk ? await sdkForProject() :
2287
+ sdk;
2288
+ let apiPath = '/tablesdb/{databaseId}/usage'.replace('{databaseId}', databaseId);
2289
+ let payload = {};
2290
+ if (typeof range !== 'undefined') {
2291
+ payload['range'] = range;
2292
+ }
2293
+
2294
+ let response = undefined;
2295
+
2296
+ response = await client.call('get', apiPath, {
2297
+ }, payload);
2298
+
2299
+ if (parseOutput) {
2300
+ parse(response)
2301
+ }
2302
+
2303
+ return response;
2304
+
2305
+ }
2306
+ tablesDB
2307
+ .command(`list`)
2308
+ .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`)
2309
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name`)
2310
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2311
+ .option(`--console`, `Get the resource console url`)
2312
+ .action(actionRunner(tablesDBList))
2313
+
2314
+ tablesDB
2315
+ .command(`create`)
2316
+ .description(`Create a new Database. `)
2317
+ .requiredOption(`--database-id <database-id>`, `Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2318
+ .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
2319
+ .option(`--enabled [value]`, `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.`, (value) => value === undefined ? true : parseBool(value))
2320
+ .action(actionRunner(tablesDBCreate))
2321
+
2322
+ tablesDB
2323
+ .command(`list-usage`)
2324
+ .description(`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.`)
2325
+ .option(`--range <range>`, `Date range.`)
2326
+ .option(`--console`, `Get the resource console url`)
2327
+ .action(actionRunner(tablesDBListUsage))
2328
+
2329
+ tablesDB
2330
+ .command(`get`)
2331
+ .description(`Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`)
2332
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2333
+ .option(`--console`, `Get the resource console url`)
2334
+ .action(actionRunner(tablesDBGet))
2335
+
2336
+ tablesDB
2337
+ .command(`update`)
2338
+ .description(`Update a database by its unique ID.`)
2339
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2340
+ .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
2341
+ .option(`--enabled [value]`, `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.`, (value) => value === undefined ? true : parseBool(value))
2342
+ .action(actionRunner(tablesDBUpdate))
2343
+
2344
+ tablesDB
2345
+ .command(`delete`)
2346
+ .description(`Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`)
2347
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2348
+ .action(actionRunner(tablesDBDelete))
2349
+
2350
+ tablesDB
2351
+ .command(`list-tables`)
2352
+ .description(`Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.`)
2353
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2354
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity`)
2355
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2356
+ .option(`--console`, `Get the resource console url`)
2357
+ .action(actionRunner(tablesDBListTables))
2358
+
2359
+ tablesDB
2360
+ .command(`create-table`)
2361
+ .description(`Create a new Table. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console.`)
2362
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2363
+ .requiredOption(`--table-id <table-id>`, `Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2364
+ .requiredOption(`--name <name>`, `Table name. Max length: 128 chars.`)
2365
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2366
+ .option(`--row-security [value]`, `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).`, (value) => value === undefined ? true : parseBool(value))
2367
+ .option(`--enabled [value]`, `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.`, (value) => value === undefined ? true : parseBool(value))
2368
+ .action(actionRunner(tablesDBCreateTable))
2369
+
2370
+ tablesDB
2371
+ .command(`get-table`)
2372
+ .description(`Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.`)
2373
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2374
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2375
+ .option(`--console`, `Get the resource console url`)
2376
+ .action(actionRunner(tablesDBGetTable))
2377
+
2378
+ tablesDB
2379
+ .command(`update-table`)
2380
+ .description(`Update a table by its unique ID.`)
2381
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2382
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2383
+ .requiredOption(`--name <name>`, `Table name. Max length: 128 chars.`)
2384
+ .option(`--permissions [permissions...]`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2385
+ .option(`--row-security [value]`, `Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value))
2386
+ .option(`--enabled [value]`, `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.`, (value) => value === undefined ? true : parseBool(value))
2387
+ .action(actionRunner(tablesDBUpdateTable))
2388
+
2389
+ tablesDB
2390
+ .command(`delete-table`)
2391
+ .description(`Delete a table by its unique ID. Only users with write permissions have access to delete this resource.`)
2392
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2393
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2394
+ .action(actionRunner(tablesDBDeleteTable))
2395
+
2396
+ tablesDB
2397
+ .command(`list-columns`)
2398
+ .description(`List columns in the table.`)
2399
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2400
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2401
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error`)
2402
+ .option(`--console`, `Get the resource console url`)
2403
+ .action(actionRunner(tablesDBListColumns))
2404
+
2405
+ tablesDB
2406
+ .command(`create-boolean-column`)
2407
+ .description(`Create a boolean column. `)
2408
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2409
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2410
+ .requiredOption(`--key <key>`, `Column Key.`)
2411
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2412
+ .option(`--xdefault [value]`, `Default value for column when not provided. Cannot be set when column is required.`, (value) => value === undefined ? true : parseBool(value))
2413
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
2414
+ .action(actionRunner(tablesDBCreateBooleanColumn))
2415
+
2416
+ tablesDB
2417
+ .command(`update-boolean-column`)
2418
+ .description(`Update a boolean column. Changing the 'default' value will not update already existing rows.`)
2419
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2420
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2421
+ .requiredOption(`--key <key>`, `Column Key.`)
2422
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2423
+ .option(`--xdefault [value]`, `Default value for column when not provided. Cannot be set when column is required.`, (value) => value === undefined ? true : parseBool(value))
2424
+ .option(`--new-key <new-key>`, `New Column Key.`)
2425
+ .action(actionRunner(tablesDBUpdateBooleanColumn))
2426
+
2427
+ tablesDB
2428
+ .command(`create-datetime-column`)
2429
+ .description(`Create a date time column according to the ISO 8601 standard.`)
2430
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2431
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2432
+ .requiredOption(`--key <key>`, `Column Key.`)
2433
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2434
+ .option(`--xdefault <xdefault>`, `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.`)
2435
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
2436
+ .action(actionRunner(tablesDBCreateDatetimeColumn))
2437
+
2438
+ tablesDB
2439
+ .command(`update-datetime-column`)
2440
+ .description(`Update a date time column. Changing the 'default' value will not update already existing rows.`)
2441
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2442
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2443
+ .requiredOption(`--key <key>`, `Column Key.`)
2444
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2445
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
2446
+ .option(`--new-key <new-key>`, `New Column Key.`)
2447
+ .action(actionRunner(tablesDBUpdateDatetimeColumn))
2448
+
2449
+ tablesDB
2450
+ .command(`create-email-column`)
2451
+ .description(`Create an email column. `)
2452
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2453
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2454
+ .requiredOption(`--key <key>`, `Column Key.`)
2455
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2456
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
2457
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
2458
+ .action(actionRunner(tablesDBCreateEmailColumn))
2459
+
2460
+ tablesDB
2461
+ .command(`update-email-column`)
2462
+ .description(`Update an email column. Changing the 'default' value will not update already existing rows. `)
2463
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2464
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2465
+ .requiredOption(`--key <key>`, `Column Key.`)
2466
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2467
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
2468
+ .option(`--new-key <new-key>`, `New Column Key.`)
2469
+ .action(actionRunner(tablesDBUpdateEmailColumn))
2470
+
2471
+ tablesDB
2472
+ .command(`create-enum-column`)
2473
+ .description(`Create an enumeration column. The 'elements' param acts as a white-list of accepted values for this column.`)
2474
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2475
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2476
+ .requiredOption(`--key <key>`, `Column Key.`)
2477
+ .requiredOption(`--elements [elements...]`, `Array of enum values.`)
2478
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2479
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
2480
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
2481
+ .action(actionRunner(tablesDBCreateEnumColumn))
2482
+
2483
+ tablesDB
2484
+ .command(`update-enum-column`)
2485
+ .description(`Update an enum column. Changing the 'default' value will not update already existing rows. `)
2486
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2487
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2488
+ .requiredOption(`--key <key>`, `Column Key.`)
2489
+ .requiredOption(`--elements [elements...]`, `Updated list of enum values.`)
2490
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2491
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
2492
+ .option(`--new-key <new-key>`, `New Column Key.`)
2493
+ .action(actionRunner(tablesDBUpdateEnumColumn))
2494
+
2495
+ tablesDB
2496
+ .command(`create-float-column`)
2497
+ .description(`Create a float column. Optionally, minimum and maximum values can be provided. `)
2498
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2499
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2500
+ .requiredOption(`--key <key>`, `Column Key.`)
2501
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2502
+ .option(`--min <min>`, `Minimum value`, parseInteger)
2503
+ .option(`--max <max>`, `Maximum value`, parseInteger)
2504
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parseInteger)
2505
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
2506
+ .action(actionRunner(tablesDBCreateFloatColumn))
2507
+
2508
+ tablesDB
2509
+ .command(`update-float-column`)
2510
+ .description(`Update a float column. Changing the 'default' value will not update already existing rows. `)
2511
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2512
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2513
+ .requiredOption(`--key <key>`, `Column Key.`)
2514
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2515
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parseInteger)
2516
+ .option(`--min <min>`, `Minimum value`, parseInteger)
2517
+ .option(`--max <max>`, `Maximum value`, parseInteger)
2518
+ .option(`--new-key <new-key>`, `New Column Key.`)
2519
+ .action(actionRunner(tablesDBUpdateFloatColumn))
2520
+
2521
+ tablesDB
2522
+ .command(`create-integer-column`)
2523
+ .description(`Create an integer column. Optionally, minimum and maximum values can be provided. `)
2524
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2525
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2526
+ .requiredOption(`--key <key>`, `Column Key.`)
2527
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2528
+ .option(`--min <min>`, `Minimum value`, parseInteger)
2529
+ .option(`--max <max>`, `Maximum value`, parseInteger)
2530
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`, parseInteger)
2531
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
2532
+ .action(actionRunner(tablesDBCreateIntegerColumn))
2533
+
2534
+ tablesDB
2535
+ .command(`update-integer-column`)
2536
+ .description(`Update an integer column. Changing the 'default' value will not update already existing rows. `)
2537
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2538
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2539
+ .requiredOption(`--key <key>`, `Column Key.`)
2540
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2541
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`, parseInteger)
2542
+ .option(`--min <min>`, `Minimum value`, parseInteger)
2543
+ .option(`--max <max>`, `Maximum value`, parseInteger)
2544
+ .option(`--new-key <new-key>`, `New Column Key.`)
2545
+ .action(actionRunner(tablesDBUpdateIntegerColumn))
2546
+
2547
+ tablesDB
2548
+ .command(`create-ip-column`)
2549
+ .description(`Create IP address column. `)
2550
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2551
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2552
+ .requiredOption(`--key <key>`, `Column Key.`)
2553
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2554
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`)
2555
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
2556
+ .action(actionRunner(tablesDBCreateIpColumn))
2557
+
2558
+ tablesDB
2559
+ .command(`update-ip-column`)
2560
+ .description(`Update an ip column. Changing the 'default' value will not update already existing rows. `)
2561
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2562
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2563
+ .requiredOption(`--key <key>`, `Column Key.`)
2564
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2565
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`)
2566
+ .option(`--new-key <new-key>`, `New Column Key.`)
2567
+ .action(actionRunner(tablesDBUpdateIpColumn))
2568
+
2569
+ tablesDB
2570
+ .command(`create-relationship-column`)
2571
+ .description(`Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). `)
2572
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2573
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2574
+ .requiredOption(`--related-table-id <related-table-id>`, `Related Table ID.`)
2575
+ .requiredOption(`--type <type>`, `Relation type`)
2576
+ .option(`--two-way [value]`, `Is Two Way?`, (value) => value === undefined ? true : parseBool(value))
2577
+ .option(`--key <key>`, `Column Key.`)
2578
+ .option(`--two-way-key <two-way-key>`, `Two Way Column Key.`)
2579
+ .option(`--on-delete <on-delete>`, `Constraints option`)
2580
+ .action(actionRunner(tablesDBCreateRelationshipColumn))
2581
+
2582
+ tablesDB
2583
+ .command(`create-string-column`)
2584
+ .description(`Create a string column. `)
2585
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2586
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2587
+ .requiredOption(`--key <key>`, `Column Key.`)
2588
+ .requiredOption(`--size <size>`, `Column size for text columns, in number of characters.`, parseInteger)
2589
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2590
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
2591
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
2592
+ .option(`--encrypt [value]`, `Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.`, (value) => value === undefined ? true : parseBool(value))
2593
+ .action(actionRunner(tablesDBCreateStringColumn))
2594
+
2595
+ tablesDB
2596
+ .command(`update-string-column`)
2597
+ .description(`Update a string column. Changing the 'default' value will not update already existing rows. `)
2598
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2599
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2600
+ .requiredOption(`--key <key>`, `Column Key.`)
2601
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2602
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
2603
+ .option(`--size <size>`, `Maximum size of the string column.`, parseInteger)
2604
+ .option(`--new-key <new-key>`, `New Column Key.`)
2605
+ .action(actionRunner(tablesDBUpdateStringColumn))
2606
+
2607
+ tablesDB
2608
+ .command(`create-url-column`)
2609
+ .description(`Create a URL column. `)
2610
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2611
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2612
+ .requiredOption(`--key <key>`, `Column Key.`)
2613
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2614
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
2615
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
2616
+ .action(actionRunner(tablesDBCreateUrlColumn))
2617
+
2618
+ tablesDB
2619
+ .command(`update-url-column`)
2620
+ .description(`Update an url column. Changing the 'default' value will not update already existing rows. `)
2621
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2622
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2623
+ .requiredOption(`--key <key>`, `Column Key.`)
2624
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2625
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
2626
+ .option(`--new-key <new-key>`, `New Column Key.`)
2627
+ .action(actionRunner(tablesDBUpdateUrlColumn))
2628
+
2629
+ tablesDB
2630
+ .command(`get-column`)
2631
+ .description(`Get column by ID.`)
2632
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2633
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2634
+ .requiredOption(`--key <key>`, `Column Key.`)
2635
+ .option(`--console`, `Get the resource console url`)
2636
+ .action(actionRunner(tablesDBGetColumn))
2637
+
2638
+ tablesDB
2639
+ .command(`delete-column`)
2640
+ .description(`Deletes a column.`)
2641
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2642
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2643
+ .requiredOption(`--key <key>`, `Column Key.`)
2644
+ .action(actionRunner(tablesDBDeleteColumn))
2645
+
2646
+ tablesDB
2647
+ .command(`update-relationship-column`)
2648
+ .description(`Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). `)
2649
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2650
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2651
+ .requiredOption(`--key <key>`, `Column Key.`)
2652
+ .option(`--on-delete <on-delete>`, `Constraints option`)
2653
+ .option(`--new-key <new-key>`, `New Column Key.`)
2654
+ .action(actionRunner(tablesDBUpdateRelationshipColumn))
2655
+
2656
+ tablesDB
2657
+ .command(`list-indexes`)
2658
+ .description(`List indexes on the table.`)
2659
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2660
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2661
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error`)
2662
+ .option(`--console`, `Get the resource console url`)
2663
+ .action(actionRunner(tablesDBListIndexes))
2664
+
2665
+ tablesDB
2666
+ .command(`create-index`)
2667
+ .description(`Creates an index on the columns listed. Your index should include all the columns you will query in a single request. Type can be 'key', 'fulltext', or 'unique'.`)
2668
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2669
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2670
+ .requiredOption(`--key <key>`, `Index Key.`)
2671
+ .requiredOption(`--type <type>`, `Index type.`)
2672
+ .requiredOption(`--columns [columns...]`, `Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.`)
2673
+ .option(`--orders [orders...]`, `Array of index orders. Maximum of 100 orders are allowed.`)
2674
+ .option(`--lengths [lengths...]`, `Length of index. Maximum of 100`)
2675
+ .action(actionRunner(tablesDBCreateIndex))
2676
+
2677
+ tablesDB
2678
+ .command(`get-index`)
2679
+ .description(`Get index by ID.`)
2680
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2681
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2682
+ .requiredOption(`--key <key>`, `Index Key.`)
2683
+ .action(actionRunner(tablesDBGetIndex))
2684
+
2685
+ tablesDB
2686
+ .command(`delete-index`)
2687
+ .description(`Delete an index.`)
2688
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2689
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2690
+ .requiredOption(`--key <key>`, `Index Key.`)
2691
+ .action(actionRunner(tablesDBDeleteIndex))
2692
+
2693
+ tablesDB
2694
+ .command(`list-table-logs`)
2695
+ .description(`Get the table activity logs list by its unique ID.`)
2696
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2697
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2698
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
2699
+ .option(`--console`, `Get the resource console url`)
2700
+ .action(actionRunner(tablesDBListTableLogs))
2701
+
2702
+ tablesDB
2703
+ .command(`list-rows`)
2704
+ .description(`Get a list of all the user's rows in a given table. You can use the query params to filter your results.`)
2705
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2706
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TableDB service [server integration](https://appwrite.io/docs/server/tablesdbdb#tablesdbCreate).`)
2707
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`)
2708
+ .option(`--console`, `Get the resource console url`)
2709
+ .action(actionRunner(tablesDBListRows))
2710
+
2711
+ tablesDB
2712
+ .command(`create-row`)
2713
+ .description(`Create a new Row. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console.`)
2714
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2715
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.`)
2716
+ .requiredOption(`--row-id <row-id>`, `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.`)
2717
+ .requiredOption(`--data <data>`, `Row data as JSON object.`)
2718
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2719
+ .action(actionRunner(tablesDBCreateRow))
2720
+
2721
+ tablesDB
2722
+ .command(`create-rows`)
2723
+ .description(`Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console.`)
2724
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2725
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows.`)
2726
+ .requiredOption(`--rows [rows...]`, `Array of documents data as JSON objects.`)
2727
+ .action(actionRunner(tablesDBCreateRows))
2728
+
2729
+ tablesDB
2730
+ .command(`upsert-rows`)
2731
+ .description(`Create or update Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreateTable) API or directly from your database console. `)
2732
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2733
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2734
+ .requiredOption(`--rows [rows...]`, `Array of row data as JSON objects. May contain partial rows.`)
2735
+ .action(actionRunner(tablesDBUpsertRows))
2736
+
2737
+ tablesDB
2738
+ .command(`update-rows`)
2739
+ .description(`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.`)
2740
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2741
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2742
+ .option(`--data <data>`, `Row data as JSON object. Include only column and value pairs to be updated.`)
2743
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`)
2744
+ .action(actionRunner(tablesDBUpdateRows))
2745
+
2746
+ tablesDB
2747
+ .command(`delete-rows`)
2748
+ .description(`Bulk delete rows using queries, if no queries are passed then all rows are deleted.`)
2749
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2750
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2751
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`)
2752
+ .action(actionRunner(tablesDBDeleteRows))
2753
+
2754
+ tablesDB
2755
+ .command(`get-row`)
2756
+ .description(`Get a row by its unique ID. This endpoint response returns a JSON object with the row data.`)
2757
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2758
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2759
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2760
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`)
2761
+ .option(`--console`, `Get the resource console url`)
2762
+ .action(actionRunner(tablesDBGetRow))
2763
+
2764
+ tablesDB
2765
+ .command(`upsert-row`)
2766
+ .description(`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/server/tablesdb#tablesDBCreateTable) API or directly from your database console.`)
2767
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2768
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2769
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2770
+ .option(`--data <data>`, `Row data as JSON object. Include all required columns of the row to be created or updated.`)
2771
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2772
+ .action(actionRunner(tablesDBUpsertRow))
2773
+
2774
+ tablesDB
2775
+ .command(`update-row`)
2776
+ .description(`Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.`)
2777
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2778
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2779
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2780
+ .option(`--data <data>`, `Row data as JSON object. Include only columns and value pairs to be updated.`)
2781
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2782
+ .action(actionRunner(tablesDBUpdateRow))
2783
+
2784
+ tablesDB
2785
+ .command(`delete-row`)
2786
+ .description(`Delete a row by its unique ID.`)
2787
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2788
+ .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate).`)
2789
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2790
+ .action(actionRunner(tablesDBDeleteRow))
2791
+
2792
+ tablesDB
2793
+ .command(`list-row-logs`)
2794
+ .description(`Get the row activity logs list by its unique ID.`)
2795
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2796
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2797
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2798
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset`)
2799
+ .option(`--console`, `Get the resource console url`)
2800
+ .action(actionRunner(tablesDBListRowLogs))
2801
+
2802
+ tablesDB
2803
+ .command(`decrement-row-column`)
2804
+ .description(`Decrement a specific column of a row by a given value.`)
2805
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2806
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2807
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2808
+ .requiredOption(`--column <column>`, `Column key.`)
2809
+ .option(`--value <value>`, `Value to increment the column by. The value must be a number.`, parseInteger)
2810
+ .option(`--min <min>`, `Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.`, parseInteger)
2811
+ .action(actionRunner(tablesDBDecrementRowColumn))
2812
+
2813
+ tablesDB
2814
+ .command(`increment-row-column`)
2815
+ .description(`Increment a specific column of a row by a given value.`)
2816
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2817
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2818
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2819
+ .requiredOption(`--column <column>`, `Column key.`)
2820
+ .option(`--value <value>`, `Value to increment the column by. The value must be a number.`, parseInteger)
2821
+ .option(`--max <max>`, `Maximum value for the column. If the current value is greater than this value, an error will be thrown.`, parseInteger)
2822
+ .action(actionRunner(tablesDBIncrementRowColumn))
2823
+
2824
+ tablesDB
2825
+ .command(`get-table-usage`)
2826
+ .description(`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.`)
2827
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2828
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2829
+ .option(`--range <range>`, `Date range.`)
2830
+ .option(`--console`, `Get the resource console url`)
2831
+ .action(actionRunner(tablesDBGetTableUsage))
2832
+
2833
+ tablesDB
2834
+ .command(`get-usage`)
2835
+ .description(`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.`)
2836
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2837
+ .option(`--range <range>`, `Date range.`)
2838
+ .action(actionRunner(tablesDBGetUsage))
2839
+
2840
+ module.exports = {
2841
+ tablesDB,
2842
+ tablesDBList,
2843
+ tablesDBCreate,
2844
+ tablesDBListUsage,
2845
+ tablesDBGet,
2846
+ tablesDBUpdate,
2847
+ tablesDBDelete,
2848
+ tablesDBListTables,
2849
+ tablesDBCreateTable,
2850
+ tablesDBGetTable,
2851
+ tablesDBUpdateTable,
2852
+ tablesDBDeleteTable,
2853
+ tablesDBListColumns,
2854
+ tablesDBCreateBooleanColumn,
2855
+ tablesDBUpdateBooleanColumn,
2856
+ tablesDBCreateDatetimeColumn,
2857
+ tablesDBUpdateDatetimeColumn,
2858
+ tablesDBCreateEmailColumn,
2859
+ tablesDBUpdateEmailColumn,
2860
+ tablesDBCreateEnumColumn,
2861
+ tablesDBUpdateEnumColumn,
2862
+ tablesDBCreateFloatColumn,
2863
+ tablesDBUpdateFloatColumn,
2864
+ tablesDBCreateIntegerColumn,
2865
+ tablesDBUpdateIntegerColumn,
2866
+ tablesDBCreateIpColumn,
2867
+ tablesDBUpdateIpColumn,
2868
+ tablesDBCreateRelationshipColumn,
2869
+ tablesDBCreateStringColumn,
2870
+ tablesDBUpdateStringColumn,
2871
+ tablesDBCreateUrlColumn,
2872
+ tablesDBUpdateUrlColumn,
2873
+ tablesDBGetColumn,
2874
+ tablesDBDeleteColumn,
2875
+ tablesDBUpdateRelationshipColumn,
2876
+ tablesDBListIndexes,
2877
+ tablesDBCreateIndex,
2878
+ tablesDBGetIndex,
2879
+ tablesDBDeleteIndex,
2880
+ tablesDBListTableLogs,
2881
+ tablesDBListRows,
2882
+ tablesDBCreateRow,
2883
+ tablesDBCreateRows,
2884
+ tablesDBUpsertRows,
2885
+ tablesDBUpdateRows,
2886
+ tablesDBDeleteRows,
2887
+ tablesDBGetRow,
2888
+ tablesDBUpsertRow,
2889
+ tablesDBUpdateRow,
2890
+ tablesDBDeleteRow,
2891
+ tablesDBListRowLogs,
2892
+ tablesDBDecrementRowColumn,
2893
+ tablesDBIncrementRowColumn,
2894
+ tablesDBGetTableUsage,
2895
+ tablesDBGetUsage
2896
+ };