appwrite-cli 12.0.1 → 13.0.0-rc.2

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 (801) hide show
  1. package/.github/workflows/build-verify.yml +71 -0
  2. package/.github/workflows/npm-publish.yml +41 -22
  3. package/CHANGELOG.md +108 -100
  4. package/LICENSE.md +1 -1
  5. package/README.md +58 -35
  6. package/bun.lock +625 -0
  7. package/dist/bundle.cjs +94853 -0
  8. package/dist/index.d.ts +3 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +145 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/lib/client.d.ts +88 -0
  13. package/dist/lib/client.d.ts.map +1 -0
  14. package/dist/lib/client.js +238 -0
  15. package/dist/lib/client.js.map +1 -0
  16. package/dist/lib/commands/generic.d.ts +17 -0
  17. package/dist/lib/commands/generic.d.ts.map +1 -0
  18. package/dist/lib/commands/generic.js +292 -0
  19. package/dist/lib/commands/generic.js.map +1 -0
  20. package/dist/lib/commands/init.d.ts +3 -0
  21. package/dist/lib/commands/init.d.ts.map +1 -0
  22. package/{lib → dist/lib}/commands/init.js +186 -270
  23. package/dist/lib/commands/init.js.map +1 -0
  24. package/dist/lib/commands/pull.d.ts +8 -0
  25. package/dist/lib/commands/pull.d.ts.map +1 -0
  26. package/{lib → dist/lib}/commands/pull.js +159 -280
  27. package/dist/lib/commands/pull.js.map +1 -0
  28. package/dist/lib/commands/push.d.ts +4 -0
  29. package/dist/lib/commands/push.d.ts.map +1 -0
  30. package/dist/lib/commands/push.js +2127 -0
  31. package/dist/lib/commands/push.js.map +1 -0
  32. package/dist/lib/commands/run.d.ts +3 -0
  33. package/dist/lib/commands/run.d.ts.map +1 -0
  34. package/{lib → dist/lib}/commands/run.js +146 -187
  35. package/dist/lib/commands/run.js.map +1 -0
  36. package/dist/lib/commands/services/account.d.ts +3 -0
  37. package/dist/lib/commands/services/account.d.ts.map +1 -0
  38. package/dist/lib/commands/services/account.js +306 -0
  39. package/dist/lib/commands/services/account.js.map +1 -0
  40. package/dist/lib/commands/services/avatars.d.ts +3 -0
  41. package/dist/lib/commands/services/avatars.d.ts.map +1 -0
  42. package/dist/lib/commands/services/avatars.js +118 -0
  43. package/dist/lib/commands/services/avatars.js.map +1 -0
  44. package/dist/lib/commands/services/console.d.ts +3 -0
  45. package/dist/lib/commands/services/console.d.ts.map +1 -0
  46. package/dist/lib/commands/services/console.js +41 -0
  47. package/dist/lib/commands/services/console.js.map +1 -0
  48. package/dist/lib/commands/services/databases.d.ts +3 -0
  49. package/dist/lib/commands/services/databases.d.ts.map +1 -0
  50. package/dist/lib/commands/services/databases.js +612 -0
  51. package/dist/lib/commands/services/databases.js.map +1 -0
  52. package/dist/lib/commands/services/functions.d.ts +3 -0
  53. package/dist/lib/commands/services/functions.d.ts.map +1 -0
  54. package/dist/lib/commands/services/functions.js +258 -0
  55. package/dist/lib/commands/services/functions.js.map +1 -0
  56. package/dist/lib/commands/services/graphql.d.ts +3 -0
  57. package/dist/lib/commands/services/graphql.d.ts.map +1 -0
  58. package/dist/lib/commands/services/graphql.js +28 -0
  59. package/dist/lib/commands/services/graphql.js.map +1 -0
  60. package/dist/lib/commands/services/health.d.ts +3 -0
  61. package/dist/lib/commands/services/health.d.ts.map +1 -0
  62. package/dist/lib/commands/services/health.js +123 -0
  63. package/dist/lib/commands/services/health.js.map +1 -0
  64. package/dist/lib/commands/services/locale.d.ts +3 -0
  65. package/dist/lib/commands/services/locale.d.ts.map +1 -0
  66. package/dist/lib/commands/services/locale.js +52 -0
  67. package/dist/lib/commands/services/locale.js.map +1 -0
  68. package/dist/lib/commands/services/messaging.d.ts +3 -0
  69. package/dist/lib/commands/services/messaging.d.ts.map +1 -0
  70. package/dist/lib/commands/services/messaging.js +505 -0
  71. package/dist/lib/commands/services/messaging.js.map +1 -0
  72. package/dist/lib/commands/services/migrations.d.ts +3 -0
  73. package/dist/lib/commands/services/migrations.d.ts.map +1 -0
  74. package/dist/lib/commands/services/migrations.js +135 -0
  75. package/dist/lib/commands/services/migrations.js.map +1 -0
  76. package/dist/lib/commands/services/project.d.ts +3 -0
  77. package/dist/lib/commands/services/project.d.ts.map +1 -0
  78. package/dist/lib/commands/services/project.js +54 -0
  79. package/dist/lib/commands/services/project.js.map +1 -0
  80. package/dist/lib/commands/services/projects.d.ts +3 -0
  81. package/dist/lib/commands/services/projects.d.ts.map +1 -0
  82. package/dist/lib/commands/services/projects.js +415 -0
  83. package/dist/lib/commands/services/projects.js.map +1 -0
  84. package/dist/lib/commands/services/proxy.d.ts +3 -0
  85. package/dist/lib/commands/services/proxy.d.ts.map +1 -0
  86. package/dist/lib/commands/services/proxy.js +68 -0
  87. package/dist/lib/commands/services/proxy.js.map +1 -0
  88. package/dist/lib/commands/services/sites.d.ts +3 -0
  89. package/dist/lib/commands/services/sites.d.ts.map +1 -0
  90. package/dist/lib/commands/services/sites.js +242 -0
  91. package/dist/lib/commands/services/sites.js.map +1 -0
  92. package/dist/lib/commands/services/storage.d.ts +3 -0
  93. package/dist/lib/commands/services/storage.d.ts.map +1 -0
  94. package/dist/lib/commands/services/storage.js +153 -0
  95. package/dist/lib/commands/services/storage.js.map +1 -0
  96. package/dist/lib/commands/services/tablesdb.d.ts +3 -0
  97. package/dist/lib/commands/services/tablesdb.d.ts.map +1 -0
  98. package/dist/lib/commands/services/tablesdb.js +605 -0
  99. package/dist/lib/commands/services/tablesdb.js.map +1 -0
  100. package/dist/lib/commands/services/teams.d.ts +3 -0
  101. package/dist/lib/commands/services/teams.d.ts.map +1 -0
  102. package/dist/lib/commands/services/teams.js +123 -0
  103. package/dist/lib/commands/services/teams.js.map +1 -0
  104. package/dist/lib/commands/services/tokens.d.ts +3 -0
  105. package/dist/lib/commands/services/tokens.d.ts.map +1 -0
  106. package/dist/lib/commands/services/tokens.js +49 -0
  107. package/dist/lib/commands/services/tokens.js.map +1 -0
  108. package/dist/lib/commands/services/users.d.ts +3 -0
  109. package/dist/lib/commands/services/users.d.ts.map +1 -0
  110. package/dist/lib/commands/services/users.js +312 -0
  111. package/dist/lib/commands/services/users.js.map +1 -0
  112. package/dist/lib/commands/services/vcs.d.ts +3 -0
  113. package/dist/lib/commands/services/vcs.d.ts.map +1 -0
  114. package/dist/lib/commands/services/vcs.js +87 -0
  115. package/dist/lib/commands/services/vcs.js.map +1 -0
  116. package/dist/lib/commands/types.d.ts +3 -0
  117. package/dist/lib/commands/types.d.ts.map +1 -0
  118. package/dist/lib/commands/types.js +151 -0
  119. package/dist/lib/commands/types.js.map +1 -0
  120. package/dist/lib/commands/update.d.ts +3 -0
  121. package/dist/lib/commands/update.d.ts.map +1 -0
  122. package/{lib → dist/lib}/commands/update.js +62 -79
  123. package/dist/lib/commands/update.js.map +1 -0
  124. package/dist/lib/config.d.ts +118 -0
  125. package/dist/lib/config.d.ts.map +1 -0
  126. package/{lib → dist/lib}/config.js +173 -232
  127. package/dist/lib/config.js.map +1 -0
  128. package/dist/lib/emulation/docker.d.ts +7 -0
  129. package/dist/lib/emulation/docker.d.ts.map +1 -0
  130. package/dist/lib/emulation/docker.js +224 -0
  131. package/dist/lib/emulation/docker.js.map +1 -0
  132. package/dist/lib/emulation/utils.d.ts +29 -0
  133. package/dist/lib/emulation/utils.d.ts.map +1 -0
  134. package/{lib → dist/lib}/emulation/utils.js +70 -91
  135. package/dist/lib/emulation/utils.js.map +1 -0
  136. package/dist/lib/id.d.ts +7 -0
  137. package/dist/lib/id.d.ts.map +1 -0
  138. package/{lib → dist/lib}/id.js +5 -8
  139. package/dist/lib/id.js.map +1 -0
  140. package/dist/lib/paginate.d.ts +9 -0
  141. package/dist/lib/paginate.d.ts.map +1 -0
  142. package/{lib → dist/lib}/paginate.js +10 -19
  143. package/dist/lib/paginate.js.map +1 -0
  144. package/dist/lib/parser.d.ts +18 -0
  145. package/dist/lib/parser.d.ts.map +1 -0
  146. package/dist/lib/parser.js +225 -0
  147. package/dist/lib/parser.js.map +1 -0
  148. package/dist/lib/questions.d.ts +59 -0
  149. package/dist/lib/questions.d.ts.map +1 -0
  150. package/{lib → dist/lib}/questions.js +393 -500
  151. package/dist/lib/questions.js.map +1 -0
  152. package/dist/lib/sdks.d.ts +4 -0
  153. package/dist/lib/sdks.d.ts.map +1 -0
  154. package/dist/lib/sdks.js +61 -0
  155. package/dist/lib/sdks.js.map +1 -0
  156. package/dist/lib/services.d.ts +13 -0
  157. package/dist/lib/services.d.ts.map +1 -0
  158. package/dist/lib/services.js +47 -0
  159. package/dist/lib/services.js.map +1 -0
  160. package/dist/lib/spinner.d.ts +28 -0
  161. package/dist/lib/spinner.d.ts.map +1 -0
  162. package/dist/lib/spinner.js +91 -0
  163. package/dist/lib/spinner.js.map +1 -0
  164. package/dist/lib/type-generation/attribute.d.ts +17 -0
  165. package/dist/lib/type-generation/attribute.d.ts.map +1 -0
  166. package/{lib → dist/lib}/type-generation/attribute.js +2 -5
  167. package/dist/lib/type-generation/attribute.js.map +1 -0
  168. package/dist/lib/type-generation/languages/csharp.d.ts +7 -0
  169. package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -0
  170. package/dist/lib/type-generation/languages/csharp.js +180 -0
  171. package/dist/lib/type-generation/languages/csharp.js.map +1 -0
  172. package/dist/lib/type-generation/languages/dart.d.ts +8 -0
  173. package/dist/lib/type-generation/languages/dart.d.ts.map +1 -0
  174. package/dist/lib/type-generation/languages/dart.js +197 -0
  175. package/dist/lib/type-generation/languages/dart.js.map +1 -0
  176. package/dist/lib/type-generation/languages/java.d.ts +7 -0
  177. package/dist/lib/type-generation/languages/java.d.ts.map +1 -0
  178. package/dist/lib/type-generation/languages/java.js +140 -0
  179. package/dist/lib/type-generation/languages/java.js.map +1 -0
  180. package/dist/lib/type-generation/languages/javascript.d.ts +9 -0
  181. package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -0
  182. package/dist/lib/type-generation/languages/javascript.js +109 -0
  183. package/dist/lib/type-generation/languages/javascript.js.map +1 -0
  184. package/dist/lib/type-generation/languages/kotlin.d.ts +7 -0
  185. package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -0
  186. package/dist/lib/type-generation/languages/kotlin.js +95 -0
  187. package/dist/lib/type-generation/languages/kotlin.js.map +1 -0
  188. package/dist/lib/type-generation/languages/language.d.ts +43 -0
  189. package/dist/lib/type-generation/languages/language.d.ts.map +1 -0
  190. package/dist/lib/type-generation/languages/language.js +77 -0
  191. package/dist/lib/type-generation/languages/language.js.map +1 -0
  192. package/dist/lib/type-generation/languages/php.d.ts +7 -0
  193. package/dist/lib/type-generation/languages/php.d.ts.map +1 -0
  194. package/dist/lib/type-generation/languages/php.js +116 -0
  195. package/dist/lib/type-generation/languages/php.js.map +1 -0
  196. package/dist/lib/type-generation/languages/swift.d.ts +7 -0
  197. package/dist/lib/type-generation/languages/swift.d.ts.map +1 -0
  198. package/dist/lib/type-generation/languages/swift.js +179 -0
  199. package/dist/lib/type-generation/languages/swift.js.map +1 -0
  200. package/dist/lib/type-generation/languages/typescript.d.ts +9 -0
  201. package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -0
  202. package/dist/lib/type-generation/languages/typescript.js +115 -0
  203. package/dist/lib/type-generation/languages/typescript.js.map +1 -0
  204. package/dist/lib/types.d.ts +277 -0
  205. package/dist/lib/types.d.ts.map +1 -0
  206. package/dist/lib/types.js +2 -0
  207. package/dist/lib/types.js.map +1 -0
  208. package/dist/lib/utils.d.ts +15 -0
  209. package/dist/lib/utils.d.ts.map +1 -0
  210. package/{lib → dist/lib}/utils.js +125 -167
  211. package/dist/lib/utils.js.map +1 -0
  212. package/dist/lib/validations.d.ts +2 -0
  213. package/dist/lib/validations.d.ts.map +1 -0
  214. package/dist/lib/validations.js +16 -0
  215. package/dist/lib/validations.js.map +1 -0
  216. package/dist/package.json +67 -0
  217. package/dist/scripts/generate-commands.d.ts +2 -0
  218. package/dist/scripts/generate-commands.d.ts.map +1 -0
  219. package/dist/scripts/generate-commands.js +398 -0
  220. package/dist/scripts/generate-commands.js.map +1 -0
  221. package/index.ts +168 -0
  222. package/install.ps1 +2 -5
  223. package/install.sh +1 -2
  224. package/lib/client.ts +292 -0
  225. package/lib/commands/generic.ts +440 -0
  226. package/lib/commands/init.ts +713 -0
  227. package/lib/commands/pull.ts +668 -0
  228. package/lib/commands/push.ts +3183 -0
  229. package/lib/commands/run.ts +416 -0
  230. package/lib/commands/services/account.ts +832 -0
  231. package/lib/commands/services/avatars.ts +400 -0
  232. package/lib/commands/services/console.ts +73 -0
  233. package/lib/commands/services/databases.ts +2080 -0
  234. package/lib/commands/services/functions.ts +855 -0
  235. package/lib/commands/services/graphql.ts +47 -0
  236. package/lib/commands/services/health.ts +322 -0
  237. package/lib/commands/services/locale.ts +99 -0
  238. package/lib/commands/services/messaging.ts +1871 -0
  239. package/lib/commands/services/migrations.ts +421 -0
  240. package/lib/commands/services/project.ts +116 -0
  241. package/lib/commands/services/projects.ts +1317 -0
  242. package/lib/commands/services/proxy.ts +163 -0
  243. package/lib/commands/services/sites.ts +777 -0
  244. package/lib/commands/services/storage.ts +547 -0
  245. package/lib/commands/services/tablesdb.ts +1928 -0
  246. package/lib/commands/services/teams.ts +294 -0
  247. package/lib/commands/services/tokens.ts +106 -0
  248. package/lib/commands/services/users.ts +886 -0
  249. package/lib/commands/services/vcs.ts +268 -0
  250. package/lib/commands/types.ts +220 -0
  251. package/lib/commands/update.ts +255 -0
  252. package/lib/config.ts +969 -0
  253. package/lib/emulation/docker.ts +312 -0
  254. package/lib/emulation/utils.ts +207 -0
  255. package/lib/id.ts +30 -0
  256. package/lib/paginate.ts +77 -0
  257. package/lib/parser.ts +264 -0
  258. package/lib/questions.ts +1167 -0
  259. package/lib/sdks.ts +84 -0
  260. package/lib/services.ts +72 -0
  261. package/lib/spinner.ts +131 -0
  262. package/lib/type-generation/attribute.ts +18 -0
  263. package/lib/type-generation/languages/{csharp.js → csharp.ts} +27 -14
  264. package/lib/type-generation/languages/{dart.js → dart.ts} +61 -46
  265. package/lib/type-generation/languages/{java.js → java.ts} +31 -18
  266. package/lib/type-generation/languages/{javascript.js → javascript.ts} +35 -24
  267. package/lib/type-generation/languages/{kotlin.js → kotlin.ts} +27 -14
  268. package/lib/type-generation/languages/{language.js → language.ts} +45 -43
  269. package/lib/type-generation/languages/{php.js → php.ts} +28 -15
  270. package/lib/type-generation/languages/{swift.js → swift.ts} +27 -14
  271. package/lib/type-generation/languages/{typescript.js → typescript.ts} +43 -26
  272. package/lib/types.ts +304 -0
  273. package/lib/utils.ts +352 -0
  274. package/lib/validations.ts +20 -0
  275. package/package.json +36 -19
  276. package/scoop/appwrite.config.json +19 -29
  277. package/scripts/generate-commands.ts +539 -0
  278. package/tsconfig.json +24 -0
  279. package/.github/workflows/autoclose.yml +0 -11
  280. package/docs/examples/account/create-anonymous-session.md +0 -1
  281. package/docs/examples/account/create-email-password-session.md +0 -3
  282. package/docs/examples/account/create-email-token.md +0 -3
  283. package/docs/examples/account/create-email-verification.md +0 -2
  284. package/docs/examples/account/create-jwt.md +0 -1
  285. package/docs/examples/account/create-magic-url-token.md +0 -3
  286. package/docs/examples/account/create-mfa-authenticator.md +0 -2
  287. package/docs/examples/account/create-mfa-challenge.md +0 -2
  288. package/docs/examples/account/create-mfa-recovery-codes.md +0 -1
  289. package/docs/examples/account/create-o-auth-2-session.md +0 -2
  290. package/docs/examples/account/create-o-auth-2-token.md +0 -2
  291. package/docs/examples/account/create-phone-token.md +0 -3
  292. package/docs/examples/account/create-phone-verification.md +0 -1
  293. package/docs/examples/account/create-push-target.md +0 -3
  294. package/docs/examples/account/create-recovery.md +0 -3
  295. package/docs/examples/account/create-session.md +0 -3
  296. package/docs/examples/account/create-verification.md +0 -2
  297. package/docs/examples/account/create.md +0 -4
  298. package/docs/examples/account/delete-identity.md +0 -2
  299. package/docs/examples/account/delete-mfa-authenticator.md +0 -2
  300. package/docs/examples/account/delete-push-target.md +0 -2
  301. package/docs/examples/account/delete-session.md +0 -2
  302. package/docs/examples/account/delete-sessions.md +0 -1
  303. package/docs/examples/account/delete.md +0 -1
  304. package/docs/examples/account/get-mfa-recovery-codes.md +0 -1
  305. package/docs/examples/account/get-prefs.md +0 -1
  306. package/docs/examples/account/get-session.md +0 -2
  307. package/docs/examples/account/get.md +0 -1
  308. package/docs/examples/account/list-identities.md +0 -1
  309. package/docs/examples/account/list-logs.md +0 -1
  310. package/docs/examples/account/list-mfa-factors.md +0 -1
  311. package/docs/examples/account/list-sessions.md +0 -1
  312. package/docs/examples/account/update-email-verification.md +0 -3
  313. package/docs/examples/account/update-email.md +0 -3
  314. package/docs/examples/account/update-magic-url-session.md +0 -3
  315. package/docs/examples/account/update-mfa-authenticator.md +0 -3
  316. package/docs/examples/account/update-mfa-challenge.md +0 -3
  317. package/docs/examples/account/update-mfa-recovery-codes.md +0 -1
  318. package/docs/examples/account/update-mfa.md +0 -2
  319. package/docs/examples/account/update-name.md +0 -2
  320. package/docs/examples/account/update-password.md +0 -2
  321. package/docs/examples/account/update-phone-session.md +0 -3
  322. package/docs/examples/account/update-phone-verification.md +0 -3
  323. package/docs/examples/account/update-phone.md +0 -3
  324. package/docs/examples/account/update-prefs.md +0 -2
  325. package/docs/examples/account/update-push-target.md +0 -3
  326. package/docs/examples/account/update-recovery.md +0 -4
  327. package/docs/examples/account/update-session.md +0 -2
  328. package/docs/examples/account/update-status.md +0 -1
  329. package/docs/examples/account/update-verification.md +0 -3
  330. package/docs/examples/console/get-resource.md +0 -3
  331. package/docs/examples/console/variables.md +0 -1
  332. package/docs/examples/databases/create-boolean-attribute.md +0 -5
  333. package/docs/examples/databases/create-collection.md +0 -4
  334. package/docs/examples/databases/create-datetime-attribute.md +0 -5
  335. package/docs/examples/databases/create-document.md +0 -5
  336. package/docs/examples/databases/create-documents.md +0 -4
  337. package/docs/examples/databases/create-email-attribute.md +0 -5
  338. package/docs/examples/databases/create-enum-attribute.md +0 -6
  339. package/docs/examples/databases/create-float-attribute.md +0 -5
  340. package/docs/examples/databases/create-index.md +0 -6
  341. package/docs/examples/databases/create-integer-attribute.md +0 -5
  342. package/docs/examples/databases/create-ip-attribute.md +0 -5
  343. package/docs/examples/databases/create-line-attribute.md +0 -5
  344. package/docs/examples/databases/create-operations.md +0 -2
  345. package/docs/examples/databases/create-point-attribute.md +0 -5
  346. package/docs/examples/databases/create-polygon-attribute.md +0 -5
  347. package/docs/examples/databases/create-relationship-attribute.md +0 -5
  348. package/docs/examples/databases/create-string-attribute.md +0 -6
  349. package/docs/examples/databases/create-transaction.md +0 -1
  350. package/docs/examples/databases/create-url-attribute.md +0 -5
  351. package/docs/examples/databases/create.md +0 -3
  352. package/docs/examples/databases/decrement-document-attribute.md +0 -5
  353. package/docs/examples/databases/delete-attribute.md +0 -4
  354. package/docs/examples/databases/delete-collection.md +0 -3
  355. package/docs/examples/databases/delete-document.md +0 -4
  356. package/docs/examples/databases/delete-documents.md +0 -3
  357. package/docs/examples/databases/delete-index.md +0 -4
  358. package/docs/examples/databases/delete-transaction.md +0 -2
  359. package/docs/examples/databases/delete.md +0 -2
  360. package/docs/examples/databases/get-attribute.md +0 -4
  361. package/docs/examples/databases/get-collection-usage.md +0 -3
  362. package/docs/examples/databases/get-collection.md +0 -3
  363. package/docs/examples/databases/get-document.md +0 -4
  364. package/docs/examples/databases/get-index.md +0 -4
  365. package/docs/examples/databases/get-transaction.md +0 -2
  366. package/docs/examples/databases/get-usage.md +0 -2
  367. package/docs/examples/databases/get.md +0 -2
  368. package/docs/examples/databases/increment-document-attribute.md +0 -5
  369. package/docs/examples/databases/list-attributes.md +0 -3
  370. package/docs/examples/databases/list-collection-logs.md +0 -3
  371. package/docs/examples/databases/list-collections.md +0 -2
  372. package/docs/examples/databases/list-document-logs.md +0 -4
  373. package/docs/examples/databases/list-documents.md +0 -3
  374. package/docs/examples/databases/list-indexes.md +0 -3
  375. package/docs/examples/databases/list-logs.md +0 -2
  376. package/docs/examples/databases/list-transactions.md +0 -1
  377. package/docs/examples/databases/list-usage.md +0 -1
  378. package/docs/examples/databases/list.md +0 -1
  379. package/docs/examples/databases/update-boolean-attribute.md +0 -6
  380. package/docs/examples/databases/update-collection.md +0 -4
  381. package/docs/examples/databases/update-datetime-attribute.md +0 -6
  382. package/docs/examples/databases/update-document.md +0 -4
  383. package/docs/examples/databases/update-documents.md +0 -3
  384. package/docs/examples/databases/update-email-attribute.md +0 -6
  385. package/docs/examples/databases/update-enum-attribute.md +0 -7
  386. package/docs/examples/databases/update-float-attribute.md +0 -6
  387. package/docs/examples/databases/update-integer-attribute.md +0 -6
  388. package/docs/examples/databases/update-ip-attribute.md +0 -6
  389. package/docs/examples/databases/update-line-attribute.md +0 -5
  390. package/docs/examples/databases/update-point-attribute.md +0 -5
  391. package/docs/examples/databases/update-polygon-attribute.md +0 -5
  392. package/docs/examples/databases/update-relationship-attribute.md +0 -4
  393. package/docs/examples/databases/update-string-attribute.md +0 -6
  394. package/docs/examples/databases/update-transaction.md +0 -2
  395. package/docs/examples/databases/update-url-attribute.md +0 -6
  396. package/docs/examples/databases/update.md +0 -3
  397. package/docs/examples/databases/upsert-document.md +0 -5
  398. package/docs/examples/databases/upsert-documents.md +0 -4
  399. package/docs/examples/functions/create-deployment.md +0 -4
  400. package/docs/examples/functions/create-duplicate-deployment.md +0 -3
  401. package/docs/examples/functions/create-execution.md +0 -2
  402. package/docs/examples/functions/create-template-deployment.md +0 -7
  403. package/docs/examples/functions/create-variable.md +0 -4
  404. package/docs/examples/functions/create-vcs-deployment.md +0 -4
  405. package/docs/examples/functions/create.md +0 -4
  406. package/docs/examples/functions/delete-deployment.md +0 -3
  407. package/docs/examples/functions/delete-execution.md +0 -3
  408. package/docs/examples/functions/delete-variable.md +0 -3
  409. package/docs/examples/functions/delete.md +0 -2
  410. package/docs/examples/functions/get-deployment-download.md +0 -3
  411. package/docs/examples/functions/get-deployment.md +0 -3
  412. package/docs/examples/functions/get-execution.md +0 -3
  413. package/docs/examples/functions/get-template.md +0 -2
  414. package/docs/examples/functions/get-usage.md +0 -2
  415. package/docs/examples/functions/get-variable.md +0 -3
  416. package/docs/examples/functions/get.md +0 -2
  417. package/docs/examples/functions/list-deployments.md +0 -2
  418. package/docs/examples/functions/list-executions.md +0 -2
  419. package/docs/examples/functions/list-runtimes.md +0 -1
  420. package/docs/examples/functions/list-specifications.md +0 -1
  421. package/docs/examples/functions/list-templates.md +0 -1
  422. package/docs/examples/functions/list-usage.md +0 -1
  423. package/docs/examples/functions/list-variables.md +0 -2
  424. package/docs/examples/functions/list.md +0 -1
  425. package/docs/examples/functions/update-deployment-status.md +0 -3
  426. package/docs/examples/functions/update-function-deployment.md +0 -3
  427. package/docs/examples/functions/update-variable.md +0 -4
  428. package/docs/examples/functions/update.md +0 -3
  429. package/docs/examples/graphql/mutation.md +0 -2
  430. package/docs/examples/graphql/query.md +0 -2
  431. package/docs/examples/health/get-antivirus.md +0 -1
  432. package/docs/examples/health/get-cache.md +0 -1
  433. package/docs/examples/health/get-certificate.md +0 -1
  434. package/docs/examples/health/get-db.md +0 -1
  435. package/docs/examples/health/get-failed-jobs.md +0 -2
  436. package/docs/examples/health/get-pub-sub.md +0 -1
  437. package/docs/examples/health/get-queue-builds.md +0 -1
  438. package/docs/examples/health/get-queue-certificates.md +0 -1
  439. package/docs/examples/health/get-queue-databases.md +0 -1
  440. package/docs/examples/health/get-queue-deletes.md +0 -1
  441. package/docs/examples/health/get-queue-functions.md +0 -1
  442. package/docs/examples/health/get-queue-logs.md +0 -1
  443. package/docs/examples/health/get-queue-mails.md +0 -1
  444. package/docs/examples/health/get-queue-messaging.md +0 -1
  445. package/docs/examples/health/get-queue-migrations.md +0 -1
  446. package/docs/examples/health/get-queue-stats-resources.md +0 -1
  447. package/docs/examples/health/get-queue-usage.md +0 -1
  448. package/docs/examples/health/get-queue-webhooks.md +0 -1
  449. package/docs/examples/health/get-storage-local.md +0 -1
  450. package/docs/examples/health/get-storage.md +0 -1
  451. package/docs/examples/health/get-time.md +0 -1
  452. package/docs/examples/health/get.md +0 -1
  453. package/docs/examples/locale/get.md +0 -1
  454. package/docs/examples/locale/list-codes.md +0 -1
  455. package/docs/examples/locale/list-continents.md +0 -1
  456. package/docs/examples/locale/list-countries-eu.md +0 -1
  457. package/docs/examples/locale/list-countries-phones.md +0 -1
  458. package/docs/examples/locale/list-countries.md +0 -1
  459. package/docs/examples/locale/list-currencies.md +0 -1
  460. package/docs/examples/locale/list-languages.md +0 -1
  461. package/docs/examples/messaging/create-apns-provider.md +0 -3
  462. package/docs/examples/messaging/create-email.md +0 -4
  463. package/docs/examples/messaging/create-fcm-provider.md +0 -3
  464. package/docs/examples/messaging/create-mailgun-provider.md +0 -3
  465. package/docs/examples/messaging/create-msg-91-provider.md +0 -3
  466. package/docs/examples/messaging/create-push.md +0 -2
  467. package/docs/examples/messaging/create-resend-provider.md +0 -3
  468. package/docs/examples/messaging/create-sendgrid-provider.md +0 -3
  469. package/docs/examples/messaging/create-sms.md +0 -3
  470. package/docs/examples/messaging/create-smtp-provider.md +0 -4
  471. package/docs/examples/messaging/create-subscriber.md +0 -4
  472. package/docs/examples/messaging/create-telesign-provider.md +0 -3
  473. package/docs/examples/messaging/create-textmagic-provider.md +0 -3
  474. package/docs/examples/messaging/create-topic.md +0 -3
  475. package/docs/examples/messaging/create-twilio-provider.md +0 -3
  476. package/docs/examples/messaging/create-vonage-provider.md +0 -3
  477. package/docs/examples/messaging/delete-provider.md +0 -2
  478. package/docs/examples/messaging/delete-subscriber.md +0 -3
  479. package/docs/examples/messaging/delete-topic.md +0 -2
  480. package/docs/examples/messaging/delete.md +0 -2
  481. package/docs/examples/messaging/get-message.md +0 -2
  482. package/docs/examples/messaging/get-provider.md +0 -2
  483. package/docs/examples/messaging/get-subscriber.md +0 -3
  484. package/docs/examples/messaging/get-topic.md +0 -2
  485. package/docs/examples/messaging/list-message-logs.md +0 -2
  486. package/docs/examples/messaging/list-messages.md +0 -1
  487. package/docs/examples/messaging/list-provider-logs.md +0 -2
  488. package/docs/examples/messaging/list-providers.md +0 -1
  489. package/docs/examples/messaging/list-subscriber-logs.md +0 -2
  490. package/docs/examples/messaging/list-subscribers.md +0 -2
  491. package/docs/examples/messaging/list-targets.md +0 -2
  492. package/docs/examples/messaging/list-topic-logs.md +0 -2
  493. package/docs/examples/messaging/list-topics.md +0 -1
  494. package/docs/examples/messaging/update-apns-provider.md +0 -2
  495. package/docs/examples/messaging/update-email.md +0 -2
  496. package/docs/examples/messaging/update-fcm-provider.md +0 -2
  497. package/docs/examples/messaging/update-mailgun-provider.md +0 -2
  498. package/docs/examples/messaging/update-msg-91-provider.md +0 -2
  499. package/docs/examples/messaging/update-push.md +0 -2
  500. package/docs/examples/messaging/update-resend-provider.md +0 -2
  501. package/docs/examples/messaging/update-sendgrid-provider.md +0 -2
  502. package/docs/examples/messaging/update-sms.md +0 -2
  503. package/docs/examples/messaging/update-smtp-provider.md +0 -2
  504. package/docs/examples/messaging/update-telesign-provider.md +0 -2
  505. package/docs/examples/messaging/update-textmagic-provider.md +0 -2
  506. package/docs/examples/messaging/update-topic.md +0 -2
  507. package/docs/examples/messaging/update-twilio-provider.md +0 -2
  508. package/docs/examples/messaging/update-vonage-provider.md +0 -2
  509. package/docs/examples/migrations/create-appwrite-migration.md +0 -5
  510. package/docs/examples/migrations/create-csv-export.md +0 -3
  511. package/docs/examples/migrations/create-csv-import.md +0 -4
  512. package/docs/examples/migrations/create-firebase-migration.md +0 -3
  513. package/docs/examples/migrations/create-n-host-migration.md +0 -8
  514. package/docs/examples/migrations/create-supabase-migration.md +0 -7
  515. package/docs/examples/migrations/delete.md +0 -2
  516. package/docs/examples/migrations/get-appwrite-report.md +0 -5
  517. package/docs/examples/migrations/get-firebase-report.md +0 -3
  518. package/docs/examples/migrations/get-n-host-report.md +0 -8
  519. package/docs/examples/migrations/get-supabase-report.md +0 -7
  520. package/docs/examples/migrations/get.md +0 -2
  521. package/docs/examples/migrations/list.md +0 -1
  522. package/docs/examples/migrations/retry.md +0 -2
  523. package/docs/examples/project/create-variable.md +0 -3
  524. package/docs/examples/project/delete-variable.md +0 -2
  525. package/docs/examples/project/get-usage.md +0 -3
  526. package/docs/examples/project/get-variable.md +0 -2
  527. package/docs/examples/project/list-variables.md +0 -1
  528. package/docs/examples/project/update-variable.md +0 -3
  529. package/docs/examples/projects/create-dev-key.md +0 -4
  530. package/docs/examples/projects/create-jwt.md +0 -3
  531. package/docs/examples/projects/create-key.md +0 -4
  532. package/docs/examples/projects/create-platform.md +0 -4
  533. package/docs/examples/projects/create-smtp-test.md +0 -6
  534. package/docs/examples/projects/create-webhook.md +0 -6
  535. package/docs/examples/projects/create.md +0 -4
  536. package/docs/examples/projects/delete-dev-key.md +0 -3
  537. package/docs/examples/projects/delete-email-template.md +0 -4
  538. package/docs/examples/projects/delete-key.md +0 -3
  539. package/docs/examples/projects/delete-platform.md +0 -3
  540. package/docs/examples/projects/delete-sms-template.md +0 -4
  541. package/docs/examples/projects/delete-webhook.md +0 -3
  542. package/docs/examples/projects/delete.md +0 -2
  543. package/docs/examples/projects/get-dev-key.md +0 -3
  544. package/docs/examples/projects/get-email-template.md +0 -4
  545. package/docs/examples/projects/get-key.md +0 -3
  546. package/docs/examples/projects/get-platform.md +0 -3
  547. package/docs/examples/projects/get-sms-template.md +0 -4
  548. package/docs/examples/projects/get-webhook.md +0 -3
  549. package/docs/examples/projects/get.md +0 -2
  550. package/docs/examples/projects/list-dev-keys.md +0 -2
  551. package/docs/examples/projects/list-keys.md +0 -2
  552. package/docs/examples/projects/list-platforms.md +0 -2
  553. package/docs/examples/projects/list-webhooks.md +0 -2
  554. package/docs/examples/projects/list.md +0 -1
  555. package/docs/examples/projects/update-api-status-all.md +0 -3
  556. package/docs/examples/projects/update-api-status.md +0 -4
  557. package/docs/examples/projects/update-auth-duration.md +0 -3
  558. package/docs/examples/projects/update-auth-limit.md +0 -3
  559. package/docs/examples/projects/update-auth-password-dictionary.md +0 -3
  560. package/docs/examples/projects/update-auth-password-history.md +0 -3
  561. package/docs/examples/projects/update-auth-sessions-limit.md +0 -3
  562. package/docs/examples/projects/update-auth-status.md +0 -4
  563. package/docs/examples/projects/update-dev-key.md +0 -5
  564. package/docs/examples/projects/update-email-template.md +0 -6
  565. package/docs/examples/projects/update-key.md +0 -5
  566. package/docs/examples/projects/update-memberships-privacy.md +0 -5
  567. package/docs/examples/projects/update-mock-numbers.md +0 -3
  568. package/docs/examples/projects/update-o-auth-2.md +0 -3
  569. package/docs/examples/projects/update-personal-data-check.md +0 -3
  570. package/docs/examples/projects/update-platform.md +0 -4
  571. package/docs/examples/projects/update-service-status-all.md +0 -3
  572. package/docs/examples/projects/update-service-status.md +0 -4
  573. package/docs/examples/projects/update-session-alerts.md +0 -3
  574. package/docs/examples/projects/update-session-invalidation.md +0 -3
  575. package/docs/examples/projects/update-sms-template.md +0 -5
  576. package/docs/examples/projects/update-smtp.md +0 -3
  577. package/docs/examples/projects/update-team.md +0 -3
  578. package/docs/examples/projects/update-webhook-signature.md +0 -3
  579. package/docs/examples/projects/update-webhook.md +0 -7
  580. package/docs/examples/projects/update.md +0 -3
  581. package/docs/examples/proxy/create-api-rule.md +0 -2
  582. package/docs/examples/proxy/create-function-rule.md +0 -3
  583. package/docs/examples/proxy/create-redirect-rule.md +0 -6
  584. package/docs/examples/proxy/create-site-rule.md +0 -3
  585. package/docs/examples/proxy/delete-rule.md +0 -2
  586. package/docs/examples/proxy/get-rule.md +0 -2
  587. package/docs/examples/proxy/list-rules.md +0 -1
  588. package/docs/examples/proxy/update-rule-verification.md +0 -2
  589. package/docs/examples/sites/create-deployment.md +0 -4
  590. package/docs/examples/sites/create-duplicate-deployment.md +0 -3
  591. package/docs/examples/sites/create-template-deployment.md +0 -7
  592. package/docs/examples/sites/create-variable.md +0 -4
  593. package/docs/examples/sites/create-vcs-deployment.md +0 -4
  594. package/docs/examples/sites/create.md +0 -5
  595. package/docs/examples/sites/delete-deployment.md +0 -3
  596. package/docs/examples/sites/delete-log.md +0 -3
  597. package/docs/examples/sites/delete-variable.md +0 -3
  598. package/docs/examples/sites/delete.md +0 -2
  599. package/docs/examples/sites/get-deployment-download.md +0 -3
  600. package/docs/examples/sites/get-deployment.md +0 -3
  601. package/docs/examples/sites/get-log.md +0 -3
  602. package/docs/examples/sites/get-template.md +0 -2
  603. package/docs/examples/sites/get-usage.md +0 -2
  604. package/docs/examples/sites/get-variable.md +0 -3
  605. package/docs/examples/sites/get.md +0 -2
  606. package/docs/examples/sites/list-deployments.md +0 -2
  607. package/docs/examples/sites/list-frameworks.md +0 -1
  608. package/docs/examples/sites/list-logs.md +0 -2
  609. package/docs/examples/sites/list-specifications.md +0 -1
  610. package/docs/examples/sites/list-templates.md +0 -1
  611. package/docs/examples/sites/list-usage.md +0 -1
  612. package/docs/examples/sites/list-variables.md +0 -2
  613. package/docs/examples/sites/list.md +0 -1
  614. package/docs/examples/sites/update-deployment-status.md +0 -3
  615. package/docs/examples/sites/update-site-deployment.md +0 -3
  616. package/docs/examples/sites/update-variable.md +0 -4
  617. package/docs/examples/sites/update.md +0 -4
  618. package/docs/examples/storage/create-bucket.md +0 -3
  619. package/docs/examples/storage/create-file.md +0 -4
  620. package/docs/examples/storage/delete-bucket.md +0 -2
  621. package/docs/examples/storage/delete-file.md +0 -3
  622. package/docs/examples/storage/get-bucket-usage.md +0 -2
  623. package/docs/examples/storage/get-bucket.md +0 -2
  624. package/docs/examples/storage/get-file-download.md +0 -3
  625. package/docs/examples/storage/get-file-preview.md +0 -3
  626. package/docs/examples/storage/get-file-view.md +0 -3
  627. package/docs/examples/storage/get-file.md +0 -3
  628. package/docs/examples/storage/get-usage.md +0 -1
  629. package/docs/examples/storage/list-buckets.md +0 -1
  630. package/docs/examples/storage/list-files.md +0 -2
  631. package/docs/examples/storage/update-bucket.md +0 -3
  632. package/docs/examples/storage/update-file.md +0 -3
  633. package/docs/examples/tablesdb/create-boolean-column.md +0 -5
  634. package/docs/examples/tablesdb/create-datetime-column.md +0 -5
  635. package/docs/examples/tablesdb/create-email-column.md +0 -5
  636. package/docs/examples/tablesdb/create-enum-column.md +0 -6
  637. package/docs/examples/tablesdb/create-float-column.md +0 -5
  638. package/docs/examples/tablesdb/create-index.md +0 -6
  639. package/docs/examples/tablesdb/create-integer-column.md +0 -5
  640. package/docs/examples/tablesdb/create-ip-column.md +0 -5
  641. package/docs/examples/tablesdb/create-line-column.md +0 -5
  642. package/docs/examples/tablesdb/create-operations.md +0 -2
  643. package/docs/examples/tablesdb/create-point-column.md +0 -5
  644. package/docs/examples/tablesdb/create-polygon-column.md +0 -5
  645. package/docs/examples/tablesdb/create-relationship-column.md +0 -5
  646. package/docs/examples/tablesdb/create-row.md +0 -5
  647. package/docs/examples/tablesdb/create-rows.md +0 -4
  648. package/docs/examples/tablesdb/create-string-column.md +0 -6
  649. package/docs/examples/tablesdb/create-table.md +0 -4
  650. package/docs/examples/tablesdb/create-transaction.md +0 -1
  651. package/docs/examples/tablesdb/create-url-column.md +0 -5
  652. package/docs/examples/tablesdb/create.md +0 -3
  653. package/docs/examples/tablesdb/decrement-row-column.md +0 -5
  654. package/docs/examples/tablesdb/delete-column.md +0 -4
  655. package/docs/examples/tablesdb/delete-index.md +0 -4
  656. package/docs/examples/tablesdb/delete-row.md +0 -4
  657. package/docs/examples/tablesdb/delete-rows.md +0 -3
  658. package/docs/examples/tablesdb/delete-table.md +0 -3
  659. package/docs/examples/tablesdb/delete-transaction.md +0 -2
  660. package/docs/examples/tablesdb/delete.md +0 -2
  661. package/docs/examples/tablesdb/get-column.md +0 -4
  662. package/docs/examples/tablesdb/get-index.md +0 -4
  663. package/docs/examples/tablesdb/get-row.md +0 -4
  664. package/docs/examples/tablesdb/get-table-usage.md +0 -3
  665. package/docs/examples/tablesdb/get-table.md +0 -3
  666. package/docs/examples/tablesdb/get-transaction.md +0 -2
  667. package/docs/examples/tablesdb/get-usage.md +0 -2
  668. package/docs/examples/tablesdb/get.md +0 -2
  669. package/docs/examples/tablesdb/increment-row-column.md +0 -5
  670. package/docs/examples/tablesdb/list-columns.md +0 -3
  671. package/docs/examples/tablesdb/list-indexes.md +0 -3
  672. package/docs/examples/tablesdb/list-row-logs.md +0 -4
  673. package/docs/examples/tablesdb/list-rows.md +0 -3
  674. package/docs/examples/tablesdb/list-table-logs.md +0 -3
  675. package/docs/examples/tablesdb/list-tables.md +0 -2
  676. package/docs/examples/tablesdb/list-transactions.md +0 -1
  677. package/docs/examples/tablesdb/list-usage.md +0 -1
  678. package/docs/examples/tablesdb/list.md +0 -1
  679. package/docs/examples/tablesdb/update-boolean-column.md +0 -6
  680. package/docs/examples/tablesdb/update-datetime-column.md +0 -6
  681. package/docs/examples/tablesdb/update-email-column.md +0 -6
  682. package/docs/examples/tablesdb/update-enum-column.md +0 -7
  683. package/docs/examples/tablesdb/update-float-column.md +0 -6
  684. package/docs/examples/tablesdb/update-integer-column.md +0 -6
  685. package/docs/examples/tablesdb/update-ip-column.md +0 -6
  686. package/docs/examples/tablesdb/update-line-column.md +0 -5
  687. package/docs/examples/tablesdb/update-point-column.md +0 -5
  688. package/docs/examples/tablesdb/update-polygon-column.md +0 -5
  689. package/docs/examples/tablesdb/update-relationship-column.md +0 -4
  690. package/docs/examples/tablesdb/update-row.md +0 -4
  691. package/docs/examples/tablesdb/update-rows.md +0 -3
  692. package/docs/examples/tablesdb/update-string-column.md +0 -6
  693. package/docs/examples/tablesdb/update-table.md +0 -4
  694. package/docs/examples/tablesdb/update-transaction.md +0 -2
  695. package/docs/examples/tablesdb/update-url-column.md +0 -6
  696. package/docs/examples/tablesdb/update.md +0 -3
  697. package/docs/examples/tablesdb/upsert-row.md +0 -4
  698. package/docs/examples/tablesdb/upsert-rows.md +0 -4
  699. package/docs/examples/teams/create-membership.md +0 -3
  700. package/docs/examples/teams/create.md +0 -3
  701. package/docs/examples/teams/delete-membership.md +0 -3
  702. package/docs/examples/teams/delete.md +0 -2
  703. package/docs/examples/teams/get-membership.md +0 -3
  704. package/docs/examples/teams/get-prefs.md +0 -2
  705. package/docs/examples/teams/get.md +0 -2
  706. package/docs/examples/teams/list-logs.md +0 -2
  707. package/docs/examples/teams/list-memberships.md +0 -2
  708. package/docs/examples/teams/list.md +0 -1
  709. package/docs/examples/teams/update-membership-status.md +0 -5
  710. package/docs/examples/teams/update-membership.md +0 -4
  711. package/docs/examples/teams/update-name.md +0 -3
  712. package/docs/examples/teams/update-prefs.md +0 -3
  713. package/docs/examples/tokens/create-file-token.md +0 -3
  714. package/docs/examples/tokens/delete.md +0 -2
  715. package/docs/examples/tokens/get.md +0 -2
  716. package/docs/examples/tokens/list.md +0 -3
  717. package/docs/examples/tokens/update.md +0 -2
  718. package/docs/examples/users/create-argon-2-user.md +0 -4
  719. package/docs/examples/users/create-bcrypt-user.md +0 -4
  720. package/docs/examples/users/create-jwt.md +0 -2
  721. package/docs/examples/users/create-md-5-user.md +0 -4
  722. package/docs/examples/users/create-mfa-recovery-codes.md +0 -2
  723. package/docs/examples/users/create-ph-pass-user.md +0 -4
  724. package/docs/examples/users/create-scrypt-modified-user.md +0 -7
  725. package/docs/examples/users/create-scrypt-user.md +0 -9
  726. package/docs/examples/users/create-session.md +0 -2
  727. package/docs/examples/users/create-sha-user.md +0 -4
  728. package/docs/examples/users/create-target.md +0 -5
  729. package/docs/examples/users/create-token.md +0 -2
  730. package/docs/examples/users/create.md +0 -2
  731. package/docs/examples/users/delete-identity.md +0 -2
  732. package/docs/examples/users/delete-mfa-authenticator.md +0 -3
  733. package/docs/examples/users/delete-session.md +0 -3
  734. package/docs/examples/users/delete-sessions.md +0 -2
  735. package/docs/examples/users/delete-target.md +0 -3
  736. package/docs/examples/users/delete.md +0 -2
  737. package/docs/examples/users/get-mfa-recovery-codes.md +0 -2
  738. package/docs/examples/users/get-prefs.md +0 -2
  739. package/docs/examples/users/get-target.md +0 -3
  740. package/docs/examples/users/get-usage.md +0 -1
  741. package/docs/examples/users/get.md +0 -2
  742. package/docs/examples/users/list-identities.md +0 -1
  743. package/docs/examples/users/list-logs.md +0 -2
  744. package/docs/examples/users/list-memberships.md +0 -2
  745. package/docs/examples/users/list-mfa-factors.md +0 -2
  746. package/docs/examples/users/list-sessions.md +0 -2
  747. package/docs/examples/users/list-targets.md +0 -2
  748. package/docs/examples/users/list.md +0 -1
  749. package/docs/examples/users/update-email-verification.md +0 -3
  750. package/docs/examples/users/update-email.md +0 -3
  751. package/docs/examples/users/update-labels.md +0 -3
  752. package/docs/examples/users/update-mfa-recovery-codes.md +0 -2
  753. package/docs/examples/users/update-mfa.md +0 -3
  754. package/docs/examples/users/update-name.md +0 -3
  755. package/docs/examples/users/update-password.md +0 -3
  756. package/docs/examples/users/update-phone-verification.md +0 -3
  757. package/docs/examples/users/update-phone.md +0 -3
  758. package/docs/examples/users/update-prefs.md +0 -3
  759. package/docs/examples/users/update-status.md +0 -3
  760. package/docs/examples/users/update-target.md +0 -3
  761. package/docs/examples/vcs/create-repository-detection.md +0 -4
  762. package/docs/examples/vcs/create-repository.md +0 -4
  763. package/docs/examples/vcs/delete-installation.md +0 -2
  764. package/docs/examples/vcs/get-installation.md +0 -2
  765. package/docs/examples/vcs/get-repository-contents.md +0 -3
  766. package/docs/examples/vcs/get-repository.md +0 -3
  767. package/docs/examples/vcs/list-installations.md +0 -1
  768. package/docs/examples/vcs/list-repositories.md +0 -3
  769. package/docs/examples/vcs/list-repository-branches.md +0 -3
  770. package/docs/examples/vcs/update-external-deployments.md +0 -4
  771. package/index.js +0 -147
  772. package/lib/client.js +0 -254
  773. package/lib/commands/account.js +0 -2121
  774. package/lib/commands/console.js +0 -127
  775. package/lib/commands/databases.js +0 -3590
  776. package/lib/commands/functions.js +0 -1732
  777. package/lib/commands/generic.js +0 -330
  778. package/lib/commands/graphql.js +0 -126
  779. package/lib/commands/health.js +0 -869
  780. package/lib/commands/locale.js +0 -316
  781. package/lib/commands/messaging.js +0 -3116
  782. package/lib/commands/migrations.js +0 -830
  783. package/lib/commands/organizations.js +0 -48
  784. package/lib/commands/project.js +0 -302
  785. package/lib/commands/projects.js +0 -2626
  786. package/lib/commands/proxy.js +0 -403
  787. package/lib/commands/push.js +0 -2570
  788. package/lib/commands/sites.js +0 -1654
  789. package/lib/commands/storage.js +0 -995
  790. package/lib/commands/tables-db.js +0 -3569
  791. package/lib/commands/teams.js +0 -683
  792. package/lib/commands/tokens.js +0 -261
  793. package/lib/commands/types.js +0 -191
  794. package/lib/commands/users.js +0 -2022
  795. package/lib/commands/vcs.js +0 -484
  796. package/lib/emulation/docker.js +0 -264
  797. package/lib/exception.js +0 -9
  798. package/lib/parser.js +0 -250
  799. package/lib/sdks.js +0 -60
  800. package/lib/spinner.js +0 -104
  801. package/lib/validations.js +0 -17
