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,3590 +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 databases = new Command("databases").description(commandDescriptions['databases'] ?? '').configureHelp({
39
- helpWidth: process.stdout.columns || 80
40
- })
41
-
42
- /**
43
- * @typedef {Object} DatabasesListRequestParams
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 attributes: 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 {DatabasesListRequestParams} params
54
- */
55
- const databasesList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
56
- let client = !sdk ? await sdkForProject() :
57
- sdk;
58
- let apiPath = '/databases';
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('databases', 'list');
78
- } else {
79
- parse(response)
80
- }
81
- }
82
-
83
- return response;
84
-
85
- }
86
- /**
87
- * @typedef {Object} DatabasesCreateRequestParams
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 {DatabasesCreateRequestParams} params
98
- */
99
- const databasesCreate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
100
- let client = !sdk ? await sdkForProject() :
101
- sdk;
102
- let apiPath = '/databases';
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} DatabasesListTransactionsRequestParams
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 {DatabasesListTransactionsRequestParams} params
137
- */
138
- const databasesListTransactions = async ({queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
139
- let client = !sdk ? await sdkForProject() :
140
- sdk;
141
- let apiPath = '/databases/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('databases', 'listTransactions');
155
- } else {
156
- parse(response)
157
- }
158
- }
159
-
160
- return response;
161
-
162
- }
163
- /**
164
- * @typedef {Object} DatabasesCreateTransactionRequestParams
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 {DatabasesCreateTransactionRequestParams} params
173
- */
174
- const databasesCreateTransaction = async ({ttl,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
175
- let client = !sdk ? await sdkForProject() :
176
- sdk;
177
- let apiPath = '/databases/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} DatabasesGetTransactionRequestParams
198
- * @property {string} transactionId Transaction ID.
199
- * @property {boolean} overrideForCli
200
- * @property {boolean} parseOutput
201
- * @property {libClient | undefined} sdk
202
- */
203
-
204
- /**
205
- * @param {DatabasesGetTransactionRequestParams} params
206
- */
207
- const databasesGetTransaction = async ({transactionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
208
- let client = !sdk ? await sdkForProject() :
209
- sdk;
210
- let apiPath = '/databases/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('databases', 'getTransaction', transactionId);
221
- } else {
222
- parse(response)
223
- }
224
- }
225
-
226
- return response;
227
-
228
- }
229
- /**
230
- * @typedef {Object} DatabasesUpdateTransactionRequestParams
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 {DatabasesUpdateTransactionRequestParams} params
241
- */
242
- const databasesUpdateTransaction = async ({transactionId,commit,rollback,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
243
- let client = !sdk ? await sdkForProject() :
244
- sdk;
245
- let apiPath = '/databases/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} DatabasesDeleteTransactionRequestParams
269
- * @property {string} transactionId Transaction ID.
270
- * @property {boolean} overrideForCli
271
- * @property {boolean} parseOutput
272
- * @property {libClient | undefined} sdk
273
- */
274
-
275
- /**
276
- * @param {DatabasesDeleteTransactionRequestParams} params
277
- */
278
- const databasesDeleteTransaction = async ({transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
279
- let client = !sdk ? await sdkForProject() :
280
- sdk;
281
- let apiPath = '/databases/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} DatabasesCreateOperationsRequestParams
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 {DatabasesCreateOperationsRequestParams} params
308
- */
309
- const databasesCreateOperations = async ({transactionId,operations,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
310
- let client = !sdk ? await sdkForProject() :
311
- sdk;
312
- let apiPath = '/databases/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} DatabasesListUsageRequestParams
334
- * @property {UsageRange} range Date range.
335
- * @property {boolean} overrideForCli
336
- * @property {boolean} parseOutput
337
- * @property {libClient | undefined} sdk
338
- */
339
-
340
- /**
341
- * @param {DatabasesListUsageRequestParams} params
342
- */
343
- const databasesListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
344
- let client = !sdk ? await sdkForProject() :
345
- sdk;
346
- let apiPath = '/databases/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('databases', 'listUsage');
360
- } else {
361
- parse(response)
362
- }
363
- }
364
-
365
- return response;
366
-
367
- }
368
- /**
369
- * @typedef {Object} DatabasesGetRequestParams
370
- * @property {string} databaseId Database ID.
371
- * @property {boolean} overrideForCli
372
- * @property {boolean} parseOutput
373
- * @property {libClient | undefined} sdk
374
- */
375
-
376
- /**
377
- * @param {DatabasesGetRequestParams} params
378
- */
379
- const databasesGet = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
380
- let client = !sdk ? await sdkForProject() :
381
- sdk;
382
- let apiPath = '/databases/{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('databases', 'get', databaseId);
393
- } else {
394
- parse(response)
395
- }
396
- }
397
-
398
- return response;
399
-
400
- }
401
- /**
402
- * @typedef {Object} DatabasesUpdateRequestParams
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 {DatabasesUpdateRequestParams} params
413
- */
414
- const databasesUpdate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
415
- let client = !sdk ? await sdkForProject() :
416
- sdk;
417
- let apiPath = '/databases/{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} DatabasesDeleteRequestParams
441
- * @property {string} databaseId Database ID.
442
- * @property {boolean} overrideForCli
443
- * @property {boolean} parseOutput
444
- * @property {libClient | undefined} sdk
445
- */
446
-
447
- /**
448
- * @param {DatabasesDeleteRequestParams} params
449
- */
450
- const databasesDelete = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
451
- let client = !sdk ? await sdkForProject() :
452
- sdk;
453
- let apiPath = '/databases/{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} DatabasesListCollectionsRequestParams
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 attributes: name, enabled, documentSecurity
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 {DatabasesListCollectionsRequestParams} params
482
- */
483
- const databasesListCollections = async ({databaseId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
484
- let client = !sdk ? await sdkForProject() :
485
- sdk;
486
- let apiPath = '/databases/{databaseId}/collections'.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('databases', 'listCollections', databaseId);
506
- } else {
507
- parse(response)
508
- }
509
- }
510
-
511
- return response;
512
-
513
- }
514
- /**
515
- * @typedef {Object} DatabasesCreateCollectionRequestParams
516
- * @property {string} databaseId Database ID.
517
- * @property {string} collectionId 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 Collection 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} documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
521
- * @property {boolean} enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. 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 {DatabasesCreateCollectionRequestParams} params
529
- */
530
- const databasesCreateCollection = async ({databaseId,collectionId,name,permissions,documentSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
531
- let client = !sdk ? await sdkForProject() :
532
- sdk;
533
- let apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
534
- let payload = {};
535
- if (typeof collectionId !== 'undefined') {
536
- payload['collectionId'] = collectionId;
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 documentSecurity !== 'undefined') {
546
- payload['documentSecurity'] = documentSecurity;
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} DatabasesGetCollectionRequestParams
567
- * @property {string} databaseId Database ID.
568
- * @property {string} collectionId Collection ID.
569
- * @property {boolean} overrideForCli
570
- * @property {boolean} parseOutput
571
- * @property {libClient | undefined} sdk
572
- */
573
-
574
- /**
575
- * @param {DatabasesGetCollectionRequestParams} params
576
- */
577
- const databasesGetCollection = async ({databaseId,collectionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
578
- let client = !sdk ? await sdkForProject() :
579
- sdk;
580
- let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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('databases', 'getCollection', databaseId, collectionId);
591
- } else {
592
- parse(response)
593
- }
594
- }
595
-
596
- return response;
597
-
598
- }
599
- /**
600
- * @typedef {Object} DatabasesUpdateCollectionRequestParams
601
- * @property {string} databaseId Database ID.
602
- * @property {string} collectionId Collection ID.
603
- * @property {string} name Collection 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} documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
606
- * @property {boolean} enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. 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 {DatabasesUpdateCollectionRequestParams} params
614
- */
615
- const databasesUpdateCollection = async ({databaseId,collectionId,name,permissions,documentSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
616
- let client = !sdk ? await sdkForProject() :
617
- sdk;
618
- let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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 documentSecurity !== 'undefined') {
628
- payload['documentSecurity'] = documentSecurity;
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} DatabasesDeleteCollectionRequestParams
649
- * @property {string} databaseId Database ID.
650
- * @property {string} collectionId Collection ID.
651
- * @property {boolean} overrideForCli
652
- * @property {boolean} parseOutput
653
- * @property {libClient | undefined} sdk
654
- */
655
-
656
- /**
657
- * @param {DatabasesDeleteCollectionRequestParams} params
658
- */
659
- const databasesDeleteCollection = async ({databaseId,collectionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
660
- let client = !sdk ? await sdkForProject() :
661
- sdk;
662
- let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesListAttributesRequestParams
680
- * @property {string} databaseId Database ID.
681
- * @property {string} collectionId Collection 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 attributes: 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 {DatabasesListAttributesRequestParams} params
691
- */
692
- const databasesListAttributes = async ({databaseId,collectionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
693
- let client = !sdk ? await sdkForProject() :
694
- sdk;
695
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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('databases', 'listAttributes', databaseId, collectionId);
712
- } else {
713
- parse(response)
714
- }
715
- }
716
-
717
- return response;
718
-
719
- }
720
- /**
721
- * @typedef {Object} DatabasesCreateBooleanAttributeRequestParams
722
- * @property {string} databaseId Database ID.
723
- * @property {string} collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
724
- * @property {string} key Attribute Key.
725
- * @property {boolean} required Is attribute required?
726
- * @property {boolean} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
727
- * @property {boolean} array Is attribute an array?
728
- * @property {boolean} overrideForCli
729
- * @property {boolean} parseOutput
730
- * @property {libClient | undefined} sdk
731
- */
732
-
733
- /**
734
- * @param {DatabasesCreateBooleanAttributeRequestParams} params
735
- */
736
- const databasesCreateBooleanAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
737
- let client = !sdk ? await sdkForProject() :
738
- sdk;
739
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdateBooleanAttributeRequestParams
769
- * @property {string} databaseId Database ID.
770
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
771
- * @property {string} key Attribute Key.
772
- * @property {boolean} required Is attribute required?
773
- * @property {boolean} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
774
- * @property {string} newKey New attribute key.
775
- * @property {boolean} overrideForCli
776
- * @property {boolean} parseOutput
777
- * @property {libClient | undefined} sdk
778
- */
779
-
780
- /**
781
- * @param {DatabasesUpdateBooleanAttributeRequestParams} params
782
- */
783
- const databasesUpdateBooleanAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
784
- let client = !sdk ? await sdkForProject() :
785
- sdk;
786
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreateDatetimeAttributeRequestParams
813
- * @property {string} databaseId Database ID.
814
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
815
- * @property {string} key Attribute Key.
816
- * @property {boolean} required Is attribute required?
817
- * @property {string} xdefault Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.
818
- * @property {boolean} array Is attribute an array?
819
- * @property {boolean} overrideForCli
820
- * @property {boolean} parseOutput
821
- * @property {libClient | undefined} sdk
822
- */
823
-
824
- /**
825
- * @param {DatabasesCreateDatetimeAttributeRequestParams} params
826
- */
827
- const databasesCreateDatetimeAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
828
- let client = !sdk ? await sdkForProject() :
829
- sdk;
830
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdateDatetimeAttributeRequestParams
860
- * @property {string} databaseId Database ID.
861
- * @property {string} collectionId Collection ID.
862
- * @property {string} key Attribute Key.
863
- * @property {boolean} required Is attribute required?
864
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
865
- * @property {string} newKey New attribute key.
866
- * @property {boolean} overrideForCli
867
- * @property {boolean} parseOutput
868
- * @property {libClient | undefined} sdk
869
- */
870
-
871
- /**
872
- * @param {DatabasesUpdateDatetimeAttributeRequestParams} params
873
- */
874
- const databasesUpdateDatetimeAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
875
- let client = !sdk ? await sdkForProject() :
876
- sdk;
877
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreateEmailAttributeRequestParams
904
- * @property {string} databaseId Database ID.
905
- * @property {string} collectionId Collection ID.
906
- * @property {string} key Attribute Key.
907
- * @property {boolean} required Is attribute required?
908
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
909
- * @property {boolean} array Is attribute an array?
910
- * @property {boolean} overrideForCli
911
- * @property {boolean} parseOutput
912
- * @property {libClient | undefined} sdk
913
- */
914
-
915
- /**
916
- * @param {DatabasesCreateEmailAttributeRequestParams} params
917
- */
918
- const databasesCreateEmailAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
919
- let client = !sdk ? await sdkForProject() :
920
- sdk;
921
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdateEmailAttributeRequestParams
951
- * @property {string} databaseId Database ID.
952
- * @property {string} collectionId Collection ID.
953
- * @property {string} key Attribute Key.
954
- * @property {boolean} required Is attribute required?
955
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
956
- * @property {string} newKey New Attribute Key.
957
- * @property {boolean} overrideForCli
958
- * @property {boolean} parseOutput
959
- * @property {libClient | undefined} sdk
960
- */
961
-
962
- /**
963
- * @param {DatabasesUpdateEmailAttributeRequestParams} params
964
- */
965
- const databasesUpdateEmailAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
966
- let client = !sdk ? await sdkForProject() :
967
- sdk;
968
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreateEnumAttributeRequestParams
995
- * @property {string} databaseId Database ID.
996
- * @property {string} collectionId Collection ID.
997
- * @property {string} key Attribute Key.
998
- * @property {string[]} elements Array of enum values.
999
- * @property {boolean} required Is attribute required?
1000
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1001
- * @property {boolean} array Is attribute an array?
1002
- * @property {boolean} overrideForCli
1003
- * @property {boolean} parseOutput
1004
- * @property {libClient | undefined} sdk
1005
- */
1006
-
1007
- /**
1008
- * @param {DatabasesCreateEnumAttributeRequestParams} params
1009
- */
1010
- const databasesCreateEnumAttribute = async ({databaseId,collectionId,key,elements,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1011
- let client = !sdk ? await sdkForProject() :
1012
- sdk;
1013
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdateEnumAttributeRequestParams
1047
- * @property {string} databaseId Database ID.
1048
- * @property {string} collectionId Collection ID.
1049
- * @property {string} key Attribute Key.
1050
- * @property {string[]} elements Updated list of enum values.
1051
- * @property {boolean} required Is attribute required?
1052
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1053
- * @property {string} newKey New Attribute Key.
1054
- * @property {boolean} overrideForCli
1055
- * @property {boolean} parseOutput
1056
- * @property {libClient | undefined} sdk
1057
- */
1058
-
1059
- /**
1060
- * @param {DatabasesUpdateEnumAttributeRequestParams} params
1061
- */
1062
- const databasesUpdateEnumAttribute = async ({databaseId,collectionId,key,elements,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1063
- let client = !sdk ? await sdkForProject() :
1064
- sdk;
1065
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreateFloatAttributeRequestParams
1096
- * @property {string} databaseId Database ID.
1097
- * @property {string} collectionId Collection ID.
1098
- * @property {string} key Attribute Key.
1099
- * @property {boolean} required Is attribute 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 attribute an array?
1104
- * @property {boolean} overrideForCli
1105
- * @property {boolean} parseOutput
1106
- * @property {libClient | undefined} sdk
1107
- */
1108
-
1109
- /**
1110
- * @param {DatabasesCreateFloatAttributeRequestParams} params
1111
- */
1112
- const databasesCreateFloatAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1113
- let client = !sdk ? await sdkForProject() :
1114
- sdk;
1115
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdateFloatAttributeRequestParams
1151
- * @property {string} databaseId Database ID.
1152
- * @property {string} collectionId Collection ID.
1153
- * @property {string} key Attribute Key.
1154
- * @property {boolean} required Is attribute 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 Attribute Key.
1159
- * @property {boolean} overrideForCli
1160
- * @property {boolean} parseOutput
1161
- * @property {libClient | undefined} sdk
1162
- */
1163
-
1164
- /**
1165
- * @param {DatabasesUpdateFloatAttributeRequestParams} params
1166
- */
1167
- const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1168
- let client = !sdk ? await sdkForProject() :
1169
- sdk;
1170
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreateIntegerAttributeRequestParams
1203
- * @property {string} databaseId Database ID.
1204
- * @property {string} collectionId Collection ID.
1205
- * @property {string} key Attribute Key.
1206
- * @property {boolean} required Is attribute required?
1207
- * @property {number} min Minimum value
1208
- * @property {number} max Maximum value
1209
- * @property {number} xdefault Default value. Cannot be set when attribute is required.
1210
- * @property {boolean} array Is attribute an array?
1211
- * @property {boolean} overrideForCli
1212
- * @property {boolean} parseOutput
1213
- * @property {libClient | undefined} sdk
1214
- */
1215
-
1216
- /**
1217
- * @param {DatabasesCreateIntegerAttributeRequestParams} params
1218
- */
1219
- const databasesCreateIntegerAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1220
- let client = !sdk ? await sdkForProject() :
1221
- sdk;
1222
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdateIntegerAttributeRequestParams
1258
- * @property {string} databaseId Database ID.
1259
- * @property {string} collectionId Collection ID.
1260
- * @property {string} key Attribute Key.
1261
- * @property {boolean} required Is attribute required?
1262
- * @property {number} xdefault Default value. Cannot be set when attribute is required.
1263
- * @property {number} min Minimum value
1264
- * @property {number} max Maximum value
1265
- * @property {string} newKey New Attribute Key.
1266
- * @property {boolean} overrideForCli
1267
- * @property {boolean} parseOutput
1268
- * @property {libClient | undefined} sdk
1269
- */
1270
-
1271
- /**
1272
- * @param {DatabasesUpdateIntegerAttributeRequestParams} params
1273
- */
1274
- const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1275
- let client = !sdk ? await sdkForProject() :
1276
- sdk;
1277
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreateIpAttributeRequestParams
1310
- * @property {string} databaseId Database ID.
1311
- * @property {string} collectionId Collection ID.
1312
- * @property {string} key Attribute Key.
1313
- * @property {boolean} required Is attribute required?
1314
- * @property {string} xdefault Default value. Cannot be set when attribute is required.
1315
- * @property {boolean} array Is attribute an array?
1316
- * @property {boolean} overrideForCli
1317
- * @property {boolean} parseOutput
1318
- * @property {libClient | undefined} sdk
1319
- */
1320
-
1321
- /**
1322
- * @param {DatabasesCreateIpAttributeRequestParams} params
1323
- */
1324
- const databasesCreateIpAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1325
- let client = !sdk ? await sdkForProject() :
1326
- sdk;
1327
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdateIpAttributeRequestParams
1357
- * @property {string} databaseId Database ID.
1358
- * @property {string} collectionId Collection ID.
1359
- * @property {string} key Attribute Key.
1360
- * @property {boolean} required Is attribute required?
1361
- * @property {string} xdefault Default value. Cannot be set when attribute is required.
1362
- * @property {string} newKey New Attribute Key.
1363
- * @property {boolean} overrideForCli
1364
- * @property {boolean} parseOutput
1365
- * @property {libClient | undefined} sdk
1366
- */
1367
-
1368
- /**
1369
- * @param {DatabasesUpdateIpAttributeRequestParams} params
1370
- */
1371
- const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1372
- let client = !sdk ? await sdkForProject() :
1373
- sdk;
1374
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreateLineAttributeRequestParams
1401
- * @property {string} databaseId Database ID.
1402
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1403
- * @property {string} key Attribute Key.
1404
- * @property {boolean} required Is attribute required?
1405
- * @property {any[]} xdefault Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
1406
- * @property {boolean} overrideForCli
1407
- * @property {boolean} parseOutput
1408
- * @property {libClient | undefined} sdk
1409
- */
1410
-
1411
- /**
1412
- * @param {DatabasesCreateLineAttributeRequestParams} params
1413
- */
1414
- const databasesCreateLineAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1415
- let client = !sdk ? await sdkForProject() :
1416
- sdk;
1417
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/line'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdateLineAttributeRequestParams
1445
- * @property {string} databaseId Database ID.
1446
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
1447
- * @property {string} key Attribute Key.
1448
- * @property {boolean} required Is attribute required?
1449
- * @property {any[]} xdefault Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
1450
- * @property {string} newKey New attribute key.
1451
- * @property {boolean} overrideForCli
1452
- * @property {boolean} parseOutput
1453
- * @property {libClient | undefined} sdk
1454
- */
1455
-
1456
- /**
1457
- * @param {DatabasesUpdateLineAttributeRequestParams} params
1458
- */
1459
- const databasesUpdateLineAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1460
- let client = !sdk ? await sdkForProject() :
1461
- sdk;
1462
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreatePointAttributeRequestParams
1490
- * @property {string} databaseId Database ID.
1491
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1492
- * @property {string} key Attribute Key.
1493
- * @property {boolean} required Is attribute required?
1494
- * @property {any[]} xdefault Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
1495
- * @property {boolean} overrideForCli
1496
- * @property {boolean} parseOutput
1497
- * @property {libClient | undefined} sdk
1498
- */
1499
-
1500
- /**
1501
- * @param {DatabasesCreatePointAttributeRequestParams} params
1502
- */
1503
- const databasesCreatePointAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1504
- let client = !sdk ? await sdkForProject() :
1505
- sdk;
1506
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdatePointAttributeRequestParams
1534
- * @property {string} databaseId Database ID.
1535
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
1536
- * @property {string} key Attribute Key.
1537
- * @property {boolean} required Is attribute required?
1538
- * @property {any[]} xdefault Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
1539
- * @property {string} newKey New attribute key.
1540
- * @property {boolean} overrideForCli
1541
- * @property {boolean} parseOutput
1542
- * @property {libClient | undefined} sdk
1543
- */
1544
-
1545
- /**
1546
- * @param {DatabasesUpdatePointAttributeRequestParams} params
1547
- */
1548
- const databasesUpdatePointAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1549
- let client = !sdk ? await sdkForProject() :
1550
- sdk;
1551
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreatePolygonAttributeRequestParams
1579
- * @property {string} databaseId Database ID.
1580
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1581
- * @property {string} key Attribute Key.
1582
- * @property {boolean} required Is attribute required?
1583
- * @property {any[]} xdefault Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
1584
- * @property {boolean} overrideForCli
1585
- * @property {boolean} parseOutput
1586
- * @property {libClient | undefined} sdk
1587
- */
1588
-
1589
- /**
1590
- * @param {DatabasesCreatePolygonAttributeRequestParams} params
1591
- */
1592
- const databasesCreatePolygonAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1593
- let client = !sdk ? await sdkForProject() :
1594
- sdk;
1595
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdatePolygonAttributeRequestParams
1623
- * @property {string} databaseId Database ID.
1624
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
1625
- * @property {string} key Attribute Key.
1626
- * @property {boolean} required Is attribute required?
1627
- * @property {any[]} xdefault Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
1628
- * @property {string} newKey New attribute key.
1629
- * @property {boolean} overrideForCli
1630
- * @property {boolean} parseOutput
1631
- * @property {libClient | undefined} sdk
1632
- */
1633
-
1634
- /**
1635
- * @param {DatabasesUpdatePolygonAttributeRequestParams} params
1636
- */
1637
- const databasesUpdatePolygonAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1638
- let client = !sdk ? await sdkForProject() :
1639
- sdk;
1640
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreateRelationshipAttributeRequestParams
1668
- * @property {string} databaseId Database ID.
1669
- * @property {string} collectionId Collection ID.
1670
- * @property {string} relatedCollectionId Related Collection ID.
1671
- * @property {RelationshipType} type Relation type
1672
- * @property {boolean} twoWay Is Two Way?
1673
- * @property {string} key Attribute Key.
1674
- * @property {string} twoWayKey Two Way Attribute 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 {DatabasesCreateRelationshipAttributeRequestParams} params
1683
- */
1684
- const databasesCreateRelationshipAttribute = async ({databaseId,collectionId,relatedCollectionId,type,twoWay,key,twoWayKey,onDelete,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1685
- let client = !sdk ? await sdkForProject() :
1686
- sdk;
1687
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1688
- let payload = {};
1689
- if (typeof relatedCollectionId !== 'undefined') {
1690
- payload['relatedCollectionId'] = relatedCollectionId;
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} DatabasesCreateStringAttributeRequestParams
1723
- * @property {string} databaseId Database ID.
1724
- * @property {string} collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1725
- * @property {string} key Attribute Key.
1726
- * @property {number} size Attribute size for text attributes, in number of characters.
1727
- * @property {boolean} required Is attribute required?
1728
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1729
- * @property {boolean} array Is attribute an array?
1730
- * @property {boolean} encrypt Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
1731
- * @property {boolean} overrideForCli
1732
- * @property {boolean} parseOutput
1733
- * @property {libClient | undefined} sdk
1734
- */
1735
-
1736
- /**
1737
- * @param {DatabasesCreateStringAttributeRequestParams} params
1738
- */
1739
- const databasesCreateStringAttribute = async ({databaseId,collectionId,key,size,required,xdefault,array,encrypt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1740
- let client = !sdk ? await sdkForProject() :
1741
- sdk;
1742
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdateStringAttributeRequestParams
1778
- * @property {string} databaseId Database ID.
1779
- * @property {string} collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1780
- * @property {string} key Attribute Key.
1781
- * @property {boolean} required Is attribute required?
1782
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1783
- * @property {number} size Maximum size of the string attribute.
1784
- * @property {string} newKey New Attribute Key.
1785
- * @property {boolean} overrideForCli
1786
- * @property {boolean} parseOutput
1787
- * @property {libClient | undefined} sdk
1788
- */
1789
-
1790
- /**
1791
- * @param {DatabasesUpdateStringAttributeRequestParams} params
1792
- */
1793
- const databasesUpdateStringAttribute = async ({databaseId,collectionId,key,required,xdefault,size,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1794
- let client = !sdk ? await sdkForProject() :
1795
- sdk;
1796
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesCreateUrlAttributeRequestParams
1826
- * @property {string} databaseId Database ID.
1827
- * @property {string} collectionId Collection ID.
1828
- * @property {string} key Attribute Key.
1829
- * @property {boolean} required Is attribute required?
1830
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1831
- * @property {boolean} array Is attribute an array?
1832
- * @property {boolean} overrideForCli
1833
- * @property {boolean} parseOutput
1834
- * @property {libClient | undefined} sdk
1835
- */
1836
-
1837
- /**
1838
- * @param {DatabasesCreateUrlAttributeRequestParams} params
1839
- */
1840
- const databasesCreateUrlAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1841
- let client = !sdk ? await sdkForProject() :
1842
- sdk;
1843
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
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} DatabasesUpdateUrlAttributeRequestParams
1873
- * @property {string} databaseId Database ID.
1874
- * @property {string} collectionId Collection ID.
1875
- * @property {string} key Attribute Key.
1876
- * @property {boolean} required Is attribute required?
1877
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1878
- * @property {string} newKey New Attribute Key.
1879
- * @property {boolean} overrideForCli
1880
- * @property {boolean} parseOutput
1881
- * @property {libClient | undefined} sdk
1882
- */
1883
-
1884
- /**
1885
- * @param {DatabasesUpdateUrlAttributeRequestParams} params
1886
- */
1887
- const databasesUpdateUrlAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1888
- let client = !sdk ? await sdkForProject() :
1889
- sdk;
1890
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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} DatabasesGetAttributeRequestParams
1917
- * @property {string} databaseId Database ID.
1918
- * @property {string} collectionId Collection ID.
1919
- * @property {string} key Attribute Key.
1920
- * @property {boolean} overrideForCli
1921
- * @property {boolean} parseOutput
1922
- * @property {libClient | undefined} sdk
1923
- */
1924
-
1925
- /**
1926
- * @param {DatabasesGetAttributeRequestParams} params
1927
- */
1928
- const databasesGetAttribute = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1929
- let client = !sdk ? await sdkForProject() :
1930
- sdk;
1931
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).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
- parse(response)
1941
- }
1942
-
1943
- return response;
1944
-
1945
- }
1946
- /**
1947
- * @typedef {Object} DatabasesDeleteAttributeRequestParams
1948
- * @property {string} databaseId Database ID.
1949
- * @property {string} collectionId Collection ID.
1950
- * @property {string} key Attribute Key.
1951
- * @property {boolean} overrideForCli
1952
- * @property {boolean} parseOutput
1953
- * @property {libClient | undefined} sdk
1954
- */
1955
-
1956
- /**
1957
- * @param {DatabasesDeleteAttributeRequestParams} params
1958
- */
1959
- const databasesDeleteAttribute = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1960
- let client = !sdk ? await sdkForProject() :
1961
- sdk;
1962
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1963
- let payload = {};
1964
-
1965
- let response = undefined;
1966
-
1967
- response = await client.call('delete', apiPath, {
1968
- 'content-type': 'application/json',
1969
- }, payload);
1970
-
1971
- if (parseOutput) {
1972
- parse(response)
1973
- }
1974
-
1975
- return response;
1976
-
1977
- }
1978
- /**
1979
- * @typedef {Object} DatabasesUpdateRelationshipAttributeRequestParams
1980
- * @property {string} databaseId Database ID.
1981
- * @property {string} collectionId Collection ID.
1982
- * @property {string} key Attribute Key.
1983
- * @property {RelationMutate} onDelete Constraints option
1984
- * @property {string} newKey New Attribute Key.
1985
- * @property {boolean} overrideForCli
1986
- * @property {boolean} parseOutput
1987
- * @property {libClient | undefined} sdk
1988
- */
1989
-
1990
- /**
1991
- * @param {DatabasesUpdateRelationshipAttributeRequestParams} params
1992
- */
1993
- const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key,onDelete,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1994
- let client = !sdk ? await sdkForProject() :
1995
- sdk;
1996
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1997
- let payload = {};
1998
- if (typeof onDelete !== 'undefined') {
1999
- payload['onDelete'] = onDelete;
2000
- }
2001
- if (typeof newKey !== 'undefined') {
2002
- payload['newKey'] = newKey;
2003
- }
2004
-
2005
- let response = undefined;
2006
-
2007
- response = await client.call('patch', apiPath, {
2008
- 'content-type': 'application/json',
2009
- }, payload);
2010
-
2011
- if (parseOutput) {
2012
- parse(response)
2013
- }
2014
-
2015
- return response;
2016
-
2017
- }
2018
- /**
2019
- * @typedef {Object} DatabasesListDocumentsRequestParams
2020
- * @property {string} databaseId Database ID.
2021
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2022
- * @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.
2023
- * @property {string} transactionId Transaction ID to read uncommitted changes within the transaction.
2024
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
2025
- * @property {boolean} overrideForCli
2026
- * @property {boolean} parseOutput
2027
- * @property {libClient | undefined} sdk
2028
- */
2029
-
2030
- /**
2031
- * @param {DatabasesListDocumentsRequestParams} params
2032
- */
2033
- const databasesListDocuments = async ({databaseId,collectionId,queries,transactionId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2034
- let client = !sdk ? await sdkForProject() :
2035
- sdk;
2036
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2037
- let payload = {};
2038
- if (typeof queries !== 'undefined') {
2039
- payload['queries'] = queries;
2040
- }
2041
- if (typeof transactionId !== 'undefined') {
2042
- payload['transactionId'] = transactionId;
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('databases', 'listDocuments', databaseId, collectionId);
2056
- } else {
2057
- parse(response)
2058
- }
2059
- }
2060
-
2061
- return response;
2062
-
2063
- }
2064
- /**
2065
- * @typedef {Object} DatabasesCreateDocumentRequestParams
2066
- * @property {string} databaseId Database ID.
2067
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
2068
- * @property {string} documentId Document ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
2069
- * @property {object} data Document data as JSON object.
2070
- * @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).
2071
- * @property {string} transactionId Transaction ID for staging the operation.
2072
- * @property {boolean} overrideForCli
2073
- * @property {boolean} parseOutput
2074
- * @property {libClient | undefined} sdk
2075
- */
2076
-
2077
- /**
2078
- * @param {DatabasesCreateDocumentRequestParams} params
2079
- */
2080
- const databasesCreateDocument = async ({databaseId,collectionId,documentId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2081
- let client = !sdk ? await sdkForProject() :
2082
- sdk;
2083
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2084
- let payload = {};
2085
- if (typeof documentId !== 'undefined') {
2086
- payload['documentId'] = documentId;
2087
- }
2088
- if (typeof data !== 'undefined') {
2089
- payload['data'] = JSON.parse(data);
2090
- }
2091
- permissions = permissions === true ? [] : permissions;
2092
- if (typeof permissions !== 'undefined') {
2093
- payload['permissions'] = permissions;
2094
- }
2095
- if (typeof transactionId !== 'undefined') {
2096
- payload['transactionId'] = transactionId;
2097
- }
2098
-
2099
- let response = undefined;
2100
-
2101
- response = await client.call('post', apiPath, {
2102
- 'content-type': 'application/json',
2103
- }, payload);
2104
-
2105
- if (parseOutput) {
2106
- parse(response)
2107
- }
2108
-
2109
- return response;
2110
-
2111
- }
2112
- /**
2113
- * @typedef {Object} DatabasesCreateDocumentsRequestParams
2114
- * @property {string} databaseId Database ID.
2115
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
2116
- * @property {object[]} documents Array of documents data as JSON objects.
2117
- * @property {string} transactionId Transaction ID for staging the operation.
2118
- * @property {boolean} overrideForCli
2119
- * @property {boolean} parseOutput
2120
- * @property {libClient | undefined} sdk
2121
- */
2122
-
2123
- /**
2124
- * @param {DatabasesCreateDocumentsRequestParams} params
2125
- */
2126
- const databasesCreateDocuments = async ({databaseId,collectionId,documents,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2127
- let client = !sdk ? await sdkForProject() :
2128
- sdk;
2129
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2130
- let payload = {};
2131
- documents = documents === true ? [] : documents;
2132
- if (typeof documents !== 'undefined') {
2133
- payload['documents'] = documents;
2134
- }
2135
- if (typeof transactionId !== 'undefined') {
2136
- payload['transactionId'] = transactionId;
2137
- }
2138
-
2139
- let response = undefined;
2140
-
2141
- response = await client.call('post', apiPath, {
2142
- 'content-type': 'application/json',
2143
- }, payload);
2144
-
2145
- if (parseOutput) {
2146
- parse(response)
2147
- }
2148
-
2149
- return response;
2150
-
2151
- }
2152
- /**
2153
- * @typedef {Object} DatabasesUpsertDocumentsRequestParams
2154
- * @property {string} databaseId Database ID.
2155
- * @property {string} collectionId Collection ID.
2156
- * @property {object[]} documents Array of document data as JSON objects. May contain partial documents.
2157
- * @property {string} transactionId Transaction ID for staging the operation.
2158
- * @property {boolean} overrideForCli
2159
- * @property {boolean} parseOutput
2160
- * @property {libClient | undefined} sdk
2161
- */
2162
-
2163
- /**
2164
- * @param {DatabasesUpsertDocumentsRequestParams} params
2165
- */
2166
- const databasesUpsertDocuments = async ({databaseId,collectionId,documents,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2167
- let client = !sdk ? await sdkForProject() :
2168
- sdk;
2169
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2170
- let payload = {};
2171
- documents = documents === true ? [] : documents;
2172
- if (typeof documents !== 'undefined') {
2173
- payload['documents'] = documents;
2174
- }
2175
- if (typeof transactionId !== 'undefined') {
2176
- payload['transactionId'] = transactionId;
2177
- }
2178
-
2179
- let response = undefined;
2180
-
2181
- response = await client.call('put', apiPath, {
2182
- 'content-type': 'application/json',
2183
- }, payload);
2184
-
2185
- if (parseOutput) {
2186
- parse(response)
2187
- }
2188
-
2189
- return response;
2190
-
2191
- }
2192
- /**
2193
- * @typedef {Object} DatabasesUpdateDocumentsRequestParams
2194
- * @property {string} databaseId Database ID.
2195
- * @property {string} collectionId Collection ID.
2196
- * @property {object} data Document data as JSON object. Include only attribute and value pairs to be updated.
2197
- * @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.
2198
- * @property {string} transactionId Transaction ID for staging the operation.
2199
- * @property {boolean} overrideForCli
2200
- * @property {boolean} parseOutput
2201
- * @property {libClient | undefined} sdk
2202
- */
2203
-
2204
- /**
2205
- * @param {DatabasesUpdateDocumentsRequestParams} params
2206
- */
2207
- const databasesUpdateDocuments = async ({databaseId,collectionId,data,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2208
- let client = !sdk ? await sdkForProject() :
2209
- sdk;
2210
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2211
- let payload = {};
2212
- if (typeof data !== 'undefined') {
2213
- payload['data'] = JSON.parse(data);
2214
- }
2215
- queries = queries === true ? [] : queries;
2216
- if (typeof queries !== 'undefined') {
2217
- payload['queries'] = queries;
2218
- }
2219
- if (typeof transactionId !== 'undefined') {
2220
- payload['transactionId'] = transactionId;
2221
- }
2222
-
2223
- let response = undefined;
2224
-
2225
- response = await client.call('patch', apiPath, {
2226
- 'content-type': 'application/json',
2227
- }, payload);
2228
-
2229
- if (parseOutput) {
2230
- parse(response)
2231
- }
2232
-
2233
- return response;
2234
-
2235
- }
2236
- /**
2237
- * @typedef {Object} DatabasesDeleteDocumentsRequestParams
2238
- * @property {string} databaseId Database ID.
2239
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2240
- * @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.
2241
- * @property {string} transactionId Transaction ID for staging the operation.
2242
- * @property {boolean} overrideForCli
2243
- * @property {boolean} parseOutput
2244
- * @property {libClient | undefined} sdk
2245
- */
2246
-
2247
- /**
2248
- * @param {DatabasesDeleteDocumentsRequestParams} params
2249
- */
2250
- const databasesDeleteDocuments = async ({databaseId,collectionId,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2251
- let client = !sdk ? await sdkForProject() :
2252
- sdk;
2253
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2254
- let payload = {};
2255
- queries = queries === true ? [] : queries;
2256
- if (typeof queries !== 'undefined') {
2257
- payload['queries'] = queries;
2258
- }
2259
- if (typeof transactionId !== 'undefined') {
2260
- payload['transactionId'] = transactionId;
2261
- }
2262
-
2263
- let response = undefined;
2264
-
2265
- response = await client.call('delete', apiPath, {
2266
- 'content-type': 'application/json',
2267
- }, payload);
2268
-
2269
- if (parseOutput) {
2270
- parse(response)
2271
- }
2272
-
2273
- return response;
2274
-
2275
- }
2276
- /**
2277
- * @typedef {Object} DatabasesGetDocumentRequestParams
2278
- * @property {string} databaseId Database ID.
2279
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2280
- * @property {string} documentId Document ID.
2281
- * @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.
2282
- * @property {string} transactionId Transaction ID to read uncommitted changes within the transaction.
2283
- * @property {boolean} overrideForCli
2284
- * @property {boolean} parseOutput
2285
- * @property {libClient | undefined} sdk
2286
- */
2287
-
2288
- /**
2289
- * @param {DatabasesGetDocumentRequestParams} params
2290
- */
2291
- const databasesGetDocument = async ({databaseId,collectionId,documentId,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2292
- let client = !sdk ? await sdkForProject() :
2293
- sdk;
2294
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2295
- let payload = {};
2296
- if (typeof queries !== 'undefined') {
2297
- payload['queries'] = queries;
2298
- }
2299
- if (typeof transactionId !== 'undefined') {
2300
- payload['transactionId'] = transactionId;
2301
- }
2302
-
2303
- let response = undefined;
2304
-
2305
- response = await client.call('get', apiPath, {
2306
- }, payload);
2307
-
2308
- if (parseOutput) {
2309
- if(console) {
2310
- showConsoleLink('databases', 'getDocument', databaseId, collectionId, documentId);
2311
- } else {
2312
- parse(response)
2313
- }
2314
- }
2315
-
2316
- return response;
2317
-
2318
- }
2319
- /**
2320
- * @typedef {Object} DatabasesUpsertDocumentRequestParams
2321
- * @property {string} databaseId Database ID.
2322
- * @property {string} collectionId Collection ID.
2323
- * @property {string} documentId Document ID.
2324
- * @property {object} data Document data as JSON object. Include all required attributes of the document to be created or updated.
2325
- * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2326
- * @property {string} transactionId Transaction ID for staging the operation.
2327
- * @property {boolean} overrideForCli
2328
- * @property {boolean} parseOutput
2329
- * @property {libClient | undefined} sdk
2330
- */
2331
-
2332
- /**
2333
- * @param {DatabasesUpsertDocumentRequestParams} params
2334
- */
2335
- const databasesUpsertDocument = async ({databaseId,collectionId,documentId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2336
- let client = !sdk ? await sdkForProject() :
2337
- sdk;
2338
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2339
- let payload = {};
2340
- if (typeof data !== 'undefined') {
2341
- payload['data'] = JSON.parse(data);
2342
- }
2343
- permissions = permissions === true ? [] : permissions;
2344
- if (typeof permissions !== 'undefined') {
2345
- payload['permissions'] = permissions;
2346
- }
2347
- if (typeof transactionId !== 'undefined') {
2348
- payload['transactionId'] = transactionId;
2349
- }
2350
-
2351
- let response = undefined;
2352
-
2353
- response = await client.call('put', apiPath, {
2354
- 'content-type': 'application/json',
2355
- }, payload);
2356
-
2357
- if (parseOutput) {
2358
- parse(response)
2359
- }
2360
-
2361
- return response;
2362
-
2363
- }
2364
- /**
2365
- * @typedef {Object} DatabasesUpdateDocumentRequestParams
2366
- * @property {string} databaseId Database ID.
2367
- * @property {string} collectionId Collection ID.
2368
- * @property {string} documentId Document ID.
2369
- * @property {object} data Document data as JSON object. Include only attribute and value pairs to be updated.
2370
- * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2371
- * @property {string} transactionId Transaction ID for staging the operation.
2372
- * @property {boolean} overrideForCli
2373
- * @property {boolean} parseOutput
2374
- * @property {libClient | undefined} sdk
2375
- */
2376
-
2377
- /**
2378
- * @param {DatabasesUpdateDocumentRequestParams} params
2379
- */
2380
- const databasesUpdateDocument = async ({databaseId,collectionId,documentId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2381
- let client = !sdk ? await sdkForProject() :
2382
- sdk;
2383
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2384
- let payload = {};
2385
- if (typeof data !== 'undefined') {
2386
- payload['data'] = JSON.parse(data);
2387
- }
2388
- permissions = permissions === true ? [] : permissions;
2389
- if (typeof permissions !== 'undefined') {
2390
- payload['permissions'] = permissions;
2391
- }
2392
- if (typeof transactionId !== 'undefined') {
2393
- payload['transactionId'] = transactionId;
2394
- }
2395
-
2396
- let response = undefined;
2397
-
2398
- response = await client.call('patch', apiPath, {
2399
- 'content-type': 'application/json',
2400
- }, payload);
2401
-
2402
- if (parseOutput) {
2403
- parse(response)
2404
- }
2405
-
2406
- return response;
2407
-
2408
- }
2409
- /**
2410
- * @typedef {Object} DatabasesDeleteDocumentRequestParams
2411
- * @property {string} databaseId Database ID.
2412
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2413
- * @property {string} documentId Document ID.
2414
- * @property {string} transactionId Transaction ID for staging the operation.
2415
- * @property {boolean} overrideForCli
2416
- * @property {boolean} parseOutput
2417
- * @property {libClient | undefined} sdk
2418
- */
2419
-
2420
- /**
2421
- * @param {DatabasesDeleteDocumentRequestParams} params
2422
- */
2423
- const databasesDeleteDocument = async ({databaseId,collectionId,documentId,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2424
- let client = !sdk ? await sdkForProject() :
2425
- sdk;
2426
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2427
- let payload = {};
2428
- if (typeof transactionId !== 'undefined') {
2429
- payload['transactionId'] = transactionId;
2430
- }
2431
-
2432
- let response = undefined;
2433
-
2434
- response = await client.call('delete', apiPath, {
2435
- 'content-type': 'application/json',
2436
- }, payload);
2437
-
2438
- if (parseOutput) {
2439
- parse(response)
2440
- }
2441
-
2442
- return response;
2443
-
2444
- }
2445
- /**
2446
- * @typedef {Object} DatabasesListDocumentLogsRequestParams
2447
- * @property {string} databaseId Database ID.
2448
- * @property {string} collectionId Collection ID.
2449
- * @property {string} documentId Document ID.
2450
- * @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
2451
- * @property {boolean} overrideForCli
2452
- * @property {boolean} parseOutput
2453
- * @property {libClient | undefined} sdk
2454
- */
2455
-
2456
- /**
2457
- * @param {DatabasesListDocumentLogsRequestParams} params
2458
- */
2459
- const databasesListDocumentLogs = async ({databaseId,collectionId,documentId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2460
- let client = !sdk ? await sdkForProject() :
2461
- sdk;
2462
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
2463
- let payload = {};
2464
- if (typeof queries !== 'undefined') {
2465
- payload['queries'] = queries;
2466
- }
2467
-
2468
- let response = undefined;
2469
-
2470
- response = await client.call('get', apiPath, {
2471
- }, payload);
2472
-
2473
- if (parseOutput) {
2474
- parse(response)
2475
- }
2476
-
2477
- return response;
2478
-
2479
- }
2480
- /**
2481
- * @typedef {Object} DatabasesDecrementDocumentAttributeRequestParams
2482
- * @property {string} databaseId Database ID.
2483
- * @property {string} collectionId Collection ID.
2484
- * @property {string} documentId Document ID.
2485
- * @property {string} attribute Attribute key.
2486
- * @property {number} value Value to increment the attribute by. The value must be a number.
2487
- * @property {number} min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
2488
- * @property {string} transactionId Transaction ID for staging the operation.
2489
- * @property {boolean} overrideForCli
2490
- * @property {boolean} parseOutput
2491
- * @property {libClient | undefined} sdk
2492
- */
2493
-
2494
- /**
2495
- * @param {DatabasesDecrementDocumentAttributeRequestParams} params
2496
- */
2497
- const databasesDecrementDocumentAttribute = async ({databaseId,collectionId,documentId,attribute,value,min,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2498
- let client = !sdk ? await sdkForProject() :
2499
- sdk;
2500
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
2501
- let payload = {};
2502
- if (typeof value !== 'undefined') {
2503
- payload['value'] = value;
2504
- }
2505
- if (typeof min !== 'undefined') {
2506
- payload['min'] = min;
2507
- }
2508
- if (typeof transactionId !== 'undefined') {
2509
- payload['transactionId'] = transactionId;
2510
- }
2511
-
2512
- let response = undefined;
2513
-
2514
- response = await client.call('patch', apiPath, {
2515
- 'content-type': 'application/json',
2516
- }, payload);
2517
-
2518
- if (parseOutput) {
2519
- parse(response)
2520
- }
2521
-
2522
- return response;
2523
-
2524
- }
2525
- /**
2526
- * @typedef {Object} DatabasesIncrementDocumentAttributeRequestParams
2527
- * @property {string} databaseId Database ID.
2528
- * @property {string} collectionId Collection ID.
2529
- * @property {string} documentId Document ID.
2530
- * @property {string} attribute Attribute key.
2531
- * @property {number} value Value to increment the attribute by. The value must be a number.
2532
- * @property {number} max Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
2533
- * @property {string} transactionId Transaction ID for staging the operation.
2534
- * @property {boolean} overrideForCli
2535
- * @property {boolean} parseOutput
2536
- * @property {libClient | undefined} sdk
2537
- */
2538
-
2539
- /**
2540
- * @param {DatabasesIncrementDocumentAttributeRequestParams} params
2541
- */
2542
- const databasesIncrementDocumentAttribute = async ({databaseId,collectionId,documentId,attribute,value,max,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2543
- let client = !sdk ? await sdkForProject() :
2544
- sdk;
2545
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
2546
- let payload = {};
2547
- if (typeof value !== 'undefined') {
2548
- payload['value'] = value;
2549
- }
2550
- if (typeof max !== 'undefined') {
2551
- payload['max'] = max;
2552
- }
2553
- if (typeof transactionId !== 'undefined') {
2554
- payload['transactionId'] = transactionId;
2555
- }
2556
-
2557
- let response = undefined;
2558
-
2559
- response = await client.call('patch', apiPath, {
2560
- 'content-type': 'application/json',
2561
- }, payload);
2562
-
2563
- if (parseOutput) {
2564
- parse(response)
2565
- }
2566
-
2567
- return response;
2568
-
2569
- }
2570
- /**
2571
- * @typedef {Object} DatabasesListIndexesRequestParams
2572
- * @property {string} databaseId Database ID.
2573
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2574
- * @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 attributes: key, type, status, attributes, error
2575
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
2576
- * @property {boolean} overrideForCli
2577
- * @property {boolean} parseOutput
2578
- * @property {libClient | undefined} sdk
2579
- */
2580
-
2581
- /**
2582
- * @param {DatabasesListIndexesRequestParams} params
2583
- */
2584
- const databasesListIndexes = async ({databaseId,collectionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2585
- let client = !sdk ? await sdkForProject() :
2586
- sdk;
2587
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2588
- let payload = {};
2589
- if (typeof queries !== 'undefined') {
2590
- payload['queries'] = queries;
2591
- }
2592
- if (typeof total !== 'undefined') {
2593
- payload['total'] = total;
2594
- }
2595
-
2596
- let response = undefined;
2597
-
2598
- response = await client.call('get', apiPath, {
2599
- }, payload);
2600
-
2601
- if (parseOutput) {
2602
- if(console) {
2603
- showConsoleLink('databases', 'listIndexes', databaseId, collectionId);
2604
- } else {
2605
- parse(response)
2606
- }
2607
- }
2608
-
2609
- return response;
2610
-
2611
- }
2612
- /**
2613
- * @typedef {Object} DatabasesCreateIndexRequestParams
2614
- * @property {string} databaseId Database ID.
2615
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2616
- * @property {string} key Index Key.
2617
- * @property {IndexType} type Index type.
2618
- * @property {string[]} attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
2619
- * @property {string[]} orders Array of index orders. Maximum of 100 orders are allowed.
2620
- * @property {number[]} lengths Length of index. Maximum of 100
2621
- * @property {boolean} overrideForCli
2622
- * @property {boolean} parseOutput
2623
- * @property {libClient | undefined} sdk
2624
- */
2625
-
2626
- /**
2627
- * @param {DatabasesCreateIndexRequestParams} params
2628
- */
2629
- const databasesCreateIndex = async ({databaseId,collectionId,key,type,attributes,orders,lengths,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2630
- let client = !sdk ? await sdkForProject() :
2631
- sdk;
2632
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2633
- let payload = {};
2634
- if (typeof key !== 'undefined') {
2635
- payload['key'] = key;
2636
- }
2637
- if (typeof type !== 'undefined') {
2638
- payload['type'] = type;
2639
- }
2640
- attributes = attributes === true ? [] : attributes;
2641
- if (typeof attributes !== 'undefined') {
2642
- payload['attributes'] = attributes;
2643
- }
2644
- orders = orders === true ? [] : orders;
2645
- if (typeof orders !== 'undefined') {
2646
- payload['orders'] = orders;
2647
- }
2648
- lengths = lengths === true ? [] : lengths;
2649
- if (typeof lengths !== 'undefined') {
2650
- payload['lengths'] = lengths;
2651
- }
2652
-
2653
- let response = undefined;
2654
-
2655
- response = await client.call('post', apiPath, {
2656
- 'content-type': 'application/json',
2657
- }, payload);
2658
-
2659
- if (parseOutput) {
2660
- parse(response)
2661
- }
2662
-
2663
- return response;
2664
-
2665
- }
2666
- /**
2667
- * @typedef {Object} DatabasesGetIndexRequestParams
2668
- * @property {string} databaseId Database ID.
2669
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2670
- * @property {string} key Index Key.
2671
- * @property {boolean} overrideForCli
2672
- * @property {boolean} parseOutput
2673
- * @property {libClient | undefined} sdk
2674
- */
2675
-
2676
- /**
2677
- * @param {DatabasesGetIndexRequestParams} params
2678
- */
2679
- const databasesGetIndex = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2680
- let client = !sdk ? await sdkForProject() :
2681
- sdk;
2682
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2683
- let payload = {};
2684
-
2685
- let response = undefined;
2686
-
2687
- response = await client.call('get', apiPath, {
2688
- }, payload);
2689
-
2690
- if (parseOutput) {
2691
- parse(response)
2692
- }
2693
-
2694
- return response;
2695
-
2696
- }
2697
- /**
2698
- * @typedef {Object} DatabasesDeleteIndexRequestParams
2699
- * @property {string} databaseId Database ID.
2700
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2701
- * @property {string} key Index Key.
2702
- * @property {boolean} overrideForCli
2703
- * @property {boolean} parseOutput
2704
- * @property {libClient | undefined} sdk
2705
- */
2706
-
2707
- /**
2708
- * @param {DatabasesDeleteIndexRequestParams} params
2709
- */
2710
- const databasesDeleteIndex = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2711
- let client = !sdk ? await sdkForProject() :
2712
- sdk;
2713
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
2714
- let payload = {};
2715
-
2716
- let response = undefined;
2717
-
2718
- response = await client.call('delete', apiPath, {
2719
- 'content-type': 'application/json',
2720
- }, payload);
2721
-
2722
- if (parseOutput) {
2723
- parse(response)
2724
- }
2725
-
2726
- return response;
2727
-
2728
- }
2729
- /**
2730
- * @typedef {Object} DatabasesListCollectionLogsRequestParams
2731
- * @property {string} databaseId Database ID.
2732
- * @property {string} collectionId Collection ID.
2733
- * @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
2734
- * @property {boolean} overrideForCli
2735
- * @property {boolean} parseOutput
2736
- * @property {libClient | undefined} sdk
2737
- */
2738
-
2739
- /**
2740
- * @param {DatabasesListCollectionLogsRequestParams} params
2741
- */
2742
- const databasesListCollectionLogs = async ({databaseId,collectionId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2743
- let client = !sdk ? await sdkForProject() :
2744
- sdk;
2745
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2746
- let payload = {};
2747
- if (typeof queries !== 'undefined') {
2748
- payload['queries'] = queries;
2749
- }
2750
-
2751
- let response = undefined;
2752
-
2753
- response = await client.call('get', apiPath, {
2754
- }, payload);
2755
-
2756
- if (parseOutput) {
2757
- parse(response)
2758
- }
2759
-
2760
- return response;
2761
-
2762
- }
2763
- /**
2764
- * @typedef {Object} DatabasesGetCollectionUsageRequestParams
2765
- * @property {string} databaseId Database ID.
2766
- * @property {string} collectionId Collection ID.
2767
- * @property {UsageRange} range Date range.
2768
- * @property {boolean} overrideForCli
2769
- * @property {boolean} parseOutput
2770
- * @property {libClient | undefined} sdk
2771
- */
2772
-
2773
- /**
2774
- * @param {DatabasesGetCollectionUsageRequestParams} params
2775
- */
2776
- const databasesGetCollectionUsage = async ({databaseId,collectionId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2777
- let client = !sdk ? await sdkForProject() :
2778
- sdk;
2779
- let apiPath = '/databases/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
2780
- let payload = {};
2781
- if (typeof range !== 'undefined') {
2782
- payload['range'] = range;
2783
- }
2784
-
2785
- let response = undefined;
2786
-
2787
- response = await client.call('get', apiPath, {
2788
- }, payload);
2789
-
2790
- if (parseOutput) {
2791
- parse(response)
2792
- }
2793
-
2794
- return response;
2795
-
2796
- }
2797
- /**
2798
- * @typedef {Object} DatabasesListLogsRequestParams
2799
- * @property {string} databaseId Database ID.
2800
- * @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
2801
- * @property {boolean} overrideForCli
2802
- * @property {boolean} parseOutput
2803
- * @property {libClient | undefined} sdk
2804
- */
2805
-
2806
- /**
2807
- * @param {DatabasesListLogsRequestParams} params
2808
- */
2809
- const databasesListLogs = async ({databaseId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2810
- let client = !sdk ? await sdkForProject() :
2811
- sdk;
2812
- let apiPath = '/databases/{databaseId}/logs'.replace('{databaseId}', databaseId);
2813
- let payload = {};
2814
- if (typeof queries !== 'undefined') {
2815
- payload['queries'] = queries;
2816
- }
2817
-
2818
- let response = undefined;
2819
-
2820
- response = await client.call('get', apiPath, {
2821
- }, payload);
2822
-
2823
- if (parseOutput) {
2824
- parse(response)
2825
- }
2826
-
2827
- return response;
2828
-
2829
- }
2830
- /**
2831
- * @typedef {Object} DatabasesGetUsageRequestParams
2832
- * @property {string} databaseId Database ID.
2833
- * @property {UsageRange} range Date range.
2834
- * @property {boolean} overrideForCli
2835
- * @property {boolean} parseOutput
2836
- * @property {libClient | undefined} sdk
2837
- */
2838
-
2839
- /**
2840
- * @param {DatabasesGetUsageRequestParams} params
2841
- */
2842
- const databasesGetUsage = async ({databaseId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2843
- let client = !sdk ? await sdkForProject() :
2844
- sdk;
2845
- let apiPath = '/databases/{databaseId}/usage'.replace('{databaseId}', databaseId);
2846
- let payload = {};
2847
- if (typeof range !== 'undefined') {
2848
- payload['range'] = range;
2849
- }
2850
-
2851
- let response = undefined;
2852
-
2853
- response = await client.call('get', apiPath, {
2854
- }, payload);
2855
-
2856
- if (parseOutput) {
2857
- parse(response)
2858
- }
2859
-
2860
- return response;
2861
-
2862
- }
2863
- databases
2864
- .command(`list`)
2865
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list' instead] Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`)
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). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name`)
2867
- .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2868
- .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))
2869
- .option(`--console`, `Get the resource console url`)
2870
- .action(actionRunner(databasesList))
2871
-
2872
- databases
2873
- .command(`create`)
2874
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create' instead] Create a new Database. `)
2875
- .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.`)
2876
- .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
2877
- .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))
2878
- .action(actionRunner(databasesCreate))
2879
-
2880
- databases
2881
- .command(`list-transactions`)
2882
- .description(`List transactions across all databases.`)
2883
- .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).`)
2884
- .option(`--console`, `Get the resource console url`)
2885
- .action(actionRunner(databasesListTransactions))
2886
-
2887
- databases
2888
- .command(`create-transaction`)
2889
- .description(`Create a new transaction.`)
2890
- .option(`--ttl <ttl>`, `Seconds before the transaction expires.`, parseInteger)
2891
- .action(actionRunner(databasesCreateTransaction))
2892
-
2893
- databases
2894
- .command(`get-transaction`)
2895
- .description(`Get a transaction by its unique ID.`)
2896
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
2897
- .option(`--console`, `Get the resource console url`)
2898
- .action(actionRunner(databasesGetTransaction))
2899
-
2900
- databases
2901
- .command(`update-transaction`)
2902
- .description(`Update a transaction, to either commit or roll back its operations.`)
2903
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
2904
- .option(`--commit [value]`, `Commit transaction?`, (value) => value === undefined ? true : parseBool(value))
2905
- .option(`--rollback [value]`, `Rollback transaction?`, (value) => value === undefined ? true : parseBool(value))
2906
- .action(actionRunner(databasesUpdateTransaction))
2907
-
2908
- databases
2909
- .command(`delete-transaction`)
2910
- .description(`Delete a transaction by its unique ID.`)
2911
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
2912
- .action(actionRunner(databasesDeleteTransaction))
2913
-
2914
- databases
2915
- .command(`create-operations`)
2916
- .description(`Create multiple operations in a single transaction.`)
2917
- .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
2918
- .option(`--operations [operations...]`, `Array of staged operations.`)
2919
- .action(actionRunner(databasesCreateOperations))
2920
-
2921
- databases
2922
- .command(`list-usage`)
2923
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-usage' instead] List usage metrics and statistics for all databases in the project. You can view the total number of databases, collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`)
2924
- .option(`--range <range>`, `Date range.`)
2925
- .option(`--console`, `Get the resource console url`)
2926
- .action(actionRunner(databasesListUsage))
2927
-
2928
- databases
2929
- .command(`get`)
2930
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get' instead] Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`)
2931
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2932
- .option(`--console`, `Get the resource console url`)
2933
- .action(actionRunner(databasesGet))
2934
-
2935
- databases
2936
- .command(`update`)
2937
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update' instead] Update a database by its unique ID.`)
2938
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2939
- .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
2940
- .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))
2941
- .action(actionRunner(databasesUpdate))
2942
-
2943
- databases
2944
- .command(`delete`)
2945
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete' instead] Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`)
2946
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2947
- .action(actionRunner(databasesDelete))
2948
-
2949
- databases
2950
- .command(`list-collections`)
2951
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-tables' instead] Get a list of all collections that belong to the provided databaseId. You can use the search parameter to filter your results.`)
2952
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2953
- .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity`)
2954
- .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2955
- .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))
2956
- .option(`--console`, `Get the resource console url`)
2957
- .action(actionRunner(databasesListCollections))
2958
-
2959
- databases
2960
- .command(`create-collection`)
2961
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-table' instead] Create a new Collection. Before using this route, you should create a new database resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
2962
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2963
- .requiredOption(`--collection-id <collection-id>`, `Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2964
- .requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
2965
- .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).`)
2966
- .option(`--document-security [value]`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value))
2967
- .option(`--enabled [value]`, `Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
2968
- .action(actionRunner(databasesCreateCollection))
2969
-
2970
- databases
2971
- .command(`get-collection`)
2972
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-table' instead] Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.`)
2973
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2974
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
2975
- .option(`--console`, `Get the resource console url`)
2976
- .action(actionRunner(databasesGetCollection))
2977
-
2978
- databases
2979
- .command(`update-collection`)
2980
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-table' instead] Update a collection by its unique ID.`)
2981
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2982
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
2983
- .requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
2984
- .option(`--permissions [permissions...]`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2985
- .option(`--document-security [value]`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value))
2986
- .option(`--enabled [value]`, `Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
2987
- .action(actionRunner(databasesUpdateCollection))
2988
-
2989
- databases
2990
- .command(`delete-collection`)
2991
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete-table' instead] Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.`)
2992
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
2993
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
2994
- .action(actionRunner(databasesDeleteCollection))
2995
-
2996
- databases
2997
- .command(`list-attributes`)
2998
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-columns' instead] List attributes in the collection.`)
2999
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3000
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3001
- .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error`)
3002
- .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))
3003
- .option(`--console`, `Get the resource console url`)
3004
- .action(actionRunner(databasesListAttributes))
3005
-
3006
- databases
3007
- .command(`create-boolean-attribute`)
3008
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-boolean-column' instead] Create a boolean attribute. `)
3009
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3010
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3011
- .requiredOption(`--key <key>`, `Attribute Key.`)
3012
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3013
- .option(`--xdefault [value]`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, (value) => value === undefined ? true : parseBool(value))
3014
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3015
- .action(actionRunner(databasesCreateBooleanAttribute))
3016
-
3017
- databases
3018
- .command(`update-boolean-attribute`)
3019
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-boolean-column' instead] Update a boolean attribute. Changing the 'default' value will not update already existing documents.`)
3020
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3021
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
3022
- .requiredOption(`--key <key>`, `Attribute Key.`)
3023
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3024
- .option(`--xdefault [value]`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, (value) => value === undefined ? true : parseBool(value))
3025
- .option(`--new-key <new-key>`, `New attribute key.`)
3026
- .action(actionRunner(databasesUpdateBooleanAttribute))
3027
-
3028
- databases
3029
- .command(`create-datetime-attribute`)
3030
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-datetime-column' instead] Create a date time attribute according to the ISO 8601 standard.`)
3031
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3032
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
3033
- .requiredOption(`--key <key>`, `Attribute Key.`)
3034
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3035
- .option(`--xdefault <xdefault>`, `Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.`)
3036
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3037
- .action(actionRunner(databasesCreateDatetimeAttribute))
3038
-
3039
- databases
3040
- .command(`update-datetime-attribute`)
3041
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-datetime-column' instead] Update a date time attribute. Changing the 'default' value will not update already existing documents.`)
3042
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3043
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3044
- .requiredOption(`--key <key>`, `Attribute Key.`)
3045
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3046
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3047
- .option(`--new-key <new-key>`, `New attribute key.`)
3048
- .action(actionRunner(databasesUpdateDatetimeAttribute))
3049
-
3050
- databases
3051
- .command(`create-email-attribute`)
3052
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-email-column' instead] Create an email attribute. `)
3053
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3054
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3055
- .requiredOption(`--key <key>`, `Attribute Key.`)
3056
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3057
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3058
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3059
- .action(actionRunner(databasesCreateEmailAttribute))
3060
-
3061
- databases
3062
- .command(`update-email-attribute`)
3063
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-email-column' instead] Update an email attribute. Changing the 'default' value will not update already existing documents. `)
3064
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3065
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3066
- .requiredOption(`--key <key>`, `Attribute Key.`)
3067
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3068
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3069
- .option(`--new-key <new-key>`, `New Attribute Key.`)
3070
- .action(actionRunner(databasesUpdateEmailAttribute))
3071
-
3072
- databases
3073
- .command(`create-enum-attribute`)
3074
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-enum-column' instead] Create an enum attribute. The 'elements' param acts as a white-list of accepted values for this attribute. `)
3075
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3076
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3077
- .requiredOption(`--key <key>`, `Attribute Key.`)
3078
- .requiredOption(`--elements [elements...]`, `Array of enum values.`)
3079
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3080
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3081
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3082
- .action(actionRunner(databasesCreateEnumAttribute))
3083
-
3084
- databases
3085
- .command(`update-enum-attribute`)
3086
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-enum-column' instead] Update an enum attribute. Changing the 'default' value will not update already existing documents. `)
3087
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3088
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3089
- .requiredOption(`--key <key>`, `Attribute Key.`)
3090
- .requiredOption(`--elements [elements...]`, `Updated list of enum values.`)
3091
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3092
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3093
- .option(`--new-key <new-key>`, `New Attribute Key.`)
3094
- .action(actionRunner(databasesUpdateEnumAttribute))
3095
-
3096
- databases
3097
- .command(`create-float-attribute`)
3098
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-float-column' instead] Create a float attribute. Optionally, minimum and maximum values can be provided. `)
3099
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3100
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3101
- .requiredOption(`--key <key>`, `Attribute Key.`)
3102
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3103
- .option(`--min <min>`, `Minimum value.`, parseInteger)
3104
- .option(`--max <max>`, `Maximum value.`, parseInteger)
3105
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parseInteger)
3106
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3107
- .action(actionRunner(databasesCreateFloatAttribute))
3108
-
3109
- databases
3110
- .command(`update-float-attribute`)
3111
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-float-column' instead] Update a float attribute. Changing the 'default' value will not update already existing documents. `)
3112
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3113
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3114
- .requiredOption(`--key <key>`, `Attribute Key.`)
3115
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3116
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parseInteger)
3117
- .option(`--min <min>`, `Minimum value.`, parseInteger)
3118
- .option(`--max <max>`, `Maximum value.`, parseInteger)
3119
- .option(`--new-key <new-key>`, `New Attribute Key.`)
3120
- .action(actionRunner(databasesUpdateFloatAttribute))
3121
-
3122
- databases
3123
- .command(`create-integer-attribute`)
3124
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-integer-column' instead] Create an integer attribute. Optionally, minimum and maximum values can be provided. `)
3125
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3126
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3127
- .requiredOption(`--key <key>`, `Attribute Key.`)
3128
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3129
- .option(`--min <min>`, `Minimum value`, parseInteger)
3130
- .option(`--max <max>`, `Maximum value`, parseInteger)
3131
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`, parseInteger)
3132
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3133
- .action(actionRunner(databasesCreateIntegerAttribute))
3134
-
3135
- databases
3136
- .command(`update-integer-attribute`)
3137
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-integer-column' instead] Update an integer attribute. Changing the 'default' value will not update already existing documents. `)
3138
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3139
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3140
- .requiredOption(`--key <key>`, `Attribute Key.`)
3141
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3142
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`, parseInteger)
3143
- .option(`--min <min>`, `Minimum value`, parseInteger)
3144
- .option(`--max <max>`, `Maximum value`, parseInteger)
3145
- .option(`--new-key <new-key>`, `New Attribute Key.`)
3146
- .action(actionRunner(databasesUpdateIntegerAttribute))
3147
-
3148
- databases
3149
- .command(`create-ip-attribute`)
3150
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-ip-column' instead] Create IP address attribute. `)
3151
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3152
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3153
- .requiredOption(`--key <key>`, `Attribute Key.`)
3154
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3155
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`)
3156
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3157
- .action(actionRunner(databasesCreateIpAttribute))
3158
-
3159
- databases
3160
- .command(`update-ip-attribute`)
3161
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-ip-column' instead] Update an ip attribute. Changing the 'default' value will not update already existing documents. `)
3162
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3163
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3164
- .requiredOption(`--key <key>`, `Attribute Key.`)
3165
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3166
- .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`)
3167
- .option(`--new-key <new-key>`, `New Attribute Key.`)
3168
- .action(actionRunner(databasesUpdateIpAttribute))
3169
-
3170
- databases
3171
- .command(`create-line-attribute`)
3172
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-line-column' instead] Create a geometric line attribute.`)
3173
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3174
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3175
- .requiredOption(`--key <key>`, `Attribute Key.`)
3176
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3177
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`)
3178
- .action(actionRunner(databasesCreateLineAttribute))
3179
-
3180
- databases
3181
- .command(`update-line-attribute`)
3182
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-line-column' instead] Update a line attribute. Changing the 'default' value will not update already existing documents.`)
3183
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3184
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
3185
- .requiredOption(`--key <key>`, `Attribute Key.`)
3186
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3187
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`)
3188
- .option(`--new-key <new-key>`, `New attribute key.`)
3189
- .action(actionRunner(databasesUpdateLineAttribute))
3190
-
3191
- databases
3192
- .command(`create-point-attribute`)
3193
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-point-column' instead] Create a geometric point attribute.`)
3194
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3195
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3196
- .requiredOption(`--key <key>`, `Attribute Key.`)
3197
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3198
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`)
3199
- .action(actionRunner(databasesCreatePointAttribute))
3200
-
3201
- databases
3202
- .command(`update-point-attribute`)
3203
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-point-column' instead] Update a point attribute. Changing the 'default' value will not update already existing documents.`)
3204
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3205
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
3206
- .requiredOption(`--key <key>`, `Attribute Key.`)
3207
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3208
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`)
3209
- .option(`--new-key <new-key>`, `New attribute key.`)
3210
- .action(actionRunner(databasesUpdatePointAttribute))
3211
-
3212
- databases
3213
- .command(`create-polygon-attribute`)
3214
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-polygon-column' instead] Create a geometric polygon attribute.`)
3215
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3216
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3217
- .requiredOption(`--key <key>`, `Attribute Key.`)
3218
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3219
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`)
3220
- .action(actionRunner(databasesCreatePolygonAttribute))
3221
-
3222
- databases
3223
- .command(`update-polygon-attribute`)
3224
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-polygon-column' instead] Update a polygon attribute. Changing the 'default' value will not update already existing documents.`)
3225
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3226
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
3227
- .requiredOption(`--key <key>`, `Attribute Key.`)
3228
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3229
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`)
3230
- .option(`--new-key <new-key>`, `New attribute key.`)
3231
- .action(actionRunner(databasesUpdatePolygonAttribute))
3232
-
3233
- databases
3234
- .command(`create-relationship-attribute`)
3235
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-relationship-column' instead] Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). `)
3236
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3237
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3238
- .requiredOption(`--related-collection-id <related-collection-id>`, `Related Collection ID.`)
3239
- .requiredOption(`--type <type>`, `Relation type`)
3240
- .option(`--two-way [value]`, `Is Two Way?`, (value) => value === undefined ? true : parseBool(value))
3241
- .option(`--key <key>`, `Attribute Key.`)
3242
- .option(`--two-way-key <two-way-key>`, `Two Way Attribute Key.`)
3243
- .option(`--on-delete <on-delete>`, `Constraints option`)
3244
- .action(actionRunner(databasesCreateRelationshipAttribute))
3245
-
3246
- databases
3247
- .command(`create-string-attribute`)
3248
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-string-column' instead] Create a string attribute. `)
3249
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3250
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3251
- .requiredOption(`--key <key>`, `Attribute Key.`)
3252
- .requiredOption(`--size <size>`, `Attribute size for text attributes, in number of characters.`, parseInteger)
3253
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3254
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3255
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3256
- .option(`--encrypt [value]`, `Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.`, (value) => value === undefined ? true : parseBool(value))
3257
- .action(actionRunner(databasesCreateStringAttribute))
3258
-
3259
- databases
3260
- .command(`update-string-attribute`)
3261
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-string-column' instead] Update a string attribute. Changing the 'default' value will not update already existing documents. `)
3262
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3263
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3264
- .requiredOption(`--key <key>`, `Attribute Key.`)
3265
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3266
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3267
- .option(`--size <size>`, `Maximum size of the string attribute.`, parseInteger)
3268
- .option(`--new-key <new-key>`, `New Attribute Key.`)
3269
- .action(actionRunner(databasesUpdateStringAttribute))
3270
-
3271
- databases
3272
- .command(`create-url-attribute`)
3273
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-url-column' instead] Create a URL attribute. `)
3274
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3275
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3276
- .requiredOption(`--key <key>`, `Attribute Key.`)
3277
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3278
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3279
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3280
- .action(actionRunner(databasesCreateUrlAttribute))
3281
-
3282
- databases
3283
- .command(`update-url-attribute`)
3284
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-url-column' instead] Update an url attribute. Changing the 'default' value will not update already existing documents. `)
3285
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3286
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3287
- .requiredOption(`--key <key>`, `Attribute Key.`)
3288
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3289
- .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3290
- .option(`--new-key <new-key>`, `New Attribute Key.`)
3291
- .action(actionRunner(databasesUpdateUrlAttribute))
3292
-
3293
- databases
3294
- .command(`get-attribute`)
3295
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-column' instead] Get attribute by ID.`)
3296
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3297
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3298
- .requiredOption(`--key <key>`, `Attribute Key.`)
3299
- .action(actionRunner(databasesGetAttribute))
3300
-
3301
- databases
3302
- .command(`delete-attribute`)
3303
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete-column' instead] Deletes an attribute.`)
3304
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3305
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3306
- .requiredOption(`--key <key>`, `Attribute Key.`)
3307
- .action(actionRunner(databasesDeleteAttribute))
3308
-
3309
- databases
3310
- .command(`update-relationship-attribute`)
3311
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-relationship-column' instead] Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes). `)
3312
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3313
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3314
- .requiredOption(`--key <key>`, `Attribute Key.`)
3315
- .option(`--on-delete <on-delete>`, `Constraints option`)
3316
- .option(`--new-key <new-key>`, `New Attribute Key.`)
3317
- .action(actionRunner(databasesUpdateRelationshipAttribute))
3318
-
3319
- databases
3320
- .command(`list-documents`)
3321
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-rows' instead] Get a list of all the user's documents in a given collection. You can use the query params to filter your results.`)
3322
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3323
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3324
- .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.`)
3325
- .option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`)
3326
- .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))
3327
- .option(`--console`, `Get the resource console url`)
3328
- .action(actionRunner(databasesListDocuments))
3329
-
3330
- databases
3331
- .command(`create-document`)
3332
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-row' instead] Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
3333
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3334
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`)
3335
- .requiredOption(`--document-id <document-id>`, `Document ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
3336
- .requiredOption(`--data <data>`, `Document data as JSON object.`)
3337
- .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).`)
3338
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3339
- .action(actionRunner(databasesCreateDocument))
3340
-
3341
- databases
3342
- .command(`create-documents`)
3343
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-rows' instead] Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
3344
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3345
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.`)
3346
- .requiredOption(`--documents [documents...]`, `Array of documents data as JSON objects.`)
3347
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3348
- .action(actionRunner(databasesCreateDocuments))
3349
-
3350
- databases
3351
- .command(`upsert-documents`)
3352
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db upsert-rows' instead] Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console. `)
3353
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3354
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3355
- .requiredOption(`--documents [documents...]`, `Array of document data as JSON objects. May contain partial documents.`)
3356
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3357
- .action(actionRunner(databasesUpsertDocuments))
3358
-
3359
- databases
3360
- .command(`update-documents`)
3361
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-rows' instead] Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.`)
3362
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3363
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3364
- .option(`--data <data>`, `Document data as JSON object. Include only attribute and value pairs to be updated.`)
3365
- .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.`)
3366
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3367
- .action(actionRunner(databasesUpdateDocuments))
3368
-
3369
- databases
3370
- .command(`delete-documents`)
3371
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete-rows' instead] Bulk delete documents using queries, if no queries are passed then all documents are deleted.`)
3372
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3373
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3374
- .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.`)
3375
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3376
- .action(actionRunner(databasesDeleteDocuments))
3377
-
3378
- databases
3379
- .command(`get-document`)
3380
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-row' instead] Get a document by its unique ID. This endpoint response returns a JSON object with the document data.`)
3381
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3382
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3383
- .requiredOption(`--document-id <document-id>`, `Document ID.`)
3384
- .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.`)
3385
- .option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`)
3386
- .option(`--console`, `Get the resource console url`)
3387
- .action(actionRunner(databasesGetDocument))
3388
-
3389
- databases
3390
- .command(`upsert-document`)
3391
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db upsert-row' instead] Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.`)
3392
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3393
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3394
- .requiredOption(`--document-id <document-id>`, `Document ID.`)
3395
- .requiredOption(`--data <data>`, `Document data as JSON object. Include all required attributes of the document to be created or updated.`)
3396
- .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
3397
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3398
- .action(actionRunner(databasesUpsertDocument))
3399
-
3400
- databases
3401
- .command(`update-document`)
3402
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update-row' instead] Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.`)
3403
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3404
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3405
- .requiredOption(`--document-id <document-id>`, `Document ID.`)
3406
- .option(`--data <data>`, `Document data as JSON object. Include only attribute and value pairs to be updated.`)
3407
- .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
3408
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3409
- .action(actionRunner(databasesUpdateDocument))
3410
-
3411
- databases
3412
- .command(`delete-document`)
3413
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete-row' instead] Delete a document by its unique ID.`)
3414
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3415
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3416
- .requiredOption(`--document-id <document-id>`, `Document ID.`)
3417
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3418
- .action(actionRunner(databasesDeleteDocument))
3419
-
3420
- databases
3421
- .command(`list-document-logs`)
3422
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-row-logs' instead] Get the document activity logs list by its unique ID.`)
3423
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3424
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3425
- .requiredOption(`--document-id <document-id>`, `Document ID.`)
3426
- .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`)
3427
- .action(actionRunner(databasesListDocumentLogs))
3428
-
3429
- databases
3430
- .command(`decrement-document-attribute`)
3431
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db decrement-row-column' instead] Decrement a specific attribute of a document by a given value.`)
3432
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3433
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3434
- .requiredOption(`--document-id <document-id>`, `Document ID.`)
3435
- .requiredOption(`--attribute <attribute>`, `Attribute key.`)
3436
- .option(`--value <value>`, `Value to increment the attribute by. The value must be a number.`, parseInteger)
3437
- .option(`--min <min>`, `Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.`, parseInteger)
3438
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3439
- .action(actionRunner(databasesDecrementDocumentAttribute))
3440
-
3441
- databases
3442
- .command(`increment-document-attribute`)
3443
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db increment-row-column' instead] Increment a specific attribute of a document by a given value.`)
3444
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3445
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3446
- .requiredOption(`--document-id <document-id>`, `Document ID.`)
3447
- .requiredOption(`--attribute <attribute>`, `Attribute key.`)
3448
- .option(`--value <value>`, `Value to increment the attribute by. The value must be a number.`, parseInteger)
3449
- .option(`--max <max>`, `Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.`, parseInteger)
3450
- .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3451
- .action(actionRunner(databasesIncrementDocumentAttribute))
3452
-
3453
- databases
3454
- .command(`list-indexes`)
3455
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-indexes' instead] List indexes in the collection.`)
3456
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3457
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3458
- .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error`)
3459
- .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))
3460
- .option(`--console`, `Get the resource console url`)
3461
- .action(actionRunner(databasesListIndexes))
3462
-
3463
- databases
3464
- .command(`create-index`)
3465
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create-index' instead] Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be 'key', 'fulltext', and 'unique'.`)
3466
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3467
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3468
- .requiredOption(`--key <key>`, `Index Key.`)
3469
- .requiredOption(`--type <type>`, `Index type.`)
3470
- .requiredOption(`--attributes [attributes...]`, `Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.`)
3471
- .option(`--orders [orders...]`, `Array of index orders. Maximum of 100 orders are allowed.`)
3472
- .option(`--lengths [lengths...]`, `Length of index. Maximum of 100`)
3473
- .action(actionRunner(databasesCreateIndex))
3474
-
3475
- databases
3476
- .command(`get-index`)
3477
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-index' instead] Get an index by its unique ID.`)
3478
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3479
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3480
- .requiredOption(`--key <key>`, `Index Key.`)
3481
- .action(actionRunner(databasesGetIndex))
3482
-
3483
- databases
3484
- .command(`delete-index`)
3485
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db delete-index' instead] Delete an index.`)
3486
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3487
- .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3488
- .requiredOption(`--key <key>`, `Index Key.`)
3489
- .action(actionRunner(databasesDeleteIndex))
3490
-
3491
- databases
3492
- .command(`list-collection-logs`)
3493
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-table-logs' instead] Get the collection activity logs list by its unique ID.`)
3494
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3495
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3496
- .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`)
3497
- .action(actionRunner(databasesListCollectionLogs))
3498
-
3499
- databases
3500
- .command(`get-collection-usage`)
3501
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-table-usage' instead] Get usage metrics and statistics for a collection. Returning the total number of documents. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`)
3502
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3503
- .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3504
- .option(`--range <range>`, `Date range.`)
3505
- .action(actionRunner(databasesGetCollectionUsage))
3506
-
3507
- databases
3508
- .command(`list-logs`)
3509
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list-database-logs' instead] Get the database activity logs list by its unique ID.`)
3510
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3511
- .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`)
3512
- .action(actionRunner(databasesListLogs))
3513
-
3514
- databases
3515
- .command(`get-usage`)
3516
- .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db get-usage' instead] Get usage metrics and statistics for a database. You can view the total number of collections, documents, and storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.`)
3517
- .requiredOption(`--database-id <database-id>`, `Database ID.`)
3518
- .option(`--range <range>`, `Date range.`)
3519
- .action(actionRunner(databasesGetUsage))
3520
-
3521
- module.exports = {
3522
- databases,
3523
- databasesList,
3524
- databasesCreate,
3525
- databasesListTransactions,
3526
- databasesCreateTransaction,
3527
- databasesGetTransaction,
3528
- databasesUpdateTransaction,
3529
- databasesDeleteTransaction,
3530
- databasesCreateOperations,
3531
- databasesListUsage,
3532
- databasesGet,
3533
- databasesUpdate,
3534
- databasesDelete,
3535
- databasesListCollections,
3536
- databasesCreateCollection,
3537
- databasesGetCollection,
3538
- databasesUpdateCollection,
3539
- databasesDeleteCollection,
3540
- databasesListAttributes,
3541
- databasesCreateBooleanAttribute,
3542
- databasesUpdateBooleanAttribute,
3543
- databasesCreateDatetimeAttribute,
3544
- databasesUpdateDatetimeAttribute,
3545
- databasesCreateEmailAttribute,
3546
- databasesUpdateEmailAttribute,
3547
- databasesCreateEnumAttribute,
3548
- databasesUpdateEnumAttribute,
3549
- databasesCreateFloatAttribute,
3550
- databasesUpdateFloatAttribute,
3551
- databasesCreateIntegerAttribute,
3552
- databasesUpdateIntegerAttribute,
3553
- databasesCreateIpAttribute,
3554
- databasesUpdateIpAttribute,
3555
- databasesCreateLineAttribute,
3556
- databasesUpdateLineAttribute,
3557
- databasesCreatePointAttribute,
3558
- databasesUpdatePointAttribute,
3559
- databasesCreatePolygonAttribute,
3560
- databasesUpdatePolygonAttribute,
3561
- databasesCreateRelationshipAttribute,
3562
- databasesCreateStringAttribute,
3563
- databasesUpdateStringAttribute,
3564
- databasesCreateUrlAttribute,
3565
- databasesUpdateUrlAttribute,
3566
- databasesGetAttribute,
3567
- databasesDeleteAttribute,
3568
- databasesUpdateRelationshipAttribute,
3569
- databasesListDocuments,
3570
- databasesCreateDocument,
3571
- databasesCreateDocuments,
3572
- databasesUpsertDocuments,
3573
- databasesUpdateDocuments,
3574
- databasesDeleteDocuments,
3575
- databasesGetDocument,
3576
- databasesUpsertDocument,
3577
- databasesUpdateDocument,
3578
- databasesDeleteDocument,
3579
- databasesListDocumentLogs,
3580
- databasesDecrementDocumentAttribute,
3581
- databasesIncrementDocumentAttribute,
3582
- databasesListIndexes,
3583
- databasesCreateIndex,
3584
- databasesGetIndex,
3585
- databasesDeleteIndex,
3586
- databasesListCollectionLogs,
3587
- databasesGetCollectionUsage,
3588
- databasesListLogs,
3589
- databasesGetUsage
3590
- };