appwrite-cli 12.0.0 → 13.0.0-rc.1

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 (283) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -2
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +145 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/lib/client.d.ts +89 -0
  8. package/dist/lib/client.d.ts.map +1 -0
  9. package/dist/lib/client.js +227 -0
  10. package/dist/lib/client.js.map +1 -0
  11. package/dist/lib/commands/account.d.ts +379 -0
  12. package/dist/lib/commands/account.d.ts.map +1 -0
  13. package/dist/lib/commands/account.js +1228 -0
  14. package/dist/lib/commands/account.js.map +1 -0
  15. package/dist/lib/commands/console.d.ts +20 -0
  16. package/dist/lib/commands/console.d.ts.map +1 -0
  17. package/dist/lib/commands/console.js +78 -0
  18. package/dist/lib/commands/console.js.map +1 -0
  19. package/dist/lib/commands/databases.d.ts +732 -0
  20. package/dist/lib/commands/databases.d.ts.map +1 -0
  21. package/dist/lib/commands/databases.js +2196 -0
  22. package/dist/lib/commands/databases.js.map +1 -0
  23. package/dist/lib/commands/functions.d.ts +310 -0
  24. package/dist/lib/commands/functions.d.ts.map +1 -0
  25. package/dist/lib/commands/functions.js +1100 -0
  26. package/dist/lib/commands/functions.js.map +1 -0
  27. package/dist/lib/commands/generic.d.ts +17 -0
  28. package/dist/lib/commands/generic.d.ts.map +1 -0
  29. package/dist/lib/commands/generic.js +279 -0
  30. package/dist/lib/commands/generic.js.map +1 -0
  31. package/dist/lib/commands/graphql.d.ts +19 -0
  32. package/dist/lib/commands/graphql.d.ts.map +1 -0
  33. package/dist/lib/commands/graphql.js +77 -0
  34. package/dist/lib/commands/graphql.js.map +1 -0
  35. package/dist/lib/commands/health.d.ts +153 -0
  36. package/dist/lib/commands/health.d.ts.map +1 -0
  37. package/dist/lib/commands/health.js +464 -0
  38. package/dist/lib/commands/health.js.map +1 -0
  39. package/dist/lib/commands/init.d.ts +3 -0
  40. package/dist/lib/commands/init.d.ts.map +1 -0
  41. package/dist/lib/commands/init.js +518 -0
  42. package/dist/lib/commands/init.js.map +1 -0
  43. package/dist/lib/commands/locale.d.ts +53 -0
  44. package/dist/lib/commands/locale.d.ts.map +1 -0
  45. package/dist/lib/commands/locale.js +165 -0
  46. package/dist/lib/commands/locale.js.map +1 -0
  47. package/dist/lib/commands/messaging.d.ts +588 -0
  48. package/dist/lib/commands/messaging.d.ts.map +1 -0
  49. package/dist/lib/commands/messaging.js +2042 -0
  50. package/dist/lib/commands/messaging.js.map +1 -0
  51. package/dist/lib/commands/migrations.d.ts +150 -0
  52. package/dist/lib/commands/migrations.d.ts.map +1 -0
  53. package/dist/lib/commands/migrations.js +524 -0
  54. package/dist/lib/commands/migrations.js.map +1 -0
  55. package/dist/lib/commands/organizations.d.ts +11 -0
  56. package/dist/lib/commands/organizations.d.ts.map +1 -0
  57. package/dist/lib/commands/organizations.js +31 -0
  58. package/dist/lib/commands/organizations.js.map +1 -0
  59. package/dist/lib/commands/project.d.ts +53 -0
  60. package/dist/lib/commands/project.d.ts.map +1 -0
  61. package/dist/lib/commands/project.js +176 -0
  62. package/dist/lib/commands/project.js.map +1 -0
  63. package/dist/lib/commands/projects.d.ts +516 -0
  64. package/dist/lib/commands/projects.d.ts.map +1 -0
  65. package/dist/lib/commands/projects.js +1590 -0
  66. package/dist/lib/commands/projects.js.map +1 -0
  67. package/dist/lib/commands/proxy.d.ts +71 -0
  68. package/dist/lib/commands/proxy.d.ts.map +1 -0
  69. package/dist/lib/commands/proxy.js +240 -0
  70. package/dist/lib/commands/proxy.js.map +1 -0
  71. package/dist/lib/commands/pull.d.ts +8 -0
  72. package/dist/lib/commands/pull.d.ts.map +1 -0
  73. package/dist/lib/commands/pull.js +455 -0
  74. package/dist/lib/commands/pull.js.map +1 -0
  75. package/dist/lib/commands/push.d.ts +4 -0
  76. package/dist/lib/commands/push.d.ts.map +1 -0
  77. package/dist/lib/commands/push.js +2154 -0
  78. package/dist/lib/commands/push.js.map +1 -0
  79. package/dist/lib/commands/run.d.ts +3 -0
  80. package/dist/lib/commands/run.d.ts.map +1 -0
  81. package/dist/lib/commands/run.js +287 -0
  82. package/dist/lib/commands/run.js.map +1 -0
  83. package/dist/lib/commands/sites.d.ts +296 -0
  84. package/dist/lib/commands/sites.d.ts.map +1 -0
  85. package/dist/lib/commands/sites.js +1046 -0
  86. package/dist/lib/commands/sites.js.map +1 -0
  87. package/dist/lib/commands/storage.d.ts +170 -0
  88. package/dist/lib/commands/storage.d.ts.map +1 -0
  89. package/dist/lib/commands/storage.js +651 -0
  90. package/dist/lib/commands/storage.js.map +1 -0
  91. package/dist/lib/commands/tables-db.d.ts +728 -0
  92. package/dist/lib/commands/tables-db.d.ts.map +1 -0
  93. package/dist/lib/commands/tables-db.js +2198 -0
  94. package/dist/lib/commands/tables-db.js.map +1 -0
  95. package/dist/lib/commands/teams.d.ts +129 -0
  96. package/dist/lib/commands/teams.d.ts.map +1 -0
  97. package/dist/lib/commands/teams.js +403 -0
  98. package/dist/lib/commands/teams.js.map +1 -0
  99. package/dist/lib/commands/tokens.d.ts +48 -0
  100. package/dist/lib/commands/tokens.d.ts.map +1 -0
  101. package/dist/lib/commands/tokens.js +156 -0
  102. package/dist/lib/commands/tokens.js.map +1 -0
  103. package/dist/lib/commands/types.d.ts +3 -0
  104. package/dist/lib/commands/types.d.ts.map +1 -0
  105. package/dist/lib/commands/types.js +155 -0
  106. package/dist/lib/commands/types.js.map +1 -0
  107. package/dist/lib/commands/update.d.ts +3 -0
  108. package/dist/lib/commands/update.d.ts.map +1 -0
  109. package/dist/lib/commands/update.js +202 -0
  110. package/dist/lib/commands/update.js.map +1 -0
  111. package/dist/lib/commands/users.d.ts +382 -0
  112. package/dist/lib/commands/users.d.ts.map +1 -0
  113. package/dist/lib/commands/users.js +1195 -0
  114. package/dist/lib/commands/users.js.map +1 -0
  115. package/dist/lib/commands/vcs.d.ts +92 -0
  116. package/dist/lib/commands/vcs.d.ts.map +1 -0
  117. package/dist/lib/commands/vcs.js +276 -0
  118. package/dist/lib/commands/vcs.js.map +1 -0
  119. package/dist/lib/config.d.ts +118 -0
  120. package/dist/lib/config.d.ts.map +1 -0
  121. package/{lib → dist/lib}/config.js +204 -325
  122. package/dist/lib/config.js.map +1 -0
  123. package/dist/lib/emulation/docker.d.ts +15 -0
  124. package/dist/lib/emulation/docker.d.ts.map +1 -0
  125. package/dist/lib/emulation/docker.js +220 -0
  126. package/dist/lib/emulation/docker.js.map +1 -0
  127. package/dist/lib/emulation/utils.d.ts +29 -0
  128. package/dist/lib/emulation/utils.d.ts.map +1 -0
  129. package/dist/lib/emulation/utils.js +168 -0
  130. package/dist/lib/emulation/utils.js.map +1 -0
  131. package/dist/lib/exception.d.ts +8 -0
  132. package/dist/lib/exception.d.ts.map +1 -0
  133. package/dist/lib/exception.js +16 -0
  134. package/dist/lib/exception.js.map +1 -0
  135. package/dist/lib/id.d.ts +7 -0
  136. package/dist/lib/id.d.ts.map +1 -0
  137. package/dist/lib/id.js +32 -0
  138. package/dist/lib/id.js.map +1 -0
  139. package/dist/lib/paginate.d.ts +10 -0
  140. package/dist/lib/paginate.d.ts.map +1 -0
  141. package/{lib → dist/lib}/paginate.js +9 -15
  142. package/dist/lib/paginate.js.map +1 -0
  143. package/dist/lib/parser.d.ts +18 -0
  144. package/dist/lib/parser.d.ts.map +1 -0
  145. package/dist/lib/parser.js +237 -0
  146. package/dist/lib/parser.js.map +1 -0
  147. package/dist/lib/questions.d.ts +59 -0
  148. package/dist/lib/questions.d.ts.map +1 -0
  149. package/dist/lib/questions.js +995 -0
  150. package/dist/lib/questions.js.map +1 -0
  151. package/dist/lib/sdks.d.ts +4 -0
  152. package/dist/lib/sdks.d.ts.map +1 -0
  153. package/dist/lib/sdks.js +51 -0
  154. package/dist/lib/sdks.js.map +1 -0
  155. package/dist/lib/spinner.d.ts +28 -0
  156. package/dist/lib/spinner.d.ts.map +1 -0
  157. package/{lib → dist/lib}/spinner.js +34 -45
  158. package/dist/lib/spinner.js.map +1 -0
  159. package/dist/lib/type-generation/attribute.d.ts +17 -0
  160. package/dist/lib/type-generation/attribute.d.ts.map +1 -0
  161. package/dist/lib/type-generation/attribute.js +19 -0
  162. package/dist/lib/type-generation/attribute.js.map +1 -0
  163. package/dist/lib/type-generation/languages/csharp.d.ts +7 -0
  164. package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -0
  165. package/dist/lib/type-generation/languages/csharp.js +180 -0
  166. package/dist/lib/type-generation/languages/csharp.js.map +1 -0
  167. package/dist/lib/type-generation/languages/dart.d.ts +8 -0
  168. package/dist/lib/type-generation/languages/dart.d.ts.map +1 -0
  169. package/dist/lib/type-generation/languages/dart.js +197 -0
  170. package/dist/lib/type-generation/languages/dart.js.map +1 -0
  171. package/dist/lib/type-generation/languages/java.d.ts +7 -0
  172. package/dist/lib/type-generation/languages/java.d.ts.map +1 -0
  173. package/dist/lib/type-generation/languages/java.js +140 -0
  174. package/dist/lib/type-generation/languages/java.js.map +1 -0
  175. package/dist/lib/type-generation/languages/javascript.d.ts +9 -0
  176. package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -0
  177. package/dist/lib/type-generation/languages/javascript.js +108 -0
  178. package/dist/lib/type-generation/languages/javascript.js.map +1 -0
  179. package/dist/lib/type-generation/languages/kotlin.d.ts +7 -0
  180. package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -0
  181. package/dist/lib/type-generation/languages/kotlin.js +95 -0
  182. package/dist/lib/type-generation/languages/kotlin.js.map +1 -0
  183. package/dist/lib/type-generation/languages/language.d.ts +43 -0
  184. package/dist/lib/type-generation/languages/language.d.ts.map +1 -0
  185. package/dist/lib/type-generation/languages/language.js +82 -0
  186. package/dist/lib/type-generation/languages/language.js.map +1 -0
  187. package/dist/lib/type-generation/languages/php.d.ts +7 -0
  188. package/dist/lib/type-generation/languages/php.d.ts.map +1 -0
  189. package/dist/lib/type-generation/languages/php.js +116 -0
  190. package/dist/lib/type-generation/languages/php.js.map +1 -0
  191. package/dist/lib/type-generation/languages/swift.d.ts +7 -0
  192. package/dist/lib/type-generation/languages/swift.d.ts.map +1 -0
  193. package/dist/lib/type-generation/languages/swift.js +179 -0
  194. package/dist/lib/type-generation/languages/swift.js.map +1 -0
  195. package/dist/lib/type-generation/languages/typescript.d.ts +9 -0
  196. package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -0
  197. package/dist/lib/type-generation/languages/typescript.js +112 -0
  198. package/dist/lib/type-generation/languages/typescript.js.map +1 -0
  199. package/dist/lib/types.d.ts +133 -0
  200. package/dist/lib/types.d.ts.map +1 -0
  201. package/dist/lib/types.js +3 -0
  202. package/dist/lib/types.js.map +1 -0
  203. package/dist/lib/utils.d.ts +15 -0
  204. package/dist/lib/utils.d.ts.map +1 -0
  205. package/{lib → dist/lib}/utils.js +74 -120
  206. package/dist/lib/utils.js.map +1 -0
  207. package/dist/lib/validations.d.ts +2 -0
  208. package/dist/lib/validations.d.ts.map +1 -0
  209. package/dist/lib/validations.js +20 -0
  210. package/dist/lib/validations.js.map +1 -0
  211. package/docs/examples/databases/upsert-document.md +1 -2
  212. package/index.ts +152 -0
  213. package/install.ps1 +2 -5
  214. package/install.sh +1 -2
  215. package/lib/client.ts +259 -0
  216. package/lib/commands/{account.js → account.ts} +410 -664
  217. package/lib/commands/console.ts +112 -0
  218. package/lib/commands/{databases.js → databases.ts} +818 -1136
  219. package/lib/commands/{functions.js → functions.ts} +381 -526
  220. package/lib/commands/{generic.js → generic.ts} +47 -39
  221. package/lib/commands/graphql.ts +110 -0
  222. package/lib/commands/{health.js → health.ts} +168 -284
  223. package/lib/commands/{init.js → init.ts} +68 -66
  224. package/lib/commands/{locale.js → locale.ts} +75 -121
  225. package/lib/commands/{messaging.js → messaging.ts} +699 -937
  226. package/lib/commands/{migrations.js → migrations.ts} +182 -258
  227. package/lib/commands/organizations.ts +46 -0
  228. package/lib/commands/{project.js → project.ts} +75 -111
  229. package/lib/commands/{projects.js → projects.ts} +587 -843
  230. package/lib/commands/{proxy.js → proxy.ts} +94 -140
  231. package/lib/commands/{pull.js → pull.ts} +54 -44
  232. package/lib/commands/{push.js → push.ts} +235 -191
  233. package/lib/commands/{run.js → run.ts} +61 -55
  234. package/lib/commands/{sites.js → sites.ts} +364 -504
  235. package/lib/commands/{storage.js → storage.ts} +216 -292
  236. package/lib/commands/{tables-db.js → tables-db.ts} +817 -1126
  237. package/lib/commands/{teams.js → teams.ts} +162 -236
  238. package/lib/commands/{tokens.js → tokens.ts} +70 -99
  239. package/lib/commands/{types.js → types.ts} +37 -35
  240. package/lib/commands/{update.js → update.ts} +25 -27
  241. package/lib/commands/{users.js → users.ts} +426 -644
  242. package/lib/commands/{vcs.js → vcs.ts} +122 -173
  243. package/lib/config.ts +854 -0
  244. package/lib/emulation/{docker.js → docker.ts} +39 -38
  245. package/lib/emulation/utils.ts +193 -0
  246. package/lib/exception.ts +20 -0
  247. package/lib/{id.js → id.ts} +5 -5
  248. package/lib/paginate.ts +63 -0
  249. package/lib/parser.ts +238 -0
  250. package/lib/{questions.js → questions.ts} +148 -156
  251. package/lib/sdks.ts +55 -0
  252. package/lib/spinner.ts +118 -0
  253. package/lib/type-generation/attribute.ts +17 -0
  254. package/lib/type-generation/languages/{csharp.js → csharp.ts} +59 -48
  255. package/lib/type-generation/languages/{dart.js → dart.ts} +91 -80
  256. package/lib/type-generation/languages/{java.js → java.ts} +58 -47
  257. package/lib/type-generation/languages/javascript.ts +111 -0
  258. package/lib/type-generation/languages/kotlin.ts +96 -0
  259. package/lib/type-generation/languages/language.ts +119 -0
  260. package/lib/type-generation/languages/{php.js → php.ts} +55 -48
  261. package/lib/type-generation/languages/{swift.js → swift.ts} +59 -48
  262. package/lib/type-generation/languages/typescript.ts +116 -0
  263. package/lib/types.ts +150 -0
  264. package/lib/utils.ts +322 -0
  265. package/lib/validations.ts +17 -0
  266. package/package.json +21 -12
  267. package/scoop/appwrite.config.json +3 -3
  268. package/tsconfig.json +30 -0
  269. package/index.js +0 -147
  270. package/lib/client.js +0 -254
  271. package/lib/commands/console.js +0 -127
  272. package/lib/commands/graphql.js +0 -126
  273. package/lib/commands/organizations.js +0 -48
  274. package/lib/emulation/utils.js +0 -186
  275. package/lib/exception.js +0 -9
  276. package/lib/parser.js +0 -250
  277. package/lib/sdks.js +0 -60
  278. package/lib/type-generation/attribute.js +0 -16
  279. package/lib/type-generation/languages/javascript.js +0 -102
  280. package/lib/type-generation/languages/kotlin.js +0 -85
  281. package/lib/type-generation/languages/language.js +0 -125
  282. package/lib/type-generation/languages/typescript.js +0 -107
  283. package/lib/validations.js +0 -17
