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

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