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
@@ -1,31 +1,27 @@
1
- const fs = require('fs');
2
- const pathLib = require('path');
3
- const tar = require("tar");
4
- const ignore = require("ignore");
5
- const { promisify } = require('util');
6
- const libClient = require('../client.js');
7
- const { getAllFiles, showConsoleLink } = require('../utils.js');
8
- const { Command } = require('commander');
9
- const { sdkForProject, sdkForConsole } = require('../sdks')
10
- const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser')
11
- const { localConfig, globalConfig } = require("../config");
12
- const { File } = require('undici');
13
- const { ReadableStream } = require('stream/web');
14
-
15
- /**
16
- * @param {fs.ReadStream} readStream
17
- * @returns {ReadableStream}
18
- */
19
- function convertReadStreamToReadableStream(readStream) {
1
+ import fs = require('fs');
2
+ import pathLib = require('path');
3
+ import tar = require('tar');
4
+ import ignore = require('ignore');
5
+ import { promisify } from 'util';
6
+ import Client from '../client';
7
+ import { getAllFiles, showConsoleLink } from '../utils';
8
+ import { Command } from 'commander';
9
+ import { sdkForProject, sdkForConsole } from '../sdks';
10
+ import { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } from '../parser';
11
+ import { localConfig, globalConfig } from '../config';
12
+ import { File } from 'undici';
13
+ import { ReadableStream } from 'stream/web';
14
+
15
+ function convertReadStreamToReadableStream(readStream: fs.ReadStream): ReadableStream {
20
16
  return new ReadableStream({
21
17
  start(controller) {
22
- readStream.on("data", (chunk) => {
18
+ readStream.on("data", (chunk: Buffer) => {
23
19
  controller.enqueue(chunk);
24
20
  });
25
21
  readStream.on("end", () => {
26
22
  controller.close();
27
23
  });
28
- readStream.on("error", (err) => {
24
+ readStream.on("error", (err: Error) => {
29
25
  controller.error(err);
30
26
  });
31
27
  },
@@ -35,24 +31,21 @@ function convertReadStreamToReadableStream(readStream) {
35
31
  });
36
32
  }
37
33
 
38
- const databases = new Command("databases").description(commandDescriptions['databases'] ?? '').configureHelp({
34
+ export const databases = new Command("databases").description(commandDescriptions['databases'] ?? '').configureHelp({
39
35
  helpWidth: process.stdout.columns || 80
40
36
  })
41
37
 
42
- /**
43
- * @typedef {Object} DatabasesListRequestParams
44
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name
45
- * @property {string} search Search term to filter your list results. Max length: 256 chars.
46
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
47
- * @property {boolean} overrideForCli
48
- * @property {boolean} parseOutput
49
- * @property {libClient | undefined} sdk
50
- */
38
+ interface DatabasesListRequestParams {
39
+ queries?: string[];
40
+ search?: string;
41
+ total?: boolean;
42
+ overrideForCli?: boolean;
43
+ parseOutput?: boolean;
44
+ sdk?: Client;
45
+ console?: boolean;
46
+ }
51
47
 
52
- /**
53
- * @param {DatabasesListRequestParams} params
54
- */
55
- const databasesList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
48
+ export const databasesList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesListRequestParams): Promise<any> => {
56
49
  let client = !sdk ? await sdkForProject() :
57
50
  sdk;
58
51
  let apiPath = '/databases';
@@ -73,7 +66,7 @@ const databasesList = async ({queries,search,total,parseOutput = true, overrideF
73
66
  }, payload);
74
67
 
75
68
  if (parseOutput) {
76
- if(console) {
69
+ if(showConsole) {
77
70
  showConsoleLink('databases', 'list');
78
71
  } else {
79
72
  parse(response)
@@ -83,20 +76,16 @@ const databasesList = async ({queries,search,total,parseOutput = true, overrideF
83
76
  return response;
84
77
 
85
78
  }
86
- /**
87
- * @typedef {Object} DatabasesCreateRequestParams
88
- * @property {string} databaseId Unique Id. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
89
- * @property {string} name Database name. Max length: 128 chars.
90
- * @property {boolean} enabled Is the database enabled? When set to &#039;disabled&#039;, users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
91
- * @property {boolean} overrideForCli
92
- * @property {boolean} parseOutput
93
- * @property {libClient | undefined} sdk
94
- */
79
+ interface DatabasesCreateRequestParams {
80
+ databaseId: string;
81
+ name: string;
82
+ enabled?: boolean;
83
+ overrideForCli?: boolean;
84
+ parseOutput?: boolean;
85
+ sdk?: Client;
86
+ }
95
87
 
96
- /**
97
- * @param {DatabasesCreateRequestParams} params
98
- */
99
- const databasesCreate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
88
+ export const databasesCreate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateRequestParams): Promise<any> => {
100
89
  let client = !sdk ? await sdkForProject() :
101
90
  sdk;
102
91
  let apiPath = '/databases';
@@ -124,18 +113,15 @@ const databasesCreate = async ({databaseId,name,enabled,parseOutput = true, over
124
113
  return response;
125
114
 
126
115
  }
127
- /**
128
- * @typedef {Object} DatabasesListTransactionsRequestParams
129
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries).
130
- * @property {boolean} overrideForCli
131
- * @property {boolean} parseOutput
132
- * @property {libClient | undefined} sdk
133
- */
116
+ interface DatabasesListTransactionsRequestParams {
117
+ queries?: string[];
118
+ overrideForCli?: boolean;
119
+ parseOutput?: boolean;
120
+ sdk?: Client;
121
+ console?: boolean;
122
+ }
134
123
 
135
- /**
136
- * @param {DatabasesListTransactionsRequestParams} params
137
- */
138
- const databasesListTransactions = async ({queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
124
+ export const databasesListTransactions = async ({queries,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesListTransactionsRequestParams): Promise<any> => {
139
125
  let client = !sdk ? await sdkForProject() :
140
126
  sdk;
141
127
  let apiPath = '/databases/transactions';
@@ -150,7 +136,7 @@ const databasesListTransactions = async ({queries,parseOutput = true, overrideFo
150
136
  }, payload);
151
137
 
152
138
  if (parseOutput) {
153
- if(console) {
139
+ if(showConsole) {
154
140
  showConsoleLink('databases', 'listTransactions');
155
141
  } else {
156
142
  parse(response)
@@ -160,18 +146,14 @@ const databasesListTransactions = async ({queries,parseOutput = true, overrideFo
160
146
  return response;
161
147
 
162
148
  }
163
- /**
164
- * @typedef {Object} DatabasesCreateTransactionRequestParams
165
- * @property {number} ttl Seconds before the transaction expires.
166
- * @property {boolean} overrideForCli
167
- * @property {boolean} parseOutput
168
- * @property {libClient | undefined} sdk
169
- */
149
+ interface DatabasesCreateTransactionRequestParams {
150
+ ttl?: number;
151
+ overrideForCli?: boolean;
152
+ parseOutput?: boolean;
153
+ sdk?: Client;
154
+ }
170
155
 
171
- /**
172
- * @param {DatabasesCreateTransactionRequestParams} params
173
- */
174
- const databasesCreateTransaction = async ({ttl,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
156
+ export const databasesCreateTransaction = async ({ttl,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateTransactionRequestParams): Promise<any> => {
175
157
  let client = !sdk ? await sdkForProject() :
176
158
  sdk;
177
159
  let apiPath = '/databases/transactions';
@@ -193,18 +175,15 @@ const databasesCreateTransaction = async ({ttl,parseOutput = true, overrideForCl
193
175
  return response;
194
176
 
195
177
  }
196
- /**
197
- * @typedef {Object} DatabasesGetTransactionRequestParams
198
- * @property {string} transactionId Transaction ID.
199
- * @property {boolean} overrideForCli
200
- * @property {boolean} parseOutput
201
- * @property {libClient | undefined} sdk
202
- */
178
+ interface DatabasesGetTransactionRequestParams {
179
+ transactionId: string;
180
+ overrideForCli?: boolean;
181
+ parseOutput?: boolean;
182
+ sdk?: Client;
183
+ console?: boolean;
184
+ }
203
185
 
204
- /**
205
- * @param {DatabasesGetTransactionRequestParams} params
206
- */
207
- const databasesGetTransaction = async ({transactionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
186
+ export const databasesGetTransaction = async ({transactionId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesGetTransactionRequestParams): Promise<any> => {
208
187
  let client = !sdk ? await sdkForProject() :
209
188
  sdk;
210
189
  let apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId);
@@ -216,7 +195,7 @@ const databasesGetTransaction = async ({transactionId,parseOutput = true, overri
216
195
  }, payload);
217
196
 
218
197
  if (parseOutput) {
219
- if(console) {
198
+ if(showConsole) {
220
199
  showConsoleLink('databases', 'getTransaction', transactionId);
221
200
  } else {
222
201
  parse(response)
@@ -226,20 +205,16 @@ const databasesGetTransaction = async ({transactionId,parseOutput = true, overri
226
205
  return response;
227
206
 
228
207
  }
229
- /**
230
- * @typedef {Object} DatabasesUpdateTransactionRequestParams
231
- * @property {string} transactionId Transaction ID.
232
- * @property {boolean} commit Commit transaction?
233
- * @property {boolean} rollback Rollback transaction?
234
- * @property {boolean} overrideForCli
235
- * @property {boolean} parseOutput
236
- * @property {libClient | undefined} sdk
237
- */
208
+ interface DatabasesUpdateTransactionRequestParams {
209
+ transactionId: string;
210
+ commit?: boolean;
211
+ rollback?: boolean;
212
+ overrideForCli?: boolean;
213
+ parseOutput?: boolean;
214
+ sdk?: Client;
215
+ }
238
216
 
239
- /**
240
- * @param {DatabasesUpdateTransactionRequestParams} params
241
- */
242
- const databasesUpdateTransaction = async ({transactionId,commit,rollback,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
217
+ export const databasesUpdateTransaction = async ({transactionId,commit,rollback,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateTransactionRequestParams): Promise<any> => {
243
218
  let client = !sdk ? await sdkForProject() :
244
219
  sdk;
245
220
  let apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId);
@@ -264,18 +239,14 @@ const databasesUpdateTransaction = async ({transactionId,commit,rollback,parseOu
264
239
  return response;
265
240
 
266
241
  }
267
- /**
268
- * @typedef {Object} DatabasesDeleteTransactionRequestParams
269
- * @property {string} transactionId Transaction ID.
270
- * @property {boolean} overrideForCli
271
- * @property {boolean} parseOutput
272
- * @property {libClient | undefined} sdk
273
- */
242
+ interface DatabasesDeleteTransactionRequestParams {
243
+ transactionId: string;
244
+ overrideForCli?: boolean;
245
+ parseOutput?: boolean;
246
+ sdk?: Client;
247
+ }
274
248
 
275
- /**
276
- * @param {DatabasesDeleteTransactionRequestParams} params
277
- */
278
- const databasesDeleteTransaction = async ({transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
249
+ export const databasesDeleteTransaction = async ({transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesDeleteTransactionRequestParams): Promise<any> => {
279
250
  let client = !sdk ? await sdkForProject() :
280
251
  sdk;
281
252
  let apiPath = '/databases/transactions/{transactionId}'.replace('{transactionId}', transactionId);
@@ -294,19 +265,15 @@ const databasesDeleteTransaction = async ({transactionId,parseOutput = true, ove
294
265
  return response;
295
266
 
296
267
  }
297
- /**
298
- * @typedef {Object} DatabasesCreateOperationsRequestParams
299
- * @property {string} transactionId Transaction ID.
300
- * @property {object[]} operations Array of staged operations.
301
- * @property {boolean} overrideForCli
302
- * @property {boolean} parseOutput
303
- * @property {libClient | undefined} sdk
304
- */
268
+ interface DatabasesCreateOperationsRequestParams {
269
+ transactionId: string;
270
+ operations?: object[];
271
+ overrideForCli?: boolean;
272
+ parseOutput?: boolean;
273
+ sdk?: Client;
274
+ }
305
275
 
306
- /**
307
- * @param {DatabasesCreateOperationsRequestParams} params
308
- */
309
- const databasesCreateOperations = async ({transactionId,operations,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
276
+ export const databasesCreateOperations = async ({transactionId,operations,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateOperationsRequestParams): Promise<any> => {
310
277
  let client = !sdk ? await sdkForProject() :
311
278
  sdk;
312
279
  let apiPath = '/databases/transactions/{transactionId}/operations'.replace('{transactionId}', transactionId);
@@ -329,18 +296,15 @@ const databasesCreateOperations = async ({transactionId,operations,parseOutput =
329
296
  return response;
330
297
 
331
298
  }
332
- /**
333
- * @typedef {Object} DatabasesListUsageRequestParams
334
- * @property {UsageRange} range Date range.
335
- * @property {boolean} overrideForCli
336
- * @property {boolean} parseOutput
337
- * @property {libClient | undefined} sdk
338
- */
299
+ interface DatabasesListUsageRequestParams {
300
+ range?: UsageRange;
301
+ overrideForCli?: boolean;
302
+ parseOutput?: boolean;
303
+ sdk?: Client;
304
+ console?: boolean;
305
+ }
339
306
 
340
- /**
341
- * @param {DatabasesListUsageRequestParams} params
342
- */
343
- const databasesListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
307
+ export const databasesListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesListUsageRequestParams): Promise<any> => {
344
308
  let client = !sdk ? await sdkForProject() :
345
309
  sdk;
346
310
  let apiPath = '/databases/usage';
@@ -355,7 +319,7 @@ const databasesListUsage = async ({range,parseOutput = true, overrideForCli = fa
355
319
  }, payload);
356
320
 
357
321
  if (parseOutput) {
358
- if(console) {
322
+ if(showConsole) {
359
323
  showConsoleLink('databases', 'listUsage');
360
324
  } else {
361
325
  parse(response)
@@ -365,18 +329,15 @@ const databasesListUsage = async ({range,parseOutput = true, overrideForCli = fa
365
329
  return response;
366
330
 
367
331
  }
368
- /**
369
- * @typedef {Object} DatabasesGetRequestParams
370
- * @property {string} databaseId Database ID.
371
- * @property {boolean} overrideForCli
372
- * @property {boolean} parseOutput
373
- * @property {libClient | undefined} sdk
374
- */
332
+ interface DatabasesGetRequestParams {
333
+ databaseId: string;
334
+ overrideForCli?: boolean;
335
+ parseOutput?: boolean;
336
+ sdk?: Client;
337
+ console?: boolean;
338
+ }
375
339
 
376
- /**
377
- * @param {DatabasesGetRequestParams} params
378
- */
379
- const databasesGet = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
340
+ export const databasesGet = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesGetRequestParams): Promise<any> => {
380
341
  let client = !sdk ? await sdkForProject() :
381
342
  sdk;
382
343
  let apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
@@ -388,7 +349,7 @@ const databasesGet = async ({databaseId,parseOutput = true, overrideForCli = fal
388
349
  }, payload);
389
350
 
390
351
  if (parseOutput) {
391
- if(console) {
352
+ if(showConsole) {
392
353
  showConsoleLink('databases', 'get', databaseId);
393
354
  } else {
394
355
  parse(response)
@@ -398,20 +359,16 @@ const databasesGet = async ({databaseId,parseOutput = true, overrideForCli = fal
398
359
  return response;
399
360
 
400
361
  }
401
- /**
402
- * @typedef {Object} DatabasesUpdateRequestParams
403
- * @property {string} databaseId Database ID.
404
- * @property {string} name Database name. Max length: 128 chars.
405
- * @property {boolean} enabled Is database enabled? When set to &#039;disabled&#039;, users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
406
- * @property {boolean} overrideForCli
407
- * @property {boolean} parseOutput
408
- * @property {libClient | undefined} sdk
409
- */
362
+ interface DatabasesUpdateRequestParams {
363
+ databaseId: string;
364
+ name: string;
365
+ enabled?: boolean;
366
+ overrideForCli?: boolean;
367
+ parseOutput?: boolean;
368
+ sdk?: Client;
369
+ }
410
370
 
411
- /**
412
- * @param {DatabasesUpdateRequestParams} params
413
- */
414
- const databasesUpdate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
371
+ export const databasesUpdate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateRequestParams): Promise<any> => {
415
372
  let client = !sdk ? await sdkForProject() :
416
373
  sdk;
417
374
  let apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
@@ -436,18 +393,14 @@ const databasesUpdate = async ({databaseId,name,enabled,parseOutput = true, over
436
393
  return response;
437
394
 
438
395
  }
439
- /**
440
- * @typedef {Object} DatabasesDeleteRequestParams
441
- * @property {string} databaseId Database ID.
442
- * @property {boolean} overrideForCli
443
- * @property {boolean} parseOutput
444
- * @property {libClient | undefined} sdk
445
- */
396
+ interface DatabasesDeleteRequestParams {
397
+ databaseId: string;
398
+ overrideForCli?: boolean;
399
+ parseOutput?: boolean;
400
+ sdk?: Client;
401
+ }
446
402
 
447
- /**
448
- * @param {DatabasesDeleteRequestParams} params
449
- */
450
- const databasesDelete = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
403
+ export const databasesDelete = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesDeleteRequestParams): Promise<any> => {
451
404
  let client = !sdk ? await sdkForProject() :
452
405
  sdk;
453
406
  let apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
@@ -466,21 +419,18 @@ const databasesDelete = async ({databaseId,parseOutput = true, overrideForCli =
466
419
  return response;
467
420
 
468
421
  }
469
- /**
470
- * @typedef {Object} DatabasesListCollectionsRequestParams
471
- * @property {string} databaseId Database ID.
472
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity
473
- * @property {string} search Search term to filter your list results. Max length: 256 chars.
474
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
475
- * @property {boolean} overrideForCli
476
- * @property {boolean} parseOutput
477
- * @property {libClient | undefined} sdk
478
- */
422
+ interface DatabasesListCollectionsRequestParams {
423
+ databaseId: string;
424
+ queries?: string[];
425
+ search?: string;
426
+ total?: boolean;
427
+ overrideForCli?: boolean;
428
+ parseOutput?: boolean;
429
+ sdk?: Client;
430
+ console?: boolean;
431
+ }
479
432
 
480
- /**
481
- * @param {DatabasesListCollectionsRequestParams} params
482
- */
483
- const databasesListCollections = async ({databaseId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
433
+ export const databasesListCollections = async ({databaseId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesListCollectionsRequestParams): Promise<any> => {
484
434
  let client = !sdk ? await sdkForProject() :
485
435
  sdk;
486
436
  let apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
@@ -501,7 +451,7 @@ const databasesListCollections = async ({databaseId,queries,search,total,parseOu
501
451
  }, payload);
502
452
 
503
453
  if (parseOutput) {
504
- if(console) {
454
+ if(showConsole) {
505
455
  showConsoleLink('databases', 'listCollections', databaseId);
506
456
  } else {
507
457
  parse(response)
@@ -511,23 +461,21 @@ const databasesListCollections = async ({databaseId,queries,search,total,parseOu
511
461
  return response;
512
462
 
513
463
  }
514
- /**
515
- * @typedef {Object} DatabasesCreateCollectionRequestParams
516
- * @property {string} databaseId Database ID.
517
- * @property {string} collectionId Unique Id. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
518
- * @property {string} name Collection name. Max length: 128 chars.
519
- * @property {string[]} permissions An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
520
- * @property {boolean} documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
521
- * @property {boolean} enabled Is collection enabled? When set to &#039;disabled&#039;, users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
522
- * @property {boolean} overrideForCli
523
- * @property {boolean} parseOutput
524
- * @property {libClient | undefined} sdk
525
- */
464
+ interface DatabasesCreateCollectionRequestParams {
465
+ databaseId: string;
466
+ collectionId: string;
467
+ name: string;
468
+ permissions?: string[];
469
+ documentSecurity?: boolean;
470
+ enabled?: boolean;
471
+ attributes?: object[];
472
+ indexes?: object[];
473
+ overrideForCli?: boolean;
474
+ parseOutput?: boolean;
475
+ sdk?: Client;
476
+ }
526
477
 
527
- /**
528
- * @param {DatabasesCreateCollectionRequestParams} params
529
- */
530
- const databasesCreateCollection = async ({databaseId,collectionId,name,permissions,documentSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
478
+ export const databasesCreateCollection = async ({databaseId,collectionId,name,permissions,documentSecurity,enabled,attributes,indexes,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateCollectionRequestParams): Promise<any> => {
531
479
  let client = !sdk ? await sdkForProject() :
532
480
  sdk;
533
481
  let apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
@@ -548,6 +496,14 @@ const databasesCreateCollection = async ({databaseId,collectionId,name,permissio
548
496
  if (typeof enabled !== 'undefined') {
549
497
  payload['enabled'] = enabled;
550
498
  }
499
+ attributes = attributes === true ? [] : attributes;
500
+ if (typeof attributes !== 'undefined') {
501
+ payload['attributes'] = attributes;
502
+ }
503
+ indexes = indexes === true ? [] : indexes;
504
+ if (typeof indexes !== 'undefined') {
505
+ payload['indexes'] = indexes;
506
+ }
551
507
 
552
508
  let response = undefined;
553
509
 
@@ -562,19 +518,16 @@ const databasesCreateCollection = async ({databaseId,collectionId,name,permissio
562
518
  return response;
563
519
 
564
520
  }
565
- /**
566
- * @typedef {Object} DatabasesGetCollectionRequestParams
567
- * @property {string} databaseId Database ID.
568
- * @property {string} collectionId Collection ID.
569
- * @property {boolean} overrideForCli
570
- * @property {boolean} parseOutput
571
- * @property {libClient | undefined} sdk
572
- */
521
+ interface DatabasesGetCollectionRequestParams {
522
+ databaseId: string;
523
+ collectionId: string;
524
+ overrideForCli?: boolean;
525
+ parseOutput?: boolean;
526
+ sdk?: Client;
527
+ console?: boolean;
528
+ }
573
529
 
574
- /**
575
- * @param {DatabasesGetCollectionRequestParams} params
576
- */
577
- const databasesGetCollection = async ({databaseId,collectionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
530
+ export const databasesGetCollection = async ({databaseId,collectionId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesGetCollectionRequestParams): Promise<any> => {
578
531
  let client = !sdk ? await sdkForProject() :
579
532
  sdk;
580
533
  let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -586,7 +539,7 @@ const databasesGetCollection = async ({databaseId,collectionId,parseOutput = tru
586
539
  }, payload);
587
540
 
588
541
  if (parseOutput) {
589
- if(console) {
542
+ if(showConsole) {
590
543
  showConsoleLink('databases', 'getCollection', databaseId, collectionId);
591
544
  } else {
592
545
  parse(response)
@@ -596,23 +549,19 @@ const databasesGetCollection = async ({databaseId,collectionId,parseOutput = tru
596
549
  return response;
597
550
 
598
551
  }
599
- /**
600
- * @typedef {Object} DatabasesUpdateCollectionRequestParams
601
- * @property {string} databaseId Database ID.
602
- * @property {string} collectionId Collection ID.
603
- * @property {string} name Collection name. Max length: 128 chars.
604
- * @property {string[]} permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
605
- * @property {boolean} documentSecurity Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
606
- * @property {boolean} enabled Is collection enabled? When set to &#039;disabled&#039;, users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
607
- * @property {boolean} overrideForCli
608
- * @property {boolean} parseOutput
609
- * @property {libClient | undefined} sdk
610
- */
552
+ interface DatabasesUpdateCollectionRequestParams {
553
+ databaseId: string;
554
+ collectionId: string;
555
+ name: string;
556
+ permissions?: string[];
557
+ documentSecurity?: boolean;
558
+ enabled?: boolean;
559
+ overrideForCli?: boolean;
560
+ parseOutput?: boolean;
561
+ sdk?: Client;
562
+ }
611
563
 
612
- /**
613
- * @param {DatabasesUpdateCollectionRequestParams} params
614
- */
615
- const databasesUpdateCollection = async ({databaseId,collectionId,name,permissions,documentSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
564
+ export const databasesUpdateCollection = async ({databaseId,collectionId,name,permissions,documentSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateCollectionRequestParams): Promise<any> => {
616
565
  let client = !sdk ? await sdkForProject() :
617
566
  sdk;
618
567
  let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -644,19 +593,15 @@ const databasesUpdateCollection = async ({databaseId,collectionId,name,permissio
644
593
  return response;
645
594
 
646
595
  }
647
- /**
648
- * @typedef {Object} DatabasesDeleteCollectionRequestParams
649
- * @property {string} databaseId Database ID.
650
- * @property {string} collectionId Collection ID.
651
- * @property {boolean} overrideForCli
652
- * @property {boolean} parseOutput
653
- * @property {libClient | undefined} sdk
654
- */
596
+ interface DatabasesDeleteCollectionRequestParams {
597
+ databaseId: string;
598
+ collectionId: string;
599
+ overrideForCli?: boolean;
600
+ parseOutput?: boolean;
601
+ sdk?: Client;
602
+ }
655
603
 
656
- /**
657
- * @param {DatabasesDeleteCollectionRequestParams} params
658
- */
659
- const databasesDeleteCollection = async ({databaseId,collectionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
604
+ export const databasesDeleteCollection = async ({databaseId,collectionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesDeleteCollectionRequestParams): Promise<any> => {
660
605
  let client = !sdk ? await sdkForProject() :
661
606
  sdk;
662
607
  let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -675,21 +620,18 @@ const databasesDeleteCollection = async ({databaseId,collectionId,parseOutput =
675
620
  return response;
676
621
 
677
622
  }
678
- /**
679
- * @typedef {Object} DatabasesListAttributesRequestParams
680
- * @property {string} databaseId Database ID.
681
- * @property {string} collectionId Collection ID.
682
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error
683
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
684
- * @property {boolean} overrideForCli
685
- * @property {boolean} parseOutput
686
- * @property {libClient | undefined} sdk
687
- */
623
+ interface DatabasesListAttributesRequestParams {
624
+ databaseId: string;
625
+ collectionId: string;
626
+ queries?: string[];
627
+ total?: boolean;
628
+ overrideForCli?: boolean;
629
+ parseOutput?: boolean;
630
+ sdk?: Client;
631
+ console?: boolean;
632
+ }
688
633
 
689
- /**
690
- * @param {DatabasesListAttributesRequestParams} params
691
- */
692
- const databasesListAttributes = async ({databaseId,collectionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
634
+ export const databasesListAttributes = async ({databaseId,collectionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesListAttributesRequestParams): Promise<any> => {
693
635
  let client = !sdk ? await sdkForProject() :
694
636
  sdk;
695
637
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -707,7 +649,7 @@ const databasesListAttributes = async ({databaseId,collectionId,queries,total,pa
707
649
  }, payload);
708
650
 
709
651
  if (parseOutput) {
710
- if(console) {
652
+ if(showConsole) {
711
653
  showConsoleLink('databases', 'listAttributes', databaseId, collectionId);
712
654
  } else {
713
655
  parse(response)
@@ -717,23 +659,19 @@ const databasesListAttributes = async ({databaseId,collectionId,queries,total,pa
717
659
  return response;
718
660
 
719
661
  }
720
- /**
721
- * @typedef {Object} DatabasesCreateBooleanAttributeRequestParams
722
- * @property {string} databaseId Database ID.
723
- * @property {string} collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
724
- * @property {string} key Attribute Key.
725
- * @property {boolean} required Is attribute required?
726
- * @property {boolean} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
727
- * @property {boolean} array Is attribute an array?
728
- * @property {boolean} overrideForCli
729
- * @property {boolean} parseOutput
730
- * @property {libClient | undefined} sdk
731
- */
662
+ interface DatabasesCreateBooleanAttributeRequestParams {
663
+ databaseId: string;
664
+ collectionId: string;
665
+ key: string;
666
+ required: boolean;
667
+ xdefault?: boolean;
668
+ array?: boolean;
669
+ overrideForCli?: boolean;
670
+ parseOutput?: boolean;
671
+ sdk?: Client;
672
+ }
732
673
 
733
- /**
734
- * @param {DatabasesCreateBooleanAttributeRequestParams} params
735
- */
736
- const databasesCreateBooleanAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
674
+ export const databasesCreateBooleanAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateBooleanAttributeRequestParams): Promise<any> => {
737
675
  let client = !sdk ? await sdkForProject() :
738
676
  sdk;
739
677
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -764,23 +702,19 @@ const databasesCreateBooleanAttribute = async ({databaseId,collectionId,key,requ
764
702
  return response;
765
703
 
766
704
  }
767
- /**
768
- * @typedef {Object} DatabasesUpdateBooleanAttributeRequestParams
769
- * @property {string} databaseId Database ID.
770
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
771
- * @property {string} key Attribute Key.
772
- * @property {boolean} required Is attribute required?
773
- * @property {boolean} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
774
- * @property {string} newKey New attribute key.
775
- * @property {boolean} overrideForCli
776
- * @property {boolean} parseOutput
777
- * @property {libClient | undefined} sdk
778
- */
705
+ interface DatabasesUpdateBooleanAttributeRequestParams {
706
+ databaseId: string;
707
+ collectionId: string;
708
+ key: string;
709
+ required: boolean;
710
+ xdefault: boolean;
711
+ newKey?: string;
712
+ overrideForCli?: boolean;
713
+ parseOutput?: boolean;
714
+ sdk?: Client;
715
+ }
779
716
 
780
- /**
781
- * @param {DatabasesUpdateBooleanAttributeRequestParams} params
782
- */
783
- const databasesUpdateBooleanAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
717
+ export const databasesUpdateBooleanAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateBooleanAttributeRequestParams): Promise<any> => {
784
718
  let client = !sdk ? await sdkForProject() :
785
719
  sdk;
786
720
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -808,23 +742,19 @@ const databasesUpdateBooleanAttribute = async ({databaseId,collectionId,key,requ
808
742
  return response;
809
743
 
810
744
  }
811
- /**
812
- * @typedef {Object} DatabasesCreateDatetimeAttributeRequestParams
813
- * @property {string} databaseId Database ID.
814
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
815
- * @property {string} key Attribute Key.
816
- * @property {boolean} required Is attribute required?
817
- * @property {string} xdefault Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.
818
- * @property {boolean} array Is attribute an array?
819
- * @property {boolean} overrideForCli
820
- * @property {boolean} parseOutput
821
- * @property {libClient | undefined} sdk
822
- */
745
+ interface DatabasesCreateDatetimeAttributeRequestParams {
746
+ databaseId: string;
747
+ collectionId: string;
748
+ key: string;
749
+ required: boolean;
750
+ xdefault?: string;
751
+ array?: boolean;
752
+ overrideForCli?: boolean;
753
+ parseOutput?: boolean;
754
+ sdk?: Client;
755
+ }
823
756
 
824
- /**
825
- * @param {DatabasesCreateDatetimeAttributeRequestParams} params
826
- */
827
- const databasesCreateDatetimeAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
757
+ export const databasesCreateDatetimeAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateDatetimeAttributeRequestParams): Promise<any> => {
828
758
  let client = !sdk ? await sdkForProject() :
829
759
  sdk;
830
760
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -855,23 +785,19 @@ const databasesCreateDatetimeAttribute = async ({databaseId,collectionId,key,req
855
785
  return response;
856
786
 
857
787
  }
858
- /**
859
- * @typedef {Object} DatabasesUpdateDatetimeAttributeRequestParams
860
- * @property {string} databaseId Database ID.
861
- * @property {string} collectionId Collection ID.
862
- * @property {string} key Attribute Key.
863
- * @property {boolean} required Is attribute required?
864
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
865
- * @property {string} newKey New attribute key.
866
- * @property {boolean} overrideForCli
867
- * @property {boolean} parseOutput
868
- * @property {libClient | undefined} sdk
869
- */
788
+ interface DatabasesUpdateDatetimeAttributeRequestParams {
789
+ databaseId: string;
790
+ collectionId: string;
791
+ key: string;
792
+ required: boolean;
793
+ xdefault: string;
794
+ newKey?: string;
795
+ overrideForCli?: boolean;
796
+ parseOutput?: boolean;
797
+ sdk?: Client;
798
+ }
870
799
 
871
- /**
872
- * @param {DatabasesUpdateDatetimeAttributeRequestParams} params
873
- */
874
- const databasesUpdateDatetimeAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
800
+ export const databasesUpdateDatetimeAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateDatetimeAttributeRequestParams): Promise<any> => {
875
801
  let client = !sdk ? await sdkForProject() :
876
802
  sdk;
877
803
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -899,23 +825,19 @@ const databasesUpdateDatetimeAttribute = async ({databaseId,collectionId,key,req
899
825
  return response;
900
826
 
901
827
  }
902
- /**
903
- * @typedef {Object} DatabasesCreateEmailAttributeRequestParams
904
- * @property {string} databaseId Database ID.
905
- * @property {string} collectionId Collection ID.
906
- * @property {string} key Attribute Key.
907
- * @property {boolean} required Is attribute required?
908
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
909
- * @property {boolean} array Is attribute an array?
910
- * @property {boolean} overrideForCli
911
- * @property {boolean} parseOutput
912
- * @property {libClient | undefined} sdk
913
- */
828
+ interface DatabasesCreateEmailAttributeRequestParams {
829
+ databaseId: string;
830
+ collectionId: string;
831
+ key: string;
832
+ required: boolean;
833
+ xdefault?: string;
834
+ array?: boolean;
835
+ overrideForCli?: boolean;
836
+ parseOutput?: boolean;
837
+ sdk?: Client;
838
+ }
914
839
 
915
- /**
916
- * @param {DatabasesCreateEmailAttributeRequestParams} params
917
- */
918
- const databasesCreateEmailAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
840
+ export const databasesCreateEmailAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateEmailAttributeRequestParams): Promise<any> => {
919
841
  let client = !sdk ? await sdkForProject() :
920
842
  sdk;
921
843
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -946,23 +868,19 @@ const databasesCreateEmailAttribute = async ({databaseId,collectionId,key,requir
946
868
  return response;
947
869
 
948
870
  }
949
- /**
950
- * @typedef {Object} DatabasesUpdateEmailAttributeRequestParams
951
- * @property {string} databaseId Database ID.
952
- * @property {string} collectionId Collection ID.
953
- * @property {string} key Attribute Key.
954
- * @property {boolean} required Is attribute required?
955
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
956
- * @property {string} newKey New Attribute Key.
957
- * @property {boolean} overrideForCli
958
- * @property {boolean} parseOutput
959
- * @property {libClient | undefined} sdk
960
- */
871
+ interface DatabasesUpdateEmailAttributeRequestParams {
872
+ databaseId: string;
873
+ collectionId: string;
874
+ key: string;
875
+ required: boolean;
876
+ xdefault: string;
877
+ newKey?: string;
878
+ overrideForCli?: boolean;
879
+ parseOutput?: boolean;
880
+ sdk?: Client;
881
+ }
961
882
 
962
- /**
963
- * @param {DatabasesUpdateEmailAttributeRequestParams} params
964
- */
965
- const databasesUpdateEmailAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
883
+ export const databasesUpdateEmailAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateEmailAttributeRequestParams): Promise<any> => {
966
884
  let client = !sdk ? await sdkForProject() :
967
885
  sdk;
968
886
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -990,24 +908,20 @@ const databasesUpdateEmailAttribute = async ({databaseId,collectionId,key,requir
990
908
  return response;
991
909
 
992
910
  }
993
- /**
994
- * @typedef {Object} DatabasesCreateEnumAttributeRequestParams
995
- * @property {string} databaseId Database ID.
996
- * @property {string} collectionId Collection ID.
997
- * @property {string} key Attribute Key.
998
- * @property {string[]} elements Array of enum values.
999
- * @property {boolean} required Is attribute required?
1000
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1001
- * @property {boolean} array Is attribute an array?
1002
- * @property {boolean} overrideForCli
1003
- * @property {boolean} parseOutput
1004
- * @property {libClient | undefined} sdk
1005
- */
911
+ interface DatabasesCreateEnumAttributeRequestParams {
912
+ databaseId: string;
913
+ collectionId: string;
914
+ key: string;
915
+ elements: string[];
916
+ required: boolean;
917
+ xdefault?: string;
918
+ array?: boolean;
919
+ overrideForCli?: boolean;
920
+ parseOutput?: boolean;
921
+ sdk?: Client;
922
+ }
1006
923
 
1007
- /**
1008
- * @param {DatabasesCreateEnumAttributeRequestParams} params
1009
- */
1010
- const databasesCreateEnumAttribute = async ({databaseId,collectionId,key,elements,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
924
+ export const databasesCreateEnumAttribute = async ({databaseId,collectionId,key,elements,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateEnumAttributeRequestParams): Promise<any> => {
1011
925
  let client = !sdk ? await sdkForProject() :
1012
926
  sdk;
1013
927
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1042,24 +956,20 @@ const databasesCreateEnumAttribute = async ({databaseId,collectionId,key,element
1042
956
  return response;
1043
957
 
1044
958
  }
1045
- /**
1046
- * @typedef {Object} DatabasesUpdateEnumAttributeRequestParams
1047
- * @property {string} databaseId Database ID.
1048
- * @property {string} collectionId Collection ID.
1049
- * @property {string} key Attribute Key.
1050
- * @property {string[]} elements Updated list of enum values.
1051
- * @property {boolean} required Is attribute required?
1052
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1053
- * @property {string} newKey New Attribute Key.
1054
- * @property {boolean} overrideForCli
1055
- * @property {boolean} parseOutput
1056
- * @property {libClient | undefined} sdk
1057
- */
959
+ interface DatabasesUpdateEnumAttributeRequestParams {
960
+ databaseId: string;
961
+ collectionId: string;
962
+ key: string;
963
+ elements: string[];
964
+ required: boolean;
965
+ xdefault: string;
966
+ newKey?: string;
967
+ overrideForCli?: boolean;
968
+ parseOutput?: boolean;
969
+ sdk?: Client;
970
+ }
1058
971
 
1059
- /**
1060
- * @param {DatabasesUpdateEnumAttributeRequestParams} params
1061
- */
1062
- const databasesUpdateEnumAttribute = async ({databaseId,collectionId,key,elements,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
972
+ export const databasesUpdateEnumAttribute = async ({databaseId,collectionId,key,elements,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateEnumAttributeRequestParams): Promise<any> => {
1063
973
  let client = !sdk ? await sdkForProject() :
1064
974
  sdk;
1065
975
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1091,25 +1001,21 @@ const databasesUpdateEnumAttribute = async ({databaseId,collectionId,key,element
1091
1001
  return response;
1092
1002
 
1093
1003
  }
1094
- /**
1095
- * @typedef {Object} DatabasesCreateFloatAttributeRequestParams
1096
- * @property {string} databaseId Database ID.
1097
- * @property {string} collectionId Collection ID.
1098
- * @property {string} key Attribute Key.
1099
- * @property {boolean} required Is attribute required?
1100
- * @property {number} min Minimum value.
1101
- * @property {number} max Maximum value.
1102
- * @property {number} xdefault Default value. Cannot be set when required.
1103
- * @property {boolean} array Is attribute an array?
1104
- * @property {boolean} overrideForCli
1105
- * @property {boolean} parseOutput
1106
- * @property {libClient | undefined} sdk
1107
- */
1004
+ interface DatabasesCreateFloatAttributeRequestParams {
1005
+ databaseId: string;
1006
+ collectionId: string;
1007
+ key: string;
1008
+ required: boolean;
1009
+ min?: number;
1010
+ max?: number;
1011
+ xdefault?: number;
1012
+ array?: boolean;
1013
+ overrideForCli?: boolean;
1014
+ parseOutput?: boolean;
1015
+ sdk?: Client;
1016
+ }
1108
1017
 
1109
- /**
1110
- * @param {DatabasesCreateFloatAttributeRequestParams} params
1111
- */
1112
- const databasesCreateFloatAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1018
+ export const databasesCreateFloatAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateFloatAttributeRequestParams): Promise<any> => {
1113
1019
  let client = !sdk ? await sdkForProject() :
1114
1020
  sdk;
1115
1021
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1146,25 +1052,21 @@ const databasesCreateFloatAttribute = async ({databaseId,collectionId,key,requir
1146
1052
  return response;
1147
1053
 
1148
1054
  }
1149
- /**
1150
- * @typedef {Object} DatabasesUpdateFloatAttributeRequestParams
1151
- * @property {string} databaseId Database ID.
1152
- * @property {string} collectionId Collection ID.
1153
- * @property {string} key Attribute Key.
1154
- * @property {boolean} required Is attribute required?
1155
- * @property {number} xdefault Default value. Cannot be set when required.
1156
- * @property {number} min Minimum value.
1157
- * @property {number} max Maximum value.
1158
- * @property {string} newKey New Attribute Key.
1159
- * @property {boolean} overrideForCli
1160
- * @property {boolean} parseOutput
1161
- * @property {libClient | undefined} sdk
1162
- */
1055
+ interface DatabasesUpdateFloatAttributeRequestParams {
1056
+ databaseId: string;
1057
+ collectionId: string;
1058
+ key: string;
1059
+ required: boolean;
1060
+ xdefault: number;
1061
+ min?: number;
1062
+ max?: number;
1063
+ newKey?: string;
1064
+ overrideForCli?: boolean;
1065
+ parseOutput?: boolean;
1066
+ sdk?: Client;
1067
+ }
1163
1068
 
1164
- /**
1165
- * @param {DatabasesUpdateFloatAttributeRequestParams} params
1166
- */
1167
- const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1069
+ export const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateFloatAttributeRequestParams): Promise<any> => {
1168
1070
  let client = !sdk ? await sdkForProject() :
1169
1071
  sdk;
1170
1072
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1198,25 +1100,21 @@ const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,requir
1198
1100
  return response;
1199
1101
 
1200
1102
  }
1201
- /**
1202
- * @typedef {Object} DatabasesCreateIntegerAttributeRequestParams
1203
- * @property {string} databaseId Database ID.
1204
- * @property {string} collectionId Collection ID.
1205
- * @property {string} key Attribute Key.
1206
- * @property {boolean} required Is attribute required?
1207
- * @property {number} min Minimum value
1208
- * @property {number} max Maximum value
1209
- * @property {number} xdefault Default value. Cannot be set when attribute is required.
1210
- * @property {boolean} array Is attribute an array?
1211
- * @property {boolean} overrideForCli
1212
- * @property {boolean} parseOutput
1213
- * @property {libClient | undefined} sdk
1214
- */
1103
+ interface DatabasesCreateIntegerAttributeRequestParams {
1104
+ databaseId: string;
1105
+ collectionId: string;
1106
+ key: string;
1107
+ required: boolean;
1108
+ min?: number;
1109
+ max?: number;
1110
+ xdefault?: number;
1111
+ array?: boolean;
1112
+ overrideForCli?: boolean;
1113
+ parseOutput?: boolean;
1114
+ sdk?: Client;
1115
+ }
1215
1116
 
1216
- /**
1217
- * @param {DatabasesCreateIntegerAttributeRequestParams} params
1218
- */
1219
- const databasesCreateIntegerAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1117
+ export const databasesCreateIntegerAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateIntegerAttributeRequestParams): Promise<any> => {
1220
1118
  let client = !sdk ? await sdkForProject() :
1221
1119
  sdk;
1222
1120
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1253,25 +1151,21 @@ const databasesCreateIntegerAttribute = async ({databaseId,collectionId,key,requ
1253
1151
  return response;
1254
1152
 
1255
1153
  }
1256
- /**
1257
- * @typedef {Object} DatabasesUpdateIntegerAttributeRequestParams
1258
- * @property {string} databaseId Database ID.
1259
- * @property {string} collectionId Collection ID.
1260
- * @property {string} key Attribute Key.
1261
- * @property {boolean} required Is attribute required?
1262
- * @property {number} xdefault Default value. Cannot be set when attribute is required.
1263
- * @property {number} min Minimum value
1264
- * @property {number} max Maximum value
1265
- * @property {string} newKey New Attribute Key.
1266
- * @property {boolean} overrideForCli
1267
- * @property {boolean} parseOutput
1268
- * @property {libClient | undefined} sdk
1269
- */
1154
+ interface DatabasesUpdateIntegerAttributeRequestParams {
1155
+ databaseId: string;
1156
+ collectionId: string;
1157
+ key: string;
1158
+ required: boolean;
1159
+ xdefault: number;
1160
+ min?: number;
1161
+ max?: number;
1162
+ newKey?: string;
1163
+ overrideForCli?: boolean;
1164
+ parseOutput?: boolean;
1165
+ sdk?: Client;
1166
+ }
1270
1167
 
1271
- /**
1272
- * @param {DatabasesUpdateIntegerAttributeRequestParams} params
1273
- */
1274
- const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1168
+ export const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,required,xdefault,min,max,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateIntegerAttributeRequestParams): Promise<any> => {
1275
1169
  let client = !sdk ? await sdkForProject() :
1276
1170
  sdk;
1277
1171
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1305,23 +1199,19 @@ const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,requ
1305
1199
  return response;
1306
1200
 
1307
1201
  }
1308
- /**
1309
- * @typedef {Object} DatabasesCreateIpAttributeRequestParams
1310
- * @property {string} databaseId Database ID.
1311
- * @property {string} collectionId Collection ID.
1312
- * @property {string} key Attribute Key.
1313
- * @property {boolean} required Is attribute required?
1314
- * @property {string} xdefault Default value. Cannot be set when attribute is required.
1315
- * @property {boolean} array Is attribute an array?
1316
- * @property {boolean} overrideForCli
1317
- * @property {boolean} parseOutput
1318
- * @property {libClient | undefined} sdk
1319
- */
1202
+ interface DatabasesCreateIpAttributeRequestParams {
1203
+ databaseId: string;
1204
+ collectionId: string;
1205
+ key: string;
1206
+ required: boolean;
1207
+ xdefault?: string;
1208
+ array?: boolean;
1209
+ overrideForCli?: boolean;
1210
+ parseOutput?: boolean;
1211
+ sdk?: Client;
1212
+ }
1320
1213
 
1321
- /**
1322
- * @param {DatabasesCreateIpAttributeRequestParams} params
1323
- */
1324
- const databasesCreateIpAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1214
+ export const databasesCreateIpAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateIpAttributeRequestParams): Promise<any> => {
1325
1215
  let client = !sdk ? await sdkForProject() :
1326
1216
  sdk;
1327
1217
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1352,23 +1242,19 @@ const databasesCreateIpAttribute = async ({databaseId,collectionId,key,required,
1352
1242
  return response;
1353
1243
 
1354
1244
  }
1355
- /**
1356
- * @typedef {Object} DatabasesUpdateIpAttributeRequestParams
1357
- * @property {string} databaseId Database ID.
1358
- * @property {string} collectionId Collection ID.
1359
- * @property {string} key Attribute Key.
1360
- * @property {boolean} required Is attribute required?
1361
- * @property {string} xdefault Default value. Cannot be set when attribute is required.
1362
- * @property {string} newKey New Attribute Key.
1363
- * @property {boolean} overrideForCli
1364
- * @property {boolean} parseOutput
1365
- * @property {libClient | undefined} sdk
1366
- */
1245
+ interface DatabasesUpdateIpAttributeRequestParams {
1246
+ databaseId: string;
1247
+ collectionId: string;
1248
+ key: string;
1249
+ required: boolean;
1250
+ xdefault: string;
1251
+ newKey?: string;
1252
+ overrideForCli?: boolean;
1253
+ parseOutput?: boolean;
1254
+ sdk?: Client;
1255
+ }
1367
1256
 
1368
- /**
1369
- * @param {DatabasesUpdateIpAttributeRequestParams} params
1370
- */
1371
- const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1257
+ export const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateIpAttributeRequestParams): Promise<any> => {
1372
1258
  let client = !sdk ? await sdkForProject() :
1373
1259
  sdk;
1374
1260
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1396,22 +1282,18 @@ const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required,
1396
1282
  return response;
1397
1283
 
1398
1284
  }
1399
- /**
1400
- * @typedef {Object} DatabasesCreateLineAttributeRequestParams
1401
- * @property {string} databaseId Database ID.
1402
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1403
- * @property {string} key Attribute Key.
1404
- * @property {boolean} required Is attribute required?
1405
- * @property {any[]} xdefault Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
1406
- * @property {boolean} overrideForCli
1407
- * @property {boolean} parseOutput
1408
- * @property {libClient | undefined} sdk
1409
- */
1285
+ interface DatabasesCreateLineAttributeRequestParams {
1286
+ databaseId: string;
1287
+ collectionId: string;
1288
+ key: string;
1289
+ required: boolean;
1290
+ xdefault?: any[];
1291
+ overrideForCli?: boolean;
1292
+ parseOutput?: boolean;
1293
+ sdk?: Client;
1294
+ }
1410
1295
 
1411
- /**
1412
- * @param {DatabasesCreateLineAttributeRequestParams} params
1413
- */
1414
- const databasesCreateLineAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1296
+ export const databasesCreateLineAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateLineAttributeRequestParams): Promise<any> => {
1415
1297
  let client = !sdk ? await sdkForProject() :
1416
1298
  sdk;
1417
1299
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/line'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1440,23 +1322,19 @@ const databasesCreateLineAttribute = async ({databaseId,collectionId,key,require
1440
1322
  return response;
1441
1323
 
1442
1324
  }
1443
- /**
1444
- * @typedef {Object} DatabasesUpdateLineAttributeRequestParams
1445
- * @property {string} databaseId Database ID.
1446
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
1447
- * @property {string} key Attribute Key.
1448
- * @property {boolean} required Is attribute required?
1449
- * @property {any[]} xdefault Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
1450
- * @property {string} newKey New attribute key.
1451
- * @property {boolean} overrideForCli
1452
- * @property {boolean} parseOutput
1453
- * @property {libClient | undefined} sdk
1454
- */
1325
+ interface DatabasesUpdateLineAttributeRequestParams {
1326
+ databaseId: string;
1327
+ collectionId: string;
1328
+ key: string;
1329
+ required: boolean;
1330
+ xdefault?: any[];
1331
+ newKey?: string;
1332
+ overrideForCli?: boolean;
1333
+ parseOutput?: boolean;
1334
+ sdk?: Client;
1335
+ }
1455
1336
 
1456
- /**
1457
- * @param {DatabasesUpdateLineAttributeRequestParams} params
1458
- */
1459
- const databasesUpdateLineAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1337
+ export const databasesUpdateLineAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateLineAttributeRequestParams): Promise<any> => {
1460
1338
  let client = !sdk ? await sdkForProject() :
1461
1339
  sdk;
1462
1340
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1485,22 +1363,18 @@ const databasesUpdateLineAttribute = async ({databaseId,collectionId,key,require
1485
1363
  return response;
1486
1364
 
1487
1365
  }
1488
- /**
1489
- * @typedef {Object} DatabasesCreatePointAttributeRequestParams
1490
- * @property {string} databaseId Database ID.
1491
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1492
- * @property {string} key Attribute Key.
1493
- * @property {boolean} required Is attribute required?
1494
- * @property {any[]} xdefault Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
1495
- * @property {boolean} overrideForCli
1496
- * @property {boolean} parseOutput
1497
- * @property {libClient | undefined} sdk
1498
- */
1366
+ interface DatabasesCreatePointAttributeRequestParams {
1367
+ databaseId: string;
1368
+ collectionId: string;
1369
+ key: string;
1370
+ required: boolean;
1371
+ xdefault?: any[];
1372
+ overrideForCli?: boolean;
1373
+ parseOutput?: boolean;
1374
+ sdk?: Client;
1375
+ }
1499
1376
 
1500
- /**
1501
- * @param {DatabasesCreatePointAttributeRequestParams} params
1502
- */
1503
- const databasesCreatePointAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1377
+ export const databasesCreatePointAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreatePointAttributeRequestParams): Promise<any> => {
1504
1378
  let client = !sdk ? await sdkForProject() :
1505
1379
  sdk;
1506
1380
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1529,23 +1403,19 @@ const databasesCreatePointAttribute = async ({databaseId,collectionId,key,requir
1529
1403
  return response;
1530
1404
 
1531
1405
  }
1532
- /**
1533
- * @typedef {Object} DatabasesUpdatePointAttributeRequestParams
1534
- * @property {string} databaseId Database ID.
1535
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
1536
- * @property {string} key Attribute Key.
1537
- * @property {boolean} required Is attribute required?
1538
- * @property {any[]} xdefault Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
1539
- * @property {string} newKey New attribute key.
1540
- * @property {boolean} overrideForCli
1541
- * @property {boolean} parseOutput
1542
- * @property {libClient | undefined} sdk
1543
- */
1406
+ interface DatabasesUpdatePointAttributeRequestParams {
1407
+ databaseId: string;
1408
+ collectionId: string;
1409
+ key: string;
1410
+ required: boolean;
1411
+ xdefault?: any[];
1412
+ newKey?: string;
1413
+ overrideForCli?: boolean;
1414
+ parseOutput?: boolean;
1415
+ sdk?: Client;
1416
+ }
1544
1417
 
1545
- /**
1546
- * @param {DatabasesUpdatePointAttributeRequestParams} params
1547
- */
1548
- const databasesUpdatePointAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1418
+ export const databasesUpdatePointAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdatePointAttributeRequestParams): Promise<any> => {
1549
1419
  let client = !sdk ? await sdkForProject() :
1550
1420
  sdk;
1551
1421
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1574,22 +1444,18 @@ const databasesUpdatePointAttribute = async ({databaseId,collectionId,key,requir
1574
1444
  return response;
1575
1445
 
1576
1446
  }
1577
- /**
1578
- * @typedef {Object} DatabasesCreatePolygonAttributeRequestParams
1579
- * @property {string} databaseId Database ID.
1580
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1581
- * @property {string} key Attribute Key.
1582
- * @property {boolean} required Is attribute required?
1583
- * @property {any[]} xdefault Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
1584
- * @property {boolean} overrideForCli
1585
- * @property {boolean} parseOutput
1586
- * @property {libClient | undefined} sdk
1587
- */
1447
+ interface DatabasesCreatePolygonAttributeRequestParams {
1448
+ databaseId: string;
1449
+ collectionId: string;
1450
+ key: string;
1451
+ required: boolean;
1452
+ xdefault?: any[];
1453
+ overrideForCli?: boolean;
1454
+ parseOutput?: boolean;
1455
+ sdk?: Client;
1456
+ }
1588
1457
 
1589
- /**
1590
- * @param {DatabasesCreatePolygonAttributeRequestParams} params
1591
- */
1592
- const databasesCreatePolygonAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1458
+ export const databasesCreatePolygonAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreatePolygonAttributeRequestParams): Promise<any> => {
1593
1459
  let client = !sdk ? await sdkForProject() :
1594
1460
  sdk;
1595
1461
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1618,23 +1484,19 @@ const databasesCreatePolygonAttribute = async ({databaseId,collectionId,key,requ
1618
1484
  return response;
1619
1485
 
1620
1486
  }
1621
- /**
1622
- * @typedef {Object} DatabasesUpdatePolygonAttributeRequestParams
1623
- * @property {string} databaseId Database ID.
1624
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
1625
- * @property {string} key Attribute Key.
1626
- * @property {boolean} required Is attribute required?
1627
- * @property {any[]} xdefault Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
1628
- * @property {string} newKey New attribute key.
1629
- * @property {boolean} overrideForCli
1630
- * @property {boolean} parseOutput
1631
- * @property {libClient | undefined} sdk
1632
- */
1487
+ interface DatabasesUpdatePolygonAttributeRequestParams {
1488
+ databaseId: string;
1489
+ collectionId: string;
1490
+ key: string;
1491
+ required: boolean;
1492
+ xdefault?: any[];
1493
+ newKey?: string;
1494
+ overrideForCli?: boolean;
1495
+ parseOutput?: boolean;
1496
+ sdk?: Client;
1497
+ }
1633
1498
 
1634
- /**
1635
- * @param {DatabasesUpdatePolygonAttributeRequestParams} params
1636
- */
1637
- const databasesUpdatePolygonAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1499
+ export const databasesUpdatePolygonAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdatePolygonAttributeRequestParams): Promise<any> => {
1638
1500
  let client = !sdk ? await sdkForProject() :
1639
1501
  sdk;
1640
1502
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1663,25 +1525,21 @@ const databasesUpdatePolygonAttribute = async ({databaseId,collectionId,key,requ
1663
1525
  return response;
1664
1526
 
1665
1527
  }
1666
- /**
1667
- * @typedef {Object} DatabasesCreateRelationshipAttributeRequestParams
1668
- * @property {string} databaseId Database ID.
1669
- * @property {string} collectionId Collection ID.
1670
- * @property {string} relatedCollectionId Related Collection ID.
1671
- * @property {RelationshipType} type Relation type
1672
- * @property {boolean} twoWay Is Two Way?
1673
- * @property {string} key Attribute Key.
1674
- * @property {string} twoWayKey Two Way Attribute Key.
1675
- * @property {RelationMutate} onDelete Constraints option
1676
- * @property {boolean} overrideForCli
1677
- * @property {boolean} parseOutput
1678
- * @property {libClient | undefined} sdk
1679
- */
1528
+ interface DatabasesCreateRelationshipAttributeRequestParams {
1529
+ databaseId: string;
1530
+ collectionId: string;
1531
+ relatedCollectionId: string;
1532
+ type: RelationshipType;
1533
+ twoWay?: boolean;
1534
+ key?: string;
1535
+ twoWayKey?: string;
1536
+ onDelete?: RelationMutate;
1537
+ overrideForCli?: boolean;
1538
+ parseOutput?: boolean;
1539
+ sdk?: Client;
1540
+ }
1680
1541
 
1681
- /**
1682
- * @param {DatabasesCreateRelationshipAttributeRequestParams} params
1683
- */
1684
- const databasesCreateRelationshipAttribute = async ({databaseId,collectionId,relatedCollectionId,type,twoWay,key,twoWayKey,onDelete,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1542
+ export const databasesCreateRelationshipAttribute = async ({databaseId,collectionId,relatedCollectionId,type,twoWay,key,twoWayKey,onDelete,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateRelationshipAttributeRequestParams): Promise<any> => {
1685
1543
  let client = !sdk ? await sdkForProject() :
1686
1544
  sdk;
1687
1545
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1718,25 +1576,21 @@ const databasesCreateRelationshipAttribute = async ({databaseId,collectionId,rel
1718
1576
  return response;
1719
1577
 
1720
1578
  }
1721
- /**
1722
- * @typedef {Object} DatabasesCreateStringAttributeRequestParams
1723
- * @property {string} databaseId Database ID.
1724
- * @property {string} collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1725
- * @property {string} key Attribute Key.
1726
- * @property {number} size Attribute size for text attributes, in number of characters.
1727
- * @property {boolean} required Is attribute required?
1728
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1729
- * @property {boolean} array Is attribute an array?
1730
- * @property {boolean} encrypt Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.
1731
- * @property {boolean} overrideForCli
1732
- * @property {boolean} parseOutput
1733
- * @property {libClient | undefined} sdk
1734
- */
1579
+ interface DatabasesCreateStringAttributeRequestParams {
1580
+ databaseId: string;
1581
+ collectionId: string;
1582
+ key: string;
1583
+ size: number;
1584
+ required: boolean;
1585
+ xdefault?: string;
1586
+ array?: boolean;
1587
+ encrypt?: boolean;
1588
+ overrideForCli?: boolean;
1589
+ parseOutput?: boolean;
1590
+ sdk?: Client;
1591
+ }
1735
1592
 
1736
- /**
1737
- * @param {DatabasesCreateStringAttributeRequestParams} params
1738
- */
1739
- const databasesCreateStringAttribute = async ({databaseId,collectionId,key,size,required,xdefault,array,encrypt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1593
+ export const databasesCreateStringAttribute = async ({databaseId,collectionId,key,size,required,xdefault,array,encrypt,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateStringAttributeRequestParams): Promise<any> => {
1740
1594
  let client = !sdk ? await sdkForProject() :
1741
1595
  sdk;
1742
1596
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1773,24 +1627,20 @@ const databasesCreateStringAttribute = async ({databaseId,collectionId,key,size,
1773
1627
  return response;
1774
1628
 
1775
1629
  }
1776
- /**
1777
- * @typedef {Object} DatabasesUpdateStringAttributeRequestParams
1778
- * @property {string} databaseId Database ID.
1779
- * @property {string} collectionId Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1780
- * @property {string} key Attribute Key.
1781
- * @property {boolean} required Is attribute required?
1782
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1783
- * @property {number} size Maximum size of the string attribute.
1784
- * @property {string} newKey New Attribute Key.
1785
- * @property {boolean} overrideForCli
1786
- * @property {boolean} parseOutput
1787
- * @property {libClient | undefined} sdk
1788
- */
1630
+ interface DatabasesUpdateStringAttributeRequestParams {
1631
+ databaseId: string;
1632
+ collectionId: string;
1633
+ key: string;
1634
+ required: boolean;
1635
+ xdefault: string;
1636
+ size?: number;
1637
+ newKey?: string;
1638
+ overrideForCli?: boolean;
1639
+ parseOutput?: boolean;
1640
+ sdk?: Client;
1641
+ }
1789
1642
 
1790
- /**
1791
- * @param {DatabasesUpdateStringAttributeRequestParams} params
1792
- */
1793
- const databasesUpdateStringAttribute = async ({databaseId,collectionId,key,required,xdefault,size,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1643
+ export const databasesUpdateStringAttribute = async ({databaseId,collectionId,key,required,xdefault,size,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateStringAttributeRequestParams): Promise<any> => {
1794
1644
  let client = !sdk ? await sdkForProject() :
1795
1645
  sdk;
1796
1646
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1821,23 +1671,19 @@ const databasesUpdateStringAttribute = async ({databaseId,collectionId,key,requi
1821
1671
  return response;
1822
1672
 
1823
1673
  }
1824
- /**
1825
- * @typedef {Object} DatabasesCreateUrlAttributeRequestParams
1826
- * @property {string} databaseId Database ID.
1827
- * @property {string} collectionId Collection ID.
1828
- * @property {string} key Attribute Key.
1829
- * @property {boolean} required Is attribute required?
1830
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1831
- * @property {boolean} array Is attribute an array?
1832
- * @property {boolean} overrideForCli
1833
- * @property {boolean} parseOutput
1834
- * @property {libClient | undefined} sdk
1835
- */
1674
+ interface DatabasesCreateUrlAttributeRequestParams {
1675
+ databaseId: string;
1676
+ collectionId: string;
1677
+ key: string;
1678
+ required: boolean;
1679
+ xdefault?: string;
1680
+ array?: boolean;
1681
+ overrideForCli?: boolean;
1682
+ parseOutput?: boolean;
1683
+ sdk?: Client;
1684
+ }
1836
1685
 
1837
- /**
1838
- * @param {DatabasesCreateUrlAttributeRequestParams} params
1839
- */
1840
- const databasesCreateUrlAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1686
+ export const databasesCreateUrlAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateUrlAttributeRequestParams): Promise<any> => {
1841
1687
  let client = !sdk ? await sdkForProject() :
1842
1688
  sdk;
1843
1689
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -1868,23 +1714,19 @@ const databasesCreateUrlAttribute = async ({databaseId,collectionId,key,required
1868
1714
  return response;
1869
1715
 
1870
1716
  }
1871
- /**
1872
- * @typedef {Object} DatabasesUpdateUrlAttributeRequestParams
1873
- * @property {string} databaseId Database ID.
1874
- * @property {string} collectionId Collection ID.
1875
- * @property {string} key Attribute Key.
1876
- * @property {boolean} required Is attribute required?
1877
- * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1878
- * @property {string} newKey New Attribute Key.
1879
- * @property {boolean} overrideForCli
1880
- * @property {boolean} parseOutput
1881
- * @property {libClient | undefined} sdk
1882
- */
1717
+ interface DatabasesUpdateUrlAttributeRequestParams {
1718
+ databaseId: string;
1719
+ collectionId: string;
1720
+ key: string;
1721
+ required: boolean;
1722
+ xdefault: string;
1723
+ newKey?: string;
1724
+ overrideForCli?: boolean;
1725
+ parseOutput?: boolean;
1726
+ sdk?: Client;
1727
+ }
1883
1728
 
1884
- /**
1885
- * @param {DatabasesUpdateUrlAttributeRequestParams} params
1886
- */
1887
- const databasesUpdateUrlAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1729
+ export const databasesUpdateUrlAttribute = async ({databaseId,collectionId,key,required,xdefault,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateUrlAttributeRequestParams): Promise<any> => {
1888
1730
  let client = !sdk ? await sdkForProject() :
1889
1731
  sdk;
1890
1732
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1912,20 +1754,16 @@ const databasesUpdateUrlAttribute = async ({databaseId,collectionId,key,required
1912
1754
  return response;
1913
1755
 
1914
1756
  }
1915
- /**
1916
- * @typedef {Object} DatabasesGetAttributeRequestParams
1917
- * @property {string} databaseId Database ID.
1918
- * @property {string} collectionId Collection ID.
1919
- * @property {string} key Attribute Key.
1920
- * @property {boolean} overrideForCli
1921
- * @property {boolean} parseOutput
1922
- * @property {libClient | undefined} sdk
1923
- */
1757
+ interface DatabasesGetAttributeRequestParams {
1758
+ databaseId: string;
1759
+ collectionId: string;
1760
+ key: string;
1761
+ overrideForCli?: boolean;
1762
+ parseOutput?: boolean;
1763
+ sdk?: Client;
1764
+ }
1924
1765
 
1925
- /**
1926
- * @param {DatabasesGetAttributeRequestParams} params
1927
- */
1928
- const databasesGetAttribute = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1766
+ export const databasesGetAttribute = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesGetAttributeRequestParams): Promise<any> => {
1929
1767
  let client = !sdk ? await sdkForProject() :
1930
1768
  sdk;
1931
1769
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1943,20 +1781,16 @@ const databasesGetAttribute = async ({databaseId,collectionId,key,parseOutput =
1943
1781
  return response;
1944
1782
 
1945
1783
  }
1946
- /**
1947
- * @typedef {Object} DatabasesDeleteAttributeRequestParams
1948
- * @property {string} databaseId Database ID.
1949
- * @property {string} collectionId Collection ID.
1950
- * @property {string} key Attribute Key.
1951
- * @property {boolean} overrideForCli
1952
- * @property {boolean} parseOutput
1953
- * @property {libClient | undefined} sdk
1954
- */
1784
+ interface DatabasesDeleteAttributeRequestParams {
1785
+ databaseId: string;
1786
+ collectionId: string;
1787
+ key: string;
1788
+ overrideForCli?: boolean;
1789
+ parseOutput?: boolean;
1790
+ sdk?: Client;
1791
+ }
1955
1792
 
1956
- /**
1957
- * @param {DatabasesDeleteAttributeRequestParams} params
1958
- */
1959
- const databasesDeleteAttribute = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1793
+ export const databasesDeleteAttribute = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesDeleteAttributeRequestParams): Promise<any> => {
1960
1794
  let client = !sdk ? await sdkForProject() :
1961
1795
  sdk;
1962
1796
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -1975,22 +1809,18 @@ const databasesDeleteAttribute = async ({databaseId,collectionId,key,parseOutput
1975
1809
  return response;
1976
1810
 
1977
1811
  }
1978
- /**
1979
- * @typedef {Object} DatabasesUpdateRelationshipAttributeRequestParams
1980
- * @property {string} databaseId Database ID.
1981
- * @property {string} collectionId Collection ID.
1982
- * @property {string} key Attribute Key.
1983
- * @property {RelationMutate} onDelete Constraints option
1984
- * @property {string} newKey New Attribute Key.
1985
- * @property {boolean} overrideForCli
1986
- * @property {boolean} parseOutput
1987
- * @property {libClient | undefined} sdk
1988
- */
1812
+ interface DatabasesUpdateRelationshipAttributeRequestParams {
1813
+ databaseId: string;
1814
+ collectionId: string;
1815
+ key: string;
1816
+ onDelete?: RelationMutate;
1817
+ newKey?: string;
1818
+ overrideForCli?: boolean;
1819
+ parseOutput?: boolean;
1820
+ sdk?: Client;
1821
+ }
1989
1822
 
1990
- /**
1991
- * @param {DatabasesUpdateRelationshipAttributeRequestParams} params
1992
- */
1993
- const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key,onDelete,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1823
+ export const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key,onDelete,newKey,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateRelationshipAttributeRequestParams): Promise<any> => {
1994
1824
  let client = !sdk ? await sdkForProject() :
1995
1825
  sdk;
1996
1826
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -2015,22 +1845,19 @@ const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key
2015
1845
  return response;
2016
1846
 
2017
1847
  }
2018
- /**
2019
- * @typedef {Object} DatabasesListDocumentsRequestParams
2020
- * @property {string} databaseId Database ID.
2021
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2022
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
2023
- * @property {string} transactionId Transaction ID to read uncommitted changes within the transaction.
2024
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
2025
- * @property {boolean} overrideForCli
2026
- * @property {boolean} parseOutput
2027
- * @property {libClient | undefined} sdk
2028
- */
1848
+ interface DatabasesListDocumentsRequestParams {
1849
+ databaseId: string;
1850
+ collectionId: string;
1851
+ queries?: string[];
1852
+ transactionId?: string;
1853
+ total?: boolean;
1854
+ overrideForCli?: boolean;
1855
+ parseOutput?: boolean;
1856
+ sdk?: Client;
1857
+ console?: boolean;
1858
+ }
2029
1859
 
2030
- /**
2031
- * @param {DatabasesListDocumentsRequestParams} params
2032
- */
2033
- const databasesListDocuments = async ({databaseId,collectionId,queries,transactionId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1860
+ export const databasesListDocuments = async ({databaseId,collectionId,queries,transactionId,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesListDocumentsRequestParams): Promise<any> => {
2034
1861
  let client = !sdk ? await sdkForProject() :
2035
1862
  sdk;
2036
1863
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -2051,7 +1878,7 @@ const databasesListDocuments = async ({databaseId,collectionId,queries,transacti
2051
1878
  }, payload);
2052
1879
 
2053
1880
  if (parseOutput) {
2054
- if(console) {
1881
+ if(showConsole) {
2055
1882
  showConsoleLink('databases', 'listDocuments', databaseId, collectionId);
2056
1883
  } else {
2057
1884
  parse(response)
@@ -2061,23 +1888,19 @@ const databasesListDocuments = async ({databaseId,collectionId,queries,transacti
2061
1888
  return response;
2062
1889
 
2063
1890
  }
2064
- /**
2065
- * @typedef {Object} DatabasesCreateDocumentRequestParams
2066
- * @property {string} databaseId Database ID.
2067
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
2068
- * @property {string} documentId Document ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
2069
- * @property {object} data Document data as JSON object.
2070
- * @property {string[]} permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
2071
- * @property {string} transactionId Transaction ID for staging the operation.
2072
- * @property {boolean} overrideForCli
2073
- * @property {boolean} parseOutput
2074
- * @property {libClient | undefined} sdk
2075
- */
1891
+ interface DatabasesCreateDocumentRequestParams {
1892
+ databaseId: string;
1893
+ collectionId: string;
1894
+ documentId: string;
1895
+ data: object;
1896
+ permissions?: string[];
1897
+ transactionId?: string;
1898
+ overrideForCli?: boolean;
1899
+ parseOutput?: boolean;
1900
+ sdk?: Client;
1901
+ }
2076
1902
 
2077
- /**
2078
- * @param {DatabasesCreateDocumentRequestParams} params
2079
- */
2080
- const databasesCreateDocument = async ({databaseId,collectionId,documentId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1903
+ export const databasesCreateDocument = async ({databaseId,collectionId,documentId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateDocumentRequestParams): Promise<any> => {
2081
1904
  let client = !sdk ? await sdkForProject() :
2082
1905
  sdk;
2083
1906
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -2109,21 +1932,17 @@ const databasesCreateDocument = async ({databaseId,collectionId,documentId,data,
2109
1932
  return response;
2110
1933
 
2111
1934
  }
2112
- /**
2113
- * @typedef {Object} DatabasesCreateDocumentsRequestParams
2114
- * @property {string} databaseId Database ID.
2115
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
2116
- * @property {object[]} documents Array of documents data as JSON objects.
2117
- * @property {string} transactionId Transaction ID for staging the operation.
2118
- * @property {boolean} overrideForCli
2119
- * @property {boolean} parseOutput
2120
- * @property {libClient | undefined} sdk
2121
- */
1935
+ interface DatabasesCreateDocumentsRequestParams {
1936
+ databaseId: string;
1937
+ collectionId: string;
1938
+ documents: object[];
1939
+ transactionId?: string;
1940
+ overrideForCli?: boolean;
1941
+ parseOutput?: boolean;
1942
+ sdk?: Client;
1943
+ }
2122
1944
 
2123
- /**
2124
- * @param {DatabasesCreateDocumentsRequestParams} params
2125
- */
2126
- const databasesCreateDocuments = async ({databaseId,collectionId,documents,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1945
+ export const databasesCreateDocuments = async ({databaseId,collectionId,documents,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateDocumentsRequestParams): Promise<any> => {
2127
1946
  let client = !sdk ? await sdkForProject() :
2128
1947
  sdk;
2129
1948
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -2149,21 +1968,17 @@ const databasesCreateDocuments = async ({databaseId,collectionId,documents,trans
2149
1968
  return response;
2150
1969
 
2151
1970
  }
2152
- /**
2153
- * @typedef {Object} DatabasesUpsertDocumentsRequestParams
2154
- * @property {string} databaseId Database ID.
2155
- * @property {string} collectionId Collection ID.
2156
- * @property {object[]} documents Array of document data as JSON objects. May contain partial documents.
2157
- * @property {string} transactionId Transaction ID for staging the operation.
2158
- * @property {boolean} overrideForCli
2159
- * @property {boolean} parseOutput
2160
- * @property {libClient | undefined} sdk
2161
- */
1971
+ interface DatabasesUpsertDocumentsRequestParams {
1972
+ databaseId: string;
1973
+ collectionId: string;
1974
+ documents: object[];
1975
+ transactionId?: string;
1976
+ overrideForCli?: boolean;
1977
+ parseOutput?: boolean;
1978
+ sdk?: Client;
1979
+ }
2162
1980
 
2163
- /**
2164
- * @param {DatabasesUpsertDocumentsRequestParams} params
2165
- */
2166
- const databasesUpsertDocuments = async ({databaseId,collectionId,documents,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1981
+ export const databasesUpsertDocuments = async ({databaseId,collectionId,documents,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpsertDocumentsRequestParams): Promise<any> => {
2167
1982
  let client = !sdk ? await sdkForProject() :
2168
1983
  sdk;
2169
1984
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -2189,22 +2004,18 @@ const databasesUpsertDocuments = async ({databaseId,collectionId,documents,trans
2189
2004
  return response;
2190
2005
 
2191
2006
  }
2192
- /**
2193
- * @typedef {Object} DatabasesUpdateDocumentsRequestParams
2194
- * @property {string} databaseId Database ID.
2195
- * @property {string} collectionId Collection ID.
2196
- * @property {object} data Document data as JSON object. Include only attribute and value pairs to be updated.
2197
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
2198
- * @property {string} transactionId Transaction ID for staging the operation.
2199
- * @property {boolean} overrideForCli
2200
- * @property {boolean} parseOutput
2201
- * @property {libClient | undefined} sdk
2202
- */
2007
+ interface DatabasesUpdateDocumentsRequestParams {
2008
+ databaseId: string;
2009
+ collectionId: string;
2010
+ data?: object;
2011
+ queries?: string[];
2012
+ transactionId?: string;
2013
+ overrideForCli?: boolean;
2014
+ parseOutput?: boolean;
2015
+ sdk?: Client;
2016
+ }
2203
2017
 
2204
- /**
2205
- * @param {DatabasesUpdateDocumentsRequestParams} params
2206
- */
2207
- const databasesUpdateDocuments = async ({databaseId,collectionId,data,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2018
+ export const databasesUpdateDocuments = async ({databaseId,collectionId,data,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateDocumentsRequestParams): Promise<any> => {
2208
2019
  let client = !sdk ? await sdkForProject() :
2209
2020
  sdk;
2210
2021
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -2233,21 +2044,17 @@ const databasesUpdateDocuments = async ({databaseId,collectionId,data,queries,tr
2233
2044
  return response;
2234
2045
 
2235
2046
  }
2236
- /**
2237
- * @typedef {Object} DatabasesDeleteDocumentsRequestParams
2238
- * @property {string} databaseId Database ID.
2239
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2240
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
2241
- * @property {string} transactionId Transaction ID for staging the operation.
2242
- * @property {boolean} overrideForCli
2243
- * @property {boolean} parseOutput
2244
- * @property {libClient | undefined} sdk
2245
- */
2047
+ interface DatabasesDeleteDocumentsRequestParams {
2048
+ databaseId: string;
2049
+ collectionId: string;
2050
+ queries?: string[];
2051
+ transactionId?: string;
2052
+ overrideForCli?: boolean;
2053
+ parseOutput?: boolean;
2054
+ sdk?: Client;
2055
+ }
2246
2056
 
2247
- /**
2248
- * @param {DatabasesDeleteDocumentsRequestParams} params
2249
- */
2250
- const databasesDeleteDocuments = async ({databaseId,collectionId,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2057
+ export const databasesDeleteDocuments = async ({databaseId,collectionId,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesDeleteDocumentsRequestParams): Promise<any> => {
2251
2058
  let client = !sdk ? await sdkForProject() :
2252
2059
  sdk;
2253
2060
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -2273,22 +2080,19 @@ const databasesDeleteDocuments = async ({databaseId,collectionId,queries,transac
2273
2080
  return response;
2274
2081
 
2275
2082
  }
2276
- /**
2277
- * @typedef {Object} DatabasesGetDocumentRequestParams
2278
- * @property {string} databaseId Database ID.
2279
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2280
- * @property {string} documentId Document ID.
2281
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
2282
- * @property {string} transactionId Transaction ID to read uncommitted changes within the transaction.
2283
- * @property {boolean} overrideForCli
2284
- * @property {boolean} parseOutput
2285
- * @property {libClient | undefined} sdk
2286
- */
2083
+ interface DatabasesGetDocumentRequestParams {
2084
+ databaseId: string;
2085
+ collectionId: string;
2086
+ documentId: string;
2087
+ queries?: string[];
2088
+ transactionId?: string;
2089
+ overrideForCli?: boolean;
2090
+ parseOutput?: boolean;
2091
+ sdk?: Client;
2092
+ console?: boolean;
2093
+ }
2287
2094
 
2288
- /**
2289
- * @param {DatabasesGetDocumentRequestParams} params
2290
- */
2291
- const databasesGetDocument = async ({databaseId,collectionId,documentId,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2095
+ export const databasesGetDocument = async ({databaseId,collectionId,documentId,queries,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesGetDocumentRequestParams): Promise<any> => {
2292
2096
  let client = !sdk ? await sdkForProject() :
2293
2097
  sdk;
2294
2098
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
@@ -2306,7 +2110,7 @@ const databasesGetDocument = async ({databaseId,collectionId,documentId,queries,
2306
2110
  }, payload);
2307
2111
 
2308
2112
  if (parseOutput) {
2309
- if(console) {
2113
+ if(showConsole) {
2310
2114
  showConsoleLink('databases', 'getDocument', databaseId, collectionId, documentId);
2311
2115
  } else {
2312
2116
  parse(response)
@@ -2316,23 +2120,19 @@ const databasesGetDocument = async ({databaseId,collectionId,documentId,queries,
2316
2120
  return response;
2317
2121
 
2318
2122
  }
2319
- /**
2320
- * @typedef {Object} DatabasesUpsertDocumentRequestParams
2321
- * @property {string} databaseId Database ID.
2322
- * @property {string} collectionId Collection ID.
2323
- * @property {string} documentId Document ID.
2324
- * @property {object} data Document data as JSON object. Include all required attributes of the document to be created or updated.
2325
- * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2326
- * @property {string} transactionId Transaction ID for staging the operation.
2327
- * @property {boolean} overrideForCli
2328
- * @property {boolean} parseOutput
2329
- * @property {libClient | undefined} sdk
2330
- */
2123
+ interface DatabasesUpsertDocumentRequestParams {
2124
+ databaseId: string;
2125
+ collectionId: string;
2126
+ documentId: string;
2127
+ data?: object;
2128
+ permissions?: string[];
2129
+ transactionId?: string;
2130
+ overrideForCli?: boolean;
2131
+ parseOutput?: boolean;
2132
+ sdk?: Client;
2133
+ }
2331
2134
 
2332
- /**
2333
- * @param {DatabasesUpsertDocumentRequestParams} params
2334
- */
2335
- const databasesUpsertDocument = async ({databaseId,collectionId,documentId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2135
+ export const databasesUpsertDocument = async ({databaseId,collectionId,documentId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpsertDocumentRequestParams): Promise<any> => {
2336
2136
  let client = !sdk ? await sdkForProject() :
2337
2137
  sdk;
2338
2138
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
@@ -2361,23 +2161,19 @@ const databasesUpsertDocument = async ({databaseId,collectionId,documentId,data,
2361
2161
  return response;
2362
2162
 
2363
2163
  }
2364
- /**
2365
- * @typedef {Object} DatabasesUpdateDocumentRequestParams
2366
- * @property {string} databaseId Database ID.
2367
- * @property {string} collectionId Collection ID.
2368
- * @property {string} documentId Document ID.
2369
- * @property {object} data Document data as JSON object. Include only attribute and value pairs to be updated.
2370
- * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
2371
- * @property {string} transactionId Transaction ID for staging the operation.
2372
- * @property {boolean} overrideForCli
2373
- * @property {boolean} parseOutput
2374
- * @property {libClient | undefined} sdk
2375
- */
2164
+ interface DatabasesUpdateDocumentRequestParams {
2165
+ databaseId: string;
2166
+ collectionId: string;
2167
+ documentId: string;
2168
+ data?: object;
2169
+ permissions?: string[];
2170
+ transactionId?: string;
2171
+ overrideForCli?: boolean;
2172
+ parseOutput?: boolean;
2173
+ sdk?: Client;
2174
+ }
2376
2175
 
2377
- /**
2378
- * @param {DatabasesUpdateDocumentRequestParams} params
2379
- */
2380
- const databasesUpdateDocument = async ({databaseId,collectionId,documentId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2176
+ export const databasesUpdateDocument = async ({databaseId,collectionId,documentId,data,permissions,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesUpdateDocumentRequestParams): Promise<any> => {
2381
2177
  let client = !sdk ? await sdkForProject() :
2382
2178
  sdk;
2383
2179
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
@@ -2406,21 +2202,17 @@ const databasesUpdateDocument = async ({databaseId,collectionId,documentId,data,
2406
2202
  return response;
2407
2203
 
2408
2204
  }
2409
- /**
2410
- * @typedef {Object} DatabasesDeleteDocumentRequestParams
2411
- * @property {string} databaseId Database ID.
2412
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2413
- * @property {string} documentId Document ID.
2414
- * @property {string} transactionId Transaction ID for staging the operation.
2415
- * @property {boolean} overrideForCli
2416
- * @property {boolean} parseOutput
2417
- * @property {libClient | undefined} sdk
2418
- */
2205
+ interface DatabasesDeleteDocumentRequestParams {
2206
+ databaseId: string;
2207
+ collectionId: string;
2208
+ documentId: string;
2209
+ transactionId?: string;
2210
+ overrideForCli?: boolean;
2211
+ parseOutput?: boolean;
2212
+ sdk?: Client;
2213
+ }
2419
2214
 
2420
- /**
2421
- * @param {DatabasesDeleteDocumentRequestParams} params
2422
- */
2423
- const databasesDeleteDocument = async ({databaseId,collectionId,documentId,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2215
+ export const databasesDeleteDocument = async ({databaseId,collectionId,documentId,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesDeleteDocumentRequestParams): Promise<any> => {
2424
2216
  let client = !sdk ? await sdkForProject() :
2425
2217
  sdk;
2426
2218
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
@@ -2442,21 +2234,17 @@ const databasesDeleteDocument = async ({databaseId,collectionId,documentId,trans
2442
2234
  return response;
2443
2235
 
2444
2236
  }
2445
- /**
2446
- * @typedef {Object} DatabasesListDocumentLogsRequestParams
2447
- * @property {string} databaseId Database ID.
2448
- * @property {string} collectionId Collection ID.
2449
- * @property {string} documentId Document ID.
2450
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
2451
- * @property {boolean} overrideForCli
2452
- * @property {boolean} parseOutput
2453
- * @property {libClient | undefined} sdk
2454
- */
2237
+ interface DatabasesListDocumentLogsRequestParams {
2238
+ databaseId: string;
2239
+ collectionId: string;
2240
+ documentId: string;
2241
+ queries?: string[];
2242
+ overrideForCli?: boolean;
2243
+ parseOutput?: boolean;
2244
+ sdk?: Client;
2245
+ }
2455
2246
 
2456
- /**
2457
- * @param {DatabasesListDocumentLogsRequestParams} params
2458
- */
2459
- const databasesListDocumentLogs = async ({databaseId,collectionId,documentId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2247
+ export const databasesListDocumentLogs = async ({databaseId,collectionId,documentId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesListDocumentLogsRequestParams): Promise<any> => {
2460
2248
  let client = !sdk ? await sdkForProject() :
2461
2249
  sdk;
2462
2250
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
@@ -2477,24 +2265,20 @@ const databasesListDocumentLogs = async ({databaseId,collectionId,documentId,que
2477
2265
  return response;
2478
2266
 
2479
2267
  }
2480
- /**
2481
- * @typedef {Object} DatabasesDecrementDocumentAttributeRequestParams
2482
- * @property {string} databaseId Database ID.
2483
- * @property {string} collectionId Collection ID.
2484
- * @property {string} documentId Document ID.
2485
- * @property {string} attribute Attribute key.
2486
- * @property {number} value Value to increment the attribute by. The value must be a number.
2487
- * @property {number} min Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
2488
- * @property {string} transactionId Transaction ID for staging the operation.
2489
- * @property {boolean} overrideForCli
2490
- * @property {boolean} parseOutput
2491
- * @property {libClient | undefined} sdk
2492
- */
2268
+ interface DatabasesDecrementDocumentAttributeRequestParams {
2269
+ databaseId: string;
2270
+ collectionId: string;
2271
+ documentId: string;
2272
+ attribute: string;
2273
+ value?: number;
2274
+ min?: number;
2275
+ transactionId?: string;
2276
+ overrideForCli?: boolean;
2277
+ parseOutput?: boolean;
2278
+ sdk?: Client;
2279
+ }
2493
2280
 
2494
- /**
2495
- * @param {DatabasesDecrementDocumentAttributeRequestParams} params
2496
- */
2497
- const databasesDecrementDocumentAttribute = async ({databaseId,collectionId,documentId,attribute,value,min,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2281
+ export const databasesDecrementDocumentAttribute = async ({databaseId,collectionId,documentId,attribute,value,min,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesDecrementDocumentAttributeRequestParams): Promise<any> => {
2498
2282
  let client = !sdk ? await sdkForProject() :
2499
2283
  sdk;
2500
2284
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
@@ -2522,24 +2306,20 @@ const databasesDecrementDocumentAttribute = async ({databaseId,collectionId,docu
2522
2306
  return response;
2523
2307
 
2524
2308
  }
2525
- /**
2526
- * @typedef {Object} DatabasesIncrementDocumentAttributeRequestParams
2527
- * @property {string} databaseId Database ID.
2528
- * @property {string} collectionId Collection ID.
2529
- * @property {string} documentId Document ID.
2530
- * @property {string} attribute Attribute key.
2531
- * @property {number} value Value to increment the attribute by. The value must be a number.
2532
- * @property {number} max Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
2533
- * @property {string} transactionId Transaction ID for staging the operation.
2534
- * @property {boolean} overrideForCli
2535
- * @property {boolean} parseOutput
2536
- * @property {libClient | undefined} sdk
2537
- */
2309
+ interface DatabasesIncrementDocumentAttributeRequestParams {
2310
+ databaseId: string;
2311
+ collectionId: string;
2312
+ documentId: string;
2313
+ attribute: string;
2314
+ value?: number;
2315
+ max?: number;
2316
+ transactionId?: string;
2317
+ overrideForCli?: boolean;
2318
+ parseOutput?: boolean;
2319
+ sdk?: Client;
2320
+ }
2538
2321
 
2539
- /**
2540
- * @param {DatabasesIncrementDocumentAttributeRequestParams} params
2541
- */
2542
- const databasesIncrementDocumentAttribute = async ({databaseId,collectionId,documentId,attribute,value,max,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2322
+ export const databasesIncrementDocumentAttribute = async ({databaseId,collectionId,documentId,attribute,value,max,transactionId,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesIncrementDocumentAttributeRequestParams): Promise<any> => {
2543
2323
  let client = !sdk ? await sdkForProject() :
2544
2324
  sdk;
2545
2325
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
@@ -2567,21 +2347,18 @@ const databasesIncrementDocumentAttribute = async ({databaseId,collectionId,docu
2567
2347
  return response;
2568
2348
 
2569
2349
  }
2570
- /**
2571
- * @typedef {Object} DatabasesListIndexesRequestParams
2572
- * @property {string} databaseId Database ID.
2573
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2574
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error
2575
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
2576
- * @property {boolean} overrideForCli
2577
- * @property {boolean} parseOutput
2578
- * @property {libClient | undefined} sdk
2579
- */
2350
+ interface DatabasesListIndexesRequestParams {
2351
+ databaseId: string;
2352
+ collectionId: string;
2353
+ queries?: string[];
2354
+ total?: boolean;
2355
+ overrideForCli?: boolean;
2356
+ parseOutput?: boolean;
2357
+ sdk?: Client;
2358
+ console?: boolean;
2359
+ }
2580
2360
 
2581
- /**
2582
- * @param {DatabasesListIndexesRequestParams} params
2583
- */
2584
- const databasesListIndexes = async ({databaseId,collectionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2361
+ export const databasesListIndexes = async ({databaseId,collectionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console: showConsole}: DatabasesListIndexesRequestParams): Promise<any> => {
2585
2362
  let client = !sdk ? await sdkForProject() :
2586
2363
  sdk;
2587
2364
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -2599,7 +2376,7 @@ const databasesListIndexes = async ({databaseId,collectionId,queries,total,parse
2599
2376
  }, payload);
2600
2377
 
2601
2378
  if (parseOutput) {
2602
- if(console) {
2379
+ if(showConsole) {
2603
2380
  showConsoleLink('databases', 'listIndexes', databaseId, collectionId);
2604
2381
  } else {
2605
2382
  parse(response)
@@ -2609,24 +2386,20 @@ const databasesListIndexes = async ({databaseId,collectionId,queries,total,parse
2609
2386
  return response;
2610
2387
 
2611
2388
  }
2612
- /**
2613
- * @typedef {Object} DatabasesCreateIndexRequestParams
2614
- * @property {string} databaseId Database ID.
2615
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2616
- * @property {string} key Index Key.
2617
- * @property {IndexType} type Index type.
2618
- * @property {string[]} attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
2619
- * @property {string[]} orders Array of index orders. Maximum of 100 orders are allowed.
2620
- * @property {number[]} lengths Length of index. Maximum of 100
2621
- * @property {boolean} overrideForCli
2622
- * @property {boolean} parseOutput
2623
- * @property {libClient | undefined} sdk
2624
- */
2389
+ interface DatabasesCreateIndexRequestParams {
2390
+ databaseId: string;
2391
+ collectionId: string;
2392
+ key: string;
2393
+ type: IndexType;
2394
+ attributes: string[];
2395
+ orders?: string[];
2396
+ lengths?: number[];
2397
+ overrideForCli?: boolean;
2398
+ parseOutput?: boolean;
2399
+ sdk?: Client;
2400
+ }
2625
2401
 
2626
- /**
2627
- * @param {DatabasesCreateIndexRequestParams} params
2628
- */
2629
- const databasesCreateIndex = async ({databaseId,collectionId,key,type,attributes,orders,lengths,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2402
+ export const databasesCreateIndex = async ({databaseId,collectionId,key,type,attributes,orders,lengths,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesCreateIndexRequestParams): Promise<any> => {
2630
2403
  let client = !sdk ? await sdkForProject() :
2631
2404
  sdk;
2632
2405
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -2663,20 +2436,16 @@ const databasesCreateIndex = async ({databaseId,collectionId,key,type,attributes
2663
2436
  return response;
2664
2437
 
2665
2438
  }
2666
- /**
2667
- * @typedef {Object} DatabasesGetIndexRequestParams
2668
- * @property {string} databaseId Database ID.
2669
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2670
- * @property {string} key Index Key.
2671
- * @property {boolean} overrideForCli
2672
- * @property {boolean} parseOutput
2673
- * @property {libClient | undefined} sdk
2674
- */
2439
+ interface DatabasesGetIndexRequestParams {
2440
+ databaseId: string;
2441
+ collectionId: string;
2442
+ key: string;
2443
+ overrideForCli?: boolean;
2444
+ parseOutput?: boolean;
2445
+ sdk?: Client;
2446
+ }
2675
2447
 
2676
- /**
2677
- * @param {DatabasesGetIndexRequestParams} params
2678
- */
2679
- const databasesGetIndex = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2448
+ export const databasesGetIndex = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesGetIndexRequestParams): Promise<any> => {
2680
2449
  let client = !sdk ? await sdkForProject() :
2681
2450
  sdk;
2682
2451
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -2694,20 +2463,16 @@ const databasesGetIndex = async ({databaseId,collectionId,key,parseOutput = true
2694
2463
  return response;
2695
2464
 
2696
2465
  }
2697
- /**
2698
- * @typedef {Object} DatabasesDeleteIndexRequestParams
2699
- * @property {string} databaseId Database ID.
2700
- * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
2701
- * @property {string} key Index Key.
2702
- * @property {boolean} overrideForCli
2703
- * @property {boolean} parseOutput
2704
- * @property {libClient | undefined} sdk
2705
- */
2466
+ interface DatabasesDeleteIndexRequestParams {
2467
+ databaseId: string;
2468
+ collectionId: string;
2469
+ key: string;
2470
+ overrideForCli?: boolean;
2471
+ parseOutput?: boolean;
2472
+ sdk?: Client;
2473
+ }
2706
2474
 
2707
- /**
2708
- * @param {DatabasesDeleteIndexRequestParams} params
2709
- */
2710
- const databasesDeleteIndex = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2475
+ export const databasesDeleteIndex = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesDeleteIndexRequestParams): Promise<any> => {
2711
2476
  let client = !sdk ? await sdkForProject() :
2712
2477
  sdk;
2713
2478
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
@@ -2726,20 +2491,16 @@ const databasesDeleteIndex = async ({databaseId,collectionId,key,parseOutput = t
2726
2491
  return response;
2727
2492
 
2728
2493
  }
2729
- /**
2730
- * @typedef {Object} DatabasesListCollectionLogsRequestParams
2731
- * @property {string} databaseId Database ID.
2732
- * @property {string} collectionId Collection ID.
2733
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
2734
- * @property {boolean} overrideForCli
2735
- * @property {boolean} parseOutput
2736
- * @property {libClient | undefined} sdk
2737
- */
2494
+ interface DatabasesListCollectionLogsRequestParams {
2495
+ databaseId: string;
2496
+ collectionId: string;
2497
+ queries?: string[];
2498
+ overrideForCli?: boolean;
2499
+ parseOutput?: boolean;
2500
+ sdk?: Client;
2501
+ }
2738
2502
 
2739
- /**
2740
- * @param {DatabasesListCollectionLogsRequestParams} params
2741
- */
2742
- const databasesListCollectionLogs = async ({databaseId,collectionId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2503
+ export const databasesListCollectionLogs = async ({databaseId,collectionId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesListCollectionLogsRequestParams): Promise<any> => {
2743
2504
  let client = !sdk ? await sdkForProject() :
2744
2505
  sdk;
2745
2506
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -2760,20 +2521,16 @@ const databasesListCollectionLogs = async ({databaseId,collectionId,queries,pars
2760
2521
  return response;
2761
2522
 
2762
2523
  }
2763
- /**
2764
- * @typedef {Object} DatabasesGetCollectionUsageRequestParams
2765
- * @property {string} databaseId Database ID.
2766
- * @property {string} collectionId Collection ID.
2767
- * @property {UsageRange} range Date range.
2768
- * @property {boolean} overrideForCli
2769
- * @property {boolean} parseOutput
2770
- * @property {libClient | undefined} sdk
2771
- */
2524
+ interface DatabasesGetCollectionUsageRequestParams {
2525
+ databaseId: string;
2526
+ collectionId: string;
2527
+ range?: UsageRange;
2528
+ overrideForCli?: boolean;
2529
+ parseOutput?: boolean;
2530
+ sdk?: Client;
2531
+ }
2772
2532
 
2773
- /**
2774
- * @param {DatabasesGetCollectionUsageRequestParams} params
2775
- */
2776
- const databasesGetCollectionUsage = async ({databaseId,collectionId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2533
+ export const databasesGetCollectionUsage = async ({databaseId,collectionId,range,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesGetCollectionUsageRequestParams): Promise<any> => {
2777
2534
  let client = !sdk ? await sdkForProject() :
2778
2535
  sdk;
2779
2536
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
@@ -2794,19 +2551,15 @@ const databasesGetCollectionUsage = async ({databaseId,collectionId,range,parseO
2794
2551
  return response;
2795
2552
 
2796
2553
  }
2797
- /**
2798
- * @typedef {Object} DatabasesListLogsRequestParams
2799
- * @property {string} databaseId Database ID.
2800
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
2801
- * @property {boolean} overrideForCli
2802
- * @property {boolean} parseOutput
2803
- * @property {libClient | undefined} sdk
2804
- */
2554
+ interface DatabasesListLogsRequestParams {
2555
+ databaseId: string;
2556
+ queries?: string[];
2557
+ overrideForCli?: boolean;
2558
+ parseOutput?: boolean;
2559
+ sdk?: Client;
2560
+ }
2805
2561
 
2806
- /**
2807
- * @param {DatabasesListLogsRequestParams} params
2808
- */
2809
- const databasesListLogs = async ({databaseId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2562
+ export const databasesListLogs = async ({databaseId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesListLogsRequestParams): Promise<any> => {
2810
2563
  let client = !sdk ? await sdkForProject() :
2811
2564
  sdk;
2812
2565
  let apiPath = '/databases/{databaseId}/logs'.replace('{databaseId}', databaseId);
@@ -2827,19 +2580,15 @@ const databasesListLogs = async ({databaseId,queries,parseOutput = true, overrid
2827
2580
  return response;
2828
2581
 
2829
2582
  }
2830
- /**
2831
- * @typedef {Object} DatabasesGetUsageRequestParams
2832
- * @property {string} databaseId Database ID.
2833
- * @property {UsageRange} range Date range.
2834
- * @property {boolean} overrideForCli
2835
- * @property {boolean} parseOutput
2836
- * @property {libClient | undefined} sdk
2837
- */
2583
+ interface DatabasesGetUsageRequestParams {
2584
+ databaseId: string;
2585
+ range?: UsageRange;
2586
+ overrideForCli?: boolean;
2587
+ parseOutput?: boolean;
2588
+ sdk?: Client;
2589
+ }
2838
2590
 
2839
- /**
2840
- * @param {DatabasesGetUsageRequestParams} params
2841
- */
2842
- const databasesGetUsage = async ({databaseId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2591
+ export const databasesGetUsage = async ({databaseId,range,parseOutput = true, overrideForCli = false, sdk = undefined}: DatabasesGetUsageRequestParams): Promise<any> => {
2843
2592
  let client = !sdk ? await sdkForProject() :
2844
2593
  sdk;
2845
2594
  let apiPath = '/databases/{databaseId}/usage'.replace('{databaseId}', databaseId);
@@ -2865,7 +2614,7 @@ databases
2865
2614
  .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db list' instead] Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`)
2866
2615
  .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name`)
2867
2616
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2868
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
2617
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2869
2618
  .option(`--console`, `Get the resource console url`)
2870
2619
  .action(actionRunner(databasesList))
2871
2620
 
@@ -2874,7 +2623,7 @@ databases
2874
2623
  .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db create' instead] Create a new Database. `)
2875
2624
  .requiredOption(`--database-id <database-id>`, `Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2876
2625
  .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
2877
- .option(`--enabled [value]`, `Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
2626
+ .option(`--enabled [value]`, `Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2878
2627
  .action(actionRunner(databasesCreate))
2879
2628
 
2880
2629
  databases
@@ -2901,8 +2650,8 @@ databases
2901
2650
  .command(`update-transaction`)
2902
2651
  .description(`Update a transaction, to either commit or roll back its operations.`)
2903
2652
  .requiredOption(`--transaction-id <transaction-id>`, `Transaction ID.`)
2904
- .option(`--commit [value]`, `Commit transaction?`, (value) => value === undefined ? true : parseBool(value))
2905
- .option(`--rollback [value]`, `Rollback transaction?`, (value) => value === undefined ? true : parseBool(value))
2653
+ .option(`--commit [value]`, `Commit transaction?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2654
+ .option(`--rollback [value]`, `Rollback transaction?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2906
2655
  .action(actionRunner(databasesUpdateTransaction))
2907
2656
 
2908
2657
  databases
@@ -2937,7 +2686,7 @@ databases
2937
2686
  .description(`[**DEPRECATED** - This command is deprecated. Please use 'tables-db update' instead] Update a database by its unique ID.`)
2938
2687
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2939
2688
  .requiredOption(`--name <name>`, `Database name. Max length: 128 chars.`)
2940
- .option(`--enabled [value]`, `Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
2689
+ .option(`--enabled [value]`, `Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2941
2690
  .action(actionRunner(databasesUpdate))
2942
2691
 
2943
2692
  databases
@@ -2952,7 +2701,7 @@ databases
2952
2701
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
2953
2702
  .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity`)
2954
2703
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2955
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
2704
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2956
2705
  .option(`--console`, `Get the resource console url`)
2957
2706
  .action(actionRunner(databasesListCollections))
2958
2707
 
@@ -2963,8 +2712,10 @@ databases
2963
2712
  .requiredOption(`--collection-id <collection-id>`, `Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
2964
2713
  .requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
2965
2714
  .option(`--permissions [permissions...]`, `An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2966
- .option(`--document-security [value]`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value))
2967
- .option(`--enabled [value]`, `Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
2715
+ .option(`--document-security [value]`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2716
+ .option(`--enabled [value]`, `Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2717
+ .option(`--attributes [attributes...]`, `Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.`)
2718
+ .option(`--indexes [indexes...]`, `Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).`)
2968
2719
  .action(actionRunner(databasesCreateCollection))
2969
2720
 
2970
2721
  databases
@@ -2982,8 +2733,8 @@ databases
2982
2733
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
2983
2734
  .requiredOption(`--name <name>`, `Collection name. Max length: 128 chars.`)
2984
2735
  .option(`--permissions [permissions...]`, `An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
2985
- .option(`--document-security [value]`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value) => value === undefined ? true : parseBool(value))
2986
- .option(`--enabled [value]`, `Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
2736
+ .option(`--document-security [value]`, `Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2737
+ .option(`--enabled [value]`, `Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2987
2738
  .action(actionRunner(databasesUpdateCollection))
2988
2739
 
2989
2740
  databases
@@ -2999,7 +2750,7 @@ databases
2999
2750
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3000
2751
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3001
2752
  .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error`)
3002
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
2753
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3003
2754
  .option(`--console`, `Get the resource console url`)
3004
2755
  .action(actionRunner(databasesListAttributes))
3005
2756
 
@@ -3009,9 +2760,9 @@ databases
3009
2760
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3010
2761
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3011
2762
  .requiredOption(`--key <key>`, `Attribute Key.`)
3012
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3013
- .option(`--xdefault [value]`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, (value) => value === undefined ? true : parseBool(value))
3014
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2763
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2764
+ .option(`--xdefault [value]`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2765
+ .option(`--array [value]`, `Is attribute an array?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3015
2766
  .action(actionRunner(databasesCreateBooleanAttribute))
3016
2767
 
3017
2768
  databases
@@ -3020,8 +2771,8 @@ databases
3020
2771
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3021
2772
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
3022
2773
  .requiredOption(`--key <key>`, `Attribute Key.`)
3023
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3024
- .option(`--xdefault [value]`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, (value) => value === undefined ? true : parseBool(value))
2774
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
2775
+ .option(`--xdefault [value]`, `Default value for attribute when not provided. Cannot be set when attribute is required.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3025
2776
  .option(`--new-key <new-key>`, `New attribute key.`)
3026
2777
  .action(actionRunner(databasesUpdateBooleanAttribute))
3027
2778
 
@@ -3031,9 +2782,9 @@ databases
3031
2782
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3032
2783
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
3033
2784
  .requiredOption(`--key <key>`, `Attribute Key.`)
3034
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2785
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3035
2786
  .option(`--xdefault <xdefault>`, `Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.`)
3036
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2787
+ .option(`--array [value]`, `Is attribute an array?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3037
2788
  .action(actionRunner(databasesCreateDatetimeAttribute))
3038
2789
 
3039
2790
  databases
@@ -3042,7 +2793,7 @@ databases
3042
2793
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3043
2794
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3044
2795
  .requiredOption(`--key <key>`, `Attribute Key.`)
3045
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2796
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3046
2797
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3047
2798
  .option(`--new-key <new-key>`, `New attribute key.`)
3048
2799
  .action(actionRunner(databasesUpdateDatetimeAttribute))
@@ -3053,9 +2804,9 @@ databases
3053
2804
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3054
2805
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3055
2806
  .requiredOption(`--key <key>`, `Attribute Key.`)
3056
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2807
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3057
2808
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3058
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2809
+ .option(`--array [value]`, `Is attribute an array?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3059
2810
  .action(actionRunner(databasesCreateEmailAttribute))
3060
2811
 
3061
2812
  databases
@@ -3064,7 +2815,7 @@ databases
3064
2815
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3065
2816
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3066
2817
  .requiredOption(`--key <key>`, `Attribute Key.`)
3067
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2818
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3068
2819
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3069
2820
  .option(`--new-key <new-key>`, `New Attribute Key.`)
3070
2821
  .action(actionRunner(databasesUpdateEmailAttribute))
@@ -3076,9 +2827,9 @@ databases
3076
2827
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3077
2828
  .requiredOption(`--key <key>`, `Attribute Key.`)
3078
2829
  .requiredOption(`--elements [elements...]`, `Array of enum values.`)
3079
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2830
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3080
2831
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3081
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2832
+ .option(`--array [value]`, `Is attribute an array?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3082
2833
  .action(actionRunner(databasesCreateEnumAttribute))
3083
2834
 
3084
2835
  databases
@@ -3088,7 +2839,7 @@ databases
3088
2839
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3089
2840
  .requiredOption(`--key <key>`, `Attribute Key.`)
3090
2841
  .requiredOption(`--elements [elements...]`, `Updated list of enum values.`)
3091
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2842
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3092
2843
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3093
2844
  .option(`--new-key <new-key>`, `New Attribute Key.`)
3094
2845
  .action(actionRunner(databasesUpdateEnumAttribute))
@@ -3099,11 +2850,11 @@ databases
3099
2850
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3100
2851
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3101
2852
  .requiredOption(`--key <key>`, `Attribute Key.`)
3102
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2853
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3103
2854
  .option(`--min <min>`, `Minimum value.`, parseInteger)
3104
2855
  .option(`--max <max>`, `Maximum value.`, parseInteger)
3105
2856
  .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parseInteger)
3106
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2857
+ .option(`--array [value]`, `Is attribute an array?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3107
2858
  .action(actionRunner(databasesCreateFloatAttribute))
3108
2859
 
3109
2860
  databases
@@ -3112,7 +2863,7 @@ databases
3112
2863
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3113
2864
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3114
2865
  .requiredOption(`--key <key>`, `Attribute Key.`)
3115
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2866
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3116
2867
  .option(`--xdefault <xdefault>`, `Default value. Cannot be set when required.`, parseInteger)
3117
2868
  .option(`--min <min>`, `Minimum value.`, parseInteger)
3118
2869
  .option(`--max <max>`, `Maximum value.`, parseInteger)
@@ -3125,11 +2876,11 @@ databases
3125
2876
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3126
2877
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3127
2878
  .requiredOption(`--key <key>`, `Attribute Key.`)
3128
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2879
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3129
2880
  .option(`--min <min>`, `Minimum value`, parseInteger)
3130
2881
  .option(`--max <max>`, `Maximum value`, parseInteger)
3131
2882
  .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`, parseInteger)
3132
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2883
+ .option(`--array [value]`, `Is attribute an array?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3133
2884
  .action(actionRunner(databasesCreateIntegerAttribute))
3134
2885
 
3135
2886
  databases
@@ -3138,7 +2889,7 @@ databases
3138
2889
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3139
2890
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3140
2891
  .requiredOption(`--key <key>`, `Attribute Key.`)
3141
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2892
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3142
2893
  .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`, parseInteger)
3143
2894
  .option(`--min <min>`, `Minimum value`, parseInteger)
3144
2895
  .option(`--max <max>`, `Maximum value`, parseInteger)
@@ -3151,9 +2902,9 @@ databases
3151
2902
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3152
2903
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3153
2904
  .requiredOption(`--key <key>`, `Attribute Key.`)
3154
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2905
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3155
2906
  .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`)
3156
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
2907
+ .option(`--array [value]`, `Is attribute an array?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3157
2908
  .action(actionRunner(databasesCreateIpAttribute))
3158
2909
 
3159
2910
  databases
@@ -3162,7 +2913,7 @@ databases
3162
2913
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3163
2914
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3164
2915
  .requiredOption(`--key <key>`, `Attribute Key.`)
3165
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2916
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3166
2917
  .option(`--xdefault <xdefault>`, `Default value. Cannot be set when attribute is required.`)
3167
2918
  .option(`--new-key <new-key>`, `New Attribute Key.`)
3168
2919
  .action(actionRunner(databasesUpdateIpAttribute))
@@ -3173,7 +2924,7 @@ databases
3173
2924
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3174
2925
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3175
2926
  .requiredOption(`--key <key>`, `Attribute Key.`)
3176
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2927
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3177
2928
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`)
3178
2929
  .action(actionRunner(databasesCreateLineAttribute))
3179
2930
 
@@ -3183,7 +2934,7 @@ databases
3183
2934
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3184
2935
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
3185
2936
  .requiredOption(`--key <key>`, `Attribute Key.`)
3186
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2937
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3187
2938
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.`)
3188
2939
  .option(`--new-key <new-key>`, `New attribute key.`)
3189
2940
  .action(actionRunner(databasesUpdateLineAttribute))
@@ -3194,7 +2945,7 @@ databases
3194
2945
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3195
2946
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3196
2947
  .requiredOption(`--key <key>`, `Attribute Key.`)
3197
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2948
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3198
2949
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`)
3199
2950
  .action(actionRunner(databasesCreatePointAttribute))
3200
2951
 
@@ -3204,7 +2955,7 @@ databases
3204
2955
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3205
2956
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
3206
2957
  .requiredOption(`--key <key>`, `Attribute Key.`)
3207
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2958
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3208
2959
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.`)
3209
2960
  .option(`--new-key <new-key>`, `New attribute key.`)
3210
2961
  .action(actionRunner(databasesUpdatePointAttribute))
@@ -3215,7 +2966,7 @@ databases
3215
2966
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3216
2967
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3217
2968
  .requiredOption(`--key <key>`, `Attribute Key.`)
3218
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2969
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3219
2970
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`)
3220
2971
  .action(actionRunner(databasesCreatePolygonAttribute))
3221
2972
 
@@ -3225,7 +2976,7 @@ databases
3225
2976
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3226
2977
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).`)
3227
2978
  .requiredOption(`--key <key>`, `Attribute Key.`)
3228
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
2979
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3229
2980
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.`)
3230
2981
  .option(`--new-key <new-key>`, `New attribute key.`)
3231
2982
  .action(actionRunner(databasesUpdatePolygonAttribute))
@@ -3237,7 +2988,7 @@ databases
3237
2988
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3238
2989
  .requiredOption(`--related-collection-id <related-collection-id>`, `Related Collection ID.`)
3239
2990
  .requiredOption(`--type <type>`, `Relation type`)
3240
- .option(`--two-way [value]`, `Is Two Way?`, (value) => value === undefined ? true : parseBool(value))
2991
+ .option(`--two-way [value]`, `Is Two Way?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3241
2992
  .option(`--key <key>`, `Attribute Key.`)
3242
2993
  .option(`--two-way-key <two-way-key>`, `Two Way Attribute Key.`)
3243
2994
  .option(`--on-delete <on-delete>`, `Constraints option`)
@@ -3250,10 +3001,10 @@ databases
3250
3001
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3251
3002
  .requiredOption(`--key <key>`, `Attribute Key.`)
3252
3003
  .requiredOption(`--size <size>`, `Attribute size for text attributes, in number of characters.`, parseInteger)
3253
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3004
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3254
3005
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3255
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3256
- .option(`--encrypt [value]`, `Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.`, (value) => value === undefined ? true : parseBool(value))
3006
+ .option(`--array [value]`, `Is attribute an array?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3007
+ .option(`--encrypt [value]`, `Toggle encryption for the attribute. Encryption enhances security by not storing any plain text values in the database. However, encrypted attributes cannot be queried.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3257
3008
  .action(actionRunner(databasesCreateStringAttribute))
3258
3009
 
3259
3010
  databases
@@ -3262,7 +3013,7 @@ databases
3262
3013
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3263
3014
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3264
3015
  .requiredOption(`--key <key>`, `Attribute Key.`)
3265
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3016
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3266
3017
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3267
3018
  .option(`--size <size>`, `Maximum size of the string attribute.`, parseInteger)
3268
3019
  .option(`--new-key <new-key>`, `New Attribute Key.`)
@@ -3274,9 +3025,9 @@ databases
3274
3025
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3275
3026
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3276
3027
  .requiredOption(`--key <key>`, `Attribute Key.`)
3277
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3028
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3278
3029
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3279
- .option(`--array [value]`, `Is attribute an array?`, (value) => value === undefined ? true : parseBool(value))
3030
+ .option(`--array [value]`, `Is attribute an array?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3280
3031
  .action(actionRunner(databasesCreateUrlAttribute))
3281
3032
 
3282
3033
  databases
@@ -3285,7 +3036,7 @@ databases
3285
3036
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3286
3037
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3287
3038
  .requiredOption(`--key <key>`, `Attribute Key.`)
3288
- .requiredOption(`--required [value]`, `Is attribute required?`, (value) => value === undefined ? true : parseBool(value))
3039
+ .requiredOption(`--required [value]`, `Is attribute required?`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3289
3040
  .option(`--xdefault <xdefault>`, `Default value for attribute when not provided. Cannot be set when attribute is required.`)
3290
3041
  .option(`--new-key <new-key>`, `New Attribute Key.`)
3291
3042
  .action(actionRunner(databasesUpdateUrlAttribute))
@@ -3323,7 +3074,7 @@ databases
3323
3074
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3324
3075
  .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`)
3325
3076
  .option(`--transaction-id <transaction-id>`, `Transaction ID to read uncommitted changes within the transaction.`)
3326
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
3077
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3327
3078
  .option(`--console`, `Get the resource console url`)
3328
3079
  .action(actionRunner(databasesListDocuments))
3329
3080
 
@@ -3392,7 +3143,7 @@ databases
3392
3143
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3393
3144
  .requiredOption(`--collection-id <collection-id>`, `Collection ID.`)
3394
3145
  .requiredOption(`--document-id <document-id>`, `Document ID.`)
3395
- .requiredOption(`--data <data>`, `Document data as JSON object. Include all required attributes of the document to be created or updated.`)
3146
+ .option(`--data <data>`, `Document data as JSON object. Include all required attributes of the document to be created or updated.`)
3396
3147
  .option(`--permissions [permissions...]`, `An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).`)
3397
3148
  .option(`--transaction-id <transaction-id>`, `Transaction ID for staging the operation.`)
3398
3149
  .action(actionRunner(databasesUpsertDocument))
@@ -3456,7 +3207,7 @@ databases
3456
3207
  .requiredOption(`--database-id <database-id>`, `Database ID.`)
3457
3208
  .requiredOption(`--collection-id <collection-id>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
3458
3209
  .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error`)
3459
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
3210
+ .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value: string | undefined) => value === undefined ? true : parseBool(value))
3460
3211
  .option(`--console`, `Get the resource console url`)
3461
3212
  .action(actionRunner(databasesListIndexes))
3462
3213
 
@@ -3518,73 +3269,4 @@ databases
3518
3269
  .option(`--range <range>`, `Date range.`)
3519
3270
  .action(actionRunner(databasesGetUsage))
3520
3271
 
3521
- module.exports = {
3522
- databases,
3523
- databasesList,
3524
- databasesCreate,
3525
- databasesListTransactions,
3526
- databasesCreateTransaction,
3527
- databasesGetTransaction,
3528
- databasesUpdateTransaction,
3529
- databasesDeleteTransaction,
3530
- databasesCreateOperations,
3531
- databasesListUsage,
3532
- databasesGet,
3533
- databasesUpdate,
3534
- databasesDelete,
3535
- databasesListCollections,
3536
- databasesCreateCollection,
3537
- databasesGetCollection,
3538
- databasesUpdateCollection,
3539
- databasesDeleteCollection,
3540
- databasesListAttributes,
3541
- databasesCreateBooleanAttribute,
3542
- databasesUpdateBooleanAttribute,
3543
- databasesCreateDatetimeAttribute,
3544
- databasesUpdateDatetimeAttribute,
3545
- databasesCreateEmailAttribute,
3546
- databasesUpdateEmailAttribute,
3547
- databasesCreateEnumAttribute,
3548
- databasesUpdateEnumAttribute,
3549
- databasesCreateFloatAttribute,
3550
- databasesUpdateFloatAttribute,
3551
- databasesCreateIntegerAttribute,
3552
- databasesUpdateIntegerAttribute,
3553
- databasesCreateIpAttribute,
3554
- databasesUpdateIpAttribute,
3555
- databasesCreateLineAttribute,
3556
- databasesUpdateLineAttribute,
3557
- databasesCreatePointAttribute,
3558
- databasesUpdatePointAttribute,
3559
- databasesCreatePolygonAttribute,
3560
- databasesUpdatePolygonAttribute,
3561
- databasesCreateRelationshipAttribute,
3562
- databasesCreateStringAttribute,
3563
- databasesUpdateStringAttribute,
3564
- databasesCreateUrlAttribute,
3565
- databasesUpdateUrlAttribute,
3566
- databasesGetAttribute,
3567
- databasesDeleteAttribute,
3568
- databasesUpdateRelationshipAttribute,
3569
- databasesListDocuments,
3570
- databasesCreateDocument,
3571
- databasesCreateDocuments,
3572
- databasesUpsertDocuments,
3573
- databasesUpdateDocuments,
3574
- databasesDeleteDocuments,
3575
- databasesGetDocument,
3576
- databasesUpsertDocument,
3577
- databasesUpdateDocument,
3578
- databasesDeleteDocument,
3579
- databasesListDocumentLogs,
3580
- databasesDecrementDocumentAttribute,
3581
- databasesIncrementDocumentAttribute,
3582
- databasesListIndexes,
3583
- databasesCreateIndex,
3584
- databasesGetIndex,
3585
- databasesDeleteIndex,
3586
- databasesListCollectionLogs,
3587
- databasesGetCollectionUsage,
3588
- databasesListLogs,
3589
- databasesGetUsage
3590
- };
3272
+