@@ -0,0 +1,2198 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.tablesDBGetIndex = exports.tablesDBCreateIndex = exports.tablesDBListIndexes = exports.tablesDBUpdateRelationshipColumn = exports.tablesDBDeleteColumn = exports.tablesDBGetColumn = exports.tablesDBUpdateUrlColumn = exports.tablesDBCreateUrlColumn = exports.tablesDBUpdateStringColumn = exports.tablesDBCreateStringColumn = exports.tablesDBCreateRelationshipColumn = exports.tablesDBUpdatePolygonColumn = exports.tablesDBCreatePolygonColumn = exports.tablesDBUpdatePointColumn = exports.tablesDBCreatePointColumn = exports.tablesDBUpdateLineColumn = exports.tablesDBCreateLineColumn = exports.tablesDBUpdateIpColumn = exports.tablesDBCreateIpColumn = exports.tablesDBUpdateIntegerColumn = exports.tablesDBCreateIntegerColumn = exports.tablesDBUpdateFloatColumn = exports.tablesDBCreateFloatColumn = exports.tablesDBUpdateEnumColumn = exports.tablesDBCreateEnumColumn = exports.tablesDBUpdateEmailColumn = exports.tablesDBCreateEmailColumn = exports.tablesDBUpdateDatetimeColumn = exports.tablesDBCreateDatetimeColumn = exports.tablesDBUpdateBooleanColumn = exports.tablesDBCreateBooleanColumn = exports.tablesDBListColumns = exports.tablesDBDeleteTable = exports.tablesDBUpdateTable = exports.tablesDBGetTable = exports.tablesDBCreateTable = exports.tablesDBListTables = exports.tablesDBDelete = exports.tablesDBUpdate = exports.tablesDBGet = exports.tablesDBListUsage = exports.tablesDBCreateOperations = exports.tablesDBDeleteTransaction = exports.tablesDBUpdateTransaction = exports.tablesDBGetTransaction = exports.tablesDBCreateTransaction = exports.tablesDBListTransactions = exports.tablesDBCreate = exports.tablesDBList = exports.tablesDB = void 0;
4
+ exports.tablesDBGetUsage = exports.tablesDBGetTableUsage = exports.tablesDBIncrementRowColumn = exports.tablesDBDecrementRowColumn = exports.tablesDBListRowLogs = exports.tablesDBDeleteRow = exports.tablesDBUpdateRow = exports.tablesDBUpsertRow = exports.tablesDBGetRow = exports.tablesDBDeleteRows = exports.tablesDBUpdateRows = exports.tablesDBUpsertRows = exports.tablesDBCreateRows = exports.tablesDBCreateRow = exports.tablesDBListRows = exports.tablesDBListTableLogs = exports.tablesDBDeleteIndex = void 0;
5
+ const utils_1 = require("../utils");
6
+ const commander_1 = require("commander");
7
+ const sdks_1 = require("../sdks");
8
+ const parser_1 = require("../parser");
9
+ const web_1 = require("stream/web");
10
+ function convertReadStreamToReadableStream(readStream) {
11
+ return new web_1.ReadableStream({
12
+ start(controller) {
13
+ readStream.on("data", (chunk) => {
14
+ controller.enqueue(chunk);
15
+ });
16
+ readStream.on("end", () => {
17
+ controller.close();
18
+ });
19
+ readStream.on("error", (err) => {
20
+ controller.error(err);
21
+ });
22
+ },
23
+ cancel() {
24
+ readStream.destroy();
25
+ },
26
+ });
27
+ }
28
+ exports.tablesDB = new commander_1.Command("tables-db").description(parser_1.commandDescriptions['tables-db'] ?? '').configureHelp({
29
+ helpWidth: process.stdout.columns || 80
30
+ });
31
+ const tablesDBList = async ({ queries, search, total, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
32
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
33
+ sdk;
34
+ let apiPath = '/tablesdb';
35
+ let payload = {};
36
+ if (typeof queries !== 'undefined') {
37
+ payload['queries'] = queries;
38
+ }
39
+ if (typeof search !== 'undefined') {
40
+ payload['search'] = search;
41
+ }
42
+ if (typeof total !== 'undefined') {
43
+ payload['total'] = total;
44
+ }
45
+ let response = undefined;
46
+ response = await client.call('get', apiPath, {}, payload);
47
+ if (parseOutput) {
48
+ if (showConsole) {
49
+ (0, utils_1.showConsoleLink)('tablesDB', 'list');
50
+ }
51
+ else {
52
+ (0, parser_1.parse)(response);
53
+ }
54
+ }
55
+ return response;
56
+ };
57
+ exports.tablesDBList = tablesDBList;
58
+ const tablesDBCreate = async ({ databaseId, name, enabled, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
59
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
60
+ sdk;
61
+ let apiPath = '/tablesdb';
62
+ let payload = {};
63
+ if (typeof databaseId !== 'undefined') {
64
+ payload['databaseId'] = databaseId;
65
+ }
66
+ if (typeof name !== 'undefined') {
67
+ payload['name'] = name;
68
+ }
69
+ if (typeof enabled !== 'undefined') {
70
+ payload['enabled'] = enabled;
71
+ }
72
+ let response = undefined;
73
+ response = await client.call('post', apiPath, {
74
+ 'content-type': 'application/json',
75
+ }, payload);
76
+ if (parseOutput) {
77
+ (0, parser_1.parse)(response);
78
+ }
79
+ return response;
80
+ };
81
+ exports.tablesDBCreate = tablesDBCreate;
82
+ const tablesDBListTransactions = async ({ queries, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
83
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
84
+ sdk;
85
+ let apiPath = '/tablesdb/transactions';
86
+ let payload = {};
87
+ if (typeof queries !== 'undefined') {
88
+ payload['queries'] = queries;
89
+ }
90
+ let response = undefined;
91
+ response = await client.call('get', apiPath, {}, payload);
92
+ if (parseOutput) {
93
+ if (showConsole) {
94
+ (0, utils_1.showConsoleLink)('tablesDB', 'listTransactions');
95
+ }
96
+ else {
97
+ (0, parser_1.parse)(response);
98
+ }
99
+ }
100
+ return response;
101
+ };
102
+ exports.tablesDBListTransactions = tablesDBListTransactions;
103
+ const tablesDBCreateTransaction = async ({ ttl, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
104
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
105
+ sdk;
106
+ let apiPath = '/tablesdb/transactions';
107
+ let payload = {};
108
+ if (typeof ttl !== 'undefined') {
109
+ payload['ttl'] = ttl;
110
+ }
111
+ let response = undefined;
112
+ response = await client.call('post', apiPath, {
113
+ 'content-type': 'application/json',
114
+ }, payload);
115
+ if (parseOutput) {
116
+ (0, parser_1.parse)(response);
117
+ }
118
+ return response;
119
+ };
120
+ exports.tablesDBCreateTransaction = tablesDBCreateTransaction;
121
+ const tablesDBGetTransaction = async ({ transactionId, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
122
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
123
+ sdk;
124
+ let apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId);
125
+ let payload = {};
126
+ let response = undefined;
127
+ response = await client.call('get', apiPath, {}, payload);
128
+ if (parseOutput) {
129
+ if (showConsole) {
130
+ (0, utils_1.showConsoleLink)('tablesDB', 'getTransaction', transactionId);
131
+ }
132
+ else {
133
+ (0, parser_1.parse)(response);
134
+ }
135
+ }
136
+ return response;
137
+ };
138
+ exports.tablesDBGetTransaction = tablesDBGetTransaction;
139
+ const tablesDBUpdateTransaction = async ({ transactionId, commit, rollback, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
140
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
141
+ sdk;
142
+ let apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId);
143
+ let payload = {};
144
+ if (typeof commit !== 'undefined') {
145
+ payload['commit'] = commit;
146
+ }
147
+ if (typeof rollback !== 'undefined') {
148
+ payload['rollback'] = rollback;
149
+ }
150
+ let response = undefined;
151
+ response = await client.call('patch', apiPath, {
152
+ 'content-type': 'application/json',
153
+ }, payload);
154
+ if (parseOutput) {
155
+ (0, parser_1.parse)(response);
156
+ }
157
+ return response;
158
+ };
159
+ exports.tablesDBUpdateTransaction = tablesDBUpdateTransaction;
160
+ const tablesDBDeleteTransaction = async ({ transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
161
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
162
+ sdk;
163
+ let apiPath = '/tablesdb/transactions/{transactionId}'.replace('{transactionId}', transactionId);
164
+ let payload = {};
165
+ let response = undefined;
166
+ response = await client.call('delete', apiPath, {
167
+ 'content-type': 'application/json',
168
+ }, payload);
169
+ if (parseOutput) {
170
+ (0, parser_1.parse)(response);
171
+ }
172
+ return response;
173
+ };
174
+ exports.tablesDBDeleteTransaction = tablesDBDeleteTransaction;
175
+ const tablesDBCreateOperations = async ({ transactionId, operations, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
176
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
177
+ sdk;
178
+ let apiPath = '/tablesdb/transactions/{transactionId}/operations'.replace('{transactionId}', transactionId);
179
+ let payload = {};
180
+ operations = operations === true ? [] : operations;
181
+ if (typeof operations !== 'undefined') {
182
+ payload['operations'] = operations;
183
+ }
184
+ let response = undefined;
185
+ response = await client.call('post', apiPath, {
186
+ 'content-type': 'application/json',
187
+ }, payload);
188
+ if (parseOutput) {
189
+ (0, parser_1.parse)(response);
190
+ }
191
+ return response;
192
+ };
193
+ exports.tablesDBCreateOperations = tablesDBCreateOperations;
194
+ const tablesDBListUsage = async ({ range, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
195
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
196
+ sdk;
197
+ let apiPath = '/tablesdb/usage';
198
+ let payload = {};
199
+ if (typeof range !== 'undefined') {
200
+ payload['range'] = range;
201
+ }
202
+ let response = undefined;
203
+ response = await client.call('get', apiPath, {}, payload);
204
+ if (parseOutput) {
205
+ if (showConsole) {
206
+ (0, utils_1.showConsoleLink)('tablesDB', 'listUsage');
207
+ }
208
+ else {
209
+ (0, parser_1.parse)(response);
210
+ }
211
+ }
212
+ return response;
213
+ };
214
+ exports.tablesDBListUsage = tablesDBListUsage;
215
+ const tablesDBGet = async ({ databaseId, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
216
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
217
+ sdk;
218
+ let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId);
219
+ let payload = {};
220
+ let response = undefined;
221
+ response = await client.call('get', apiPath, {}, payload);
222
+ if (parseOutput) {
223
+ if (showConsole) {
224
+ (0, utils_1.showConsoleLink)('tablesDB', 'get', databaseId);
225
+ }
226
+ else {
227
+ (0, parser_1.parse)(response);
228
+ }
229
+ }
230
+ return response;
231
+ };
232
+ exports.tablesDBGet = tablesDBGet;
233
+ const tablesDBUpdate = async ({ databaseId, name, enabled, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
234
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
235
+ sdk;
236
+ let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId);
237
+ let payload = {};
238
+ if (typeof name !== 'undefined') {
239
+ payload['name'] = name;
240
+ }
241
+ if (typeof enabled !== 'undefined') {
242
+ payload['enabled'] = enabled;
243
+ }
244
+ let response = undefined;
245
+ response = await client.call('put', apiPath, {
246
+ 'content-type': 'application/json',
247
+ }, payload);
248
+ if (parseOutput) {
249
+ (0, parser_1.parse)(response);
250
+ }
251
+ return response;
252
+ };
253
+ exports.tablesDBUpdate = tablesDBUpdate;
254
+ const tablesDBDelete = async ({ databaseId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
255
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
256
+ sdk;
257
+ let apiPath = '/tablesdb/{databaseId}'.replace('{databaseId}', databaseId);
258
+ let payload = {};
259
+ let response = undefined;
260
+ response = await client.call('delete', apiPath, {
261
+ 'content-type': 'application/json',
262
+ }, payload);
263
+ if (parseOutput) {
264
+ (0, parser_1.parse)(response);
265
+ }
266
+ return response;
267
+ };
268
+ exports.tablesDBDelete = tablesDBDelete;
269
+ const tablesDBListTables = async ({ databaseId, queries, search, total, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
270
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
271
+ sdk;
272
+ let apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId);
273
+ let payload = {};
274
+ if (typeof queries !== 'undefined') {
275
+ payload['queries'] = queries;
276
+ }
277
+ if (typeof search !== 'undefined') {
278
+ payload['search'] = search;
279
+ }
280
+ if (typeof total !== 'undefined') {
281
+ payload['total'] = total;
282
+ }
283
+ let response = undefined;
284
+ response = await client.call('get', apiPath, {}, payload);
285
+ if (parseOutput) {
286
+ if (showConsole) {
287
+ (0, utils_1.showConsoleLink)('tablesDB', 'listTables', databaseId);
288
+ }
289
+ else {
290
+ (0, parser_1.parse)(response);
291
+ }
292
+ }
293
+ return response;
294
+ };
295
+ exports.tablesDBListTables = tablesDBListTables;
296
+ const tablesDBCreateTable = async ({ databaseId, tableId, name, permissions, rowSecurity, enabled, columns, indexes, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
297
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
298
+ sdk;
299
+ let apiPath = '/tablesdb/{databaseId}/tables'.replace('{databaseId}', databaseId);
300
+ let payload = {};
301
+ if (typeof tableId !== 'undefined') {
302
+ payload['tableId'] = tableId;
303
+ }
304
+ if (typeof name !== 'undefined') {
305
+ payload['name'] = name;
306
+ }
307
+ permissions = permissions === true ? [] : permissions;
308
+ if (typeof permissions !== 'undefined') {
309
+ payload['permissions'] = permissions;
310
+ }
311
+ if (typeof rowSecurity !== 'undefined') {
312
+ payload['rowSecurity'] = rowSecurity;
313
+ }
314
+ if (typeof enabled !== 'undefined') {
315
+ payload['enabled'] = enabled;
316
+ }
317
+ columns = columns === true ? [] : columns;
318
+ if (typeof columns !== 'undefined') {
319
+ payload['columns'] = columns;
320
+ }
321
+ indexes = indexes === true ? [] : indexes;
322
+ if (typeof indexes !== 'undefined') {
323
+ payload['indexes'] = indexes;
324
+ }
325
+ let response = undefined;
326
+ response = await client.call('post', apiPath, {
327
+ 'content-type': 'application/json',
328
+ }, payload);
329
+ if (parseOutput) {
330
+ (0, parser_1.parse)(response);
331
+ }
332
+ return response;
333
+ };
334
+ exports.tablesDBCreateTable = tablesDBCreateTable;
335
+ const tablesDBGetTable = async ({ databaseId, tableId, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
336
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
337
+ sdk;
338
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
339
+ let payload = {};
340
+ let response = undefined;
341
+ response = await client.call('get', apiPath, {}, payload);
342
+ if (parseOutput) {
343
+ if (showConsole) {
344
+ (0, utils_1.showConsoleLink)('tablesDB', 'getTable', databaseId, tableId);
345
+ }
346
+ else {
347
+ (0, parser_1.parse)(response);
348
+ }
349
+ }
350
+ return response;
351
+ };
352
+ exports.tablesDBGetTable = tablesDBGetTable;
353
+ const tablesDBUpdateTable = async ({ databaseId, tableId, name, permissions, rowSecurity, enabled, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
354
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
355
+ sdk;
356
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
357
+ let payload = {};
358
+ if (typeof name !== 'undefined') {
359
+ payload['name'] = name;
360
+ }
361
+ permissions = permissions === true ? [] : permissions;
362
+ if (typeof permissions !== 'undefined') {
363
+ payload['permissions'] = permissions;
364
+ }
365
+ if (typeof rowSecurity !== 'undefined') {
366
+ payload['rowSecurity'] = rowSecurity;
367
+ }
368
+ if (typeof enabled !== 'undefined') {
369
+ payload['enabled'] = enabled;
370
+ }
371
+ let response = undefined;
372
+ response = await client.call('put', apiPath, {
373
+ 'content-type': 'application/json',
374
+ }, payload);
375
+ if (parseOutput) {
376
+ (0, parser_1.parse)(response);
377
+ }
378
+ return response;
379
+ };
380
+ exports.tablesDBUpdateTable = tablesDBUpdateTable;
381
+ const tablesDBDeleteTable = async ({ databaseId, tableId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
382
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
383
+ sdk;
384
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
385
+ let payload = {};
386
+ let response = undefined;
387
+ response = await client.call('delete', apiPath, {
388
+ 'content-type': 'application/json',
389
+ }, payload);
390
+ if (parseOutput) {
391
+ (0, parser_1.parse)(response);
392
+ }
393
+ return response;
394
+ };
395
+ exports.tablesDBDeleteTable = tablesDBDeleteTable;
396
+ const tablesDBListColumns = async ({ databaseId, tableId, queries, total, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
397
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
398
+ sdk;
399
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
400
+ let payload = {};
401
+ if (typeof queries !== 'undefined') {
402
+ payload['queries'] = queries;
403
+ }
404
+ if (typeof total !== 'undefined') {
405
+ payload['total'] = total;
406
+ }
407
+ let response = undefined;
408
+ response = await client.call('get', apiPath, {}, payload);
409
+ if (parseOutput) {
410
+ if (showConsole) {
411
+ (0, utils_1.showConsoleLink)('tablesDB', 'listColumns', databaseId, tableId);
412
+ }
413
+ else {
414
+ (0, parser_1.parse)(response);
415
+ }
416
+ }
417
+ return response;
418
+ };
419
+ exports.tablesDBListColumns = tablesDBListColumns;
420
+ const tablesDBCreateBooleanColumn = async ({ databaseId, tableId, key, required, xdefault, array, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
421
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
422
+ sdk;
423
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
424
+ let payload = {};
425
+ if (typeof key !== 'undefined') {
426
+ payload['key'] = key;
427
+ }
428
+ if (typeof required !== 'undefined') {
429
+ payload['required'] = required;
430
+ }
431
+ if (typeof xdefault !== 'undefined') {
432
+ payload['default'] = xdefault;
433
+ }
434
+ if (typeof array !== 'undefined') {
435
+ payload['array'] = array;
436
+ }
437
+ let response = undefined;
438
+ response = await client.call('post', apiPath, {
439
+ 'content-type': 'application/json',
440
+ }, payload);
441
+ if (parseOutput) {
442
+ (0, parser_1.parse)(response);
443
+ }
444
+ return response;
445
+ };
446
+ exports.tablesDBCreateBooleanColumn = tablesDBCreateBooleanColumn;
447
+ const tablesDBUpdateBooleanColumn = async ({ databaseId, tableId, key, required, xdefault, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
448
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
449
+ sdk;
450
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/boolean/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
451
+ let payload = {};
452
+ if (typeof required !== 'undefined') {
453
+ payload['required'] = required;
454
+ }
455
+ if (typeof xdefault !== 'undefined') {
456
+ payload['default'] = xdefault;
457
+ }
458
+ if (typeof newKey !== 'undefined') {
459
+ payload['newKey'] = newKey;
460
+ }
461
+ let response = undefined;
462
+ response = await client.call('patch', apiPath, {
463
+ 'content-type': 'application/json',
464
+ }, payload);
465
+ if (parseOutput) {
466
+ (0, parser_1.parse)(response);
467
+ }
468
+ return response;
469
+ };
470
+ exports.tablesDBUpdateBooleanColumn = tablesDBUpdateBooleanColumn;
471
+ const tablesDBCreateDatetimeColumn = async ({ databaseId, tableId, key, required, xdefault, array, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
472
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
473
+ sdk;
474
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
475
+ let payload = {};
476
+ if (typeof key !== 'undefined') {
477
+ payload['key'] = key;
478
+ }
479
+ if (typeof required !== 'undefined') {
480
+ payload['required'] = required;
481
+ }
482
+ if (typeof xdefault !== 'undefined') {
483
+ payload['default'] = xdefault;
484
+ }
485
+ if (typeof array !== 'undefined') {
486
+ payload['array'] = array;
487
+ }
488
+ let response = undefined;
489
+ response = await client.call('post', apiPath, {
490
+ 'content-type': 'application/json',
491
+ }, payload);
492
+ if (parseOutput) {
493
+ (0, parser_1.parse)(response);
494
+ }
495
+ return response;
496
+ };
497
+ exports.tablesDBCreateDatetimeColumn = tablesDBCreateDatetimeColumn;
498
+ const tablesDBUpdateDatetimeColumn = async ({ databaseId, tableId, key, required, xdefault, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
499
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
500
+ sdk;
501
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/datetime/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
502
+ let payload = {};
503
+ if (typeof required !== 'undefined') {
504
+ payload['required'] = required;
505
+ }
506
+ if (typeof xdefault !== 'undefined') {
507
+ payload['default'] = xdefault;
508
+ }
509
+ if (typeof newKey !== 'undefined') {
510
+ payload['newKey'] = newKey;
511
+ }
512
+ let response = undefined;
513
+ response = await client.call('patch', apiPath, {
514
+ 'content-type': 'application/json',
515
+ }, payload);
516
+ if (parseOutput) {
517
+ (0, parser_1.parse)(response);
518
+ }
519
+ return response;
520
+ };
521
+ exports.tablesDBUpdateDatetimeColumn = tablesDBUpdateDatetimeColumn;
522
+ const tablesDBCreateEmailColumn = async ({ databaseId, tableId, key, required, xdefault, array, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
523
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
524
+ sdk;
525
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
526
+ let payload = {};
527
+ if (typeof key !== 'undefined') {
528
+ payload['key'] = key;
529
+ }
530
+ if (typeof required !== 'undefined') {
531
+ payload['required'] = required;
532
+ }
533
+ if (typeof xdefault !== 'undefined') {
534
+ payload['default'] = xdefault;
535
+ }
536
+ if (typeof array !== 'undefined') {
537
+ payload['array'] = array;
538
+ }
539
+ let response = undefined;
540
+ response = await client.call('post', apiPath, {
541
+ 'content-type': 'application/json',
542
+ }, payload);
543
+ if (parseOutput) {
544
+ (0, parser_1.parse)(response);
545
+ }
546
+ return response;
547
+ };
548
+ exports.tablesDBCreateEmailColumn = tablesDBCreateEmailColumn;
549
+ const tablesDBUpdateEmailColumn = async ({ databaseId, tableId, key, required, xdefault, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
550
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
551
+ sdk;
552
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/email/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
553
+ let payload = {};
554
+ if (typeof required !== 'undefined') {
555
+ payload['required'] = required;
556
+ }
557
+ if (typeof xdefault !== 'undefined') {
558
+ payload['default'] = xdefault;
559
+ }
560
+ if (typeof newKey !== 'undefined') {
561
+ payload['newKey'] = newKey;
562
+ }
563
+ let response = undefined;
564
+ response = await client.call('patch', apiPath, {
565
+ 'content-type': 'application/json',
566
+ }, payload);
567
+ if (parseOutput) {
568
+ (0, parser_1.parse)(response);
569
+ }
570
+ return response;
571
+ };
572
+ exports.tablesDBUpdateEmailColumn = tablesDBUpdateEmailColumn;
573
+ const tablesDBCreateEnumColumn = async ({ databaseId, tableId, key, elements, required, xdefault, array, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
574
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
575
+ sdk;
576
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
577
+ let payload = {};
578
+ if (typeof key !== 'undefined') {
579
+ payload['key'] = key;
580
+ }
581
+ elements = elements === true ? [] : elements;
582
+ if (typeof elements !== 'undefined') {
583
+ payload['elements'] = elements;
584
+ }
585
+ if (typeof required !== 'undefined') {
586
+ payload['required'] = required;
587
+ }
588
+ if (typeof xdefault !== 'undefined') {
589
+ payload['default'] = xdefault;
590
+ }
591
+ if (typeof array !== 'undefined') {
592
+ payload['array'] = array;
593
+ }
594
+ let response = undefined;
595
+ response = await client.call('post', apiPath, {
596
+ 'content-type': 'application/json',
597
+ }, payload);
598
+ if (parseOutput) {
599
+ (0, parser_1.parse)(response);
600
+ }
601
+ return response;
602
+ };
603
+ exports.tablesDBCreateEnumColumn = tablesDBCreateEnumColumn;
604
+ const tablesDBUpdateEnumColumn = async ({ databaseId, tableId, key, elements, required, xdefault, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
605
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
606
+ sdk;
607
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/enum/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
608
+ let payload = {};
609
+ elements = elements === true ? [] : elements;
610
+ if (typeof elements !== 'undefined') {
611
+ payload['elements'] = elements;
612
+ }
613
+ if (typeof required !== 'undefined') {
614
+ payload['required'] = required;
615
+ }
616
+ if (typeof xdefault !== 'undefined') {
617
+ payload['default'] = xdefault;
618
+ }
619
+ if (typeof newKey !== 'undefined') {
620
+ payload['newKey'] = newKey;
621
+ }
622
+ let response = undefined;
623
+ response = await client.call('patch', apiPath, {
624
+ 'content-type': 'application/json',
625
+ }, payload);
626
+ if (parseOutput) {
627
+ (0, parser_1.parse)(response);
628
+ }
629
+ return response;
630
+ };
631
+ exports.tablesDBUpdateEnumColumn = tablesDBUpdateEnumColumn;
632
+ const tablesDBCreateFloatColumn = async ({ databaseId, tableId, key, required, min, max, xdefault, array, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
633
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
634
+ sdk;
635
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
636
+ let payload = {};
637
+ if (typeof key !== 'undefined') {
638
+ payload['key'] = key;
639
+ }
640
+ if (typeof required !== 'undefined') {
641
+ payload['required'] = required;
642
+ }
643
+ if (typeof min !== 'undefined') {
644
+ payload['min'] = min;
645
+ }
646
+ if (typeof max !== 'undefined') {
647
+ payload['max'] = max;
648
+ }
649
+ if (typeof xdefault !== 'undefined') {
650
+ payload['default'] = xdefault;
651
+ }
652
+ if (typeof array !== 'undefined') {
653
+ payload['array'] = array;
654
+ }
655
+ let response = undefined;
656
+ response = await client.call('post', apiPath, {
657
+ 'content-type': 'application/json',
658
+ }, payload);
659
+ if (parseOutput) {
660
+ (0, parser_1.parse)(response);
661
+ }
662
+ return response;
663
+ };
664
+ exports.tablesDBCreateFloatColumn = tablesDBCreateFloatColumn;
665
+ const tablesDBUpdateFloatColumn = async ({ databaseId, tableId, key, required, xdefault, min, max, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
666
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
667
+ sdk;
668
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/float/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
669
+ let payload = {};
670
+ if (typeof required !== 'undefined') {
671
+ payload['required'] = required;
672
+ }
673
+ if (typeof min !== 'undefined') {
674
+ payload['min'] = min;
675
+ }
676
+ if (typeof max !== 'undefined') {
677
+ payload['max'] = max;
678
+ }
679
+ if (typeof xdefault !== 'undefined') {
680
+ payload['default'] = xdefault;
681
+ }
682
+ if (typeof newKey !== 'undefined') {
683
+ payload['newKey'] = newKey;
684
+ }
685
+ let response = undefined;
686
+ response = await client.call('patch', apiPath, {
687
+ 'content-type': 'application/json',
688
+ }, payload);
689
+ if (parseOutput) {
690
+ (0, parser_1.parse)(response);
691
+ }
692
+ return response;
693
+ };
694
+ exports.tablesDBUpdateFloatColumn = tablesDBUpdateFloatColumn;
695
+ const tablesDBCreateIntegerColumn = async ({ databaseId, tableId, key, required, min, max, xdefault, array, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
696
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
697
+ sdk;
698
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
699
+ let payload = {};
700
+ if (typeof key !== 'undefined') {
701
+ payload['key'] = key;
702
+ }
703
+ if (typeof required !== 'undefined') {
704
+ payload['required'] = required;
705
+ }
706
+ if (typeof min !== 'undefined') {
707
+ payload['min'] = min;
708
+ }
709
+ if (typeof max !== 'undefined') {
710
+ payload['max'] = max;
711
+ }
712
+ if (typeof xdefault !== 'undefined') {
713
+ payload['default'] = xdefault;
714
+ }
715
+ if (typeof array !== 'undefined') {
716
+ payload['array'] = array;
717
+ }
718
+ let response = undefined;
719
+ response = await client.call('post', apiPath, {
720
+ 'content-type': 'application/json',
721
+ }, payload);
722
+ if (parseOutput) {
723
+ (0, parser_1.parse)(response);
724
+ }
725
+ return response;
726
+ };
727
+ exports.tablesDBCreateIntegerColumn = tablesDBCreateIntegerColumn;
728
+ const tablesDBUpdateIntegerColumn = async ({ databaseId, tableId, key, required, xdefault, min, max, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
729
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
730
+ sdk;
731
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/integer/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
732
+ let payload = {};
733
+ if (typeof required !== 'undefined') {
734
+ payload['required'] = required;
735
+ }
736
+ if (typeof min !== 'undefined') {
737
+ payload['min'] = min;
738
+ }
739
+ if (typeof max !== 'undefined') {
740
+ payload['max'] = max;
741
+ }
742
+ if (typeof xdefault !== 'undefined') {
743
+ payload['default'] = xdefault;
744
+ }
745
+ if (typeof newKey !== 'undefined') {
746
+ payload['newKey'] = newKey;
747
+ }
748
+ let response = undefined;
749
+ response = await client.call('patch', apiPath, {
750
+ 'content-type': 'application/json',
751
+ }, payload);
752
+ if (parseOutput) {
753
+ (0, parser_1.parse)(response);
754
+ }
755
+ return response;
756
+ };
757
+ exports.tablesDBUpdateIntegerColumn = tablesDBUpdateIntegerColumn;
758
+ const tablesDBCreateIpColumn = async ({ databaseId, tableId, key, required, xdefault, array, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
759
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
760
+ sdk;
761
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
762
+ let payload = {};
763
+ if (typeof key !== 'undefined') {
764
+ payload['key'] = key;
765
+ }
766
+ if (typeof required !== 'undefined') {
767
+ payload['required'] = required;
768
+ }
769
+ if (typeof xdefault !== 'undefined') {
770
+ payload['default'] = xdefault;
771
+ }
772
+ if (typeof array !== 'undefined') {
773
+ payload['array'] = array;
774
+ }
775
+ let response = undefined;
776
+ response = await client.call('post', apiPath, {
777
+ 'content-type': 'application/json',
778
+ }, payload);
779
+ if (parseOutput) {
780
+ (0, parser_1.parse)(response);
781
+ }
782
+ return response;
783
+ };
784
+ exports.tablesDBCreateIpColumn = tablesDBCreateIpColumn;
785
+ const tablesDBUpdateIpColumn = async ({ databaseId, tableId, key, required, xdefault, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
786
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
787
+ sdk;
788
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/ip/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
789
+ let payload = {};
790
+ if (typeof required !== 'undefined') {
791
+ payload['required'] = required;
792
+ }
793
+ if (typeof xdefault !== 'undefined') {
794
+ payload['default'] = xdefault;
795
+ }
796
+ if (typeof newKey !== 'undefined') {
797
+ payload['newKey'] = newKey;
798
+ }
799
+ let response = undefined;
800
+ response = await client.call('patch', apiPath, {
801
+ 'content-type': 'application/json',
802
+ }, payload);
803
+ if (parseOutput) {
804
+ (0, parser_1.parse)(response);
805
+ }
806
+ return response;
807
+ };
808
+ exports.tablesDBUpdateIpColumn = tablesDBUpdateIpColumn;
809
+ const tablesDBCreateLineColumn = async ({ databaseId, tableId, key, required, xdefault, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
810
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
811
+ sdk;
812
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/line'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
813
+ let payload = {};
814
+ if (typeof key !== 'undefined') {
815
+ payload['key'] = key;
816
+ }
817
+ if (typeof required !== 'undefined') {
818
+ payload['required'] = required;
819
+ }
820
+ xdefault = xdefault === true ? [] : xdefault;
821
+ if (typeof xdefault !== 'undefined') {
822
+ payload['default'] = xdefault;
823
+ }
824
+ let response = undefined;
825
+ response = await client.call('post', apiPath, {
826
+ 'content-type': 'application/json',
827
+ }, payload);
828
+ if (parseOutput) {
829
+ (0, parser_1.parse)(response);
830
+ }
831
+ return response;
832
+ };
833
+ exports.tablesDBCreateLineColumn = tablesDBCreateLineColumn;
834
+ const tablesDBUpdateLineColumn = async ({ databaseId, tableId, key, required, xdefault, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
835
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
836
+ sdk;
837
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
838
+ let payload = {};
839
+ if (typeof required !== 'undefined') {
840
+ payload['required'] = required;
841
+ }
842
+ xdefault = xdefault === true ? [] : xdefault;
843
+ if (typeof xdefault !== 'undefined') {
844
+ payload['default'] = xdefault;
845
+ }
846
+ if (typeof newKey !== 'undefined') {
847
+ payload['newKey'] = newKey;
848
+ }
849
+ let response = undefined;
850
+ response = await client.call('patch', apiPath, {
851
+ 'content-type': 'application/json',
852
+ }, payload);
853
+ if (parseOutput) {
854
+ (0, parser_1.parse)(response);
855
+ }
856
+ return response;
857
+ };
858
+ exports.tablesDBUpdateLineColumn = tablesDBUpdateLineColumn;
859
+ const tablesDBCreatePointColumn = async ({ databaseId, tableId, key, required, xdefault, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
860
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
861
+ sdk;
862
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/point'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
863
+ let payload = {};
864
+ if (typeof key !== 'undefined') {
865
+ payload['key'] = key;
866
+ }
867
+ if (typeof required !== 'undefined') {
868
+ payload['required'] = required;
869
+ }
870
+ xdefault = xdefault === true ? [] : xdefault;
871
+ if (typeof xdefault !== 'undefined') {
872
+ payload['default'] = xdefault;
873
+ }
874
+ let response = undefined;
875
+ response = await client.call('post', apiPath, {
876
+ 'content-type': 'application/json',
877
+ }, payload);
878
+ if (parseOutput) {
879
+ (0, parser_1.parse)(response);
880
+ }
881
+ return response;
882
+ };
883
+ exports.tablesDBCreatePointColumn = tablesDBCreatePointColumn;
884
+ const tablesDBUpdatePointColumn = async ({ databaseId, tableId, key, required, xdefault, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
885
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
886
+ sdk;
887
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
888
+ let payload = {};
889
+ if (typeof required !== 'undefined') {
890
+ payload['required'] = required;
891
+ }
892
+ xdefault = xdefault === true ? [] : xdefault;
893
+ if (typeof xdefault !== 'undefined') {
894
+ payload['default'] = xdefault;
895
+ }
896
+ if (typeof newKey !== 'undefined') {
897
+ payload['newKey'] = newKey;
898
+ }
899
+ let response = undefined;
900
+ response = await client.call('patch', apiPath, {
901
+ 'content-type': 'application/json',
902
+ }, payload);
903
+ if (parseOutput) {
904
+ (0, parser_1.parse)(response);
905
+ }
906
+ return response;
907
+ };
908
+ exports.tablesDBUpdatePointColumn = tablesDBUpdatePointColumn;
909
+ const tablesDBCreatePolygonColumn = async ({ databaseId, tableId, key, required, xdefault, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
910
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
911
+ sdk;
912
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/polygon'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
913
+ let payload = {};
914
+ if (typeof key !== 'undefined') {
915
+ payload['key'] = key;
916
+ }
917
+ if (typeof required !== 'undefined') {
918
+ payload['required'] = required;
919
+ }
920
+ xdefault = xdefault === true ? [] : xdefault;
921
+ if (typeof xdefault !== 'undefined') {
922
+ payload['default'] = xdefault;
923
+ }
924
+ let response = undefined;
925
+ response = await client.call('post', apiPath, {
926
+ 'content-type': 'application/json',
927
+ }, payload);
928
+ if (parseOutput) {
929
+ (0, parser_1.parse)(response);
930
+ }
931
+ return response;
932
+ };
933
+ exports.tablesDBCreatePolygonColumn = tablesDBCreatePolygonColumn;
934
+ const tablesDBUpdatePolygonColumn = async ({ databaseId, tableId, key, required, xdefault, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
935
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
936
+ sdk;
937
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
938
+ let payload = {};
939
+ if (typeof required !== 'undefined') {
940
+ payload['required'] = required;
941
+ }
942
+ xdefault = xdefault === true ? [] : xdefault;
943
+ if (typeof xdefault !== 'undefined') {
944
+ payload['default'] = xdefault;
945
+ }
946
+ if (typeof newKey !== 'undefined') {
947
+ payload['newKey'] = newKey;
948
+ }
949
+ let response = undefined;
950
+ response = await client.call('patch', apiPath, {
951
+ 'content-type': 'application/json',
952
+ }, payload);
953
+ if (parseOutput) {
954
+ (0, parser_1.parse)(response);
955
+ }
956
+ return response;
957
+ };
958
+ exports.tablesDBUpdatePolygonColumn = tablesDBUpdatePolygonColumn;
959
+ const tablesDBCreateRelationshipColumn = async ({ databaseId, tableId, relatedTableId, type, twoWay, key, twoWayKey, onDelete, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
960
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
961
+ sdk;
962
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
963
+ let payload = {};
964
+ if (typeof relatedTableId !== 'undefined') {
965
+ payload['relatedTableId'] = relatedTableId;
966
+ }
967
+ if (typeof type !== 'undefined') {
968
+ payload['type'] = type;
969
+ }
970
+ if (typeof twoWay !== 'undefined') {
971
+ payload['twoWay'] = twoWay;
972
+ }
973
+ if (typeof key !== 'undefined') {
974
+ payload['key'] = key;
975
+ }
976
+ if (typeof twoWayKey !== 'undefined') {
977
+ payload['twoWayKey'] = twoWayKey;
978
+ }
979
+ if (typeof onDelete !== 'undefined') {
980
+ payload['onDelete'] = onDelete;
981
+ }
982
+ let response = undefined;
983
+ response = await client.call('post', apiPath, {
984
+ 'content-type': 'application/json',
985
+ }, payload);
986
+ if (parseOutput) {
987
+ (0, parser_1.parse)(response);
988
+ }
989
+ return response;
990
+ };
991
+ exports.tablesDBCreateRelationshipColumn = tablesDBCreateRelationshipColumn;
992
+ const tablesDBCreateStringColumn = async ({ databaseId, tableId, key, size, required, xdefault, array, encrypt, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
993
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
994
+ sdk;
995
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
996
+ let payload = {};
997
+ if (typeof key !== 'undefined') {
998
+ payload['key'] = key;
999
+ }
1000
+ if (typeof size !== 'undefined') {
1001
+ payload['size'] = size;
1002
+ }
1003
+ if (typeof required !== 'undefined') {
1004
+ payload['required'] = required;
1005
+ }
1006
+ if (typeof xdefault !== 'undefined') {
1007
+ payload['default'] = xdefault;
1008
+ }
1009
+ if (typeof array !== 'undefined') {
1010
+ payload['array'] = array;
1011
+ }
1012
+ if (typeof encrypt !== 'undefined') {
1013
+ payload['encrypt'] = encrypt;
1014
+ }
1015
+ let response = undefined;
1016
+ response = await client.call('post', apiPath, {
1017
+ 'content-type': 'application/json',
1018
+ }, payload);
1019
+ if (parseOutput) {
1020
+ (0, parser_1.parse)(response);
1021
+ }
1022
+ return response;
1023
+ };
1024
+ exports.tablesDBCreateStringColumn = tablesDBCreateStringColumn;
1025
+ const tablesDBUpdateStringColumn = async ({ databaseId, tableId, key, required, xdefault, size, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1026
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1027
+ sdk;
1028
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/string/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1029
+ let payload = {};
1030
+ if (typeof required !== 'undefined') {
1031
+ payload['required'] = required;
1032
+ }
1033
+ if (typeof xdefault !== 'undefined') {
1034
+ payload['default'] = xdefault;
1035
+ }
1036
+ if (typeof size !== 'undefined') {
1037
+ payload['size'] = size;
1038
+ }
1039
+ if (typeof newKey !== 'undefined') {
1040
+ payload['newKey'] = newKey;
1041
+ }
1042
+ let response = undefined;
1043
+ response = await client.call('patch', apiPath, {
1044
+ 'content-type': 'application/json',
1045
+ }, payload);
1046
+ if (parseOutput) {
1047
+ (0, parser_1.parse)(response);
1048
+ }
1049
+ return response;
1050
+ };
1051
+ exports.tablesDBUpdateStringColumn = tablesDBUpdateStringColumn;
1052
+ const tablesDBCreateUrlColumn = async ({ databaseId, tableId, key, required, xdefault, array, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1053
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1054
+ sdk;
1055
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1056
+ let payload = {};
1057
+ if (typeof key !== 'undefined') {
1058
+ payload['key'] = key;
1059
+ }
1060
+ if (typeof required !== 'undefined') {
1061
+ payload['required'] = required;
1062
+ }
1063
+ if (typeof xdefault !== 'undefined') {
1064
+ payload['default'] = xdefault;
1065
+ }
1066
+ if (typeof array !== 'undefined') {
1067
+ payload['array'] = array;
1068
+ }
1069
+ let response = undefined;
1070
+ response = await client.call('post', apiPath, {
1071
+ 'content-type': 'application/json',
1072
+ }, payload);
1073
+ if (parseOutput) {
1074
+ (0, parser_1.parse)(response);
1075
+ }
1076
+ return response;
1077
+ };
1078
+ exports.tablesDBCreateUrlColumn = tablesDBCreateUrlColumn;
1079
+ const tablesDBUpdateUrlColumn = async ({ databaseId, tableId, key, required, xdefault, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1080
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1081
+ sdk;
1082
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/url/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1083
+ let payload = {};
1084
+ if (typeof required !== 'undefined') {
1085
+ payload['required'] = required;
1086
+ }
1087
+ if (typeof xdefault !== 'undefined') {
1088
+ payload['default'] = xdefault;
1089
+ }
1090
+ if (typeof newKey !== 'undefined') {
1091
+ payload['newKey'] = newKey;
1092
+ }
1093
+ let response = undefined;
1094
+ response = await client.call('patch', apiPath, {
1095
+ 'content-type': 'application/json',
1096
+ }, payload);
1097
+ if (parseOutput) {
1098
+ (0, parser_1.parse)(response);
1099
+ }
1100
+ return response;
1101
+ };
1102
+ exports.tablesDBUpdateUrlColumn = tablesDBUpdateUrlColumn;
1103
+ const tablesDBGetColumn = async ({ databaseId, tableId, key, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
1104
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1105
+ sdk;
1106
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1107
+ let payload = {};
1108
+ let response = undefined;
1109
+ response = await client.call('get', apiPath, {}, payload);
1110
+ if (parseOutput) {
1111
+ if (showConsole) {
1112
+ (0, utils_1.showConsoleLink)('tablesDB', 'getColumn', databaseId, tableId);
1113
+ }
1114
+ else {
1115
+ (0, parser_1.parse)(response);
1116
+ }
1117
+ }
1118
+ return response;
1119
+ };
1120
+ exports.tablesDBGetColumn = tablesDBGetColumn;
1121
+ const tablesDBDeleteColumn = async ({ databaseId, tableId, key, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1122
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1123
+ sdk;
1124
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1125
+ let payload = {};
1126
+ let response = undefined;
1127
+ response = await client.call('delete', apiPath, {
1128
+ 'content-type': 'application/json',
1129
+ }, payload);
1130
+ if (parseOutput) {
1131
+ (0, parser_1.parse)(response);
1132
+ }
1133
+ return response;
1134
+ };
1135
+ exports.tablesDBDeleteColumn = tablesDBDeleteColumn;
1136
+ const tablesDBUpdateRelationshipColumn = async ({ databaseId, tableId, key, onDelete, newKey, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1137
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1138
+ sdk;
1139
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1140
+ let payload = {};
1141
+ if (typeof onDelete !== 'undefined') {
1142
+ payload['onDelete'] = onDelete;
1143
+ }
1144
+ if (typeof newKey !== 'undefined') {
1145
+ payload['newKey'] = newKey;
1146
+ }
1147
+ let response = undefined;
1148
+ response = await client.call('patch', apiPath, {
1149
+ 'content-type': 'application/json',
1150
+ }, payload);
1151
+ if (parseOutput) {
1152
+ (0, parser_1.parse)(response);
1153
+ }
1154
+ return response;
1155
+ };
1156
+ exports.tablesDBUpdateRelationshipColumn = tablesDBUpdateRelationshipColumn;
1157
+ const tablesDBListIndexes = async ({ databaseId, tableId, queries, total, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
1158
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1159
+ sdk;
1160
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1161
+ let payload = {};
1162
+ if (typeof queries !== 'undefined') {
1163
+ payload['queries'] = queries;
1164
+ }
1165
+ if (typeof total !== 'undefined') {
1166
+ payload['total'] = total;
1167
+ }
1168
+ let response = undefined;
1169
+ response = await client.call('get', apiPath, {}, payload);
1170
+ if (parseOutput) {
1171
+ if (showConsole) {
1172
+ (0, utils_1.showConsoleLink)('tablesDB', 'listIndexes', databaseId, tableId);
1173
+ }
1174
+ else {
1175
+ (0, parser_1.parse)(response);
1176
+ }
1177
+ }
1178
+ return response;
1179
+ };
1180
+ exports.tablesDBListIndexes = tablesDBListIndexes;
1181
+ const tablesDBCreateIndex = async ({ databaseId, tableId, key, type, columns, orders, lengths, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1182
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1183
+ sdk;
1184
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1185
+ let payload = {};
1186
+ if (typeof key !== 'undefined') {
1187
+ payload['key'] = key;
1188
+ }
1189
+ if (typeof type !== 'undefined') {
1190
+ payload['type'] = type;
1191
+ }
1192
+ columns = columns === true ? [] : columns;
1193
+ if (typeof columns !== 'undefined') {
1194
+ payload['columns'] = columns;
1195
+ }
1196
+ orders = orders === true ? [] : orders;
1197
+ if (typeof orders !== 'undefined') {
1198
+ payload['orders'] = orders;
1199
+ }
1200
+ lengths = lengths === true ? [] : lengths;
1201
+ if (typeof lengths !== 'undefined') {
1202
+ payload['lengths'] = lengths;
1203
+ }
1204
+ let response = undefined;
1205
+ response = await client.call('post', apiPath, {
1206
+ 'content-type': 'application/json',
1207
+ }, payload);
1208
+ if (parseOutput) {
1209
+ (0, parser_1.parse)(response);
1210
+ }
1211
+ return response;
1212
+ };
1213
+ exports.tablesDBCreateIndex = tablesDBCreateIndex;
1214
+ const tablesDBGetIndex = async ({ databaseId, tableId, key, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1215
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1216
+ sdk;
1217
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1218
+ let payload = {};
1219
+ let response = undefined;
1220
+ response = await client.call('get', apiPath, {}, payload);
1221
+ if (parseOutput) {
1222
+ (0, parser_1.parse)(response);
1223
+ }
1224
+ return response;
1225
+ };
1226
+ exports.tablesDBGetIndex = tablesDBGetIndex;
1227
+ const tablesDBDeleteIndex = async ({ databaseId, tableId, key, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1228
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1229
+ sdk;
1230
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{key}', key);
1231
+ let payload = {};
1232
+ let response = undefined;
1233
+ response = await client.call('delete', apiPath, {
1234
+ 'content-type': 'application/json',
1235
+ }, payload);
1236
+ if (parseOutput) {
1237
+ (0, parser_1.parse)(response);
1238
+ }
1239
+ return response;
1240
+ };
1241
+ exports.tablesDBDeleteIndex = tablesDBDeleteIndex;
1242
+ const tablesDBListTableLogs = async ({ databaseId, tableId, queries, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
1243
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1244
+ sdk;
1245
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/logs'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1246
+ let payload = {};
1247
+ if (typeof queries !== 'undefined') {
1248
+ payload['queries'] = queries;
1249
+ }
1250
+ let response = undefined;
1251
+ response = await client.call('get', apiPath, {}, payload);
1252
+ if (parseOutput) {
1253
+ if (showConsole) {
1254
+ (0, utils_1.showConsoleLink)('tablesDB', 'listTableLogs', databaseId, tableId);
1255
+ }
1256
+ else {
1257
+ (0, parser_1.parse)(response);
1258
+ }
1259
+ }
1260
+ return response;
1261
+ };
1262
+ exports.tablesDBListTableLogs = tablesDBListTableLogs;
1263
+ const tablesDBListRows = async ({ databaseId, tableId, queries, transactionId, total, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
1264
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1265
+ sdk;
1266
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1267
+ let payload = {};
1268
+ if (typeof queries !== 'undefined') {
1269
+ payload['queries'] = queries;
1270
+ }
1271
+ if (typeof transactionId !== 'undefined') {
1272
+ payload['transactionId'] = transactionId;
1273
+ }
1274
+ if (typeof total !== 'undefined') {
1275
+ payload['total'] = total;
1276
+ }
1277
+ let response = undefined;
1278
+ response = await client.call('get', apiPath, {}, payload);
1279
+ if (parseOutput) {
1280
+ if (showConsole) {
1281
+ (0, utils_1.showConsoleLink)('tablesDB', 'listRows', databaseId, tableId);
1282
+ }
1283
+ else {
1284
+ (0, parser_1.parse)(response);
1285
+ }
1286
+ }
1287
+ return response;
1288
+ };
1289
+ exports.tablesDBListRows = tablesDBListRows;
1290
+ const tablesDBCreateRow = async ({ databaseId, tableId, rowId, data, permissions, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1291
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1292
+ sdk;
1293
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1294
+ let payload = {};
1295
+ if (typeof rowId !== 'undefined') {
1296
+ payload['rowId'] = rowId;
1297
+ }
1298
+ if (typeof data !== 'undefined') {
1299
+ payload['data'] = JSON.parse(data);
1300
+ }
1301
+ permissions = permissions === true ? [] : permissions;
1302
+ if (typeof permissions !== 'undefined') {
1303
+ payload['permissions'] = permissions;
1304
+ }
1305
+ if (typeof transactionId !== 'undefined') {
1306
+ payload['transactionId'] = transactionId;
1307
+ }
1308
+ let response = undefined;
1309
+ response = await client.call('post', apiPath, {
1310
+ 'content-type': 'application/json',
1311
+ }, payload);
1312
+ if (parseOutput) {
1313
+ (0, parser_1.parse)(response);
1314
+ }
1315
+ return response;
1316
+ };
1317
+ exports.tablesDBCreateRow = tablesDBCreateRow;
1318
+ const tablesDBCreateRows = async ({ databaseId, tableId, rows, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1319
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1320
+ sdk;
1321
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1322
+ let payload = {};
1323
+ rows = rows === true ? [] : rows;
1324
+ if (typeof rows !== 'undefined') {
1325
+ payload['rows'] = rows;
1326
+ }
1327
+ if (typeof transactionId !== 'undefined') {
1328
+ payload['transactionId'] = transactionId;
1329
+ }
1330
+ let response = undefined;
1331
+ response = await client.call('post', apiPath, {
1332
+ 'content-type': 'application/json',
1333
+ }, payload);
1334
+ if (parseOutput) {
1335
+ (0, parser_1.parse)(response);
1336
+ }
1337
+ return response;
1338
+ };
1339
+ exports.tablesDBCreateRows = tablesDBCreateRows;
1340
+ const tablesDBUpsertRows = async ({ databaseId, tableId, rows, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1341
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1342
+ sdk;
1343
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1344
+ let payload = {};
1345
+ rows = rows === true ? [] : rows;
1346
+ if (typeof rows !== 'undefined') {
1347
+ payload['rows'] = rows;
1348
+ }
1349
+ if (typeof transactionId !== 'undefined') {
1350
+ payload['transactionId'] = transactionId;
1351
+ }
1352
+ let response = undefined;
1353
+ response = await client.call('put', apiPath, {
1354
+ 'content-type': 'application/json',
1355
+ }, payload);
1356
+ if (parseOutput) {
1357
+ (0, parser_1.parse)(response);
1358
+ }
1359
+ return response;
1360
+ };
1361
+ exports.tablesDBUpsertRows = tablesDBUpsertRows;
1362
+ const tablesDBUpdateRows = async ({ databaseId, tableId, data, queries, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1363
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1364
+ sdk;
1365
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1366
+ let payload = {};
1367
+ if (typeof data !== 'undefined') {
1368
+ payload['data'] = JSON.parse(data);
1369
+ }
1370
+ queries = queries === true ? [] : queries;
1371
+ if (typeof queries !== 'undefined') {
1372
+ payload['queries'] = queries;
1373
+ }
1374
+ if (typeof transactionId !== 'undefined') {
1375
+ payload['transactionId'] = transactionId;
1376
+ }
1377
+ let response = undefined;
1378
+ response = await client.call('patch', apiPath, {
1379
+ 'content-type': 'application/json',
1380
+ }, payload);
1381
+ if (parseOutput) {
1382
+ (0, parser_1.parse)(response);
1383
+ }
1384
+ return response;
1385
+ };
1386
+ exports.tablesDBUpdateRows = tablesDBUpdateRows;
1387
+ const tablesDBDeleteRows = async ({ databaseId, tableId, queries, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1388
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1389
+ sdk;
1390
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1391
+ let payload = {};
1392
+ queries = queries === true ? [] : queries;
1393
+ if (typeof queries !== 'undefined') {
1394
+ payload['queries'] = queries;
1395
+ }
1396
+ if (typeof transactionId !== 'undefined') {
1397
+ payload['transactionId'] = transactionId;
1398
+ }
1399
+ let response = undefined;
1400
+ response = await client.call('delete', apiPath, {
1401
+ 'content-type': 'application/json',
1402
+ }, payload);
1403
+ if (parseOutput) {
1404
+ (0, parser_1.parse)(response);
1405
+ }
1406
+ return response;
1407
+ };
1408
+ exports.tablesDBDeleteRows = tablesDBDeleteRows;
1409
+ const tablesDBGetRow = async ({ databaseId, tableId, rowId, queries, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
1410
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1411
+ sdk;
1412
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
1413
+ let payload = {};
1414
+ if (typeof queries !== 'undefined') {
1415
+ payload['queries'] = queries;
1416
+ }
1417
+ if (typeof transactionId !== 'undefined') {
1418
+ payload['transactionId'] = transactionId;
1419
+ }
1420
+ let response = undefined;
1421
+ response = await client.call('get', apiPath, {}, payload);
1422
+ if (parseOutput) {
1423
+ if (showConsole) {
1424
+ (0, utils_1.showConsoleLink)('tablesDB', 'getRow', databaseId, tableId, rowId);
1425
+ }
1426
+ else {
1427
+ (0, parser_1.parse)(response);
1428
+ }
1429
+ }
1430
+ return response;
1431
+ };
1432
+ exports.tablesDBGetRow = tablesDBGetRow;
1433
+ const tablesDBUpsertRow = async ({ databaseId, tableId, rowId, data, permissions, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1434
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1435
+ sdk;
1436
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
1437
+ let payload = {};
1438
+ if (typeof data !== 'undefined') {
1439
+ payload['data'] = JSON.parse(data);
1440
+ }
1441
+ permissions = permissions === true ? [] : permissions;
1442
+ if (typeof permissions !== 'undefined') {
1443
+ payload['permissions'] = permissions;
1444
+ }
1445
+ if (typeof transactionId !== 'undefined') {
1446
+ payload['transactionId'] = transactionId;
1447
+ }
1448
+ let response = undefined;
1449
+ response = await client.call('put', apiPath, {
1450
+ 'content-type': 'application/json',
1451
+ }, payload);
1452
+ if (parseOutput) {
1453
+ (0, parser_1.parse)(response);
1454
+ }
1455
+ return response;
1456
+ };
1457
+ exports.tablesDBUpsertRow = tablesDBUpsertRow;
1458
+ const tablesDBUpdateRow = async ({ databaseId, tableId, rowId, data, permissions, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1459
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1460
+ sdk;
1461
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
1462
+ let payload = {};
1463
+ if (typeof data !== 'undefined') {
1464
+ payload['data'] = JSON.parse(data);
1465
+ }
1466
+ permissions = permissions === true ? [] : permissions;
1467
+ if (typeof permissions !== 'undefined') {
1468
+ payload['permissions'] = permissions;
1469
+ }
1470
+ if (typeof transactionId !== 'undefined') {
1471
+ payload['transactionId'] = transactionId;
1472
+ }
1473
+ let response = undefined;
1474
+ response = await client.call('patch', apiPath, {
1475
+ 'content-type': 'application/json',
1476
+ }, payload);
1477
+ if (parseOutput) {
1478
+ (0, parser_1.parse)(response);
1479
+ }
1480
+ return response;
1481
+ };
1482
+ exports.tablesDBUpdateRow = tablesDBUpdateRow;
1483
+ const tablesDBDeleteRow = async ({ databaseId, tableId, rowId, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1484
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1485
+ sdk;
1486
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
1487
+ let payload = {};
1488
+ if (typeof transactionId !== 'undefined') {
1489
+ payload['transactionId'] = transactionId;
1490
+ }
1491
+ let response = undefined;
1492
+ response = await client.call('delete', apiPath, {
1493
+ 'content-type': 'application/json',
1494
+ }, payload);
1495
+ if (parseOutput) {
1496
+ (0, parser_1.parse)(response);
1497
+ }
1498
+ return response;
1499
+ };
1500
+ exports.tablesDBDeleteRow = tablesDBDeleteRow;
1501
+ const tablesDBListRowLogs = async ({ databaseId, tableId, rowId, queries, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
1502
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1503
+ sdk;
1504
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/logs'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId);
1505
+ let payload = {};
1506
+ if (typeof queries !== 'undefined') {
1507
+ payload['queries'] = queries;
1508
+ }
1509
+ let response = undefined;
1510
+ response = await client.call('get', apiPath, {}, payload);
1511
+ if (parseOutput) {
1512
+ if (showConsole) {
1513
+ (0, utils_1.showConsoleLink)('tablesDB', 'listRowLogs', databaseId, tableId, rowId);
1514
+ }
1515
+ else {
1516
+ (0, parser_1.parse)(response);
1517
+ }
1518
+ }
1519
+ return response;
1520
+ };
1521
+ exports.tablesDBListRowLogs = tablesDBListRowLogs;
1522
+ const tablesDBDecrementRowColumn = async ({ databaseId, tableId, rowId, column, value, min, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1523
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1524
+ sdk;
1525
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/decrement'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column);
1526
+ let payload = {};
1527
+ if (typeof value !== 'undefined') {
1528
+ payload['value'] = value;
1529
+ }
1530
+ if (typeof min !== 'undefined') {
1531
+ payload['min'] = min;
1532
+ }
1533
+ if (typeof transactionId !== 'undefined') {
1534
+ payload['transactionId'] = transactionId;
1535
+ }
1536
+ let response = undefined;
1537
+ response = await client.call('patch', apiPath, {
1538
+ 'content-type': 'application/json',
1539
+ }, payload);
1540
+ if (parseOutput) {
1541
+ (0, parser_1.parse)(response);
1542
+ }
1543
+ return response;
1544
+ };
1545
+ exports.tablesDBDecrementRowColumn = tablesDBDecrementRowColumn;
1546
+ const tablesDBIncrementRowColumn = async ({ databaseId, tableId, rowId, column, value, max, transactionId, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1547
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1548
+ sdk;
1549
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/{column}/increment'.replace('{databaseId}', databaseId).replace('{tableId}', tableId).replace('{rowId}', rowId).replace('{column}', column);
1550
+ let payload = {};
1551
+ if (typeof value !== 'undefined') {
1552
+ payload['value'] = value;
1553
+ }
1554
+ if (typeof max !== 'undefined') {
1555
+ payload['max'] = max;
1556
+ }
1557
+ if (typeof transactionId !== 'undefined') {
1558
+ payload['transactionId'] = transactionId;
1559
+ }
1560
+ let response = undefined;
1561
+ response = await client.call('patch', apiPath, {
1562
+ 'content-type': 'application/json',
1563
+ }, payload);
1564
+ if (parseOutput) {
1565
+ (0, parser_1.parse)(response);
1566
+ }
1567
+ return response;
1568
+ };
1569
+ exports.tablesDBIncrementRowColumn = tablesDBIncrementRowColumn;
1570
+ const tablesDBGetTableUsage = async ({ databaseId, tableId, range, parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole }) => {
1571
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1572
+ sdk;
1573
+ let apiPath = '/tablesdb/{databaseId}/tables/{tableId}/usage'.replace('{databaseId}', databaseId).replace('{tableId}', tableId);
1574
+ let payload = {};
1575
+ if (typeof range !== 'undefined') {
1576
+ payload['range'] = range;
1577
+ }
1578
+ let response = undefined;
1579
+ response = await client.call('get', apiPath, {}, payload);
1580
+ if (parseOutput) {
1581
+ if (showConsole) {
1582
+ (0, utils_1.showConsoleLink)('tablesDB', 'getTableUsage', databaseId, tableId);
1583
+ }
1584
+ else {
1585
+ (0, parser_1.parse)(response);
1586
+ }
1587
+ }
1588
+ return response;
1589
+ };
1590
+ exports.tablesDBGetTableUsage = tablesDBGetTableUsage;
1591
+ const tablesDBGetUsage = async ({ databaseId, range, parseOutput = true, overrideForCli = false, sdk = undefined }) => {
1592
+ let client = !sdk ? await (0, sdks_1.sdkForProject)() :
1593
+ sdk;
1594
+ let apiPath = '/tablesdb/{databaseId}/usage'.replace('{databaseId}', databaseId);
1595
+ let payload = {};
1596
+ if (typeof range !== 'undefined') {
1597
+ payload['range'] = range;
1598
+ }
1599
+ let response = undefined;
1600
+ response = await client.call('get', apiPath, {}, payload);
1601
+ if (parseOutput) {
1602
+ (0, parser_1.parse)(response);
1603
+ }
1604
+ return response;
1605
+ };
1606
+ exports.tablesDBGetUsage = tablesDBGetUsage;
1607
+ exports.tablesDB
1608
+ .command(`list`)
1609
+ .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`)
1610
+ .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`)
1611
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1612
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1613
+ .option(`--console`, `Get the resource console url`)
1614
+ .action((0, parser_1.actionRunner)(exports.tablesDBList));
1615
+ exports.tablesDB
1616
+ .command(`create`)
1617
+ .description(`Create a new Database. `)
1618
+ .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.`)
1619
+ .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
1620
+ .option(`--enabled [value]`, `Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1621
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreate));
1622
+ exports.tablesDB
1623
+ .command(`list-transactions`)
1624
+ .description(`List transactions across all databases.`)
1625
+ .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).`)
1626
+ .option(`--console`, `Get the resource console url`)
1627
+ .action((0, parser_1.actionRunner)(exports.tablesDBListTransactions));
1628
+ exports.tablesDB
1629
+ .command(`create-transaction`)
1630
+ .description(`Create a new transaction.`)
1631
+ .option(`--ttl <ttl>`, `Seconds before the transaction expires.`, parser_1.parseInteger)
1632
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateTransaction));
1633
+ exports.tablesDB
1634
+ .command(`get-transaction`)
1635
+ .description(`Get a transaction by its unique ID.`)
1636
+ .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
1637
+ .option(`--console`, `Get the resource console url`)
1638
+ .action((0, parser_1.actionRunner)(exports.tablesDBGetTransaction));
1639
+ exports.tablesDB
1640
+ .command(`update-transaction`)
1641
+ .description(`Update a transaction, to either commit or roll back its operations.`)
1642
+ .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
1643
+ .option(`--commit [value]`, `Commit transaction?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1644
+ .option(`--rollback [value]`, `Rollback transaction?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1645
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateTransaction));
1646
+ exports.tablesDB
1647
+ .command(`delete-transaction`)
1648
+ .description(`Delete a transaction by its unique ID.`)
1649
+ .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
1650
+ .action((0, parser_1.actionRunner)(exports.tablesDBDeleteTransaction));
1651
+ exports.tablesDB
1652
+ .command(`create-operations`)
1653
+ .description(`Create multiple operations in a single transaction.`)
1654
+ .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
1655
+ .option(`--operations [operations...]`, `Array of staged operations.`)
1656
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateOperations));
1657
+ exports.tablesDB
1658
+ .command(`list-usage`)
1659
+ .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.`)
1660
+ .option(`--range <range>`, `Date range.`)
1661
+ .option(`--console`, `Get the resource console url`)
1662
+ .action((0, parser_1.actionRunner)(exports.tablesDBListUsage));
1663
+ exports.tablesDB
1664
+ .command(`get`)
1665
+ .description(`Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`)
1666
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1667
+ .option(`--console`, `Get the resource console url`)
1668
+ .action((0, parser_1.actionRunner)(exports.tablesDBGet));
1669
+ exports.tablesDB
1670
+ .command(`update`)
1671
+ .description(`Update a database by its unique ID.`)
1672
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1673
+ .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
1674
+ .option(`--enabled [value]`, `Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1675
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdate));
1676
+ exports.tablesDB
1677
+ .command(`delete`)
1678
+ .description(`Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.`)
1679
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1680
+ .action((0, parser_1.actionRunner)(exports.tablesDBDelete));
1681
+ exports.tablesDB
1682
+ .command(`list-tables`)
1683
+ .description(`Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.`)
1684
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1685
+ .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`)
1686
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1687
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1688
+ .option(`--console`, `Get the resource console url`)
1689
+ .action((0, parser_1.actionRunner)(exports.tablesDBListTables));
1690
+ exports.tablesDB
1691
+ .command(`create-table`)
1692
+ .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.`)
1693
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1694
+ .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.`)
1695
+ .requiredOption(`--name <name>`, `Table name. Max length: 128 chars.`)
1696
+ .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).`)
1697
+ .option(`--row-security [value]`, `Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1698
+ .option(`--enabled [value]`, `Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1699
+ .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.`)
1700
+ .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).`)
1701
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateTable));
1702
+ exports.tablesDB
1703
+ .command(`get-table`)
1704
+ .description(`Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.`)
1705
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1706
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1707
+ .option(`--console`, `Get the resource console url`)
1708
+ .action((0, parser_1.actionRunner)(exports.tablesDBGetTable));
1709
+ exports.tablesDB
1710
+ .command(`update-table`)
1711
+ .description(`Update a table by its unique ID.`)
1712
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1713
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1714
+ .requiredOption(`--name <name>`, `Table name. Max length: 128 chars.`)
1715
+ .option(`--permissions [permissions...]`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
1716
+ .option(`--row-security [value]`, `Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1717
+ .option(`--enabled [value]`, `Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1718
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateTable));
1719
+ exports.tablesDB
1720
+ .command(`delete-table`)
1721
+ .description(`Delete a table by its unique ID. Only users with write permissions have access to delete this resource.`)
1722
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1723
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1724
+ .action((0, parser_1.actionRunner)(exports.tablesDBDeleteTable));
1725
+ exports.tablesDB
1726
+ .command(`list-columns`)
1727
+ .description(`List columns in the table.`)
1728
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1729
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1730
+ .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`)
1731
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1732
+ .option(`--console`, `Get the resource console url`)
1733
+ .action((0, parser_1.actionRunner)(exports.tablesDBListColumns));
1734
+ exports.tablesDB
1735
+ .command(`create-boolean-column`)
1736
+ .description(`Create a boolean column. `)
1737
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1738
+ .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).`)
1739
+ .requiredOption(`--key <key>`, `Column Key.`)
1740
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1741
+ .option(`--xdefault [value]`, `Default value for column when not provided. Cannot be set when column is required.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1742
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1743
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateBooleanColumn));
1744
+ exports.tablesDB
1745
+ .command(`update-boolean-column`)
1746
+ .description(`Update a boolean column. Changing the 'default' value will not update already existing rows.`)
1747
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1748
+ .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).`)
1749
+ .requiredOption(`--key <key>`, `Column Key.`)
1750
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1751
+ .option(`--xdefault [value]`, `Default value for column when not provided. Cannot be set when column is required.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1752
+ .option(`--new-key <new-key>`, `New Column Key.`)
1753
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateBooleanColumn));
1754
+ exports.tablesDB
1755
+ .command(`create-datetime-column`)
1756
+ .description(`Create a date time column according to the ISO 8601 standard.`)
1757
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1758
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1759
+ .requiredOption(`--key <key>`, `Column Key.`)
1760
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1761
+ .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.`)
1762
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1763
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateDatetimeColumn));
1764
+ exports.tablesDB
1765
+ .command(`update-datetime-column`)
1766
+ .description(`Update a date time column. Changing the 'default' value will not update already existing rows.`)
1767
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1768
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1769
+ .requiredOption(`--key <key>`, `Column Key.`)
1770
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1771
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
1772
+ .option(`--new-key <new-key>`, `New Column Key.`)
1773
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateDatetimeColumn));
1774
+ exports.tablesDB
1775
+ .command(`create-email-column`)
1776
+ .description(`Create an email column. `)
1777
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1778
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1779
+ .requiredOption(`--key <key>`, `Column Key.`)
1780
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1781
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
1782
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1783
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateEmailColumn));
1784
+ exports.tablesDB
1785
+ .command(`update-email-column`)
1786
+ .description(`Update an email column. Changing the 'default' value will not update already existing rows. `)
1787
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1788
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1789
+ .requiredOption(`--key <key>`, `Column Key.`)
1790
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1791
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
1792
+ .option(`--new-key <new-key>`, `New Column Key.`)
1793
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateEmailColumn));
1794
+ exports.tablesDB
1795
+ .command(`create-enum-column`)
1796
+ .description(`Create an enumeration column. The 'elements' param acts as a white-list of accepted values for this column.`)
1797
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1798
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1799
+ .requiredOption(`--key <key>`, `Column Key.`)
1800
+ .requiredOption(`--elements [elements...]`, `Array of enum values.`)
1801
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1802
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
1803
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1804
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateEnumColumn));
1805
+ exports.tablesDB
1806
+ .command(`update-enum-column`)
1807
+ .description(`Update an enum column. Changing the 'default' value will not update already existing rows. `)
1808
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1809
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1810
+ .requiredOption(`--key <key>`, `Column Key.`)
1811
+ .requiredOption(`--elements [elements...]`, `Updated list of enum values.`)
1812
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1813
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
1814
+ .option(`--new-key <new-key>`, `New Column Key.`)
1815
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateEnumColumn));
1816
+ exports.tablesDB
1817
+ .command(`create-float-column`)
1818
+ .description(`Create a float column. Optionally, minimum and maximum values can be provided. `)
1819
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1820
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1821
+ .requiredOption(`--key <key>`, `Column Key.`)
1822
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1823
+ .option(`--min <min>`, `Minimum value`, parser_1.parseInteger)
1824
+ .option(`--max <max>`, `Maximum value`, parser_1.parseInteger)
1825
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parser_1.parseInteger)
1826
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1827
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateFloatColumn));
1828
+ exports.tablesDB
1829
+ .command(`update-float-column`)
1830
+ .description(`Update a float column. Changing the 'default' value will not update already existing rows. `)
1831
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1832
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1833
+ .requiredOption(`--key <key>`, `Column Key.`)
1834
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1835
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parser_1.parseInteger)
1836
+ .option(`--min <min>`, `Minimum value`, parser_1.parseInteger)
1837
+ .option(`--max <max>`, `Maximum value`, parser_1.parseInteger)
1838
+ .option(`--new-key <new-key>`, `New Column Key.`)
1839
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateFloatColumn));
1840
+ exports.tablesDB
1841
+ .command(`create-integer-column`)
1842
+ .description(`Create an integer column. Optionally, minimum and maximum values can be provided. `)
1843
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1844
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1845
+ .requiredOption(`--key <key>`, `Column Key.`)
1846
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1847
+ .option(`--min <min>`, `Minimum value`, parser_1.parseInteger)
1848
+ .option(`--max <max>`, `Maximum value`, parser_1.parseInteger)
1849
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`, parser_1.parseInteger)
1850
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1851
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateIntegerColumn));
1852
+ exports.tablesDB
1853
+ .command(`update-integer-column`)
1854
+ .description(`Update an integer column. Changing the 'default' value will not update already existing rows. `)
1855
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1856
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1857
+ .requiredOption(`--key <key>`, `Column Key.`)
1858
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1859
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`, parser_1.parseInteger)
1860
+ .option(`--min <min>`, `Minimum value`, parser_1.parseInteger)
1861
+ .option(`--max <max>`, `Maximum value`, parser_1.parseInteger)
1862
+ .option(`--new-key <new-key>`, `New Column Key.`)
1863
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateIntegerColumn));
1864
+ exports.tablesDB
1865
+ .command(`create-ip-column`)
1866
+ .description(`Create IP address column. `)
1867
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1868
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1869
+ .requiredOption(`--key <key>`, `Column Key.`)
1870
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1871
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`)
1872
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1873
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateIpColumn));
1874
+ exports.tablesDB
1875
+ .command(`update-ip-column`)
1876
+ .description(`Update an ip column. Changing the 'default' value will not update already existing rows. `)
1877
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1878
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1879
+ .requiredOption(`--key <key>`, `Column Key.`)
1880
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1881
+ .option(`--xdefault <xdefault>`, `Default value. Cannot be set when column is required.`)
1882
+ .option(`--new-key <new-key>`, `New Column Key.`)
1883
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateIpColumn));
1884
+ exports.tablesDB
1885
+ .command(`create-line-column`)
1886
+ .description(`Create a geometric line column.`)
1887
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1888
+ .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).`)
1889
+ .requiredOption(`--key <key>`, `Column Key.`)
1890
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1891
+ .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.`)
1892
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateLineColumn));
1893
+ exports.tablesDB
1894
+ .command(`update-line-column`)
1895
+ .description(`Update a line column. Changing the 'default' value will not update already existing rows.`)
1896
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1897
+ .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).`)
1898
+ .requiredOption(`--key <key>`, `Column Key.`)
1899
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1900
+ .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.`)
1901
+ .option(`--new-key <new-key>`, `New Column Key.`)
1902
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateLineColumn));
1903
+ exports.tablesDB
1904
+ .command(`create-point-column`)
1905
+ .description(`Create a geometric point column.`)
1906
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1907
+ .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).`)
1908
+ .requiredOption(`--key <key>`, `Column Key.`)
1909
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1910
+ .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.`)
1911
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreatePointColumn));
1912
+ exports.tablesDB
1913
+ .command(`update-point-column`)
1914
+ .description(`Update a point column. Changing the 'default' value will not update already existing rows.`)
1915
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1916
+ .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).`)
1917
+ .requiredOption(`--key <key>`, `Column Key.`)
1918
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1919
+ .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.`)
1920
+ .option(`--new-key <new-key>`, `New Column Key.`)
1921
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdatePointColumn));
1922
+ exports.tablesDB
1923
+ .command(`create-polygon-column`)
1924
+ .description(`Create a geometric polygon column.`)
1925
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1926
+ .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).`)
1927
+ .requiredOption(`--key <key>`, `Column Key.`)
1928
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1929
+ .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.`)
1930
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreatePolygonColumn));
1931
+ exports.tablesDB
1932
+ .command(`update-polygon-column`)
1933
+ .description(`Update a polygon column. Changing the 'default' value will not update already existing rows.`)
1934
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1935
+ .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).`)
1936
+ .requiredOption(`--key <key>`, `Column Key.`)
1937
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1938
+ .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.`)
1939
+ .option(`--new-key <new-key>`, `New Column Key.`)
1940
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdatePolygonColumn));
1941
+ exports.tablesDB
1942
+ .command(`create-relationship-column`)
1943
+ .description(`Create relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). `)
1944
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1945
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1946
+ .requiredOption(`--related-table-id <related-table-id>`, `Related Table ID.`)
1947
+ .requiredOption(`--type <type>`, `Relation type`)
1948
+ .option(`--two-way [value]`, `Is Two Way?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1949
+ .option(`--key <key>`, `Column Key.`)
1950
+ .option(`--two-way-key <two-way-key>`, `Two Way Column Key.`)
1951
+ .option(`--on-delete <on-delete>`, `Constraints option`)
1952
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateRelationshipColumn));
1953
+ exports.tablesDB
1954
+ .command(`create-string-column`)
1955
+ .description(`Create a string column. `)
1956
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1957
+ .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).`)
1958
+ .requiredOption(`--key <key>`, `Column Key.`)
1959
+ .requiredOption(`--size <size>`, `Column size for text columns, in number of characters.`, parser_1.parseInteger)
1960
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1961
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
1962
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1963
+ .option(`--encrypt [value]`, `Toggle encryption for the column. Encryption enhances security by not storing any plain text values in the database. However, encrypted columns cannot be queried.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1964
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateStringColumn));
1965
+ exports.tablesDB
1966
+ .command(`update-string-column`)
1967
+ .description(`Update a string column. Changing the 'default' value will not update already existing rows. `)
1968
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1969
+ .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).`)
1970
+ .requiredOption(`--key <key>`, `Column Key.`)
1971
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1972
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
1973
+ .option(`--size <size>`, `Maximum size of the string column.`, parser_1.parseInteger)
1974
+ .option(`--new-key <new-key>`, `New Column Key.`)
1975
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateStringColumn));
1976
+ exports.tablesDB
1977
+ .command(`create-url-column`)
1978
+ .description(`Create a URL column. `)
1979
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1980
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1981
+ .requiredOption(`--key <key>`, `Column Key.`)
1982
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1983
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
1984
+ .option(`--array [value]`, `Is column an array?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1985
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateUrlColumn));
1986
+ exports.tablesDB
1987
+ .command(`update-url-column`)
1988
+ .description(`Update an url column. Changing the 'default' value will not update already existing rows. `)
1989
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
1990
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
1991
+ .requiredOption(`--key <key>`, `Column Key.`)
1992
+ .requiredOption(`--required [value]`, `Is column required?`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
1993
+ .option(`--xdefault <xdefault>`, `Default value for column when not provided. Cannot be set when column is required.`)
1994
+ .option(`--new-key <new-key>`, `New Column Key.`)
1995
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateUrlColumn));
1996
+ exports.tablesDB
1997
+ .command(`get-column`)
1998
+ .description(`Get column by ID.`)
1999
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2000
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2001
+ .requiredOption(`--key <key>`, `Column Key.`)
2002
+ .option(`--console`, `Get the resource console url`)
2003
+ .action((0, parser_1.actionRunner)(exports.tablesDBGetColumn));
2004
+ exports.tablesDB
2005
+ .command(`delete-column`)
2006
+ .description(`Deletes a column.`)
2007
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2008
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2009
+ .requiredOption(`--key <key>`, `Column Key.`)
2010
+ .action((0, parser_1.actionRunner)(exports.tablesDBDeleteColumn));
2011
+ exports.tablesDB
2012
+ .command(`update-relationship-column`)
2013
+ .description(`Update relationship column. [Learn more about relationship columns](https://appwrite.io/docs/databases-relationships#relationship-columns). `)
2014
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2015
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2016
+ .requiredOption(`--key <key>`, `Column Key.`)
2017
+ .option(`--on-delete <on-delete>`, `Constraints option`)
2018
+ .option(`--new-key <new-key>`, `New Column Key.`)
2019
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateRelationshipColumn));
2020
+ exports.tablesDB
2021
+ .command(`list-indexes`)
2022
+ .description(`List indexes on the table.`)
2023
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2024
+ .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).`)
2025
+ .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`)
2026
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
2027
+ .option(`--console`, `Get the resource console url`)
2028
+ .action((0, parser_1.actionRunner)(exports.tablesDBListIndexes));
2029
+ exports.tablesDB
2030
+ .command(`create-index`)
2031
+ .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'.`)
2032
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2033
+ .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).`)
2034
+ .requiredOption(`--key <key>`, `Index Key.`)
2035
+ .requiredOption(`--type <type>`, `Index type.`)
2036
+ .requiredOption(`--columns [columns...]`, `Array of columns to index. Maximum of 100 columns are allowed, each 32 characters long.`)
2037
+ .option(`--orders [orders...]`, `Array of index orders. Maximum of 100 orders are allowed.`)
2038
+ .option(`--lengths [lengths...]`, `Length of index. Maximum of 100`)
2039
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateIndex));
2040
+ exports.tablesDB
2041
+ .command(`get-index`)
2042
+ .description(`Get index by ID.`)
2043
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2044
+ .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).`)
2045
+ .requiredOption(`--key <key>`, `Index Key.`)
2046
+ .action((0, parser_1.actionRunner)(exports.tablesDBGetIndex));
2047
+ exports.tablesDB
2048
+ .command(`delete-index`)
2049
+ .description(`Delete an index.`)
2050
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2051
+ .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).`)
2052
+ .requiredOption(`--key <key>`, `Index Key.`)
2053
+ .action((0, parser_1.actionRunner)(exports.tablesDBDeleteIndex));
2054
+ exports.tablesDB
2055
+ .command(`list-table-logs`)
2056
+ .description(`Get the table activity logs list by its unique ID.`)
2057
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2058
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2059
+ .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`)
2060
+ .option(`--console`, `Get the resource console url`)
2061
+ .action((0, parser_1.actionRunner)(exports.tablesDBListTableLogs));
2062
+ exports.tablesDB
2063
+ .command(`list-rows`)
2064
+ .description(`Get a list of all the user's rows in a given table. You can use the query params to filter your results.`)
2065
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2066
+ .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).`)
2067
+ .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.`)
2068
+ .option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`)
2069
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : (0, parser_1.parseBool)(value))
2070
+ .option(`--console`, `Get the resource console url`)
2071
+ .action((0, parser_1.actionRunner)(exports.tablesDBListRows));
2072
+ exports.tablesDB
2073
+ .command(`create-row`)
2074
+ .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.`)
2075
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2076
+ .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.`)
2077
+ .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.`)
2078
+ .requiredOption(`--data <data>`, `Row data as JSON object.`)
2079
+ .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).`)
2080
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
2081
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateRow));
2082
+ exports.tablesDB
2083
+ .command(`create-rows`)
2084
+ .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.`)
2085
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2086
+ .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.`)
2087
+ .requiredOption(`--rows [rows...]`, `Array of rows data as JSON objects.`)
2088
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
2089
+ .action((0, parser_1.actionRunner)(exports.tablesDBCreateRows));
2090
+ exports.tablesDB
2091
+ .command(`upsert-rows`)
2092
+ .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. `)
2093
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2094
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2095
+ .requiredOption(`--rows [rows...]`, `Array of row data as JSON objects. May contain partial rows.`)
2096
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
2097
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpsertRows));
2098
+ exports.tablesDB
2099
+ .command(`update-rows`)
2100
+ .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.`)
2101
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2102
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2103
+ .option(`--data <data>`, `Row data as JSON object. Include only column and value pairs to be updated.`)
2104
+ .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.`)
2105
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
2106
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateRows));
2107
+ exports.tablesDB
2108
+ .command(`delete-rows`)
2109
+ .description(`Bulk delete rows using queries, if no queries are passed then all rows are deleted.`)
2110
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2111
+ .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).`)
2112
+ .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.`)
2113
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
2114
+ .action((0, parser_1.actionRunner)(exports.tablesDBDeleteRows));
2115
+ exports.tablesDB
2116
+ .command(`get-row`)
2117
+ .description(`Get a row by its unique ID. This endpoint response returns a JSON object with the row data.`)
2118
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2119
+ .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).`)
2120
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2121
+ .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.`)
2122
+ .option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`)
2123
+ .option(`--console`, `Get the resource console url`)
2124
+ .action((0, parser_1.actionRunner)(exports.tablesDBGetRow));
2125
+ exports.tablesDB
2126
+ .command(`upsert-row`)
2127
+ .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.`)
2128
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2129
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2130
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2131
+ .option(`--data <data>`, `Row data as JSON object. Include all required columns of the row to be created or updated.`)
2132
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2133
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
2134
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpsertRow));
2135
+ exports.tablesDB
2136
+ .command(`update-row`)
2137
+ .description(`Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.`)
2138
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2139
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2140
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2141
+ .option(`--data <data>`, `Row data as JSON object. Include only columns and value pairs to be updated.`)
2142
+ .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2143
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
2144
+ .action((0, parser_1.actionRunner)(exports.tablesDBUpdateRow));
2145
+ exports.tablesDB
2146
+ .command(`delete-row`)
2147
+ .description(`Delete a row by its unique ID.`)
2148
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2149
+ .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).`)
2150
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2151
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
2152
+ .action((0, parser_1.actionRunner)(exports.tablesDBDeleteRow));
2153
+ exports.tablesDB
2154
+ .command(`list-row-logs`)
2155
+ .description(`Get the row activity logs list by its unique ID.`)
2156
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2157
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2158
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2159
+ .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`)
2160
+ .option(`--console`, `Get the resource console url`)
2161
+ .action((0, parser_1.actionRunner)(exports.tablesDBListRowLogs));
2162
+ exports.tablesDB
2163
+ .command(`decrement-row-column`)
2164
+ .description(`Decrement a specific column of a row by a given value.`)
2165
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2166
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2167
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2168
+ .requiredOption(`--column <column>`, `Column key.`)
2169
+ .option(`--value <value>`, `Value to increment the column by. The value must be a number.`, parser_1.parseInteger)
2170
+ .option(`--min <min>`, `Minimum value for the column. If the current value is lesser than this value, an exception will be thrown.`, parser_1.parseInteger)
2171
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
2172
+ .action((0, parser_1.actionRunner)(exports.tablesDBDecrementRowColumn));
2173
+ exports.tablesDB
2174
+ .command(`increment-row-column`)
2175
+ .description(`Increment a specific column of a row by a given value.`)
2176
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2177
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2178
+ .requiredOption(`--row-id <row-id>`, `Row ID.`)
2179
+ .requiredOption(`--column <column>`, `Column key.`)
2180
+ .option(`--value <value>`, `Value to increment the column by. The value must be a number.`, parser_1.parseInteger)
2181
+ .option(`--max <max>`, `Maximum value for the column. If the current value is greater than this value, an error will be thrown.`, parser_1.parseInteger)
2182
+ .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
2183
+ .action((0, parser_1.actionRunner)(exports.tablesDBIncrementRowColumn));
2184
+ exports.tablesDB
2185
+ .command(`get-table-usage`)
2186
+ .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.`)
2187
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2188
+ .requiredOption(`--table-id <table-id>`, `Table ID.`)
2189
+ .option(`--range <range>`, `Date range.`)
2190
+ .option(`--console`, `Get the resource console url`)
2191
+ .action((0, parser_1.actionRunner)(exports.tablesDBGetTableUsage));
2192
+ exports.tablesDB
2193
+ .command(`get-usage`)
2194
+ .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.`)
2195
+ .requiredOption(`--database-id <database-id>`, `Database ID.`)
2196
+ .option(`--range <range>`, `Date range.`)
2197
+ .action((0, parser_1.actionRunner)(exports.tablesDBGetUsage));
2198
+ //# sourceMappingURL=tables-db.js.map