@@ -1,3569 +0,0 @@
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} total When set to false, the total count returned will be 0 and will not be calculated.
47
- * @property {boolean} overrideForCli
48
- * @property {boolean} parseOutput
49
- * @property {libClient | undefined} sdk
50
- */
51
-
52
- /**
53
- * @param {TablesDBListRequestParams} params
54
- */
55
- const tablesDBList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
56
- let client = !sdk ? await sdkForProject() :
57
- sdk;
58
- let apiPath = '/tablesdb';
59
- let payload = {};
60
- if (typeof queries !== 'undefined') {
61
- payload['queries'] = queries;
62
- }
63
- if (typeof search !== 'undefined') {
64
- payload['search'] = search;
65
- }
66
- if (typeof total !== 'undefined') {
67
- payload['total'] = total;
68
- }
69
-
70
- let response = undefined;
71
-
72
- response = await client.call('get', apiPath, {
73
- }, payload);
74
-
75
- if (parseOutput) {
76
- if(console) {
77
- showConsoleLink('tablesDB', 'list');
78
- } else {
79
- parse(response)
80
- }
81
- }
82
-
83
- return response;
84
-
85
- }
86
- /**
87
- * @typedef {Object} TablesDBCreateRequestParams
88
- * @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.
89
- * @property {string} name Database name. Max length: 128 chars.
90
- * @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.
91
- * @property {boolean} overrideForCli
92
- * @property {boolean} parseOutput
93
- * @property {libClient | undefined} sdk
94
- */
95
-
96
- /**
97
- * @param {TablesDBCreateRequestParams} params
98
- */
99
- const tablesDBCreate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
100
- let client = !sdk ? await sdkForProject() :
101
- sdk;
102
- let apiPath = '/tablesdb';
103
- let payload = {};
104
- if (typeof databaseId !== 'undefined') {
105
- payload['databaseId'] = databaseId;
106
- }
107
- if (typeof name !== 'undefined') {
108
- payload['name'] = name;
109
- }
110
- if (typeof enabled !== 'undefined') {
111
- payload['enabled'] = enabled;
112
- }
113
-
114
- let response = undefined;
115
-
116
- response = await client.call('post', apiPath, {
117
- 'content-type': 'application/json',
118
- }, payload);
119
-
120
- if (parseOutput) {
121
- parse(response)
122
- }
123
-
124
- return response;
125
-
126
- }
127
- /**
128
- * @typedef {Object} TablesDBListTransactionsRequestParams
129
- * @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).
130
- * @property {boolean} overrideForCli
131
- * @property {boolean} parseOutput
132
- * @property {libClient | undefined} sdk
133
- */
134
-
135
- /**
136
- * @param {TablesDBListTransactionsRequestParams} params
137
- */
138
- const tablesDBListTransactions = async ({queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
139
- let client = !sdk ? await sdkForProject() :
140
- sdk;
141
- let apiPath = '/tablesdb/transactions';
142
- let payload = {};
143
- if (typeof queries !== 'undefined') {
144
- payload['queries'] = queries;
145
- }
146
-
147
- let response = undefined;
148
-
149
- response = await client.call('get', apiPath, {
150
- }, payload);
151
-
152
- if (parseOutput) {
153
- if(console) {
154
- showConsoleLink('tablesDB', 'listTransactions');
155
- } else {
156
- parse(response)
157
- }
158
- }
159
-
160
- return response;
161
-
162
- }
163
- /**
164
- * @typedef {Object} TablesDBCreateTransactionRequestParams
165
- * @property {number} ttl Seconds before the transaction expires.
166
- * @property {boolean} overrideForCli
167
- * @property {boolean} parseOutput
168
- * @property {libClient | undefined} sdk
169
- */
170
-
171
- /**
172
- * @param {TablesDBCreateTransactionRequestParams} params
173
- */
174
- const tablesDBCreateTransaction = async ({ttl,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
175
- let client = !sdk ? await sdkForProject() :
176
- sdk;
177
- let apiPath = '/tablesdb/transactions';
178
- let payload = {};
179
- if (typeof ttl !== 'undefined') {
180
- payload['ttl'] = ttl;
181
- }
182
-
183
- let response = undefined;
184
-
185
- response = await client.call('post', apiPath, {
186
- 'content-type': 'application/json',
187
- }, payload);
188
-
189
- if (parseOutput) {
190
- parse(response)
191
- }
192
-
193
- return response;
194
-
195
- }
196
- /**
197
- * @typedef {Object} TablesDBGetTransactionRequestParams
198
- * @property {string} transactionId Transaction ID.
199
- * @property {boolean} overrideForCli
200
- * @property {boolean} parseOutput
201
- * @property {libClient | undefined} sdk
202
- */
203
-
204
- /**
205
- * @param {TablesDBGetTransactionRequestParams} params
206
- */
207
- const tablesDBGetTransaction = async ({transactionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
208
- let client = !sdk ? await sdkForProject() :
209
- sdk;
210
- let apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId);
211
- let payload = {};
212
-
213
- let response = undefined;
214
-
215
- response = await client.call('get', apiPath, {
216
- }, payload);
217
-
218
- if (parseOutput) {
219
- if(console) {
220
- showConsoleLink('tablesDB', 'getTransaction', transactionId);
221
- } else {
222
- parse(response)
223
- }
224
- }
225
-
226
- return response;
227
-
228
- }
229
- /**
230
- * @typedef {Object} TablesDBUpdateTransactionRequestParams
231
- * @property {string} transactionId Transaction ID.
232
- * @property {boolean} commit Commit transaction?
233
- * @property {boolean} rollback Rollback transaction?
234
- * @property {boolean} overrideForCli
235
- * @property {boolean} parseOutput
236
- * @property {libClient | undefined} sdk
237
- */
238
-
239
- /**
240
- * @param {TablesDBUpdateTransactionRequestParams} params
241
- */
242
- const tablesDBUpdateTransaction = async ({transactionId,commit,rollback,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
243
- let client = !sdk ? await sdkForProject() :
244
- sdk;
245
- let apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId);
246
- let payload = {};
247
- if (typeof commit !== 'undefined') {
248
- payload['commit'] = commit;
249
- }
250
- if (typeof rollback !== 'undefined') {
251
- payload['rollback'] = rollback;
252
- }
253
-
254
- let response = undefined;
255
-
256
- response = await client.call('patch', apiPath, {
257
- 'content-type': 'application/json',
258
- }, payload);
259
-
260
- if (parseOutput) {
261
- parse(response)
262
- }
263
-
264
- return response;
265
-
266
- }
267
- /**
268
- * @typedef {Object} TablesDBDeleteTransactionRequestParams
269
- * @property {string} transactionId Transaction ID.
270
- * @property {boolean} overrideForCli
271
- * @property {boolean} parseOutput
272
- * @property {libClient | undefined} sdk
273
- */
274
-
275
- /**
276
- * @param {TablesDBDeleteTransactionRequestParams} params
277
- */
278
- const tablesDBDeleteTransaction = async ({transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
279
- let client = !sdk ? await sdkForProject() :
280
- sdk;
281
- let apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId);
282
- let payload = {};
283
-
284
- let response = undefined;
285
-
286
- response = await client.call('delete', apiPath, {
287
- 'content-type': 'application/json',
288
- }, payload);
289
-
290
- if (parseOutput) {
291
- parse(response)
292
- }
293
-
294
- return response;
295
-
296
- }
297
- /**
298
- * @typedef {Object} TablesDBCreateOperationsRequestParams
299
- * @property {string} transactionId Transaction ID.
300
- * @property {object[]} operations Array of staged operations.
301
- * @property {boolean} overrideForCli
302
- * @property {boolean} parseOutput
303
- * @property {libClient | undefined} sdk
304
- */
305
-
306
- /**
307
- * @param {TablesDBCreateOperationsRequestParams} params
308
- */
309
- const tablesDBCreateOperations = async ({transactionId,operations,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
310
- let client = !sdk ? await sdkForProject() :
311
- sdk;
312
- let apiPath = '/tablesdb/transactions/{transactionId}/operations'.replace('{transactionId}', transactionId);
313
- let payload = {};
314
- operations = operations === true ? [] : operations;
315
- if (typeof operations !== 'undefined') {
316
- payload['operations'] = operations;
317
- }
318
-
319
- let response = undefined;
320
-
321
- response = await client.call('post', apiPath, {
322
- 'content-type': 'application/json',
323
- }, payload);
324
-
325
- if (parseOutput) {
326
- parse(response)
327
- }
328
-
329
- return response;
330
-
331
- }
332
- /**
333
- * @typedef {Object} TablesDBListUsageRequestParams
334
- * @property {UsageRange} range Date range.
335
- * @property {boolean} overrideForCli
336
- * @property {boolean} parseOutput
337
- * @property {libClient | undefined} sdk
338
- */
339
-
340
- /**
341
- * @param {TablesDBListUsageRequestParams} params
342
- */
343
- const tablesDBListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
344
- let client = !sdk ? await sdkForProject() :
345
- sdk;
346
- let apiPath = '/tablesdb/usage';
347
- let payload = {};
348
- if (typeof range !== 'undefined') {
349
- payload['range'] = range;
350
- }
351
-
352
- let response = undefined;
353
-
354
- response = await client.call('get', apiPath, {
355
- }, payload);
356
-
357
- if (parseOutput) {
358
- if(console) {
359
- showConsoleLink('tablesDB', 'listUsage');
360
- } else {
361
- parse(response)
362
- }
363
- }
364
-
365
- return response;
366
-
367
- }
368
- /**
369
- * @typedef {Object} TablesDBGetRequestParams
370
- * @property {string} databaseId Database ID.
371
- * @property {boolean} overrideForCli
372
- * @property {boolean} parseOutput
373
- * @property {libClient | undefined} sdk
374
- */
375
-
376
- /**
377
- * @param {TablesDBGetRequestParams} params
378
- */
379
- const tablesDBGet = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
380
- let client = !sdk ? await sdkForProject() :
381
- sdk;
382
- let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId);
383
- let payload = {};
384
-
385
- let response = undefined;
386
-
387
- response = await client.call('get', apiPath, {
388
- }, payload);
389
-
390
- if (parseOutput) {
391
- if(console) {
392
- showConsoleLink('tablesDB', 'get', databaseId);
393
- } else {
394
- parse(response)
395
- }
396
- }
397
-
398
- return response;
399
-
400
- }
401
- /**
402
- * @typedef {Object} TablesDBUpdateRequestParams
403
- * @property {string} databaseId Database ID.
404
- * @property {string} name Database name. Max length: 128 chars.
405
- * @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.
406
- * @property {boolean} overrideForCli
407
- * @property {boolean} parseOutput
408
- * @property {libClient | undefined} sdk
409
- */
410
-
411
- /**
412
- * @param {TablesDBUpdateRequestParams} params
413
- */
414
- const tablesDBUpdate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
415
- let client = !sdk ? await sdkForProject() :
416
- sdk;
417
- let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId);
418
- let payload = {};
419
- if (typeof name !== 'undefined') {
420
- payload['name'] = name;
421
- }
422
- if (typeof enabled !== 'undefined') {
423
- payload['enabled'] = enabled;
424
- }
425
-
426
- let response = undefined;
427
-
428
- response = await client.call('put', apiPath, {
429
- 'content-type': 'application/json',
430
- }, payload);
431
-
432
- if (parseOutput) {
433
- parse(response)
434
- }
435
-
436
- return response;
437
-
438
- }
439
- /**
440
- * @typedef {Object} TablesDBDeleteRequestParams
441
- * @property {string} databaseId Database ID.
442
- * @property {boolean} overrideForCli
443
- * @property {boolean} parseOutput
444
- * @property {libClient | undefined} sdk
445
- */
446
-
447
- /**
448
- * @param {TablesDBDeleteRequestParams} params
449
- */
450
- const tablesDBDelete = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
451
- let client = !sdk ? await sdkForProject() :
452
- sdk;
453
- let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId);
454
- let payload = {};
455
-
456
- let response = undefined;
457
-
458
- response = await client.call('delete', apiPath, {
459
- 'content-type': 'application/json',
460
- }, payload);
461
-
462
- if (parseOutput) {
463
- parse(response)
464
- }
465
-
466
- return response;
467
-
468
- }
469
- /**
470
- * @typedef {Object} TablesDBListTablesRequestParams
471
- * @property {string} databaseId Database ID.
472
- * @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
473
- * @property {string} search Search term to filter your list results. Max length: 256 chars.
474
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
475
- * @property {boolean} overrideForCli
476
- * @property {boolean} parseOutput
477
- * @property {libClient | undefined} sdk
478
- */
479
-
480
- /**
481
- * @param {TablesDBListTablesRequestParams} params
482
- */
483
- const tablesDBListTables = async ({databaseId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
484
- let client = !sdk ? await sdkForProject() :
485
- sdk;
486
- let apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId);
487
- let payload = {};
488
- if (typeof queries !== 'undefined') {
489
- payload['queries'] = queries;
490
- }
491
- if (typeof search !== 'undefined') {
492
- payload['search'] = search;
493
- }
494
- if (typeof total !== 'undefined') {
495
- payload['total'] = total;
496
- }
497
-
498
- let response = undefined;
499
-
500
- response = await client.call('get', apiPath, {
501
- }, payload);
502
-
503
- if (parseOutput) {
504
- if(console) {
505
- showConsoleLink('tablesDB', 'listTables', databaseId);
506
- } else {
507
- parse(response)
508
- }
509
- }
510
-
511
- return response;
512
-
513
- }
514
- /**
515
- * @typedef {Object} TablesDBCreateTableRequestParams
516
- * @property {string} databaseId Database ID.
517
- * @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.
518
- * @property {string} name Table name. Max length: 128 chars.
519
- * @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).
520
- * @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).
521
- * @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.
522
- * @property {boolean} overrideForCli
523
- * @property {boolean} parseOutput
524
- * @property {libClient | undefined} sdk
525
- */
526
-
527
- /**
528
- * @param {TablesDBCreateTableRequestParams} params
529
- */
530
- const tablesDBCreateTable = async ({databaseId,tableId,name,permissions,rowSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
531
- let client = !sdk ? await sdkForProject() :
532
- sdk;
533
- let apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId);
534
- let payload = {};
535
- if (typeof tableId !== 'undefined') {
536
- payload['tableId'] = tableId;
537
- }
538
- if (typeof name !== 'undefined') {
539
- payload['name'] = name;
540
- }
541
- permissions = permissions === true ? [] : permissions;
542
- if (typeof permissions !== 'undefined') {
543
- payload['permissions'] = permissions;
544
- }
545
- if (typeof rowSecurity !== 'undefined') {
546
- payload['rowSecurity'] = rowSecurity;
547
- }
548
- if (typeof enabled !== 'undefined') {
549
- payload['enabled'] = enabled;
550
- }
551
-
552
- let response = undefined;
553
-
554
- response = await client.call('post', apiPath, {
555
- 'content-type': 'application/json',
556
- }, payload);
557
-
558
- if (parseOutput) {
559
- parse(response)
560
- }
561
-
562
- return response;
563
-
564
- }
565
- /**
566
- * @typedef {Object} TablesDBGetTableRequestParams
567
- * @property {string} databaseId Database ID.
568
- * @property {string} tableId Table ID.
569
- * @property {boolean} overrideForCli
570
- * @property {boolean} parseOutput
571
- * @property {libClient | undefined} sdk
572
- */
573
-
574
- /**
575
- * @param {TablesDBGetTableRequestParams} params
576
- */
577
- const tablesDBGetTable = async ({databaseId,tableId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
578
- let client = !sdk ? await sdkForProject() :
579
- sdk;
580
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
581
- let payload = {};
582
-
583
- let response = undefined;
584
-
585
- response = await client.call('get', apiPath, {
586
- }, payload);
587
-
588
- if (parseOutput) {
589
- if(console) {
590
- showConsoleLink('tablesDB', 'getTable', databaseId, tableId);
591
- } else {
592
- parse(response)
593
- }
594
- }
595
-
596
- return response;
597
-
598
- }
599
- /**
600
- * @typedef {Object} TablesDBUpdateTableRequestParams
601
- * @property {string} databaseId Database ID.
602
- * @property {string} tableId Table ID.
603
- * @property {string} name Table name. Max length: 128 chars.
604
- * @property {string[]} permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
605
- * @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).
606
- * @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.
607
- * @property {boolean} overrideForCli
608
- * @property {boolean} parseOutput
609
- * @property {libClient | undefined} sdk
610
- */
611
-
612
- /**
613
- * @param {TablesDBUpdateTableRequestParams} params
614
- */
615
- const tablesDBUpdateTable = async ({databaseId,tableId,name,permissions,rowSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
616
- let client = !sdk ? await sdkForProject() :
617
- sdk;
618
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
619
- let payload = {};
620
- if (typeof name !== 'undefined') {
621
- payload['name'] = name;
622
- }
623
- permissions = permissions === true ? [] : permissions;
624
- if (typeof permissions !== 'undefined') {
625
- payload['permissions'] = permissions;
626
- }
627
- if (typeof rowSecurity !== 'undefined') {
628
- payload['rowSecurity'] = rowSecurity;
629
- }
630
- if (typeof enabled !== 'undefined') {
631
- payload['enabled'] = enabled;
632
- }
633
-
634
- let response = undefined;
635
-
636
- response = await client.call('put', apiPath, {
637
- 'content-type': 'application/json',
638
- }, payload);
639
-
640
- if (parseOutput) {
641
- parse(response)
642
- }
643
-
644
- return response;
645
-
646
- }
647
- /**
648
- * @typedef {Object} TablesDBDeleteTableRequestParams
649
- * @property {string} databaseId Database ID.
650
- * @property {string} tableId Table ID.
651
- * @property {boolean} overrideForCli
652
- * @property {boolean} parseOutput
653
- * @property {libClient | undefined} sdk
654
- */
655
-
656
- /**
657
- * @param {TablesDBDeleteTableRequestParams} params
658
- */
659
- const tablesDBDeleteTable = async ({databaseId,tableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
660
- let client = !sdk ? await sdkForProject() :
661
- sdk;
662
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
663
- let payload = {};
664
-
665
- let response = undefined;
666
-
667
- response = await client.call('delete', apiPath, {
668
- 'content-type': 'application/json',
669
- }, payload);
670
-
671
- if (parseOutput) {
672
- parse(response)
673
- }
674
-
675
- return response;
676
-
677
- }
678
- /**
679
- * @typedef {Object} TablesDBListColumnsRequestParams
680
- * @property {string} databaseId Database ID.
681
- * @property {string} tableId Table ID.
682
- * @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
683
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
684
- * @property {boolean} overrideForCli
685
- * @property {boolean} parseOutput
686
- * @property {libClient | undefined} sdk
687
- */
688
-
689
- /**
690
- * @param {TablesDBListColumnsRequestParams} params
691
- */
692
- const tablesDBListColumns = async ({databaseId,tableId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
693
- let client = !sdk ? await sdkForProject() :
694
- sdk;
695
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
696
- let payload = {};
697
- if (typeof queries !== 'undefined') {
698
- payload['queries'] = queries;
699
- }
700
- if (typeof total !== 'undefined') {
701
- payload['total'] = total;
702
- }
703
-
704
- let response = undefined;
705
-
706
- response = await client.call('get', apiPath, {
707
- }, payload);
708
-
709
- if (parseOutput) {
710
- if(console) {
711
- showConsoleLink('tablesDB', 'listColumns', databaseId, tableId);
712
- } else {
713
- parse(response)
714
- }
715
- }
716
-
717
- return response;
718
-
719
- }
720
- /**
721
- * @typedef {Object} TablesDBCreateBooleanColumnRequestParams
722
- * @property {string} databaseId Database ID.
723
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
724
- * @property {string} key Column Key.
725
- * @property {boolean} required Is column required?
726
- * @property {boolean} xdefault Default value for column when not provided. Cannot be set when column is required.
727
- * @property {boolean} array Is column an array?
728
- * @property {boolean} overrideForCli
729
- * @property {boolean} parseOutput
730
- * @property {libClient | undefined} sdk
731
- */
732
-
733
- /**
734
- * @param {TablesDBCreateBooleanColumnRequestParams} params
735
- */
736
- const tablesDBCreateBooleanColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
737
- let client = !sdk ? await sdkForProject() :
738
- sdk;
739
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
740
- let payload = {};
741
- if (typeof key !== 'undefined') {
742
- payload['key'] = key;
743
- }
744
- if (typeof required !== 'undefined') {
745
- payload['required'] = required;
746
- }
747
- if (typeof xdefault !== 'undefined') {
748
- payload['default'] = xdefault;
749
- }
750
- if (typeof array !== 'undefined') {
751
- payload['array'] = array;
752
- }
753
-
754
- let response = undefined;
755
-
756
- response = await client.call('post', apiPath, {
757
- 'content-type': 'application/json',
758
- }, payload);
759
-
760
- if (parseOutput) {
761
- parse(response)
762
- }
763
-
764
- return response;
765
-
766
- }
767
- /**
768
- * @typedef {Object} TablesDBUpdateBooleanColumnRequestParams
769
- * @property {string} databaseId Database ID.
770
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
771
- * @property {string} key Column Key.
772
- * @property {boolean} required Is column required?
773
- * @property {boolean} xdefault Default value for column when not provided. Cannot be set when column is required.
774
- * @property {string} newKey New Column Key.
775
- * @property {boolean} overrideForCli
776
- * @property {boolean} parseOutput
777
- * @property {libClient | undefined} sdk
778
- */
779
-
780
- /**
781
- * @param {TablesDBUpdateBooleanColumnRequestParams} params
782
- */
783
- const tablesDBUpdateBooleanColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
784
- let client = !sdk ? await sdkForProject() :
785
- sdk;
786
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
787
- let payload = {};
788
- if (typeof required !== 'undefined') {
789
- payload['required'] = required;
790
- }
791
- if (typeof xdefault !== 'undefined') {
792
- payload['default'] = xdefault;
793
- }
794
- if (typeof newKey !== 'undefined') {
795
- payload['newKey'] = newKey;
796
- }
797
-
798
- let response = undefined;
799
-
800
- response = await client.call('patch', apiPath, {
801
- 'content-type': 'application/json',
802
- }, payload);
803
-
804
- if (parseOutput) {
805
- parse(response)
806
- }
807
-
808
- return response;
809
-
810
- }
811
- /**
812
- * @typedef {Object} TablesDBCreateDatetimeColumnRequestParams
813
- * @property {string} databaseId Database ID.
814
- * @property {string} tableId Table ID.
815
- * @property {string} key Column Key.
816
- * @property {boolean} required Is column required?
817
- * @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.
818
- * @property {boolean} array Is column an array?
819
- * @property {boolean} overrideForCli
820
- * @property {boolean} parseOutput
821
- * @property {libClient | undefined} sdk
822
- */
823
-
824
- /**
825
- * @param {TablesDBCreateDatetimeColumnRequestParams} params
826
- */
827
- const tablesDBCreateDatetimeColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
828
- let client = !sdk ? await sdkForProject() :
829
- sdk;
830
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
831
- let payload = {};
832
- if (typeof key !== 'undefined') {
833
- payload['key'] = key;
834
- }
835
- if (typeof required !== 'undefined') {
836
- payload['required'] = required;
837
- }
838
- if (typeof xdefault !== 'undefined') {
839
- payload['default'] = xdefault;
840
- }
841
- if (typeof array !== 'undefined') {
842
- payload['array'] = array;
843
- }
844
-
845
- let response = undefined;
846
-
847
- response = await client.call('post', apiPath, {
848
- 'content-type': 'application/json',
849
- }, payload);
850
-
851
- if (parseOutput) {
852
- parse(response)
853
- }
854
-
855
- return response;
856
-
857
- }
858
- /**
859
- * @typedef {Object} TablesDBUpdateDatetimeColumnRequestParams
860
- * @property {string} databaseId Database ID.
861
- * @property {string} tableId Table ID.
862
- * @property {string} key Column Key.
863
- * @property {boolean} required Is column required?
864
- * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
865
- * @property {string} newKey New Column Key.
866
- * @property {boolean} overrideForCli
867
- * @property {boolean} parseOutput
868
- * @property {libClient | undefined} sdk
869
- */
870
-
871
- /**
872
- * @param {TablesDBUpdateDatetimeColumnRequestParams} params
873
- */
874
- const tablesDBUpdateDatetimeColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
875
- let client = !sdk ? await sdkForProject() :
876
- sdk;
877
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
878
- let payload = {};
879
- if (typeof required !== 'undefined') {
880
- payload['required'] = required;
881
- }
882
- if (typeof xdefault !== 'undefined') {
883
- payload['default'] = xdefault;
884
- }
885
- if (typeof newKey !== 'undefined') {
886
- payload['newKey'] = newKey;
887
- }
888
-
889
- let response = undefined;
890
-
891
- response = await client.call('patch', apiPath, {
892
- 'content-type': 'application/json',
893
- }, payload);
894
-
895
- if (parseOutput) {
896
- parse(response)
897
- }
898
-
899
- return response;
900
-
901
- }
902
- /**
903
- * @typedef {Object} TablesDBCreateEmailColumnRequestParams
904
- * @property {string} databaseId Database ID.
905
- * @property {string} tableId Table ID.
906
- * @property {string} key Column Key.
907
- * @property {boolean} required Is column required?
908
- * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
909
- * @property {boolean} array Is column an array?
910
- * @property {boolean} overrideForCli
911
- * @property {boolean} parseOutput
912
- * @property {libClient | undefined} sdk
913
- */
914
-
915
- /**
916
- * @param {TablesDBCreateEmailColumnRequestParams} params
917
- */
918
- const tablesDBCreateEmailColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
919
- let client = !sdk ? await sdkForProject() :
920
- sdk;
921
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
922
- let payload = {};
923
- if (typeof key !== 'undefined') {
924
- payload['key'] = key;
925
- }
926
- if (typeof required !== 'undefined') {
927
- payload['required'] = required;
928
- }
929
- if (typeof xdefault !== 'undefined') {
930
- payload['default'] = xdefault;
931
- }
932
- if (typeof array !== 'undefined') {
933
- payload['array'] = array;
934
- }
935
-
936
- let response = undefined;
937
-
938
- response = await client.call('post', apiPath, {
939
- 'content-type': 'application/json',
940
- }, payload);
941
-
942
- if (parseOutput) {
943
- parse(response)
944
- }
945
-
946
- return response;
947
-
948
- }
949
- /**
950
- * @typedef {Object} TablesDBUpdateEmailColumnRequestParams
951
- * @property {string} databaseId Database ID.
952
- * @property {string} tableId Table ID.
953
- * @property {string} key Column Key.
954
- * @property {boolean} required Is column required?
955
- * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
956
- * @property {string} newKey New Column Key.
957
- * @property {boolean} overrideForCli
958
- * @property {boolean} parseOutput
959
- * @property {libClient | undefined} sdk
960
- */
961
-
962
- /**
963
- * @param {TablesDBUpdateEmailColumnRequestParams} params
964
- */
965
- const tablesDBUpdateEmailColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
966
- let client = !sdk ? await sdkForProject() :
967
- sdk;
968
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
969
- let payload = {};
970
- if (typeof required !== 'undefined') {
971
- payload['required'] = required;
972
- }
973
- if (typeof xdefault !== 'undefined') {
974
- payload['default'] = xdefault;
975
- }
976
- if (typeof newKey !== 'undefined') {
977
- payload['newKey'] = newKey;
978
- }
979
-
980
- let response = undefined;
981
-
982
- response = await client.call('patch', apiPath, {
983
- 'content-type': 'application/json',
984
- }, payload);
985
-
986
- if (parseOutput) {
987
- parse(response)
988
- }
989
-
990
- return response;
991
-
992
- }
993
- /**
994
- * @typedef {Object} TablesDBCreateEnumColumnRequestParams
995
- * @property {string} databaseId Database ID.
996
- * @property {string} tableId Table ID.
997
- * @property {string} key Column Key.
998
- * @property {string[]} elements Array of enum values.
999
- * @property {boolean} required Is column required?
1000
- * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
1001
- * @property {boolean} array Is column an array?
1002
- * @property {boolean} overrideForCli
1003
- * @property {boolean} parseOutput
1004
- * @property {libClient | undefined} sdk
1005
- */
1006
-
1007
- /**
1008
- * @param {TablesDBCreateEnumColumnRequestParams} params
1009
- */
1010
- const tablesDBCreateEnumColumn = async ({databaseId,tableId,key,elements,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1011
- let client = !sdk ? await sdkForProject() :
1012
- sdk;
1013
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1014
- let payload = {};
1015
- if (typeof key !== 'undefined') {
1016
- payload['key'] = key;
1017
- }
1018
- elements = elements === true ? [] : elements;
1019
- if (typeof elements !== 'undefined') {
1020
- payload['elements'] = elements;
1021
- }
1022
- if (typeof required !== 'undefined') {
1023
- payload['required'] = required;
1024
- }
1025
- if (typeof xdefault !== 'undefined') {
1026
- payload['default'] = xdefault;
1027
- }
1028
- if (typeof array !== 'undefined') {
1029
- payload['array'] = array;
1030
- }
1031
-
1032
- let response = undefined;
1033
-
1034
- response = await client.call('post', apiPath, {
1035
- 'content-type': 'application/json',
1036
- }, payload);
1037
-
1038
- if (parseOutput) {
1039
- parse(response)
1040
- }
1041
-
1042
- return response;
1043
-
1044
- }
1045
- /**
1046
- * @typedef {Object} TablesDBUpdateEnumColumnRequestParams
1047
- * @property {string} databaseId Database ID.
1048
- * @property {string} tableId Table ID.
1049
- * @property {string} key Column Key.
1050
- * @property {string[]} elements Updated list of enum values.
1051
- * @property {boolean} required Is column required?
1052
- * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
1053
- * @property {string} newKey New Column Key.
1054
- * @property {boolean} overrideForCli
1055
- * @property {boolean} parseOutput
1056
- * @property {libClient | undefined} sdk
1057
- */
1058
-
1059
- /**
1060
- * @param {TablesDBUpdateEnumColumnRequestParams} params
1061
- */
1062
- const tablesDBUpdateEnumColumn = async ({databaseId,tableId,key,elements,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1063
- let client = !sdk ? await sdkForProject() :
1064
- sdk;
1065
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1066
- let payload = {};
1067
- elements = elements === true ? [] : elements;
1068
- if (typeof elements !== 'undefined') {
1069
- payload['elements'] = elements;
1070
- }
1071
- if (typeof required !== 'undefined') {
1072
- payload['required'] = required;
1073
- }
1074
- if (typeof xdefault !== 'undefined') {
1075
- payload['default'] = xdefault;
1076
- }
1077
- if (typeof newKey !== 'undefined') {
1078
- payload['newKey'] = newKey;
1079
- }
1080
-
1081
- let response = undefined;
1082
-
1083
- response = await client.call('patch', apiPath, {
1084
- 'content-type': 'application/json',
1085
- }, payload);
1086
-
1087
- if (parseOutput) {
1088
- parse(response)
1089
- }
1090
-
1091
- return response;
1092
-
1093
- }
1094
- /**
1095
- * @typedef {Object} TablesDBCreateFloatColumnRequestParams
1096
- * @property {string} databaseId Database ID.
1097
- * @property {string} tableId Table ID.
1098
- * @property {string} key Column Key.
1099
- * @property {boolean} required Is column required?
1100
- * @property {number} min Minimum value
1101
- * @property {number} max Maximum value
1102
- * @property {number} xdefault Default value. Cannot be set when required.
1103
- * @property {boolean} array Is column an array?
1104
- * @property {boolean} overrideForCli
1105
- * @property {boolean} parseOutput
1106
- * @property {libClient | undefined} sdk
1107
- */
1108
-
1109
- /**
1110
- * @param {TablesDBCreateFloatColumnRequestParams} params
1111
- */
1112
- const tablesDBCreateFloatColumn = async ({databaseId,tableId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1113
- let client = !sdk ? await sdkForProject() :
1114
- sdk;
1115
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1116
- let payload = {};
1117
- if (typeof key !== 'undefined') {
1118
- payload['key'] = key;
1119
- }
1120
- if (typeof required !== 'undefined') {
1121
- payload['required'] = required;
1122
- }
1123
- if (typeof min !== 'undefined') {
1124
- payload['min'] = min;
1125
- }
1126
- if (typeof max !== 'undefined') {
1127
- payload['max'] = max;
1128
- }
1129
- if (typeof xdefault !== 'undefined') {
1130
- payload['default'] = xdefault;
1131
- }
1132
- if (typeof array !== 'undefined') {
1133
- payload['array'] = array;
1134
- }
1135
-
1136
- let response = undefined;
1137
-
1138
- response = await client.call('post', apiPath, {
1139
- 'content-type': 'application/json',
1140
- }, payload);
1141
-
1142
- if (parseOutput) {
1143
- parse(response)
1144
- }
1145
-
1146
- return response;
1147
-
1148
- }
1149
- /**
1150
- * @typedef {Object} TablesDBUpdateFloatColumnRequestParams
1151
- * @property {string} databaseId Database ID.
1152
- * @property {string} tableId Table ID.
1153
- * @property {string} key Column Key.
1154
- * @property {boolean} required Is column required?
1155
- * @property {number} xdefault Default value. Cannot be set when required.
1156
- * @property {number} min Minimum value
1157
- * @property {number} max Maximum value
1158
- * @property {string} newKey New Column Key.
1159
- * @property {boolean} overrideForCli
1160
- * @property {boolean} parseOutput
1161
- * @property {libClient | undefined} sdk
1162
- */
1163
-
1164
- /**
1165
- * @param {TablesDBUpdateFloatColumnRequestParams} params
1166
- */
1167
- const tablesDBUpdateFloatColumn = async ({databaseId,tableId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1168
- let client = !sdk ? await sdkForProject() :
1169
- sdk;
1170
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1171
- let payload = {};
1172
- if (typeof required !== 'undefined') {
1173
- payload['required'] = required;
1174
- }
1175
- if (typeof min !== 'undefined') {
1176
- payload['min'] = min;
1177
- }
1178
- if (typeof max !== 'undefined') {
1179
- payload['max'] = max;
1180
- }
1181
- if (typeof xdefault !== 'undefined') {
1182
- payload['default'] = xdefault;
1183
- }
1184
- if (typeof newKey !== 'undefined') {
1185
- payload['newKey'] = newKey;
1186
- }
1187
-
1188
- let response = undefined;
1189
-
1190
- response = await client.call('patch', apiPath, {
1191
- 'content-type': 'application/json',
1192
- }, payload);
1193
-
1194
- if (parseOutput) {
1195
- parse(response)
1196
- }
1197
-
1198
- return response;
1199
-
1200
- }
1201
- /**
1202
- * @typedef {Object} TablesDBCreateIntegerColumnRequestParams
1203
- * @property {string} databaseId Database ID.
1204
- * @property {string} tableId Table ID.
1205
- * @property {string} key Column Key.
1206
- * @property {boolean} required Is column required?
1207
- * @property {number} min Minimum value
1208
- * @property {number} max Maximum value
1209
- * @property {number} xdefault Default value. Cannot be set when column is required.
1210
- * @property {boolean} array Is column an array?
1211
- * @property {boolean} overrideForCli
1212
- * @property {boolean} parseOutput
1213
- * @property {libClient | undefined} sdk
1214
- */
1215
-
1216
- /**
1217
- * @param {TablesDBCreateIntegerColumnRequestParams} params
1218
- */
1219
- const tablesDBCreateIntegerColumn = async ({databaseId,tableId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1220
- let client = !sdk ? await sdkForProject() :
1221
- sdk;
1222
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1223
- let payload = {};
1224
- if (typeof key !== 'undefined') {
1225
- payload['key'] = key;
1226
- }
1227
- if (typeof required !== 'undefined') {
1228
- payload['required'] = required;
1229
- }
1230
- if (typeof min !== 'undefined') {
1231
- payload['min'] = min;
1232
- }
1233
- if (typeof max !== 'undefined') {
1234
- payload['max'] = max;
1235
- }
1236
- if (typeof xdefault !== 'undefined') {
1237
- payload['default'] = xdefault;
1238
- }
1239
- if (typeof array !== 'undefined') {
1240
- payload['array'] = array;
1241
- }
1242
-
1243
- let response = undefined;
1244
-
1245
- response = await client.call('post', apiPath, {
1246
- 'content-type': 'application/json',
1247
- }, payload);
1248
-
1249
- if (parseOutput) {
1250
- parse(response)
1251
- }
1252
-
1253
- return response;
1254
-
1255
- }
1256
- /**
1257
- * @typedef {Object} TablesDBUpdateIntegerColumnRequestParams
1258
- * @property {string} databaseId Database ID.
1259
- * @property {string} tableId Table ID.
1260
- * @property {string} key Column Key.
1261
- * @property {boolean} required Is column required?
1262
- * @property {number} xdefault Default value. Cannot be set when column is required.
1263
- * @property {number} min Minimum value
1264
- * @property {number} max Maximum value
1265
- * @property {string} newKey New Column Key.
1266
- * @property {boolean} overrideForCli
1267
- * @property {boolean} parseOutput
1268
- * @property {libClient | undefined} sdk
1269
- */
1270
-
1271
- /**
1272
- * @param {TablesDBUpdateIntegerColumnRequestParams} params
1273
- */
1274
- const tablesDBUpdateIntegerColumn = async ({databaseId,tableId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1275
- let client = !sdk ? await sdkForProject() :
1276
- sdk;
1277
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1278
- let payload = {};
1279
- if (typeof required !== 'undefined') {
1280
- payload['required'] = required;
1281
- }
1282
- if (typeof min !== 'undefined') {
1283
- payload['min'] = min;
1284
- }
1285
- if (typeof max !== 'undefined') {
1286
- payload['max'] = max;
1287
- }
1288
- if (typeof xdefault !== 'undefined') {
1289
- payload['default'] = xdefault;
1290
- }
1291
- if (typeof newKey !== 'undefined') {
1292
- payload['newKey'] = newKey;
1293
- }
1294
-
1295
- let response = undefined;
1296
-
1297
- response = await client.call('patch', apiPath, {
1298
- 'content-type': 'application/json',
1299
- }, payload);
1300
-
1301
- if (parseOutput) {
1302
- parse(response)
1303
- }
1304
-
1305
- return response;
1306
-
1307
- }
1308
- /**
1309
- * @typedef {Object} TablesDBCreateIpColumnRequestParams
1310
- * @property {string} databaseId Database ID.
1311
- * @property {string} tableId Table ID.
1312
- * @property {string} key Column Key.
1313
- * @property {boolean} required Is column required?
1314
- * @property {string} xdefault Default value. Cannot be set when column is required.
1315
- * @property {boolean} array Is column an array?
1316
- * @property {boolean} overrideForCli
1317
- * @property {boolean} parseOutput
1318
- * @property {libClient | undefined} sdk
1319
- */
1320
-
1321
- /**
1322
- * @param {TablesDBCreateIpColumnRequestParams} params
1323
- */
1324
- const tablesDBCreateIpColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1325
- let client = !sdk ? await sdkForProject() :
1326
- sdk;
1327
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1328
- let payload = {};
1329
- if (typeof key !== 'undefined') {
1330
- payload['key'] = key;
1331
- }
1332
- if (typeof required !== 'undefined') {
1333
- payload['required'] = required;
1334
- }
1335
- if (typeof xdefault !== 'undefined') {
1336
- payload['default'] = xdefault;
1337
- }
1338
- if (typeof array !== 'undefined') {
1339
- payload['array'] = array;
1340
- }
1341
-
1342
- let response = undefined;
1343
-
1344
- response = await client.call('post', apiPath, {
1345
- 'content-type': 'application/json',
1346
- }, payload);
1347
-
1348
- if (parseOutput) {
1349
- parse(response)
1350
- }
1351
-
1352
- return response;
1353
-
1354
- }
1355
- /**
1356
- * @typedef {Object} TablesDBUpdateIpColumnRequestParams
1357
- * @property {string} databaseId Database ID.
1358
- * @property {string} tableId Table ID.
1359
- * @property {string} key Column Key.
1360
- * @property {boolean} required Is column required?
1361
- * @property {string} xdefault Default value. Cannot be set when column is required.
1362
- * @property {string} newKey New Column Key.
1363
- * @property {boolean} overrideForCli
1364
- * @property {boolean} parseOutput
1365
- * @property {libClient | undefined} sdk
1366
- */
1367
-
1368
- /**
1369
- * @param {TablesDBUpdateIpColumnRequestParams} params
1370
- */
1371
- const tablesDBUpdateIpColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1372
- let client = !sdk ? await sdkForProject() :
1373
- sdk;
1374
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1375
- let payload = {};
1376
- if (typeof required !== 'undefined') {
1377
- payload['required'] = required;
1378
- }
1379
- if (typeof xdefault !== 'undefined') {
1380
- payload['default'] = xdefault;
1381
- }
1382
- if (typeof newKey !== 'undefined') {
1383
- payload['newKey'] = newKey;
1384
- }
1385
-
1386
- let response = undefined;
1387
-
1388
- response = await client.call('patch', apiPath, {
1389
- 'content-type': 'application/json',
1390
- }, payload);
1391
-
1392
- if (parseOutput) {
1393
- parse(response)
1394
- }
1395
-
1396
- return response;
1397
-
1398
- }
1399
- /**
1400
- * @typedef {Object} TablesDBCreateLineColumnRequestParams
1401
- * @property {string} databaseId Database ID.
1402
- * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1403
- * @property {string} key Column Key.
1404
- * @property {boolean} required Is column required?
1405
- * @property {any[]} xdefault Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.
1406
- * @property {boolean} overrideForCli
1407
- * @property {boolean} parseOutput
1408
- * @property {libClient | undefined} sdk
1409
- */
1410
-
1411
- /**
1412
- * @param {TablesDBCreateLineColumnRequestParams} params
1413
- */
1414
- const tablesDBCreateLineColumn = async ({databaseId,tableId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1415
- let client = !sdk ? await sdkForProject() :
1416
- sdk;
1417
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/line'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1418
- let payload = {};
1419
- if (typeof key !== 'undefined') {
1420
- payload['key'] = key;
1421
- }
1422
- if (typeof required !== 'undefined') {
1423
- payload['required'] = required;
1424
- }
1425
- xdefault = xdefault === true ? [] : xdefault;
1426
- if (typeof xdefault !== 'undefined') {
1427
- payload['default'] = xdefault;
1428
- }
1429
-
1430
- let response = undefined;
1431
-
1432
- response = await client.call('post', apiPath, {
1433
- 'content-type': 'application/json',
1434
- }, payload);
1435
-
1436
- if (parseOutput) {
1437
- parse(response)
1438
- }
1439
-
1440
- return response;
1441
-
1442
- }
1443
- /**
1444
- * @typedef {Object} TablesDBUpdateLineColumnRequestParams
1445
- * @property {string} databaseId Database ID.
1446
- * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1447
- * @property {string} key Column Key.
1448
- * @property {boolean} required Is column required?
1449
- * @property {any[]} xdefault Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.
1450
- * @property {string} newKey New Column Key.
1451
- * @property {boolean} overrideForCli
1452
- * @property {boolean} parseOutput
1453
- * @property {libClient | undefined} sdk
1454
- */
1455
-
1456
- /**
1457
- * @param {TablesDBUpdateLineColumnRequestParams} params
1458
- */
1459
- const tablesDBUpdateLineColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1460
- let client = !sdk ? await sdkForProject() :
1461
- sdk;
1462
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1463
- let payload = {};
1464
- if (typeof required !== 'undefined') {
1465
- payload['required'] = required;
1466
- }
1467
- xdefault = xdefault === true ? [] : xdefault;
1468
- if (typeof xdefault !== 'undefined') {
1469
- payload['default'] = xdefault;
1470
- }
1471
- if (typeof newKey !== 'undefined') {
1472
- payload['newKey'] = newKey;
1473
- }
1474
-
1475
- let response = undefined;
1476
-
1477
- response = await client.call('patch', apiPath, {
1478
- 'content-type': 'application/json',
1479
- }, payload);
1480
-
1481
- if (parseOutput) {
1482
- parse(response)
1483
- }
1484
-
1485
- return response;
1486
-
1487
- }
1488
- /**
1489
- * @typedef {Object} TablesDBCreatePointColumnRequestParams
1490
- * @property {string} databaseId Database ID.
1491
- * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1492
- * @property {string} key Column Key.
1493
- * @property {boolean} required Is column required?
1494
- * @property {any[]} xdefault Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.
1495
- * @property {boolean} overrideForCli
1496
- * @property {boolean} parseOutput
1497
- * @property {libClient | undefined} sdk
1498
- */
1499
-
1500
- /**
1501
- * @param {TablesDBCreatePointColumnRequestParams} params
1502
- */
1503
- const tablesDBCreatePointColumn = async ({databaseId,tableId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1504
- let client = !sdk ? await sdkForProject() :
1505
- sdk;
1506
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/point'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1507
- let payload = {};
1508
- if (typeof key !== 'undefined') {
1509
- payload['key'] = key;
1510
- }
1511
- if (typeof required !== 'undefined') {
1512
- payload['required'] = required;
1513
- }
1514
- xdefault = xdefault === true ? [] : xdefault;
1515
- if (typeof xdefault !== 'undefined') {
1516
- payload['default'] = xdefault;
1517
- }
1518
-
1519
- let response = undefined;
1520
-
1521
- response = await client.call('post', apiPath, {
1522
- 'content-type': 'application/json',
1523
- }, payload);
1524
-
1525
- if (parseOutput) {
1526
- parse(response)
1527
- }
1528
-
1529
- return response;
1530
-
1531
- }
1532
- /**
1533
- * @typedef {Object} TablesDBUpdatePointColumnRequestParams
1534
- * @property {string} databaseId Database ID.
1535
- * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1536
- * @property {string} key Column Key.
1537
- * @property {boolean} required Is column required?
1538
- * @property {any[]} xdefault Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.
1539
- * @property {string} newKey New Column Key.
1540
- * @property {boolean} overrideForCli
1541
- * @property {boolean} parseOutput
1542
- * @property {libClient | undefined} sdk
1543
- */
1544
-
1545
- /**
1546
- * @param {TablesDBUpdatePointColumnRequestParams} params
1547
- */
1548
- const tablesDBUpdatePointColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1549
- let client = !sdk ? await sdkForProject() :
1550
- sdk;
1551
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1552
- let payload = {};
1553
- if (typeof required !== 'undefined') {
1554
- payload['required'] = required;
1555
- }
1556
- xdefault = xdefault === true ? [] : xdefault;
1557
- if (typeof xdefault !== 'undefined') {
1558
- payload['default'] = xdefault;
1559
- }
1560
- if (typeof newKey !== 'undefined') {
1561
- payload['newKey'] = newKey;
1562
- }
1563
-
1564
- let response = undefined;
1565
-
1566
- response = await client.call('patch', apiPath, {
1567
- 'content-type': 'application/json',
1568
- }, payload);
1569
-
1570
- if (parseOutput) {
1571
- parse(response)
1572
- }
1573
-
1574
- return response;
1575
-
1576
- }
1577
- /**
1578
- * @typedef {Object} TablesDBCreatePolygonColumnRequestParams
1579
- * @property {string} databaseId Database ID.
1580
- * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1581
- * @property {string} key Column Key.
1582
- * @property {boolean} required Is column required?
1583
- * @property {any[]} xdefault Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.
1584
- * @property {boolean} overrideForCli
1585
- * @property {boolean} parseOutput
1586
- * @property {libClient | undefined} sdk
1587
- */
1588
-
1589
- /**
1590
- * @param {TablesDBCreatePolygonColumnRequestParams} params
1591
- */
1592
- const tablesDBCreatePolygonColumn = async ({databaseId,tableId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1593
- let client = !sdk ? await sdkForProject() :
1594
- sdk;
1595
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/polygon'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1596
- let payload = {};
1597
- if (typeof key !== 'undefined') {
1598
- payload['key'] = key;
1599
- }
1600
- if (typeof required !== 'undefined') {
1601
- payload['required'] = required;
1602
- }
1603
- xdefault = xdefault === true ? [] : xdefault;
1604
- if (typeof xdefault !== 'undefined') {
1605
- payload['default'] = xdefault;
1606
- }
1607
-
1608
- let response = undefined;
1609
-
1610
- response = await client.call('post', apiPath, {
1611
- 'content-type': 'application/json',
1612
- }, payload);
1613
-
1614
- if (parseOutput) {
1615
- parse(response)
1616
- }
1617
-
1618
- return response;
1619
-
1620
- }
1621
- /**
1622
- * @typedef {Object} TablesDBUpdatePolygonColumnRequestParams
1623
- * @property {string} databaseId Database ID.
1624
- * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1625
- * @property {string} key Column Key.
1626
- * @property {boolean} required Is column required?
1627
- * @property {any[]} xdefault Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.
1628
- * @property {string} newKey New Column Key.
1629
- * @property {boolean} overrideForCli
1630
- * @property {boolean} parseOutput
1631
- * @property {libClient | undefined} sdk
1632
- */
1633
-
1634
- /**
1635
- * @param {TablesDBUpdatePolygonColumnRequestParams} params
1636
- */
1637
- const tablesDBUpdatePolygonColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1638
- let client = !sdk ? await sdkForProject() :
1639
- sdk;
1640
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1641
- let payload = {};
1642
- if (typeof required !== 'undefined') {
1643
- payload['required'] = required;
1644
- }
1645
- xdefault = xdefault === true ? [] : xdefault;
1646
- if (typeof xdefault !== 'undefined') {
1647
- payload['default'] = xdefault;
1648
- }
1649
- if (typeof newKey !== 'undefined') {
1650
- payload['newKey'] = newKey;
1651
- }
1652
-
1653
- let response = undefined;
1654
-
1655
- response = await client.call('patch', apiPath, {
1656
- 'content-type': 'application/json',
1657
- }, payload);
1658
-
1659
- if (parseOutput) {
1660
- parse(response)
1661
- }
1662
-
1663
- return response;
1664
-
1665
- }
1666
- /**
1667
- * @typedef {Object} TablesDBCreateRelationshipColumnRequestParams
1668
- * @property {string} databaseId Database ID.
1669
- * @property {string} tableId Table ID.
1670
- * @property {string} relatedTableId Related Table ID.
1671
- * @property {RelationshipType} type Relation type
1672
- * @property {boolean} twoWay Is Two Way?
1673
- * @property {string} key Column Key.
1674
- * @property {string} twoWayKey Two Way Column Key.
1675
- * @property {RelationMutate} onDelete Constraints option
1676
- * @property {boolean} overrideForCli
1677
- * @property {boolean} parseOutput
1678
- * @property {libClient | undefined} sdk
1679
- */
1680
-
1681
- /**
1682
- * @param {TablesDBCreateRelationshipColumnRequestParams} params
1683
- */
1684
- const tablesDBCreateRelationshipColumn = async ({databaseId,tableId,relatedTableId,type,twoWay,key,twoWayKey,onDelete,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1685
- let client = !sdk ? await sdkForProject() :
1686
- sdk;
1687
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1688
- let payload = {};
1689
- if (typeof relatedTableId !== 'undefined') {
1690
- payload['relatedTableId'] = relatedTableId;
1691
- }
1692
- if (typeof type !== 'undefined') {
1693
- payload['type'] = type;
1694
- }
1695
- if (typeof twoWay !== 'undefined') {
1696
- payload['twoWay'] = twoWay;
1697
- }
1698
- if (typeof key !== 'undefined') {
1699
- payload['key'] = key;
1700
- }
1701
- if (typeof twoWayKey !== 'undefined') {
1702
- payload['twoWayKey'] = twoWayKey;
1703
- }
1704
- if (typeof onDelete !== 'undefined') {
1705
- payload['onDelete'] = onDelete;
1706
- }
1707
-
1708
- let response = undefined;
1709
-
1710
- response = await client.call('post', apiPath, {
1711
- 'content-type': 'application/json',
1712
- }, payload);
1713
-
1714
- if (parseOutput) {
1715
- parse(response)
1716
- }
1717
-
1718
- return response;
1719
-
1720
- }
1721
- /**
1722
- * @typedef {Object} TablesDBCreateStringColumnRequestParams
1723
- * @property {string} databaseId Database ID.
1724
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1725
- * @property {string} key Column Key.
1726
- * @property {number} size Column size for text columns, in number of characters.
1727
- * @property {boolean} required Is column required?
1728
- * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
1729
- * @property {boolean} array Is column an array?
1730
- * @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.
1731
- * @property {boolean} overrideForCli
1732
- * @property {boolean} parseOutput
1733
- * @property {libClient | undefined} sdk
1734
- */
1735
-
1736
- /**
1737
- * @param {TablesDBCreateStringColumnRequestParams} params
1738
- */
1739
- const tablesDBCreateStringColumn = async ({databaseId,tableId,key,size,required,xdefault,array,encrypt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1740
- let client = !sdk ? await sdkForProject() :
1741
- sdk;
1742
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1743
- let payload = {};
1744
- if (typeof key !== 'undefined') {
1745
- payload['key'] = key;
1746
- }
1747
- if (typeof size !== 'undefined') {
1748
- payload['size'] = size;
1749
- }
1750
- if (typeof required !== 'undefined') {
1751
- payload['required'] = required;
1752
- }
1753
- if (typeof xdefault !== 'undefined') {
1754
- payload['default'] = xdefault;
1755
- }
1756
- if (typeof array !== 'undefined') {
1757
- payload['array'] = array;
1758
- }
1759
- if (typeof encrypt !== 'undefined') {
1760
- payload['encrypt'] = encrypt;
1761
- }
1762
-
1763
- let response = undefined;
1764
-
1765
- response = await client.call('post', apiPath, {
1766
- 'content-type': 'application/json',
1767
- }, payload);
1768
-
1769
- if (parseOutput) {
1770
- parse(response)
1771
- }
1772
-
1773
- return response;
1774
-
1775
- }
1776
- /**
1777
- * @typedef {Object} TablesDBUpdateStringColumnRequestParams
1778
- * @property {string} databaseId Database ID.
1779
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
1780
- * @property {string} key Column Key.
1781
- * @property {boolean} required Is column required?
1782
- * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
1783
- * @property {number} size Maximum size of the string column.
1784
- * @property {string} newKey New Column Key.
1785
- * @property {boolean} overrideForCli
1786
- * @property {boolean} parseOutput
1787
- * @property {libClient | undefined} sdk
1788
- */
1789
-
1790
- /**
1791
- * @param {TablesDBUpdateStringColumnRequestParams} params
1792
- */
1793
- const tablesDBUpdateStringColumn = async ({databaseId,tableId,key,required,xdefault,size,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1794
- let client = !sdk ? await sdkForProject() :
1795
- sdk;
1796
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1797
- let payload = {};
1798
- if (typeof required !== 'undefined') {
1799
- payload['required'] = required;
1800
- }
1801
- if (typeof xdefault !== 'undefined') {
1802
- payload['default'] = xdefault;
1803
- }
1804
- if (typeof size !== 'undefined') {
1805
- payload['size'] = size;
1806
- }
1807
- if (typeof newKey !== 'undefined') {
1808
- payload['newKey'] = newKey;
1809
- }
1810
-
1811
- let response = undefined;
1812
-
1813
- response = await client.call('patch', apiPath, {
1814
- 'content-type': 'application/json',
1815
- }, payload);
1816
-
1817
- if (parseOutput) {
1818
- parse(response)
1819
- }
1820
-
1821
- return response;
1822
-
1823
- }
1824
- /**
1825
- * @typedef {Object} TablesDBCreateUrlColumnRequestParams
1826
- * @property {string} databaseId Database ID.
1827
- * @property {string} tableId Table ID.
1828
- * @property {string} key Column Key.
1829
- * @property {boolean} required Is column required?
1830
- * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
1831
- * @property {boolean} array Is column an array?
1832
- * @property {boolean} overrideForCli
1833
- * @property {boolean} parseOutput
1834
- * @property {libClient | undefined} sdk
1835
- */
1836
-
1837
- /**
1838
- * @param {TablesDBCreateUrlColumnRequestParams} params
1839
- */
1840
- const tablesDBCreateUrlColumn = async ({databaseId,tableId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1841
- let client = !sdk ? await sdkForProject() :
1842
- sdk;
1843
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1844
- let payload = {};
1845
- if (typeof key !== 'undefined') {
1846
- payload['key'] = key;
1847
- }
1848
- if (typeof required !== 'undefined') {
1849
- payload['required'] = required;
1850
- }
1851
- if (typeof xdefault !== 'undefined') {
1852
- payload['default'] = xdefault;
1853
- }
1854
- if (typeof array !== 'undefined') {
1855
- payload['array'] = array;
1856
- }
1857
-
1858
- let response = undefined;
1859
-
1860
- response = await client.call('post', apiPath, {
1861
- 'content-type': 'application/json',
1862
- }, payload);
1863
-
1864
- if (parseOutput) {
1865
- parse(response)
1866
- }
1867
-
1868
- return response;
1869
-
1870
- }
1871
- /**
1872
- * @typedef {Object} TablesDBUpdateUrlColumnRequestParams
1873
- * @property {string} databaseId Database ID.
1874
- * @property {string} tableId Table ID.
1875
- * @property {string} key Column Key.
1876
- * @property {boolean} required Is column required?
1877
- * @property {string} xdefault Default value for column when not provided. Cannot be set when column is required.
1878
- * @property {string} newKey New Column Key.
1879
- * @property {boolean} overrideForCli
1880
- * @property {boolean} parseOutput
1881
- * @property {libClient | undefined} sdk
1882
- */
1883
-
1884
- /**
1885
- * @param {TablesDBUpdateUrlColumnRequestParams} params
1886
- */
1887
- const tablesDBUpdateUrlColumn = async ({databaseId,tableId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1888
- let client = !sdk ? await sdkForProject() :
1889
- sdk;
1890
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1891
- let payload = {};
1892
- if (typeof required !== 'undefined') {
1893
- payload['required'] = required;
1894
- }
1895
- if (typeof xdefault !== 'undefined') {
1896
- payload['default'] = xdefault;
1897
- }
1898
- if (typeof newKey !== 'undefined') {
1899
- payload['newKey'] = newKey;
1900
- }
1901
-
1902
- let response = undefined;
1903
-
1904
- response = await client.call('patch', apiPath, {
1905
- 'content-type': 'application/json',
1906
- }, payload);
1907
-
1908
- if (parseOutput) {
1909
- parse(response)
1910
- }
1911
-
1912
- return response;
1913
-
1914
- }
1915
- /**
1916
- * @typedef {Object} TablesDBGetColumnRequestParams
1917
- * @property {string} databaseId Database ID.
1918
- * @property {string} tableId Table ID.
1919
- * @property {string} key Column Key.
1920
- * @property {boolean} overrideForCli
1921
- * @property {boolean} parseOutput
1922
- * @property {libClient | undefined} sdk
1923
- */
1924
-
1925
- /**
1926
- * @param {TablesDBGetColumnRequestParams} params
1927
- */
1928
- const tablesDBGetColumn = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1929
- let client = !sdk ? await sdkForProject() :
1930
- sdk;
1931
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1932
- let payload = {};
1933
-
1934
- let response = undefined;
1935
-
1936
- response = await client.call('get', apiPath, {
1937
- }, payload);
1938
-
1939
- if (parseOutput) {
1940
- if(console) {
1941
- showConsoleLink('tablesDB', 'getColumn', databaseId, tableId);
1942
- } else {
1943
- parse(response)
1944
- }
1945
- }
1946
-
1947
- return response;
1948
-
1949
- }
1950
- /**
1951
- * @typedef {Object} TablesDBDeleteColumnRequestParams
1952
- * @property {string} databaseId Database ID.
1953
- * @property {string} tableId Table ID.
1954
- * @property {string} key Column Key.
1955
- * @property {boolean} overrideForCli
1956
- * @property {boolean} parseOutput
1957
- * @property {libClient | undefined} sdk
1958
- */
1959
-
1960
- /**
1961
- * @param {TablesDBDeleteColumnRequestParams} params
1962
- */
1963
- const tablesDBDeleteColumn = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1964
- let client = !sdk ? await sdkForProject() :
1965
- sdk;
1966
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1967
- let payload = {};
1968
-
1969
- let response = undefined;
1970
-
1971
- response = await client.call('delete', apiPath, {
1972
- 'content-type': 'application/json',
1973
- }, payload);
1974
-
1975
- if (parseOutput) {
1976
- parse(response)
1977
- }
1978
-
1979
- return response;
1980
-
1981
- }
1982
- /**
1983
- * @typedef {Object} TablesDBUpdateRelationshipColumnRequestParams
1984
- * @property {string} databaseId Database ID.
1985
- * @property {string} tableId Table ID.
1986
- * @property {string} key Column Key.
1987
- * @property {RelationMutate} onDelete Constraints option
1988
- * @property {string} newKey New Column Key.
1989
- * @property {boolean} overrideForCli
1990
- * @property {boolean} parseOutput
1991
- * @property {libClient | undefined} sdk
1992
- */
1993
-
1994
- /**
1995
- * @param {TablesDBUpdateRelationshipColumnRequestParams} params
1996
- */
1997
- const tablesDBUpdateRelationshipColumn = async ({databaseId,tableId,key,onDelete,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1998
- let client = !sdk ? await sdkForProject() :
1999
- sdk;
2000
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
2001
- let payload = {};
2002
- if (typeof onDelete !== 'undefined') {
2003
- payload['onDelete'] = onDelete;
2004
- }
2005
- if (typeof newKey !== 'undefined') {
2006
- payload['newKey'] = newKey;
2007
- }
2008
-
2009
- let response = undefined;
2010
-
2011
- response = await client.call('patch', apiPath, {
2012
- 'content-type': 'application/json',
2013
- }, payload);
2014
-
2015
- if (parseOutput) {
2016
- parse(response)
2017
- }
2018
-
2019
- return response;
2020
-
2021
- }
2022
- /**
2023
- * @typedef {Object} TablesDBListIndexesRequestParams
2024
- * @property {string} databaseId Database ID.
2025
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
2026
- * @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
2027
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
2028
- * @property {boolean} overrideForCli
2029
- * @property {boolean} parseOutput
2030
- * @property {libClient | undefined} sdk
2031
- */
2032
-
2033
- /**
2034
- * @param {TablesDBListIndexesRequestParams} params
2035
- */
2036
- const tablesDBListIndexes = async ({databaseId,tableId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2037
- let client = !sdk ? await sdkForProject() :
2038
- sdk;
2039
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2040
- let payload = {};
2041
- if (typeof queries !== 'undefined') {
2042
- payload['queries'] = queries;
2043
- }
2044
- if (typeof total !== 'undefined') {
2045
- payload['total'] = total;
2046
- }
2047
-
2048
- let response = undefined;
2049
-
2050
- response = await client.call('get', apiPath, {
2051
- }, payload);
2052
-
2053
- if (parseOutput) {
2054
- if(console) {
2055
- showConsoleLink('tablesDB', 'listIndexes', databaseId, tableId);
2056
- } else {
2057
- parse(response)
2058
- }
2059
- }
2060
-
2061
- return response;
2062
-
2063
- }
2064
- /**
2065
- * @typedef {Object} TablesDBCreateIndexRequestParams
2066
- * @property {string} databaseId Database ID.
2067
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
2068
- * @property {string} key Index Key.
2069
- * @property {IndexType} type Index type.
2070
- * @property {string[]} columns Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.
2071
- * @property {string[]} orders Array of index orders. Maximum of 100 orders are allowed.
2072
- * @property {number[]} lengths Length of index. Maximum of 100
2073
- * @property {boolean} overrideForCli
2074
- * @property {boolean} parseOutput
2075
- * @property {libClient | undefined} sdk
2076
- */
2077
-
2078
- /**
2079
- * @param {TablesDBCreateIndexRequestParams} params
2080
- */
2081
- const tablesDBCreateIndex = async ({databaseId,tableId,key,type,columns,orders,lengths,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2082
- let client = !sdk ? await sdkForProject() :
2083
- sdk;
2084
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2085
- let payload = {};
2086
- if (typeof key !== 'undefined') {
2087
- payload['key'] = key;
2088
- }
2089
- if (typeof type !== 'undefined') {
2090
- payload['type'] = type;
2091
- }
2092
- columns = columns === true ? [] : columns;
2093
- if (typeof columns !== 'undefined') {
2094
- payload['columns'] = columns;
2095
- }
2096
- orders = orders === true ? [] : orders;
2097
- if (typeof orders !== 'undefined') {
2098
- payload['orders'] = orders;
2099
- }
2100
- lengths = lengths === true ? [] : lengths;
2101
- if (typeof lengths !== 'undefined') {
2102
- payload['lengths'] = lengths;
2103
- }
2104
-
2105
- let response = undefined;
2106
-
2107
- response = await client.call('post', apiPath, {
2108
- 'content-type': 'application/json',
2109
- }, payload);
2110
-
2111
- if (parseOutput) {
2112
- parse(response)
2113
- }
2114
-
2115
- return response;
2116
-
2117
- }
2118
- /**
2119
- * @typedef {Object} TablesDBGetIndexRequestParams
2120
- * @property {string} databaseId Database ID.
2121
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
2122
- * @property {string} key Index Key.
2123
- * @property {boolean} overrideForCli
2124
- * @property {boolean} parseOutput
2125
- * @property {libClient | undefined} sdk
2126
- */
2127
-
2128
- /**
2129
- * @param {TablesDBGetIndexRequestParams} params
2130
- */
2131
- const tablesDBGetIndex = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2132
- let client = !sdk ? await sdkForProject() :
2133
- sdk;
2134
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
2135
- let payload = {};
2136
-
2137
- let response = undefined;
2138
-
2139
- response = await client.call('get', apiPath, {
2140
- }, payload);
2141
-
2142
- if (parseOutput) {
2143
- parse(response)
2144
- }
2145
-
2146
- return response;
2147
-
2148
- }
2149
- /**
2150
- * @typedef {Object} TablesDBDeleteIndexRequestParams
2151
- * @property {string} databaseId Database ID.
2152
- * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
2153
- * @property {string} key Index Key.
2154
- * @property {boolean} overrideForCli
2155
- * @property {boolean} parseOutput
2156
- * @property {libClient | undefined} sdk
2157
- */
2158
-
2159
- /**
2160
- * @param {TablesDBDeleteIndexRequestParams} params
2161
- */
2162
- const tablesDBDeleteIndex = async ({databaseId,tableId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2163
- let client = !sdk ? await sdkForProject() :
2164
- sdk;
2165
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
2166
- let payload = {};
2167
-
2168
- let response = undefined;
2169
-
2170
- response = await client.call('delete', apiPath, {
2171
- 'content-type': 'application/json',
2172
- }, payload);
2173
-
2174
- if (parseOutput) {
2175
- parse(response)
2176
- }
2177
-
2178
- return response;
2179
-
2180
- }
2181
- /**
2182
- * @typedef {Object} TablesDBListTableLogsRequestParams
2183
- * @property {string} databaseId Database ID.
2184
- * @property {string} tableId Table ID.
2185
- * @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
2186
- * @property {boolean} overrideForCli
2187
- * @property {boolean} parseOutput
2188
- * @property {libClient | undefined} sdk
2189
- */
2190
-
2191
- /**
2192
- * @param {TablesDBListTableLogsRequestParams} params
2193
- */
2194
- const tablesDBListTableLogs = async ({databaseId,tableId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2195
- let client = !sdk ? await sdkForProject() :
2196
- sdk;
2197
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/logs'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2198
- let payload = {};
2199
- if (typeof queries !== 'undefined') {
2200
- payload['queries'] = queries;
2201
- }
2202
-
2203
- let response = undefined;
2204
-
2205
- response = await client.call('get', apiPath, {
2206
- }, payload);
2207
-
2208
- if (parseOutput) {
2209
- if(console) {
2210
- showConsoleLink('tablesDB', 'listTableLogs', databaseId, tableId);
2211
- } else {
2212
- parse(response)
2213
- }
2214
- }
2215
-
2216
- return response;
2217
-
2218
- }
2219
- /**
2220
- * @typedef {Object} TablesDBListRowsRequestParams
2221
- * @property {string} databaseId Database ID.
2222
- * @property {string} tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table).
2223
- * @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.
2224
- * @property {string} transactionId Transaction ID to read uncommitted changes within the transaction.
2225
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
2226
- * @property {boolean} overrideForCli
2227
- * @property {boolean} parseOutput
2228
- * @property {libClient | undefined} sdk
2229
- */
2230
-
2231
- /**
2232
- * @param {TablesDBListRowsRequestParams} params
2233
- */
2234
- const tablesDBListRows = async ({databaseId,tableId,queries,transactionId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2235
- let client = !sdk ? await sdkForProject() :
2236
- sdk;
2237
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2238
- let payload = {};
2239
- if (typeof queries !== 'undefined') {
2240
- payload['queries'] = queries;
2241
- }
2242
- if (typeof transactionId !== 'undefined') {
2243
- payload['transactionId'] = transactionId;
2244
- }
2245
- if (typeof total !== 'undefined') {
2246
- payload['total'] = total;
2247
- }
2248
-
2249
- let response = undefined;
2250
-
2251
- response = await client.call('get', apiPath, {
2252
- }, payload);
2253
-
2254
- if (parseOutput) {
2255
- if(console) {
2256
- showConsoleLink('tablesDB', 'listRows', databaseId, tableId);
2257
- } else {
2258
- parse(response)
2259
- }
2260
- }
2261
-
2262
- return response;
2263
-
2264
- }
2265
- /**
2266
- * @typedef {Object} TablesDBCreateRowRequestParams
2267
- * @property {string} databaseId Database ID.
2268
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows.
2269
- * @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.
2270
- * @property {object} data Row data as JSON object.
2271
- * @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).
2272
- * @property {string} transactionId Transaction ID for staging the operation.
2273
- * @property {boolean} overrideForCli
2274
- * @property {boolean} parseOutput
2275
- * @property {libClient | undefined} sdk
2276
- */
2277
-
2278
- /**
2279
- * @param {TablesDBCreateRowRequestParams} params
2280
- */
2281
- const tablesDBCreateRow = async ({databaseId,tableId,rowId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2282
- let client = !sdk ? await sdkForProject() :
2283
- sdk;
2284
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2285
- let payload = {};
2286
- if (typeof rowId !== 'undefined') {
2287
- payload['rowId'] = rowId;
2288
- }
2289
- if (typeof data !== 'undefined') {
2290
- payload['data'] = JSON.parse(data);
2291
- }
2292
- permissions = permissions === true ? [] : permissions;
2293
- if (typeof permissions !== 'undefined') {
2294
- payload['permissions'] = permissions;
2295
- }
2296
- if (typeof transactionId !== 'undefined') {
2297
- payload['transactionId'] = transactionId;
2298
- }
2299
-
2300
- let response = undefined;
2301
-
2302
- response = await client.call('post', apiPath, {
2303
- 'content-type': 'application/json',
2304
- }, payload);
2305
-
2306
- if (parseOutput) {
2307
- parse(response)
2308
- }
2309
-
2310
- return response;
2311
-
2312
- }
2313
- /**
2314
- * @typedef {Object} TablesDBCreateRowsRequestParams
2315
- * @property {string} databaseId Database ID.
2316
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows.
2317
- * @property {object[]} rows Array of rows data as JSON objects.
2318
- * @property {string} transactionId Transaction ID for staging the operation.
2319
- * @property {boolean} overrideForCli
2320
- * @property {boolean} parseOutput
2321
- * @property {libClient | undefined} sdk
2322
- */
2323
-
2324
- /**
2325
- * @param {TablesDBCreateRowsRequestParams} params
2326
- */
2327
- const tablesDBCreateRows = async ({databaseId,tableId,rows,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2328
- let client = !sdk ? await sdkForProject() :
2329
- sdk;
2330
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2331
- let payload = {};
2332
- rows = rows === true ? [] : rows;
2333
- if (typeof rows !== 'undefined') {
2334
- payload['rows'] = rows;
2335
- }
2336
- if (typeof transactionId !== 'undefined') {
2337
- payload['transactionId'] = transactionId;
2338
- }
2339
-
2340
- let response = undefined;
2341
-
2342
- response = await client.call('post', apiPath, {
2343
- 'content-type': 'application/json',
2344
- }, payload);
2345
-
2346
- if (parseOutput) {
2347
- parse(response)
2348
- }
2349
-
2350
- return response;
2351
-
2352
- }
2353
- /**
2354
- * @typedef {Object} TablesDBUpsertRowsRequestParams
2355
- * @property {string} databaseId Database ID.
2356
- * @property {string} tableId Table ID.
2357
- * @property {object[]} rows Array of row data as JSON objects. May contain partial rows.
2358
- * @property {string} transactionId Transaction ID for staging the operation.
2359
- * @property {boolean} overrideForCli
2360
- * @property {boolean} parseOutput
2361
- * @property {libClient | undefined} sdk
2362
- */
2363
-
2364
- /**
2365
- * @param {TablesDBUpsertRowsRequestParams} params
2366
- */
2367
- const tablesDBUpsertRows = async ({databaseId,tableId,rows,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2368
- let client = !sdk ? await sdkForProject() :
2369
- sdk;
2370
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2371
- let payload = {};
2372
- rows = rows === true ? [] : rows;
2373
- if (typeof rows !== 'undefined') {
2374
- payload['rows'] = rows;
2375
- }
2376
- if (typeof transactionId !== 'undefined') {
2377
- payload['transactionId'] = transactionId;
2378
- }
2379
-
2380
- let response = undefined;
2381
-
2382
- response = await client.call('put', apiPath, {
2383
- 'content-type': 'application/json',
2384
- }, payload);
2385
-
2386
- if (parseOutput) {
2387
- parse(response)
2388
- }
2389
-
2390
- return response;
2391
-
2392
- }
2393
- /**
2394
- * @typedef {Object} TablesDBUpdateRowsRequestParams
2395
- * @property {string} databaseId Database ID.
2396
- * @property {string} tableId Table ID.
2397
- * @property {object} data Row data as JSON object. Include only column and value pairs to be updated.
2398
- * @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.
2399
- * @property {string} transactionId Transaction ID for staging the operation.
2400
- * @property {boolean} overrideForCli
2401
- * @property {boolean} parseOutput
2402
- * @property {libClient | undefined} sdk
2403
- */
2404
-
2405
- /**
2406
- * @param {TablesDBUpdateRowsRequestParams} params
2407
- */
2408
- const tablesDBUpdateRows = async ({databaseId,tableId,data,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2409
- let client = !sdk ? await sdkForProject() :
2410
- sdk;
2411
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2412
- let payload = {};
2413
- if (typeof data !== 'undefined') {
2414
- payload['data'] = JSON.parse(data);
2415
- }
2416
- queries = queries === true ? [] : queries;
2417
- if (typeof queries !== 'undefined') {
2418
- payload['queries'] = queries;
2419
- }
2420
- if (typeof transactionId !== 'undefined') {
2421
- payload['transactionId'] = transactionId;
2422
- }
2423
-
2424
- let response = undefined;
2425
-
2426
- response = await client.call('patch', apiPath, {
2427
- 'content-type': 'application/json',
2428
- }, payload);
2429
-
2430
- if (parseOutput) {
2431
- parse(response)
2432
- }
2433
-
2434
- return response;
2435
-
2436
- }
2437
- /**
2438
- * @typedef {Object} TablesDBDeleteRowsRequestParams
2439
- * @property {string} databaseId Database ID.
2440
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
2441
- * @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.
2442
- * @property {string} transactionId Transaction ID for staging the operation.
2443
- * @property {boolean} overrideForCli
2444
- * @property {boolean} parseOutput
2445
- * @property {libClient | undefined} sdk
2446
- */
2447
-
2448
- /**
2449
- * @param {TablesDBDeleteRowsRequestParams} params
2450
- */
2451
- const tablesDBDeleteRows = async ({databaseId,tableId,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2452
- let client = !sdk ? await sdkForProject() :
2453
- sdk;
2454
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2455
- let payload = {};
2456
- queries = queries === true ? [] : queries;
2457
- if (typeof queries !== 'undefined') {
2458
- payload['queries'] = queries;
2459
- }
2460
- if (typeof transactionId !== 'undefined') {
2461
- payload['transactionId'] = transactionId;
2462
- }
2463
-
2464
- let response = undefined;
2465
-
2466
- response = await client.call('delete', apiPath, {
2467
- 'content-type': 'application/json',
2468
- }, payload);
2469
-
2470
- if (parseOutput) {
2471
- parse(response)
2472
- }
2473
-
2474
- return response;
2475
-
2476
- }
2477
- /**
2478
- * @typedef {Object} TablesDBGetRowRequestParams
2479
- * @property {string} databaseId Database ID.
2480
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
2481
- * @property {string} rowId Row ID.
2482
- * @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.
2483
- * @property {string} transactionId Transaction ID to read uncommitted changes within the transaction.
2484
- * @property {boolean} overrideForCli
2485
- * @property {boolean} parseOutput
2486
- * @property {libClient | undefined} sdk
2487
- */
2488
-
2489
- /**
2490
- * @param {TablesDBGetRowRequestParams} params
2491
- */
2492
- const tablesDBGetRow = async ({databaseId,tableId,rowId,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2493
- let client = !sdk ? await sdkForProject() :
2494
- sdk;
2495
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
2496
- let payload = {};
2497
- if (typeof queries !== 'undefined') {
2498
- payload['queries'] = queries;
2499
- }
2500
- if (typeof transactionId !== 'undefined') {
2501
- payload['transactionId'] = transactionId;
2502
- }
2503
-
2504
- let response = undefined;
2505
-
2506
- response = await client.call('get', apiPath, {
2507
- }, payload);
2508
-
2509
- if (parseOutput) {
2510
- if(console) {
2511
- showConsoleLink('tablesDB', 'getRow', databaseId, tableId, rowId);
2512
- } else {
2513
- parse(response)
2514
- }
2515
- }
2516
-
2517
- return response;
2518
-
2519
- }
2520
- /**
2521
- * @typedef {Object} TablesDBUpsertRowRequestParams
2522
- * @property {string} databaseId Database ID.
2523
- * @property {string} tableId Table ID.
2524
- * @property {string} rowId Row ID.
2525
- * @property {object} data Row data as JSON object. Include all required columns of the row to be created or updated.
2526
- * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2527
- * @property {string} transactionId Transaction ID for staging the operation.
2528
- * @property {boolean} overrideForCli
2529
- * @property {boolean} parseOutput
2530
- * @property {libClient | undefined} sdk
2531
- */
2532
-
2533
- /**
2534
- * @param {TablesDBUpsertRowRequestParams} params
2535
- */
2536
- const tablesDBUpsertRow = async ({databaseId,tableId,rowId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2537
- let client = !sdk ? await sdkForProject() :
2538
- sdk;
2539
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
2540
- let payload = {};
2541
- if (typeof data !== 'undefined') {
2542
- payload['data'] = JSON.parse(data);
2543
- }
2544
- permissions = permissions === true ? [] : permissions;
2545
- if (typeof permissions !== 'undefined') {
2546
- payload['permissions'] = permissions;
2547
- }
2548
- if (typeof transactionId !== 'undefined') {
2549
- payload['transactionId'] = transactionId;
2550
- }
2551
-
2552
- let response = undefined;
2553
-
2554
- response = await client.call('put', apiPath, {
2555
- 'content-type': 'application/json',
2556
- }, payload);
2557
-
2558
- if (parseOutput) {
2559
- parse(response)
2560
- }
2561
-
2562
- return response;
2563
-
2564
- }
2565
- /**
2566
- * @typedef {Object} TablesDBUpdateRowRequestParams
2567
- * @property {string} databaseId Database ID.
2568
- * @property {string} tableId Table ID.
2569
- * @property {string} rowId Row ID.
2570
- * @property {object} data Row data as JSON object. Include only columns and value pairs to be updated.
2571
- * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2572
- * @property {string} transactionId Transaction ID for staging the operation.
2573
- * @property {boolean} overrideForCli
2574
- * @property {boolean} parseOutput
2575
- * @property {libClient | undefined} sdk
2576
- */
2577
-
2578
- /**
2579
- * @param {TablesDBUpdateRowRequestParams} params
2580
- */
2581
- const tablesDBUpdateRow = async ({databaseId,tableId,rowId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2582
- let client = !sdk ? await sdkForProject() :
2583
- sdk;
2584
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
2585
- let payload = {};
2586
- if (typeof data !== 'undefined') {
2587
- payload['data'] = JSON.parse(data);
2588
- }
2589
- permissions = permissions === true ? [] : permissions;
2590
- if (typeof permissions !== 'undefined') {
2591
- payload['permissions'] = permissions;
2592
- }
2593
- if (typeof transactionId !== 'undefined') {
2594
- payload['transactionId'] = transactionId;
2595
- }
2596
-
2597
- let response = undefined;
2598
-
2599
- response = await client.call('patch', apiPath, {
2600
- 'content-type': 'application/json',
2601
- }, payload);
2602
-
2603
- if (parseOutput) {
2604
- parse(response)
2605
- }
2606
-
2607
- return response;
2608
-
2609
- }
2610
- /**
2611
- * @typedef {Object} TablesDBDeleteRowRequestParams
2612
- * @property {string} databaseId Database ID.
2613
- * @property {string} tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).
2614
- * @property {string} rowId Row ID.
2615
- * @property {string} transactionId Transaction ID for staging the operation.
2616
- * @property {boolean} overrideForCli
2617
- * @property {boolean} parseOutput
2618
- * @property {libClient | undefined} sdk
2619
- */
2620
-
2621
- /**
2622
- * @param {TablesDBDeleteRowRequestParams} params
2623
- */
2624
- const tablesDBDeleteRow = async ({databaseId,tableId,rowId,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2625
- let client = !sdk ? await sdkForProject() :
2626
- sdk;
2627
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
2628
- let payload = {};
2629
- if (typeof transactionId !== 'undefined') {
2630
- payload['transactionId'] = transactionId;
2631
- }
2632
-
2633
- let response = undefined;
2634
-
2635
- response = await client.call('delete', apiPath, {
2636
- 'content-type': 'application/json',
2637
- }, payload);
2638
-
2639
- if (parseOutput) {
2640
- parse(response)
2641
- }
2642
-
2643
- return response;
2644
-
2645
- }
2646
- /**
2647
- * @typedef {Object} TablesDBListRowLogsRequestParams
2648
- * @property {string} databaseId Database ID.
2649
- * @property {string} tableId Table ID.
2650
- * @property {string} rowId Row ID.
2651
- * @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
2652
- * @property {boolean} overrideForCli
2653
- * @property {boolean} parseOutput
2654
- * @property {libClient | undefined} sdk
2655
- */
2656
-
2657
- /**
2658
- * @param {TablesDBListRowLogsRequestParams} params
2659
- */
2660
- const tablesDBListRowLogs = async ({databaseId,tableId,rowId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2661
- let client = !sdk ? await sdkForProject() :
2662
- sdk;
2663
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/logs'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
2664
- let payload = {};
2665
- if (typeof queries !== 'undefined') {
2666
- payload['queries'] = queries;
2667
- }
2668
-
2669
- let response = undefined;
2670
-
2671
- response = await client.call('get', apiPath, {
2672
- }, payload);
2673
-
2674
- if (parseOutput) {
2675
- if(console) {
2676
- showConsoleLink('tablesDB', 'listRowLogs', databaseId, tableId, rowId);
2677
- } else {
2678
- parse(response)
2679
- }
2680
- }
2681
-
2682
- return response;
2683
-
2684
- }
2685
- /**
2686
- * @typedef {Object} TablesDBDecrementRowColumnRequestParams
2687
- * @property {string} databaseId Database ID.
2688
- * @property {string} tableId Table ID.
2689
- * @property {string} rowId Row ID.
2690
- * @property {string} column Column key.
2691
- * @property {number} value Value to increment the column by. The value must be a number.
2692
- * @property {number} min Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.
2693
- * @property {string} transactionId Transaction ID for staging the operation.
2694
- * @property {boolean} overrideForCli
2695
- * @property {boolean} parseOutput
2696
- * @property {libClient | undefined} sdk
2697
- */
2698
-
2699
- /**
2700
- * @param {TablesDBDecrementRowColumnRequestParams} params
2701
- */
2702
- const tablesDBDecrementRowColumn = async ({databaseId,tableId,rowId,column,value,min,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2703
- let client = !sdk ? await sdkForProject() :
2704
- sdk;
2705
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column);
2706
- let payload = {};
2707
- if (typeof value !== 'undefined') {
2708
- payload['value'] = value;
2709
- }
2710
- if (typeof min !== 'undefined') {
2711
- payload['min'] = min;
2712
- }
2713
- if (typeof transactionId !== 'undefined') {
2714
- payload['transactionId'] = transactionId;
2715
- }
2716
-
2717
- let response = undefined;
2718
-
2719
- response = await client.call('patch', apiPath, {
2720
- 'content-type': 'application/json',
2721
- }, payload);
2722
-
2723
- if (parseOutput) {
2724
- parse(response)
2725
- }
2726
-
2727
- return response;
2728
-
2729
- }
2730
- /**
2731
- * @typedef {Object} TablesDBIncrementRowColumnRequestParams
2732
- * @property {string} databaseId Database ID.
2733
- * @property {string} tableId Table ID.
2734
- * @property {string} rowId Row ID.
2735
- * @property {string} column Column key.
2736
- * @property {number} value Value to increment the column by. The value must be a number.
2737
- * @property {number} max Maximum value for the column. If the current value is greater than this value, an error will be thrown.
2738
- * @property {string} transactionId Transaction ID for staging the operation.
2739
- * @property {boolean} overrideForCli
2740
- * @property {boolean} parseOutput
2741
- * @property {libClient | undefined} sdk
2742
- */
2743
-
2744
- /**
2745
- * @param {TablesDBIncrementRowColumnRequestParams} params
2746
- */
2747
- const tablesDBIncrementRowColumn = async ({databaseId,tableId,rowId,column,value,max,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2748
- let client = !sdk ? await sdkForProject() :
2749
- sdk;
2750
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column);
2751
- let payload = {};
2752
- if (typeof value !== 'undefined') {
2753
- payload['value'] = value;
2754
- }
2755
- if (typeof max !== 'undefined') {
2756
- payload['max'] = max;
2757
- }
2758
- if (typeof transactionId !== 'undefined') {
2759
- payload['transactionId'] = transactionId;
2760
- }
2761
-
2762
- let response = undefined;
2763
-
2764
- response = await client.call('patch', apiPath, {
2765
- 'content-type': 'application/json',
2766
- }, payload);
2767
-
2768
- if (parseOutput) {
2769
- parse(response)
2770
- }
2771
-
2772
- return response;
2773
-
2774
- }
2775
- /**
2776
- * @typedef {Object} TablesDBGetTableUsageRequestParams
2777
- * @property {string} databaseId Database ID.
2778
- * @property {string} tableId Table ID.
2779
- * @property {UsageRange} range Date range.
2780
- * @property {boolean} overrideForCli
2781
- * @property {boolean} parseOutput
2782
- * @property {libClient | undefined} sdk
2783
- */
2784
-
2785
- /**
2786
- * @param {TablesDBGetTableUsageRequestParams} params
2787
- */
2788
- const tablesDBGetTableUsage = async ({databaseId,tableId,range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2789
- let client = !sdk ? await sdkForProject() :
2790
- sdk;
2791
- let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/usage'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
2792
- let payload = {};
2793
- if (typeof range !== 'undefined') {
2794
- payload['range'] = range;
2795
- }
2796
-
2797
- let response = undefined;
2798
-
2799
- response = await client.call('get', apiPath, {
2800
- }, payload);
2801
-
2802
- if (parseOutput) {
2803
- if(console) {
2804
- showConsoleLink('tablesDB', 'getTableUsage', databaseId, tableId);
2805
- } else {
2806
- parse(response)
2807
- }
2808
- }
2809
-
2810
- return response;
2811
-
2812
- }
2813
- /**
2814
- * @typedef {Object} TablesDBGetUsageRequestParams
2815
- * @property {string} databaseId Database ID.
2816
- * @property {UsageRange} range Date range.
2817
- * @property {boolean} overrideForCli
2818
- * @property {boolean} parseOutput
2819
- * @property {libClient | undefined} sdk
2820
- */
2821
-
2822
- /**
2823
- * @param {TablesDBGetUsageRequestParams} params
2824
- */
2825
- const tablesDBGetUsage = async ({databaseId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2826
- let client = !sdk ? await sdkForProject() :
2827
- sdk;
2828
- let apiPath = '/tablesdb/{databaseId}/usage'.replace('{databaseId}', databaseId);
2829
- let payload = {};
2830
- if (typeof range !== 'undefined') {
2831
- payload['range'] = range;
2832
- }
2833
-
2834
- let response = undefined;
2835
-
2836
- response = await client.call('get', apiPath, {
2837
- }, payload);
2838
-
2839
- if (parseOutput) {
2840
- parse(response)
2841
- }
2842
-
2843
- return response;
2844
-
2845
- }
2846
- tablesDB
2847
- .command(`list`)
2848
- .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`)
2849
- .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`)
2850
- .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2851
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
2852
- .option(`--console`, `Get the resource console url`)
2853
- .action(actionRunner(tablesDBList))
2854
-
2855
- tablesDB
2856
- .command(`create`)
2857
- .description(`Create a new Database. `)
2858
- .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.`)
2859
- .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
2860
- .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))
2861
- .action(actionRunner(tablesDBCreate))
2862
-
2863
- tablesDB
2864
- .command(`list-transactions`)
2865
- .description(`List transactions across all databases.`)
2866
- .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).`)
2867
- .option(`--console`, `Get the resource console url`)
2868
- .action(actionRunner(tablesDBListTransactions))
2869
-
2870
- tablesDB
2871
- .command(`create-transaction`)
2872
- .description(`Create a new transaction.`)
2873
- .option(`--ttl <ttl>`, `Seconds before the transaction expires.`, parseInteger)
2874
- .action(actionRunner(tablesDBCreateTransaction))
2875
-
2876
- tablesDB
2877
- .command(`get-transaction`)
2878
- .description(`Get a transaction by its unique ID.`)
2879
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
2880
- .option(`--console`, `Get the resource console url`)
2881
- .action(actionRunner(tablesDBGetTransaction))
2882
-
2883
- tablesDB
2884
- .command(`update-transaction`)
2885
- .description(`Update a transaction, to either commit or roll back its operations.`)
2886
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
2887
- .option(`--commit [value]`, `Commit transaction?`, (value) => value === undefined ? true : parseBool(value))
2888
- .option(`--rollback [value]`, `Rollback transaction?`, (value) => value === undefined ? true : parseBool(value))
2889
- .action(actionRunner(tablesDBUpdateTransaction))
2890
-
2891
- tablesDB
2892
- .command(`delete-transaction`)
2893
- .description(`Delete a transaction by its unique ID.`)
2894
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
2895
- .action(actionRunner(tablesDBDeleteTransaction))
2896
-
2897
- tablesDB
2898
- .command(`create-operations`)
2899
- .description(`Create multiple operations in a single transaction.`)
2900
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
2901
- .option(`--operations [operations...]`, `Array of staged operations.`)
2902
- .action(actionRunner(tablesDBCreateOperations))
2903
-
2904
- tablesDB
2905
- .command(`list-usage`)
2906
- .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.`)
2907
- .option(`--range <range>`, `Date range.`)
2908
- .option(`--console`, `Get the resource console url`)
2909
- .action(actionRunner(tablesDBListUsage))
2910
-
2911
- tablesDB
2912
- .command(`get`)
2913
- .description(`Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`)
2914
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2915
- .option(`--console`, `Get the resource console url`)
2916
- .action(actionRunner(tablesDBGet))
2917
-
2918
- tablesDB
2919
- .command(`update`)
2920
- .description(`Update a database by its unique ID.`)
2921
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2922
- .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
2923
- .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))
2924
- .action(actionRunner(tablesDBUpdate))
2925
-
2926
- tablesDB
2927
- .command(`delete`)
2928
- .description(`Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`)
2929
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2930
- .action(actionRunner(tablesDBDelete))
2931
-
2932
- tablesDB
2933
- .command(`list-tables`)
2934
- .description(`Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.`)
2935
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2936
- .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`)
2937
- .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2938
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
2939
- .option(`--console`, `Get the resource console url`)
2940
- .action(actionRunner(tablesDBListTables))
2941
-
2942
- tablesDB
2943
- .command(`create-table`)
2944
- .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/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.`)
2945
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2946
- .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.`)
2947
- .requiredOption(`--name <name>`, `Table name. Max length: 128 chars.`)
2948
- .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).`)
2949
- .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))
2950
- .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))
2951
- .action(actionRunner(tablesDBCreateTable))
2952
-
2953
- tablesDB
2954
- .command(`get-table`)
2955
- .description(`Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.`)
2956
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2957
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
2958
- .option(`--console`, `Get the resource console url`)
2959
- .action(actionRunner(tablesDBGetTable))
2960
-
2961
- tablesDB
2962
- .command(`update-table`)
2963
- .description(`Update a table by its unique ID.`)
2964
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2965
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
2966
- .requiredOption(`--name <name>`, `Table name. Max length: 128 chars.`)
2967
- .option(`--permissions [permissions...]`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2968
- .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))
2969
- .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))
2970
- .action(actionRunner(tablesDBUpdateTable))
2971
-
2972
- tablesDB
2973
- .command(`delete-table`)
2974
- .description(`Delete a table by its unique ID. Only users with write permissions have access to delete this resource.`)
2975
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2976
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
2977
- .action(actionRunner(tablesDBDeleteTable))
2978
-
2979
- tablesDB
2980
- .command(`list-columns`)
2981
- .description(`List columns in the table.`)
2982
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2983
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
2984
- .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`)
2985
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
2986
- .option(`--console`, `Get the resource console url`)
2987
- .action(actionRunner(tablesDBListColumns))
2988
-
2989
- tablesDB
2990
- .command(`create-boolean-column`)
2991
- .description(`Create a boolean column. `)
2992
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2993
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
2994
- .requiredOption(`--key <key>`, `Column Key.`)
2995
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
2996
- .option(`--xdefault [value]`, `Default value for column when not provided. Cannot be set when column is required.`, (value) => value === undefined ? true : parseBool(value))
2997
- .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
2998
- .action(actionRunner(tablesDBCreateBooleanColumn))
2999
-
3000
- tablesDB
3001
- .command(`update-boolean-column`)
3002
- .description(`Update a boolean column. Changing the 'default' value will not update already existing rows.`)
3003
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3004
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3005
- .requiredOption(`--key <key>`, `Column Key.`)
3006
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3007
- .option(`--xdefault [value]`, `Default value for column when not provided. Cannot be set when column is required.`, (value) => value === undefined ? true : parseBool(value))
3008
- .option(`--new-key <new-key>`, `New Column Key.`)
3009
- .action(actionRunner(tablesDBUpdateBooleanColumn))
3010
-
3011
- tablesDB
3012
- .command(`create-datetime-column`)
3013
- .description(`Create a date time column according to the ISO 8601 standard.`)
3014
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3015
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3016
- .requiredOption(`--key <key>`, `Column Key.`)
3017
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3018
- .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.`)
3019
- .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
3020
- .action(actionRunner(tablesDBCreateDatetimeColumn))
3021
-
3022
- tablesDB
3023
- .command(`update-datetime-column`)
3024
- .description(`Update a date time column. Changing the 'default' value will not update already existing rows.`)
3025
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3026
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3027
- .requiredOption(`--key <key>`, `Column Key.`)
3028
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3029
- .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
3030
- .option(`--new-key <new-key>`, `New Column Key.`)
3031
- .action(actionRunner(tablesDBUpdateDatetimeColumn))
3032
-
3033
- tablesDB
3034
- .command(`create-email-column`)
3035
- .description(`Create an email column. `)
3036
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3037
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3038
- .requiredOption(`--key <key>`, `Column Key.`)
3039
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3040
- .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
3041
- .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
3042
- .action(actionRunner(tablesDBCreateEmailColumn))
3043
-
3044
- tablesDB
3045
- .command(`update-email-column`)
3046
- .description(`Update an email column. Changing the 'default' value will not update already existing rows. `)
3047
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3048
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3049
- .requiredOption(`--key <key>`, `Column Key.`)
3050
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3051
- .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
3052
- .option(`--new-key <new-key>`, `New Column Key.`)
3053
- .action(actionRunner(tablesDBUpdateEmailColumn))
3054
-
3055
- tablesDB
3056
- .command(`create-enum-column`)
3057
- .description(`Create an enumeration column. The 'elements' param acts as a white-list of accepted values for this column.`)
3058
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3059
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3060
- .requiredOption(`--key <key>`, `Column Key.`)
3061
- .requiredOption(`--elements [elements...]`, `Array of enum values.`)
3062
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3063
- .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
3064
- .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
3065
- .action(actionRunner(tablesDBCreateEnumColumn))
3066
-
3067
- tablesDB
3068
- .command(`update-enum-column`)
3069
- .description(`Update an enum column. Changing the 'default' value will not update already existing rows. `)
3070
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3071
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3072
- .requiredOption(`--key <key>`, `Column Key.`)
3073
- .requiredOption(`--elements [elements...]`, `Updated list of enum values.`)
3074
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3075
- .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
3076
- .option(`--new-key <new-key>`, `New Column Key.`)
3077
- .action(actionRunner(tablesDBUpdateEnumColumn))
3078
-
3079
- tablesDB
3080
- .command(`create-float-column`)
3081
- .description(`Create a float column. Optionally, minimum and maximum values can be provided. `)
3082
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3083
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3084
- .requiredOption(`--key <key>`, `Column Key.`)
3085
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3086
- .option(`--min <min>`, `Minimum value`, parseInteger)
3087
- .option(`--max <max>`, `Maximum value`, parseInteger)
3088
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parseInteger)
3089
- .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
3090
- .action(actionRunner(tablesDBCreateFloatColumn))
3091
-
3092
- tablesDB
3093
- .command(`update-float-column`)
3094
- .description(`Update a float column. Changing the 'default' value will not update already existing rows. `)
3095
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3096
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3097
- .requiredOption(`--key <key>`, `Column Key.`)
3098
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3099
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parseInteger)
3100
- .option(`--min <min>`, `Minimum value`, parseInteger)
3101
- .option(`--max <max>`, `Maximum value`, parseInteger)
3102
- .option(`--new-key <new-key>`, `New Column Key.`)
3103
- .action(actionRunner(tablesDBUpdateFloatColumn))
3104
-
3105
- tablesDB
3106
- .command(`create-integer-column`)
3107
- .description(`Create an integer column. Optionally, minimum and maximum values can be provided. `)
3108
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3109
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3110
- .requiredOption(`--key <key>`, `Column Key.`)
3111
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3112
- .option(`--min <min>`, `Minimum value`, parseInteger)
3113
- .option(`--max <max>`, `Maximum value`, parseInteger)
3114
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`, parseInteger)
3115
- .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
3116
- .action(actionRunner(tablesDBCreateIntegerColumn))
3117
-
3118
- tablesDB
3119
- .command(`update-integer-column`)
3120
- .description(`Update an integer column. Changing the 'default' value will not update already existing rows. `)
3121
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3122
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3123
- .requiredOption(`--key <key>`, `Column Key.`)
3124
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3125
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`, parseInteger)
3126
- .option(`--min <min>`, `Minimum value`, parseInteger)
3127
- .option(`--max <max>`, `Maximum value`, parseInteger)
3128
- .option(`--new-key <new-key>`, `New Column Key.`)
3129
- .action(actionRunner(tablesDBUpdateIntegerColumn))
3130
-
3131
- tablesDB
3132
- .command(`create-ip-column`)
3133
- .description(`Create IP address column. `)
3134
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3135
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3136
- .requiredOption(`--key <key>`, `Column Key.`)
3137
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3138
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`)
3139
- .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
3140
- .action(actionRunner(tablesDBCreateIpColumn))
3141
-
3142
- tablesDB
3143
- .command(`update-ip-column`)
3144
- .description(`Update an ip column. Changing the 'default' value will not update already existing rows. `)
3145
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3146
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3147
- .requiredOption(`--key <key>`, `Column Key.`)
3148
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3149
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`)
3150
- .option(`--new-key <new-key>`, `New Column Key.`)
3151
- .action(actionRunner(tablesDBUpdateIpColumn))
3152
-
3153
- tablesDB
3154
- .command(`create-line-column`)
3155
- .description(`Create a geometric line column.`)
3156
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3157
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3158
- .requiredOption(`--key <key>`, `Column Key.`)
3159
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3160
- .option(`--xdefault <xdefault>`, `Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.`)
3161
- .action(actionRunner(tablesDBCreateLineColumn))
3162
-
3163
- tablesDB
3164
- .command(`update-line-column`)
3165
- .description(`Update a line column. Changing the 'default' value will not update already existing rows.`)
3166
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3167
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3168
- .requiredOption(`--key <key>`, `Column Key.`)
3169
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3170
- .option(`--xdefault <xdefault>`, `Default value for column when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when column is required.`)
3171
- .option(`--new-key <new-key>`, `New Column Key.`)
3172
- .action(actionRunner(tablesDBUpdateLineColumn))
3173
-
3174
- tablesDB
3175
- .command(`create-point-column`)
3176
- .description(`Create a geometric point column.`)
3177
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3178
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3179
- .requiredOption(`--key <key>`, `Column Key.`)
3180
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3181
- .option(`--xdefault <xdefault>`, `Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.`)
3182
- .action(actionRunner(tablesDBCreatePointColumn))
3183
-
3184
- tablesDB
3185
- .command(`update-point-column`)
3186
- .description(`Update a point column. Changing the 'default' value will not update already existing rows.`)
3187
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3188
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3189
- .requiredOption(`--key <key>`, `Column Key.`)
3190
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3191
- .option(`--xdefault <xdefault>`, `Default value for column when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when column is required.`)
3192
- .option(`--new-key <new-key>`, `New Column Key.`)
3193
- .action(actionRunner(tablesDBUpdatePointColumn))
3194
-
3195
- tablesDB
3196
- .command(`create-polygon-column`)
3197
- .description(`Create a geometric polygon column.`)
3198
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3199
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3200
- .requiredOption(`--key <key>`, `Column Key.`)
3201
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3202
- .option(`--xdefault <xdefault>`, `Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.`)
3203
- .action(actionRunner(tablesDBCreatePolygonColumn))
3204
-
3205
- tablesDB
3206
- .command(`update-polygon-column`)
3207
- .description(`Update a polygon column. Changing the 'default' value will not update already existing rows.`)
3208
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3209
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3210
- .requiredOption(`--key <key>`, `Column Key.`)
3211
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3212
- .option(`--xdefault <xdefault>`, `Default value for column when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when column is required.`)
3213
- .option(`--new-key <new-key>`, `New Column Key.`)
3214
- .action(actionRunner(tablesDBUpdatePolygonColumn))
3215
-
3216
- tablesDB
3217
- .command(`create-relationship-column`)
3218
- .description(`Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). `)
3219
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3220
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3221
- .requiredOption(`--related-table-id <related-table-id>`, `Related Table ID.`)
3222
- .requiredOption(`--type <type>`, `Relation type`)
3223
- .option(`--two-way [value]`, `Is Two Way?`, (value) => value === undefined ? true : parseBool(value))
3224
- .option(`--key <key>`, `Column Key.`)
3225
- .option(`--two-way-key <two-way-key>`, `Two Way Column Key.`)
3226
- .option(`--on-delete <on-delete>`, `Constraints option`)
3227
- .action(actionRunner(tablesDBCreateRelationshipColumn))
3228
-
3229
- tablesDB
3230
- .command(`create-string-column`)
3231
- .description(`Create a string column. `)
3232
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3233
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3234
- .requiredOption(`--key <key>`, `Column Key.`)
3235
- .requiredOption(`--size <size>`, `Column size for text columns, in number of characters.`, parseInteger)
3236
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3237
- .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
3238
- .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
3239
- .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))
3240
- .action(actionRunner(tablesDBCreateStringColumn))
3241
-
3242
- tablesDB
3243
- .command(`update-string-column`)
3244
- .description(`Update a string column. Changing the 'default' value will not update already existing rows. `)
3245
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3246
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3247
- .requiredOption(`--key <key>`, `Column Key.`)
3248
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3249
- .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
3250
- .option(`--size <size>`, `Maximum size of the string column.`, parseInteger)
3251
- .option(`--new-key <new-key>`, `New Column Key.`)
3252
- .action(actionRunner(tablesDBUpdateStringColumn))
3253
-
3254
- tablesDB
3255
- .command(`create-url-column`)
3256
- .description(`Create a URL column. `)
3257
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3258
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3259
- .requiredOption(`--key <key>`, `Column Key.`)
3260
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3261
- .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
3262
- .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : parseBool(value))
3263
- .action(actionRunner(tablesDBCreateUrlColumn))
3264
-
3265
- tablesDB
3266
- .command(`update-url-column`)
3267
- .description(`Update an url column. Changing the 'default' value will not update already existing rows. `)
3268
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3269
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3270
- .requiredOption(`--key <key>`, `Column Key.`)
3271
- .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : parseBool(value))
3272
- .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
3273
- .option(`--new-key <new-key>`, `New Column Key.`)
3274
- .action(actionRunner(tablesDBUpdateUrlColumn))
3275
-
3276
- tablesDB
3277
- .command(`get-column`)
3278
- .description(`Get column by ID.`)
3279
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3280
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3281
- .requiredOption(`--key <key>`, `Column Key.`)
3282
- .option(`--console`, `Get the resource console url`)
3283
- .action(actionRunner(tablesDBGetColumn))
3284
-
3285
- tablesDB
3286
- .command(`delete-column`)
3287
- .description(`Deletes a column.`)
3288
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3289
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3290
- .requiredOption(`--key <key>`, `Column Key.`)
3291
- .action(actionRunner(tablesDBDeleteColumn))
3292
-
3293
- tablesDB
3294
- .command(`update-relationship-column`)
3295
- .description(`Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). `)
3296
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3297
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3298
- .requiredOption(`--key <key>`, `Column Key.`)
3299
- .option(`--on-delete <on-delete>`, `Constraints option`)
3300
- .option(`--new-key <new-key>`, `New Column Key.`)
3301
- .action(actionRunner(tablesDBUpdateRelationshipColumn))
3302
-
3303
- tablesDB
3304
- .command(`list-indexes`)
3305
- .description(`List indexes on the table.`)
3306
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3307
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3308
- .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`)
3309
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
3310
- .option(`--console`, `Get the resource console url`)
3311
- .action(actionRunner(tablesDBListIndexes))
3312
-
3313
- tablesDB
3314
- .command(`create-index`)
3315
- .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'.`)
3316
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3317
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3318
- .requiredOption(`--key <key>`, `Index Key.`)
3319
- .requiredOption(`--type <type>`, `Index type.`)
3320
- .requiredOption(`--columns [columns...]`, `Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.`)
3321
- .option(`--orders [orders...]`, `Array of index orders. Maximum of 100 orders are allowed.`)
3322
- .option(`--lengths [lengths...]`, `Length of index. Maximum of 100`)
3323
- .action(actionRunner(tablesDBCreateIndex))
3324
-
3325
- tablesDB
3326
- .command(`get-index`)
3327
- .description(`Get index by ID.`)
3328
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3329
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3330
- .requiredOption(`--key <key>`, `Index Key.`)
3331
- .action(actionRunner(tablesDBGetIndex))
3332
-
3333
- tablesDB
3334
- .command(`delete-index`)
3335
- .description(`Delete an index.`)
3336
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3337
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3338
- .requiredOption(`--key <key>`, `Index Key.`)
3339
- .action(actionRunner(tablesDBDeleteIndex))
3340
-
3341
- tablesDB
3342
- .command(`list-table-logs`)
3343
- .description(`Get the table activity logs list by its unique ID.`)
3344
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3345
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3346
- .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`)
3347
- .option(`--console`, `Get the resource console url`)
3348
- .action(actionRunner(tablesDBListTableLogs))
3349
-
3350
- tablesDB
3351
- .command(`list-rows`)
3352
- .description(`Get a list of all the user's rows in a given table. You can use the query params to filter your results.`)
3353
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3354
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table).`)
3355
- .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.`)
3356
- .option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`)
3357
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
3358
- .option(`--console`, `Get the resource console url`)
3359
- .action(actionRunner(tablesDBListRows))
3360
-
3361
- tablesDB
3362
- .command(`create-row`)
3363
- .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/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.`)
3364
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3365
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows.`)
3366
- .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.`)
3367
- .requiredOption(`--data <data>`, `Row data as JSON object.`)
3368
- .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).`)
3369
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3370
- .action(actionRunner(tablesDBCreateRow))
3371
-
3372
- tablesDB
3373
- .command(`create-rows`)
3374
- .description(`Create new Rows. Before using this route, you should create a new table resource using either a [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.`)
3375
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3376
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). Make sure to define columns before creating rows.`)
3377
- .requiredOption(`--rows [rows...]`, `Array of rows data as JSON objects.`)
3378
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3379
- .action(actionRunner(tablesDBCreateRows))
3380
-
3381
- tablesDB
3382
- .command(`upsert-rows`)
3383
- .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/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console. `)
3384
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3385
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3386
- .requiredOption(`--rows [rows...]`, `Array of row data as JSON objects. May contain partial rows.`)
3387
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3388
- .action(actionRunner(tablesDBUpsertRows))
3389
-
3390
- tablesDB
3391
- .command(`update-rows`)
3392
- .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.`)
3393
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3394
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3395
- .option(`--data <data>`, `Row data as JSON object. Include only column and value pairs to be updated.`)
3396
- .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.`)
3397
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3398
- .action(actionRunner(tablesDBUpdateRows))
3399
-
3400
- tablesDB
3401
- .command(`delete-rows`)
3402
- .description(`Bulk delete rows using queries, if no queries are passed then all rows are deleted.`)
3403
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3404
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3405
- .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.`)
3406
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3407
- .action(actionRunner(tablesDBDeleteRows))
3408
-
3409
- tablesDB
3410
- .command(`get-row`)
3411
- .description(`Get a row by its unique ID. This endpoint response returns a JSON object with the row data.`)
3412
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3413
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3414
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
3415
- .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.`)
3416
- .option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`)
3417
- .option(`--console`, `Get the resource console url`)
3418
- .action(actionRunner(tablesDBGetRow))
3419
-
3420
- tablesDB
3421
- .command(`upsert-row`)
3422
- .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/references/cloud/server-dart/tablesDB#createTable) API or directly from your database console.`)
3423
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3424
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3425
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
3426
- .option(`--data <data>`, `Row data as JSON object. Include all required columns of the row to be created or updated.`)
3427
- .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
3428
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3429
- .action(actionRunner(tablesDBUpsertRow))
3430
-
3431
- tablesDB
3432
- .command(`update-row`)
3433
- .description(`Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.`)
3434
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3435
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3436
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
3437
- .option(`--data <data>`, `Row data as JSON object. Include only columns and value pairs to be updated.`)
3438
- .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
3439
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3440
- .action(actionRunner(tablesDBUpdateRow))
3441
-
3442
- tablesDB
3443
- .command(`delete-row`)
3444
- .description(`Delete a row by its unique ID.`)
3445
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3446
- .requiredOption(`--table-id <table-id>`, `Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable).`)
3447
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
3448
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3449
- .action(actionRunner(tablesDBDeleteRow))
3450
-
3451
- tablesDB
3452
- .command(`list-row-logs`)
3453
- .description(`Get the row activity logs list by its unique ID.`)
3454
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3455
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3456
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
3457
- .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`)
3458
- .option(`--console`, `Get the resource console url`)
3459
- .action(actionRunner(tablesDBListRowLogs))
3460
-
3461
- tablesDB
3462
- .command(`decrement-row-column`)
3463
- .description(`Decrement a specific column of a row by a given value.`)
3464
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3465
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3466
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
3467
- .requiredOption(`--column <column>`, `Column key.`)
3468
- .option(`--value <value>`, `Value to increment the column by. The value must be a number.`, parseInteger)
3469
- .option(`--min <min>`, `Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.`, parseInteger)
3470
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3471
- .action(actionRunner(tablesDBDecrementRowColumn))
3472
-
3473
- tablesDB
3474
- .command(`increment-row-column`)
3475
- .description(`Increment a specific column of a row by a given value.`)
3476
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3477
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3478
- .requiredOption(`--row-id <row-id>`, `Row ID.`)
3479
- .requiredOption(`--column <column>`, `Column key.`)
3480
- .option(`--value <value>`, `Value to increment the column by. The value must be a number.`, parseInteger)
3481
- .option(`--max <max>`, `Maximum value for the column. If the current value is greater than this value, an error will be thrown.`, parseInteger)
3482
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3483
- .action(actionRunner(tablesDBIncrementRowColumn))
3484
-
3485
- tablesDB
3486
- .command(`get-table-usage`)
3487
- .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.`)
3488
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3489
- .requiredOption(`--table-id <table-id>`, `Table ID.`)
3490
- .option(`--range <range>`, `Date range.`)
3491
- .option(`--console`, `Get the resource console url`)
3492
- .action(actionRunner(tablesDBGetTableUsage))
3493
-
3494
- tablesDB
3495
- .command(`get-usage`)
3496
- .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.`)
3497
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3498
- .option(`--range <range>`, `Date range.`)
3499
- .action(actionRunner(tablesDBGetUsage))
3500
-
3501
- module.exports = {
3502
- tablesDB,
3503
- tablesDBList,
3504
- tablesDBCreate,
3505
- tablesDBListTransactions,
3506
- tablesDBCreateTransaction,
3507
- tablesDBGetTransaction,
3508
- tablesDBUpdateTransaction,
3509
- tablesDBDeleteTransaction,
3510
- tablesDBCreateOperations,
3511
- tablesDBListUsage,
3512
- tablesDBGet,
3513
- tablesDBUpdate,
3514
- tablesDBDelete,
3515
- tablesDBListTables,
3516
- tablesDBCreateTable,
3517
- tablesDBGetTable,
3518
- tablesDBUpdateTable,
3519
- tablesDBDeleteTable,
3520
- tablesDBListColumns,
3521
- tablesDBCreateBooleanColumn,
3522
- tablesDBUpdateBooleanColumn,
3523
- tablesDBCreateDatetimeColumn,
3524
- tablesDBUpdateDatetimeColumn,
3525
- tablesDBCreateEmailColumn,
3526
- tablesDBUpdateEmailColumn,
3527
- tablesDBCreateEnumColumn,
3528
- tablesDBUpdateEnumColumn,
3529
- tablesDBCreateFloatColumn,
3530
- tablesDBUpdateFloatColumn,
3531
- tablesDBCreateIntegerColumn,
3532
- tablesDBUpdateIntegerColumn,
3533
- tablesDBCreateIpColumn,
3534
- tablesDBUpdateIpColumn,
3535
- tablesDBCreateLineColumn,
3536
- tablesDBUpdateLineColumn,
3537
- tablesDBCreatePointColumn,
3538
- tablesDBUpdatePointColumn,
3539
- tablesDBCreatePolygonColumn,
3540
- tablesDBUpdatePolygonColumn,
3541
- tablesDBCreateRelationshipColumn,
3542
- tablesDBCreateStringColumn,
3543
- tablesDBUpdateStringColumn,
3544
- tablesDBCreateUrlColumn,
3545
- tablesDBUpdateUrlColumn,
3546
- tablesDBGetColumn,
3547
- tablesDBDeleteColumn,
3548
- tablesDBUpdateRelationshipColumn,
3549
- tablesDBListIndexes,
3550
- tablesDBCreateIndex,
3551
- tablesDBGetIndex,
3552
- tablesDBDeleteIndex,
3553
- tablesDBListTableLogs,
3554
- tablesDBListRows,
3555
- tablesDBCreateRow,
3556
- tablesDBCreateRows,
3557
- tablesDBUpsertRows,
3558
- tablesDBUpdateRows,
3559
- tablesDBDeleteRows,
3560
- tablesDBGetRow,
3561
- tablesDBUpsertRow,
3562
- tablesDBUpdateRow,
3563
- tablesDBDeleteRow,
3564
- tablesDBListRowLogs,
3565
- tablesDBDecrementRowColumn,
3566
- tablesDBIncrementRowColumn,
3567
- tablesDBGetTableUsage,
3568
- tablesDBGetUsage
3569
- };