appwrite-cli 5.0.3 → 6.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 (54) hide show
  1. package/README.md +4 -4
  2. package/docs/examples/functions/create-build.md +1 -1
  3. package/docs/examples/functions/create-execution.md +1 -0
  4. package/docs/examples/functions/create.md +1 -0
  5. package/docs/examples/functions/delete-execution.md +3 -0
  6. package/docs/examples/functions/update-deployment-build.md +3 -0
  7. package/docs/examples/functions/update.md +1 -0
  8. package/docs/examples/messaging/update-email.md +1 -0
  9. package/docs/examples/projects/create-j-w-t.md +4 -0
  10. package/docs/examples/projects/update-mock-numbers.md +3 -0
  11. package/docs/examples/projects/update-session-alerts.md +3 -0
  12. package/docs/examples/users/create-j-w-t.md +4 -0
  13. package/docs/examples/vcs/get-repository-contents.md +4 -0
  14. package/index.js +34 -7
  15. package/install.ps1 +3 -3
  16. package/install.sh +2 -2
  17. package/lib/client.js +19 -5
  18. package/lib/commands/account.js +307 -153
  19. package/lib/commands/assistant.js +8 -5
  20. package/lib/commands/avatars.js +116 -60
  21. package/lib/commands/console.js +8 -5
  22. package/lib/commands/databases.js +353 -164
  23. package/lib/commands/functions.js +310 -100
  24. package/lib/commands/generic.js +206 -54
  25. package/lib/commands/graphql.js +14 -8
  26. package/lib/commands/health.js +140 -71
  27. package/lib/commands/init.js +250 -155
  28. package/lib/commands/locale.js +50 -26
  29. package/lib/commands/messaging.js +363 -179
  30. package/lib/commands/migrations.js +98 -50
  31. package/lib/commands/project.js +38 -20
  32. package/lib/commands/projects.js +449 -144
  33. package/lib/commands/proxy.js +32 -17
  34. package/lib/commands/pull.js +231 -0
  35. package/lib/commands/push.js +1518 -0
  36. package/lib/commands/run.js +282 -0
  37. package/lib/commands/storage.js +160 -76
  38. package/lib/commands/teams.js +102 -50
  39. package/lib/commands/users.js +325 -135
  40. package/lib/commands/vcs.js +102 -29
  41. package/lib/config.js +190 -18
  42. package/lib/emulation/docker.js +187 -0
  43. package/lib/emulation/utils.js +177 -0
  44. package/lib/id.js +30 -0
  45. package/lib/paginate.js +1 -2
  46. package/lib/parser.js +69 -12
  47. package/lib/questions.js +462 -84
  48. package/lib/sdks.js +1 -1
  49. package/lib/spinner.js +103 -0
  50. package/lib/utils.js +248 -3
  51. package/lib/validations.js +17 -0
  52. package/package.json +6 -2
  53. package/scoop/appwrite.json +3 -3
  54. package/lib/commands/deploy.js +0 -941
@@ -4,7 +4,7 @@ const tar = require("tar");
4
4
  const ignore = require("ignore");
5
5
  const { promisify } = require('util');
6
6
  const libClient = require('../client.js');
7
- const { getAllFiles } = require('../utils.js');
7
+ const { getAllFiles, showConsoleLink } = require('../utils.js');
8
8
  const { Command } = require('commander');
9
9
  const { sdkForProject, sdkForConsole } = require('../sdks')
10
10
  const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser')
@@ -43,6 +43,7 @@ const databases = new Command("databases").description(commandDescriptions['data
43
43
  * @typedef {Object} DatabasesListRequestParams
44
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
45
  * @property {string} search Search term to filter your list results. Max length: 256 chars.
46
+ * @property {boolean} overrideForCli
46
47
  * @property {boolean} parseOutput
47
48
  * @property {libClient | undefined} sdk
48
49
  */
@@ -50,8 +51,9 @@ const databases = new Command("databases").description(commandDescriptions['data
50
51
  /**
51
52
  * @param {DatabasesListRequestParams} params
52
53
  */
53
- const databasesList = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
54
- let client = !sdk ? await sdkForProject() : sdk;
54
+ const databasesList = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
55
+ let client = !sdk ? await sdkForProject() :
56
+ sdk;
55
57
  let apiPath = '/databases';
56
58
  let payload = {};
57
59
  if (typeof queries !== 'undefined') {
@@ -68,11 +70,16 @@ const databasesList = async ({ queries, search, parseOutput = true, sdk = undefi
68
70
  }, payload);
69
71
 
70
72
  if (parseOutput) {
71
- parse(response)
72
- success()
73
+ if(console) {
74
+ showConsoleLink('databases', 'list');
75
+ } else {
76
+ parse(response)
77
+ success()
78
+ }
73
79
  }
74
-
80
+
75
81
  return response;
82
+
76
83
  }
77
84
 
78
85
  /**
@@ -80,6 +87,7 @@ const databasesList = async ({ queries, search, parseOutput = true, sdk = undefi
80
87
  * @property {string} databaseId Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
81
88
  * @property {string} name Database name. Max length: 128 chars.
82
89
  * @property {boolean} enabled Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
90
+ * @property {boolean} overrideForCli
83
91
  * @property {boolean} parseOutput
84
92
  * @property {libClient | undefined} sdk
85
93
  */
@@ -87,8 +95,9 @@ const databasesList = async ({ queries, search, parseOutput = true, sdk = undefi
87
95
  /**
88
96
  * @param {DatabasesCreateRequestParams} params
89
97
  */
90
- const databasesCreate = async ({ databaseId, name, enabled, parseOutput = true, sdk = undefined}) => {
91
- let client = !sdk ? await sdkForProject() : sdk;
98
+ const databasesCreate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
99
+ let client = !sdk ? await sdkForProject() :
100
+ sdk;
92
101
  let apiPath = '/databases';
93
102
  let payload = {};
94
103
  if (typeof databaseId !== 'undefined') {
@@ -111,13 +120,15 @@ const databasesCreate = async ({ databaseId, name, enabled, parseOutput = true,
111
120
  parse(response)
112
121
  success()
113
122
  }
114
-
123
+
115
124
  return response;
125
+
116
126
  }
117
127
 
118
128
  /**
119
129
  * @typedef {Object} DatabasesGetUsageRequestParams
120
130
  * @property {DatabaseUsageRange} range 'Date range.
131
+ * @property {boolean} overrideForCli
121
132
  * @property {boolean} parseOutput
122
133
  * @property {libClient | undefined} sdk
123
134
  */
@@ -125,8 +136,9 @@ const databasesCreate = async ({ databaseId, name, enabled, parseOutput = true,
125
136
  /**
126
137
  * @param {DatabasesGetUsageRequestParams} params
127
138
  */
128
- const databasesGetUsage = async ({ range, parseOutput = true, sdk = undefined}) => {
129
- let client = !sdk ? await sdkForProject() : sdk;
139
+ const databasesGetUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
140
+ let client = !sdk ? await sdkForProject() :
141
+ sdk;
130
142
  let apiPath = '/databases/usage';
131
143
  let payload = {};
132
144
  if (typeof range !== 'undefined') {
@@ -143,13 +155,15 @@ const databasesGetUsage = async ({ range, parseOutput = true, sdk = undefined})
143
155
  parse(response)
144
156
  success()
145
157
  }
146
-
158
+
147
159
  return response;
160
+
148
161
  }
149
162
 
150
163
  /**
151
164
  * @typedef {Object} DatabasesGetRequestParams
152
165
  * @property {string} databaseId Database ID.
166
+ * @property {boolean} overrideForCli
153
167
  * @property {boolean} parseOutput
154
168
  * @property {libClient | undefined} sdk
155
169
  */
@@ -157,8 +171,9 @@ const databasesGetUsage = async ({ range, parseOutput = true, sdk = undefined})
157
171
  /**
158
172
  * @param {DatabasesGetRequestParams} params
159
173
  */
160
- const databasesGet = async ({ databaseId, parseOutput = true, sdk = undefined}) => {
161
- let client = !sdk ? await sdkForProject() : sdk;
174
+ const databasesGet = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
175
+ let client = !sdk ? await sdkForProject() :
176
+ sdk;
162
177
  let apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
163
178
  let payload = {};
164
179
 
@@ -169,11 +184,16 @@ const databasesGet = async ({ databaseId, parseOutput = true, sdk = undefined})
169
184
  }, payload);
170
185
 
171
186
  if (parseOutput) {
172
- parse(response)
173
- success()
187
+ if(console) {
188
+ showConsoleLink('databases', 'get', databaseId);
189
+ } else {
190
+ parse(response)
191
+ success()
192
+ }
174
193
  }
175
-
194
+
176
195
  return response;
196
+
177
197
  }
178
198
 
179
199
  /**
@@ -181,6 +201,7 @@ const databasesGet = async ({ databaseId, parseOutput = true, sdk = undefined})
181
201
  * @property {string} databaseId Database ID.
182
202
  * @property {string} name Database name. Max length: 128 chars.
183
203
  * @property {boolean} enabled Is database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
204
+ * @property {boolean} overrideForCli
184
205
  * @property {boolean} parseOutput
185
206
  * @property {libClient | undefined} sdk
186
207
  */
@@ -188,8 +209,9 @@ const databasesGet = async ({ databaseId, parseOutput = true, sdk = undefined})
188
209
  /**
189
210
  * @param {DatabasesUpdateRequestParams} params
190
211
  */
191
- const databasesUpdate = async ({ databaseId, name, enabled, parseOutput = true, sdk = undefined}) => {
192
- let client = !sdk ? await sdkForProject() : sdk;
212
+ const databasesUpdate = async ({databaseId,name,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
213
+ let client = !sdk ? await sdkForProject() :
214
+ sdk;
193
215
  let apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
194
216
  let payload = {};
195
217
  if (typeof name !== 'undefined') {
@@ -209,13 +231,15 @@ const databasesUpdate = async ({ databaseId, name, enabled, parseOutput = true,
209
231
  parse(response)
210
232
  success()
211
233
  }
212
-
234
+
213
235
  return response;
236
+
214
237
  }
215
238
 
216
239
  /**
217
240
  * @typedef {Object} DatabasesDeleteRequestParams
218
241
  * @property {string} databaseId Database ID.
242
+ * @property {boolean} overrideForCli
219
243
  * @property {boolean} parseOutput
220
244
  * @property {libClient | undefined} sdk
221
245
  */
@@ -223,8 +247,9 @@ const databasesUpdate = async ({ databaseId, name, enabled, parseOutput = true,
223
247
  /**
224
248
  * @param {DatabasesDeleteRequestParams} params
225
249
  */
226
- const databasesDelete = async ({ databaseId, parseOutput = true, sdk = undefined}) => {
227
- let client = !sdk ? await sdkForProject() : sdk;
250
+ const databasesDelete = async ({databaseId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
251
+ let client = !sdk ? await sdkForProject() :
252
+ sdk;
228
253
  let apiPath = '/databases/{databaseId}'.replace('{databaseId}', databaseId);
229
254
  let payload = {};
230
255
 
@@ -238,8 +263,9 @@ const databasesDelete = async ({ databaseId, parseOutput = true, sdk = undefined
238
263
  parse(response)
239
264
  success()
240
265
  }
241
-
266
+
242
267
  return response;
268
+
243
269
  }
244
270
 
245
271
  /**
@@ -247,6 +273,7 @@ const databasesDelete = async ({ databaseId, parseOutput = true, sdk = undefined
247
273
  * @property {string} databaseId Database ID.
248
274
  * @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
249
275
  * @property {string} search Search term to filter your list results. Max length: 256 chars.
276
+ * @property {boolean} overrideForCli
250
277
  * @property {boolean} parseOutput
251
278
  * @property {libClient | undefined} sdk
252
279
  */
@@ -254,8 +281,9 @@ const databasesDelete = async ({ databaseId, parseOutput = true, sdk = undefined
254
281
  /**
255
282
  * @param {DatabasesListCollectionsRequestParams} params
256
283
  */
257
- const databasesListCollections = async ({ databaseId, queries, search, parseOutput = true, sdk = undefined}) => {
258
- let client = !sdk ? await sdkForProject() : sdk;
284
+ const databasesListCollections = async ({databaseId,queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
285
+ let client = !sdk ? await sdkForProject() :
286
+ sdk;
259
287
  let apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
260
288
  let payload = {};
261
289
  if (typeof queries !== 'undefined') {
@@ -272,11 +300,16 @@ const databasesListCollections = async ({ databaseId, queries, search, parseOutp
272
300
  }, payload);
273
301
 
274
302
  if (parseOutput) {
275
- parse(response)
276
- success()
303
+ if(console) {
304
+ showConsoleLink('databases', 'listCollections', databaseId);
305
+ } else {
306
+ parse(response)
307
+ success()
308
+ }
277
309
  }
278
-
310
+
279
311
  return response;
312
+
280
313
  }
281
314
 
282
315
  /**
@@ -287,6 +320,7 @@ const databasesListCollections = async ({ databaseId, queries, search, parseOutp
287
320
  * @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).
288
321
  * @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).
289
322
  * @property {boolean} enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
323
+ * @property {boolean} overrideForCli
290
324
  * @property {boolean} parseOutput
291
325
  * @property {libClient | undefined} sdk
292
326
  */
@@ -294,8 +328,9 @@ const databasesListCollections = async ({ databaseId, queries, search, parseOutp
294
328
  /**
295
329
  * @param {DatabasesCreateCollectionRequestParams} params
296
330
  */
297
- const databasesCreateCollection = async ({ databaseId, collectionId, name, permissions, documentSecurity, enabled, parseOutput = true, sdk = undefined}) => {
298
- let client = !sdk ? await sdkForProject() : sdk;
331
+ const databasesCreateCollection = async ({databaseId,collectionId,name,permissions,documentSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
332
+ let client = !sdk ? await sdkForProject() :
333
+ sdk;
299
334
  let apiPath = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);
300
335
  let payload = {};
301
336
  if (typeof collectionId !== 'undefined') {
@@ -325,14 +360,16 @@ const databasesCreateCollection = async ({ databaseId, collectionId, name, permi
325
360
  parse(response)
326
361
  success()
327
362
  }
328
-
363
+
329
364
  return response;
365
+
330
366
  }
331
367
 
332
368
  /**
333
369
  * @typedef {Object} DatabasesGetCollectionRequestParams
334
370
  * @property {string} databaseId Database ID.
335
371
  * @property {string} collectionId Collection ID.
372
+ * @property {boolean} overrideForCli
336
373
  * @property {boolean} parseOutput
337
374
  * @property {libClient | undefined} sdk
338
375
  */
@@ -340,8 +377,9 @@ const databasesCreateCollection = async ({ databaseId, collectionId, name, permi
340
377
  /**
341
378
  * @param {DatabasesGetCollectionRequestParams} params
342
379
  */
343
- const databasesGetCollection = async ({ databaseId, collectionId, parseOutput = true, sdk = undefined}) => {
344
- let client = !sdk ? await sdkForProject() : sdk;
380
+ const databasesGetCollection = async ({databaseId,collectionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
381
+ let client = !sdk ? await sdkForProject() :
382
+ sdk;
345
383
  let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
346
384
  let payload = {};
347
385
 
@@ -352,11 +390,16 @@ const databasesGetCollection = async ({ databaseId, collectionId, parseOutput =
352
390
  }, payload);
353
391
 
354
392
  if (parseOutput) {
355
- parse(response)
356
- success()
393
+ if(console) {
394
+ showConsoleLink('databases', 'getCollection', databaseId, collectionId);
395
+ } else {
396
+ parse(response)
397
+ success()
398
+ }
357
399
  }
358
-
400
+
359
401
  return response;
402
+
360
403
  }
361
404
 
362
405
  /**
@@ -367,6 +410,7 @@ const databasesGetCollection = async ({ databaseId, collectionId, parseOutput =
367
410
  * @property {string[]} permissions An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
368
411
  * @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).
369
412
  * @property {boolean} enabled Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
413
+ * @property {boolean} overrideForCli
370
414
  * @property {boolean} parseOutput
371
415
  * @property {libClient | undefined} sdk
372
416
  */
@@ -374,8 +418,9 @@ const databasesGetCollection = async ({ databaseId, collectionId, parseOutput =
374
418
  /**
375
419
  * @param {DatabasesUpdateCollectionRequestParams} params
376
420
  */
377
- const databasesUpdateCollection = async ({ databaseId, collectionId, name, permissions, documentSecurity, enabled, parseOutput = true, sdk = undefined}) => {
378
- let client = !sdk ? await sdkForProject() : sdk;
421
+ const databasesUpdateCollection = async ({databaseId,collectionId,name,permissions,documentSecurity,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
422
+ let client = !sdk ? await sdkForProject() :
423
+ sdk;
379
424
  let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
380
425
  let payload = {};
381
426
  if (typeof name !== 'undefined') {
@@ -402,14 +447,16 @@ const databasesUpdateCollection = async ({ databaseId, collectionId, name, permi
402
447
  parse(response)
403
448
  success()
404
449
  }
405
-
450
+
406
451
  return response;
452
+
407
453
  }
408
454
 
409
455
  /**
410
456
  * @typedef {Object} DatabasesDeleteCollectionRequestParams
411
457
  * @property {string} databaseId Database ID.
412
458
  * @property {string} collectionId Collection ID.
459
+ * @property {boolean} overrideForCli
413
460
  * @property {boolean} parseOutput
414
461
  * @property {libClient | undefined} sdk
415
462
  */
@@ -417,8 +464,9 @@ const databasesUpdateCollection = async ({ databaseId, collectionId, name, permi
417
464
  /**
418
465
  * @param {DatabasesDeleteCollectionRequestParams} params
419
466
  */
420
- const databasesDeleteCollection = async ({ databaseId, collectionId, parseOutput = true, sdk = undefined}) => {
421
- let client = !sdk ? await sdkForProject() : sdk;
467
+ const databasesDeleteCollection = async ({databaseId,collectionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
468
+ let client = !sdk ? await sdkForProject() :
469
+ sdk;
422
470
  let apiPath = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
423
471
  let payload = {};
424
472
 
@@ -432,8 +480,9 @@ const databasesDeleteCollection = async ({ databaseId, collectionId, parseOutput
432
480
  parse(response)
433
481
  success()
434
482
  }
435
-
483
+
436
484
  return response;
485
+
437
486
  }
438
487
 
439
488
  /**
@@ -441,6 +490,7 @@ const databasesDeleteCollection = async ({ databaseId, collectionId, parseOutput
441
490
  * @property {string} databaseId Database ID.
442
491
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
443
492
  * @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
493
+ * @property {boolean} overrideForCli
444
494
  * @property {boolean} parseOutput
445
495
  * @property {libClient | undefined} sdk
446
496
  */
@@ -448,8 +498,9 @@ const databasesDeleteCollection = async ({ databaseId, collectionId, parseOutput
448
498
  /**
449
499
  * @param {DatabasesListAttributesRequestParams} params
450
500
  */
451
- const databasesListAttributes = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
452
- let client = !sdk ? await sdkForProject() : sdk;
501
+ const databasesListAttributes = async ({databaseId,collectionId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
502
+ let client = !sdk ? await sdkForProject() :
503
+ sdk;
453
504
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
454
505
  let payload = {};
455
506
  if (typeof queries !== 'undefined') {
@@ -463,11 +514,16 @@ const databasesListAttributes = async ({ databaseId, collectionId, queries, pars
463
514
  }, payload);
464
515
 
465
516
  if (parseOutput) {
466
- parse(response)
467
- success()
517
+ if(console) {
518
+ showConsoleLink('databases', 'listAttributes', databaseId, collectionId);
519
+ } else {
520
+ parse(response)
521
+ success()
522
+ }
468
523
  }
469
-
524
+
470
525
  return response;
526
+
471
527
  }
472
528
 
473
529
  /**
@@ -478,6 +534,7 @@ const databasesListAttributes = async ({ databaseId, collectionId, queries, pars
478
534
  * @property {boolean} required Is attribute required?
479
535
  * @property {boolean} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
480
536
  * @property {boolean} array Is attribute an array?
537
+ * @property {boolean} overrideForCli
481
538
  * @property {boolean} parseOutput
482
539
  * @property {libClient | undefined} sdk
483
540
  */
@@ -485,8 +542,9 @@ const databasesListAttributes = async ({ databaseId, collectionId, queries, pars
485
542
  /**
486
543
  * @param {DatabasesCreateBooleanAttributeRequestParams} params
487
544
  */
488
- const databasesCreateBooleanAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
489
- let client = !sdk ? await sdkForProject() : sdk;
545
+ const databasesCreateBooleanAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
546
+ let client = !sdk ? await sdkForProject() :
547
+ sdk;
490
548
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
491
549
  let payload = {};
492
550
  if (typeof key !== 'undefined') {
@@ -512,8 +570,9 @@ const databasesCreateBooleanAttribute = async ({ databaseId, collectionId, key,
512
570
  parse(response)
513
571
  success()
514
572
  }
515
-
573
+
516
574
  return response;
575
+
517
576
  }
518
577
 
519
578
  /**
@@ -523,6 +582,7 @@ const databasesCreateBooleanAttribute = async ({ databaseId, collectionId, key,
523
582
  * @property {string} key Attribute Key.
524
583
  * @property {boolean} required Is attribute required?
525
584
  * @property {boolean} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
585
+ * @property {boolean} overrideForCli
526
586
  * @property {boolean} parseOutput
527
587
  * @property {libClient | undefined} sdk
528
588
  */
@@ -530,8 +590,9 @@ const databasesCreateBooleanAttribute = async ({ databaseId, collectionId, key,
530
590
  /**
531
591
  * @param {DatabasesUpdateBooleanAttributeRequestParams} params
532
592
  */
533
- const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
534
- let client = !sdk ? await sdkForProject() : sdk;
593
+ const databasesUpdateBooleanAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
594
+ let client = !sdk ? await sdkForProject() :
595
+ sdk;
535
596
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
536
597
  let payload = {};
537
598
  if (typeof required !== 'undefined') {
@@ -551,8 +612,9 @@ const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key,
551
612
  parse(response)
552
613
  success()
553
614
  }
554
-
615
+
555
616
  return response;
617
+
556
618
  }
557
619
 
558
620
  /**
@@ -563,6 +625,7 @@ const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key,
563
625
  * @property {boolean} required Is attribute required?
564
626
  * @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.
565
627
  * @property {boolean} array Is attribute an array?
628
+ * @property {boolean} overrideForCli
566
629
  * @property {boolean} parseOutput
567
630
  * @property {libClient | undefined} sdk
568
631
  */
@@ -570,8 +633,9 @@ const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key,
570
633
  /**
571
634
  * @param {DatabasesCreateDatetimeAttributeRequestParams} params
572
635
  */
573
- const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
574
- let client = !sdk ? await sdkForProject() : sdk;
636
+ const databasesCreateDatetimeAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
637
+ let client = !sdk ? await sdkForProject() :
638
+ sdk;
575
639
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
576
640
  let payload = {};
577
641
  if (typeof key !== 'undefined') {
@@ -597,8 +661,9 @@ const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key,
597
661
  parse(response)
598
662
  success()
599
663
  }
600
-
664
+
601
665
  return response;
666
+
602
667
  }
603
668
 
604
669
  /**
@@ -608,6 +673,7 @@ const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key,
608
673
  * @property {string} key Attribute Key.
609
674
  * @property {boolean} required Is attribute required?
610
675
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
676
+ * @property {boolean} overrideForCli
611
677
  * @property {boolean} parseOutput
612
678
  * @property {libClient | undefined} sdk
613
679
  */
@@ -615,8 +681,9 @@ const databasesCreateDatetimeAttribute = async ({ databaseId, collectionId, key,
615
681
  /**
616
682
  * @param {DatabasesUpdateDatetimeAttributeRequestParams} params
617
683
  */
618
- const databasesUpdateDatetimeAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
619
- let client = !sdk ? await sdkForProject() : sdk;
684
+ const databasesUpdateDatetimeAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
685
+ let client = !sdk ? await sdkForProject() :
686
+ sdk;
620
687
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
621
688
  let payload = {};
622
689
  if (typeof required !== 'undefined') {
@@ -636,8 +703,9 @@ const databasesUpdateDatetimeAttribute = async ({ databaseId, collectionId, key,
636
703
  parse(response)
637
704
  success()
638
705
  }
639
-
706
+
640
707
  return response;
708
+
641
709
  }
642
710
 
643
711
  /**
@@ -648,6 +716,7 @@ const databasesUpdateDatetimeAttribute = async ({ databaseId, collectionId, key,
648
716
  * @property {boolean} required Is attribute required?
649
717
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
650
718
  * @property {boolean} array Is attribute an array?
719
+ * @property {boolean} overrideForCli
651
720
  * @property {boolean} parseOutput
652
721
  * @property {libClient | undefined} sdk
653
722
  */
@@ -655,8 +724,9 @@ const databasesUpdateDatetimeAttribute = async ({ databaseId, collectionId, key,
655
724
  /**
656
725
  * @param {DatabasesCreateEmailAttributeRequestParams} params
657
726
  */
658
- const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
659
- let client = !sdk ? await sdkForProject() : sdk;
727
+ const databasesCreateEmailAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
728
+ let client = !sdk ? await sdkForProject() :
729
+ sdk;
660
730
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
661
731
  let payload = {};
662
732
  if (typeof key !== 'undefined') {
@@ -682,8 +752,9 @@ const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, re
682
752
  parse(response)
683
753
  success()
684
754
  }
685
-
755
+
686
756
  return response;
757
+
687
758
  }
688
759
 
689
760
  /**
@@ -693,6 +764,7 @@ const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, re
693
764
  * @property {string} key Attribute Key.
694
765
  * @property {boolean} required Is attribute required?
695
766
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
767
+ * @property {boolean} overrideForCli
696
768
  * @property {boolean} parseOutput
697
769
  * @property {libClient | undefined} sdk
698
770
  */
@@ -700,8 +772,9 @@ const databasesCreateEmailAttribute = async ({ databaseId, collectionId, key, re
700
772
  /**
701
773
  * @param {DatabasesUpdateEmailAttributeRequestParams} params
702
774
  */
703
- const databasesUpdateEmailAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
704
- let client = !sdk ? await sdkForProject() : sdk;
775
+ const databasesUpdateEmailAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
776
+ let client = !sdk ? await sdkForProject() :
777
+ sdk;
705
778
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
706
779
  let payload = {};
707
780
  if (typeof required !== 'undefined') {
@@ -721,8 +794,9 @@ const databasesUpdateEmailAttribute = async ({ databaseId, collectionId, key, re
721
794
  parse(response)
722
795
  success()
723
796
  }
724
-
797
+
725
798
  return response;
799
+
726
800
  }
727
801
 
728
802
  /**
@@ -734,6 +808,7 @@ const databasesUpdateEmailAttribute = async ({ databaseId, collectionId, key, re
734
808
  * @property {boolean} required Is attribute required?
735
809
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
736
810
  * @property {boolean} array Is attribute an array?
811
+ * @property {boolean} overrideForCli
737
812
  * @property {boolean} parseOutput
738
813
  * @property {libClient | undefined} sdk
739
814
  */
@@ -741,8 +816,9 @@ const databasesUpdateEmailAttribute = async ({ databaseId, collectionId, key, re
741
816
  /**
742
817
  * @param {DatabasesCreateEnumAttributeRequestParams} params
743
818
  */
744
- const databasesCreateEnumAttribute = async ({ databaseId, collectionId, key, elements, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
745
- let client = !sdk ? await sdkForProject() : sdk;
819
+ const databasesCreateEnumAttribute = async ({databaseId,collectionId,key,elements,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
820
+ let client = !sdk ? await sdkForProject() :
821
+ sdk;
746
822
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
747
823
  let payload = {};
748
824
  if (typeof key !== 'undefined') {
@@ -772,8 +848,9 @@ const databasesCreateEnumAttribute = async ({ databaseId, collectionId, key, ele
772
848
  parse(response)
773
849
  success()
774
850
  }
775
-
851
+
776
852
  return response;
853
+
777
854
  }
778
855
 
779
856
  /**
@@ -784,6 +861,7 @@ const databasesCreateEnumAttribute = async ({ databaseId, collectionId, key, ele
784
861
  * @property {string[]} elements Array of elements in enumerated type. Uses length of longest element to determine size. Maximum of 100 elements are allowed, each 255 characters long.
785
862
  * @property {boolean} required Is attribute required?
786
863
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
864
+ * @property {boolean} overrideForCli
787
865
  * @property {boolean} parseOutput
788
866
  * @property {libClient | undefined} sdk
789
867
  */
@@ -791,8 +869,9 @@ const databasesCreateEnumAttribute = async ({ databaseId, collectionId, key, ele
791
869
  /**
792
870
  * @param {DatabasesUpdateEnumAttributeRequestParams} params
793
871
  */
794
- const databasesUpdateEnumAttribute = async ({ databaseId, collectionId, key, elements, required, xdefault, parseOutput = true, sdk = undefined}) => {
795
- let client = !sdk ? await sdkForProject() : sdk;
872
+ const databasesUpdateEnumAttribute = async ({databaseId,collectionId,key,elements,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
873
+ let client = !sdk ? await sdkForProject() :
874
+ sdk;
796
875
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
797
876
  let payload = {};
798
877
  elements = elements === true ? [] : elements;
@@ -816,8 +895,9 @@ const databasesUpdateEnumAttribute = async ({ databaseId, collectionId, key, ele
816
895
  parse(response)
817
896
  success()
818
897
  }
819
-
898
+
820
899
  return response;
900
+
821
901
  }
822
902
 
823
903
  /**
@@ -830,6 +910,7 @@ const databasesUpdateEnumAttribute = async ({ databaseId, collectionId, key, ele
830
910
  * @property {number} max Maximum value to enforce on new documents
831
911
  * @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
832
912
  * @property {boolean} array Is attribute an array?
913
+ * @property {boolean} overrideForCli
833
914
  * @property {boolean} parseOutput
834
915
  * @property {libClient | undefined} sdk
835
916
  */
@@ -837,8 +918,9 @@ const databasesUpdateEnumAttribute = async ({ databaseId, collectionId, key, ele
837
918
  /**
838
919
  * @param {DatabasesCreateFloatAttributeRequestParams} params
839
920
  */
840
- const databasesCreateFloatAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, array, parseOutput = true, sdk = undefined}) => {
841
- let client = !sdk ? await sdkForProject() : sdk;
921
+ const databasesCreateFloatAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
922
+ let client = !sdk ? await sdkForProject() :
923
+ sdk;
842
924
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
843
925
  let payload = {};
844
926
  if (typeof key !== 'undefined') {
@@ -870,8 +952,9 @@ const databasesCreateFloatAttribute = async ({ databaseId, collectionId, key, re
870
952
  parse(response)
871
953
  success()
872
954
  }
873
-
955
+
874
956
  return response;
957
+
875
958
  }
876
959
 
877
960
  /**
@@ -883,6 +966,7 @@ const databasesCreateFloatAttribute = async ({ databaseId, collectionId, key, re
883
966
  * @property {number} min Minimum value to enforce on new documents
884
967
  * @property {number} max Maximum value to enforce on new documents
885
968
  * @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
969
+ * @property {boolean} overrideForCli
886
970
  * @property {boolean} parseOutput
887
971
  * @property {libClient | undefined} sdk
888
972
  */
@@ -890,8 +974,9 @@ const databasesCreateFloatAttribute = async ({ databaseId, collectionId, key, re
890
974
  /**
891
975
  * @param {DatabasesUpdateFloatAttributeRequestParams} params
892
976
  */
893
- const databasesUpdateFloatAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, parseOutput = true, sdk = undefined}) => {
894
- let client = !sdk ? await sdkForProject() : sdk;
977
+ const databasesUpdateFloatAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
978
+ let client = !sdk ? await sdkForProject() :
979
+ sdk;
895
980
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
896
981
  let payload = {};
897
982
  if (typeof required !== 'undefined') {
@@ -917,8 +1002,9 @@ const databasesUpdateFloatAttribute = async ({ databaseId, collectionId, key, re
917
1002
  parse(response)
918
1003
  success()
919
1004
  }
920
-
1005
+
921
1006
  return response;
1007
+
922
1008
  }
923
1009
 
924
1010
  /**
@@ -931,6 +1017,7 @@ const databasesUpdateFloatAttribute = async ({ databaseId, collectionId, key, re
931
1017
  * @property {number} max Maximum value to enforce on new documents
932
1018
  * @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
933
1019
  * @property {boolean} array Is attribute an array?
1020
+ * @property {boolean} overrideForCli
934
1021
  * @property {boolean} parseOutput
935
1022
  * @property {libClient | undefined} sdk
936
1023
  */
@@ -938,8 +1025,9 @@ const databasesUpdateFloatAttribute = async ({ databaseId, collectionId, key, re
938
1025
  /**
939
1026
  * @param {DatabasesCreateIntegerAttributeRequestParams} params
940
1027
  */
941
- const databasesCreateIntegerAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, array, parseOutput = true, sdk = undefined}) => {
942
- let client = !sdk ? await sdkForProject() : sdk;
1028
+ const databasesCreateIntegerAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1029
+ let client = !sdk ? await sdkForProject() :
1030
+ sdk;
943
1031
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
944
1032
  let payload = {};
945
1033
  if (typeof key !== 'undefined') {
@@ -971,8 +1059,9 @@ const databasesCreateIntegerAttribute = async ({ databaseId, collectionId, key,
971
1059
  parse(response)
972
1060
  success()
973
1061
  }
974
-
1062
+
975
1063
  return response;
1064
+
976
1065
  }
977
1066
 
978
1067
  /**
@@ -984,6 +1073,7 @@ const databasesCreateIntegerAttribute = async ({ databaseId, collectionId, key,
984
1073
  * @property {number} min Minimum value to enforce on new documents
985
1074
  * @property {number} max Maximum value to enforce on new documents
986
1075
  * @property {number} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1076
+ * @property {boolean} overrideForCli
987
1077
  * @property {boolean} parseOutput
988
1078
  * @property {libClient | undefined} sdk
989
1079
  */
@@ -991,8 +1081,9 @@ const databasesCreateIntegerAttribute = async ({ databaseId, collectionId, key,
991
1081
  /**
992
1082
  * @param {DatabasesUpdateIntegerAttributeRequestParams} params
993
1083
  */
994
- const databasesUpdateIntegerAttribute = async ({ databaseId, collectionId, key, required, min, max, xdefault, parseOutput = true, sdk = undefined}) => {
995
- let client = !sdk ? await sdkForProject() : sdk;
1084
+ const databasesUpdateIntegerAttribute = async ({databaseId,collectionId,key,required,min,max,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1085
+ let client = !sdk ? await sdkForProject() :
1086
+ sdk;
996
1087
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
997
1088
  let payload = {};
998
1089
  if (typeof required !== 'undefined') {
@@ -1018,8 +1109,9 @@ const databasesUpdateIntegerAttribute = async ({ databaseId, collectionId, key,
1018
1109
  parse(response)
1019
1110
  success()
1020
1111
  }
1021
-
1112
+
1022
1113
  return response;
1114
+
1023
1115
  }
1024
1116
 
1025
1117
  /**
@@ -1030,6 +1122,7 @@ const databasesUpdateIntegerAttribute = async ({ databaseId, collectionId, key,
1030
1122
  * @property {boolean} required Is attribute required?
1031
1123
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1032
1124
  * @property {boolean} array Is attribute an array?
1125
+ * @property {boolean} overrideForCli
1033
1126
  * @property {boolean} parseOutput
1034
1127
  * @property {libClient | undefined} sdk
1035
1128
  */
@@ -1037,8 +1130,9 @@ const databasesUpdateIntegerAttribute = async ({ databaseId, collectionId, key,
1037
1130
  /**
1038
1131
  * @param {DatabasesCreateIpAttributeRequestParams} params
1039
1132
  */
1040
- const databasesCreateIpAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
1041
- let client = !sdk ? await sdkForProject() : sdk;
1133
+ const databasesCreateIpAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1134
+ let client = !sdk ? await sdkForProject() :
1135
+ sdk;
1042
1136
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1043
1137
  let payload = {};
1044
1138
  if (typeof key !== 'undefined') {
@@ -1064,8 +1158,9 @@ const databasesCreateIpAttribute = async ({ databaseId, collectionId, key, requi
1064
1158
  parse(response)
1065
1159
  success()
1066
1160
  }
1067
-
1161
+
1068
1162
  return response;
1163
+
1069
1164
  }
1070
1165
 
1071
1166
  /**
@@ -1075,6 +1170,7 @@ const databasesCreateIpAttribute = async ({ databaseId, collectionId, key, requi
1075
1170
  * @property {string} key Attribute Key.
1076
1171
  * @property {boolean} required Is attribute required?
1077
1172
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1173
+ * @property {boolean} overrideForCli
1078
1174
  * @property {boolean} parseOutput
1079
1175
  * @property {libClient | undefined} sdk
1080
1176
  */
@@ -1082,8 +1178,9 @@ const databasesCreateIpAttribute = async ({ databaseId, collectionId, key, requi
1082
1178
  /**
1083
1179
  * @param {DatabasesUpdateIpAttributeRequestParams} params
1084
1180
  */
1085
- const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
1086
- let client = !sdk ? await sdkForProject() : sdk;
1181
+ const databasesUpdateIpAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1182
+ let client = !sdk ? await sdkForProject() :
1183
+ sdk;
1087
1184
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1088
1185
  let payload = {};
1089
1186
  if (typeof required !== 'undefined') {
@@ -1103,8 +1200,9 @@ const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, requi
1103
1200
  parse(response)
1104
1201
  success()
1105
1202
  }
1106
-
1203
+
1107
1204
  return response;
1205
+
1108
1206
  }
1109
1207
 
1110
1208
  /**
@@ -1117,6 +1215,7 @@ const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, requi
1117
1215
  * @property {string} key Attribute Key.
1118
1216
  * @property {string} twoWayKey Two Way Attribute Key.
1119
1217
  * @property {RelationMutate} onDelete Constraints option
1218
+ * @property {boolean} overrideForCli
1120
1219
  * @property {boolean} parseOutput
1121
1220
  * @property {libClient | undefined} sdk
1122
1221
  */
@@ -1124,8 +1223,9 @@ const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, requi
1124
1223
  /**
1125
1224
  * @param {DatabasesCreateRelationshipAttributeRequestParams} params
1126
1225
  */
1127
- const databasesCreateRelationshipAttribute = async ({ databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete, parseOutput = true, sdk = undefined}) => {
1128
- let client = !sdk ? await sdkForProject() : sdk;
1226
+ const databasesCreateRelationshipAttribute = async ({databaseId,collectionId,relatedCollectionId,type,twoWay,key,twoWayKey,onDelete,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1227
+ let client = !sdk ? await sdkForProject() :
1228
+ sdk;
1129
1229
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1130
1230
  let payload = {};
1131
1231
  if (typeof relatedCollectionId !== 'undefined') {
@@ -1157,8 +1257,9 @@ const databasesCreateRelationshipAttribute = async ({ databaseId, collectionId,
1157
1257
  parse(response)
1158
1258
  success()
1159
1259
  }
1160
-
1260
+
1161
1261
  return response;
1262
+
1162
1263
  }
1163
1264
 
1164
1265
  /**
@@ -1171,6 +1272,7 @@ const databasesCreateRelationshipAttribute = async ({ databaseId, collectionId,
1171
1272
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1172
1273
  * @property {boolean} array Is attribute an array?
1173
1274
  * @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.
1275
+ * @property {boolean} overrideForCli
1174
1276
  * @property {boolean} parseOutput
1175
1277
  * @property {libClient | undefined} sdk
1176
1278
  */
@@ -1178,8 +1280,9 @@ const databasesCreateRelationshipAttribute = async ({ databaseId, collectionId,
1178
1280
  /**
1179
1281
  * @param {DatabasesCreateStringAttributeRequestParams} params
1180
1282
  */
1181
- const databasesCreateStringAttribute = async ({ databaseId, collectionId, key, size, required, xdefault, array, encrypt, parseOutput = true, sdk = undefined}) => {
1182
- let client = !sdk ? await sdkForProject() : sdk;
1283
+ const databasesCreateStringAttribute = async ({databaseId,collectionId,key,size,required,xdefault,array,encrypt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1284
+ let client = !sdk ? await sdkForProject() :
1285
+ sdk;
1183
1286
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1184
1287
  let payload = {};
1185
1288
  if (typeof key !== 'undefined') {
@@ -1211,8 +1314,9 @@ const databasesCreateStringAttribute = async ({ databaseId, collectionId, key, s
1211
1314
  parse(response)
1212
1315
  success()
1213
1316
  }
1214
-
1317
+
1215
1318
  return response;
1319
+
1216
1320
  }
1217
1321
 
1218
1322
  /**
@@ -1222,6 +1326,7 @@ const databasesCreateStringAttribute = async ({ databaseId, collectionId, key, s
1222
1326
  * @property {string} key Attribute Key.
1223
1327
  * @property {boolean} required Is attribute required?
1224
1328
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1329
+ * @property {boolean} overrideForCli
1225
1330
  * @property {boolean} parseOutput
1226
1331
  * @property {libClient | undefined} sdk
1227
1332
  */
@@ -1229,8 +1334,9 @@ const databasesCreateStringAttribute = async ({ databaseId, collectionId, key, s
1229
1334
  /**
1230
1335
  * @param {DatabasesUpdateStringAttributeRequestParams} params
1231
1336
  */
1232
- const databasesUpdateStringAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
1233
- let client = !sdk ? await sdkForProject() : sdk;
1337
+ const databasesUpdateStringAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1338
+ let client = !sdk ? await sdkForProject() :
1339
+ sdk;
1234
1340
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1235
1341
  let payload = {};
1236
1342
  if (typeof required !== 'undefined') {
@@ -1250,8 +1356,9 @@ const databasesUpdateStringAttribute = async ({ databaseId, collectionId, key, r
1250
1356
  parse(response)
1251
1357
  success()
1252
1358
  }
1253
-
1359
+
1254
1360
  return response;
1361
+
1255
1362
  }
1256
1363
 
1257
1364
  /**
@@ -1262,6 +1369,7 @@ const databasesUpdateStringAttribute = async ({ databaseId, collectionId, key, r
1262
1369
  * @property {boolean} required Is attribute required?
1263
1370
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1264
1371
  * @property {boolean} array Is attribute an array?
1372
+ * @property {boolean} overrideForCli
1265
1373
  * @property {boolean} parseOutput
1266
1374
  * @property {libClient | undefined} sdk
1267
1375
  */
@@ -1269,8 +1377,9 @@ const databasesUpdateStringAttribute = async ({ databaseId, collectionId, key, r
1269
1377
  /**
1270
1378
  * @param {DatabasesCreateUrlAttributeRequestParams} params
1271
1379
  */
1272
- const databasesCreateUrlAttribute = async ({ databaseId, collectionId, key, required, xdefault, array, parseOutput = true, sdk = undefined}) => {
1273
- let client = !sdk ? await sdkForProject() : sdk;
1380
+ const databasesCreateUrlAttribute = async ({databaseId,collectionId,key,required,xdefault,array,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1381
+ let client = !sdk ? await sdkForProject() :
1382
+ sdk;
1274
1383
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1275
1384
  let payload = {};
1276
1385
  if (typeof key !== 'undefined') {
@@ -1296,8 +1405,9 @@ const databasesCreateUrlAttribute = async ({ databaseId, collectionId, key, requ
1296
1405
  parse(response)
1297
1406
  success()
1298
1407
  }
1299
-
1408
+
1300
1409
  return response;
1410
+
1301
1411
  }
1302
1412
 
1303
1413
  /**
@@ -1307,6 +1417,7 @@ const databasesCreateUrlAttribute = async ({ databaseId, collectionId, key, requ
1307
1417
  * @property {string} key Attribute Key.
1308
1418
  * @property {boolean} required Is attribute required?
1309
1419
  * @property {string} xdefault Default value for attribute when not provided. Cannot be set when attribute is required.
1420
+ * @property {boolean} overrideForCli
1310
1421
  * @property {boolean} parseOutput
1311
1422
  * @property {libClient | undefined} sdk
1312
1423
  */
@@ -1314,8 +1425,9 @@ const databasesCreateUrlAttribute = async ({ databaseId, collectionId, key, requ
1314
1425
  /**
1315
1426
  * @param {DatabasesUpdateUrlAttributeRequestParams} params
1316
1427
  */
1317
- const databasesUpdateUrlAttribute = async ({ databaseId, collectionId, key, required, xdefault, parseOutput = true, sdk = undefined}) => {
1318
- let client = !sdk ? await sdkForProject() : sdk;
1428
+ const databasesUpdateUrlAttribute = async ({databaseId,collectionId,key,required,xdefault,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1429
+ let client = !sdk ? await sdkForProject() :
1430
+ sdk;
1319
1431
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1320
1432
  let payload = {};
1321
1433
  if (typeof required !== 'undefined') {
@@ -1335,8 +1447,9 @@ const databasesUpdateUrlAttribute = async ({ databaseId, collectionId, key, requ
1335
1447
  parse(response)
1336
1448
  success()
1337
1449
  }
1338
-
1450
+
1339
1451
  return response;
1452
+
1340
1453
  }
1341
1454
 
1342
1455
  /**
@@ -1344,6 +1457,7 @@ const databasesUpdateUrlAttribute = async ({ databaseId, collectionId, key, requ
1344
1457
  * @property {string} databaseId Database ID.
1345
1458
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1346
1459
  * @property {string} key Attribute Key.
1460
+ * @property {boolean} overrideForCli
1347
1461
  * @property {boolean} parseOutput
1348
1462
  * @property {libClient | undefined} sdk
1349
1463
  */
@@ -1351,8 +1465,9 @@ const databasesUpdateUrlAttribute = async ({ databaseId, collectionId, key, requ
1351
1465
  /**
1352
1466
  * @param {DatabasesGetAttributeRequestParams} params
1353
1467
  */
1354
- const databasesGetAttribute = async ({ databaseId, collectionId, key, parseOutput = true, sdk = undefined}) => {
1355
- let client = !sdk ? await sdkForProject() : sdk;
1468
+ const databasesGetAttribute = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1469
+ let client = !sdk ? await sdkForProject() :
1470
+ sdk;
1356
1471
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1357
1472
  let payload = {};
1358
1473
 
@@ -1366,8 +1481,9 @@ const databasesGetAttribute = async ({ databaseId, collectionId, key, parseOutpu
1366
1481
  parse(response)
1367
1482
  success()
1368
1483
  }
1369
-
1484
+
1370
1485
  return response;
1486
+
1371
1487
  }
1372
1488
 
1373
1489
  /**
@@ -1375,6 +1491,7 @@ const databasesGetAttribute = async ({ databaseId, collectionId, key, parseOutpu
1375
1491
  * @property {string} databaseId Database ID.
1376
1492
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1377
1493
  * @property {string} key Attribute Key.
1494
+ * @property {boolean} overrideForCli
1378
1495
  * @property {boolean} parseOutput
1379
1496
  * @property {libClient | undefined} sdk
1380
1497
  */
@@ -1382,8 +1499,9 @@ const databasesGetAttribute = async ({ databaseId, collectionId, key, parseOutpu
1382
1499
  /**
1383
1500
  * @param {DatabasesDeleteAttributeRequestParams} params
1384
1501
  */
1385
- const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOutput = true, sdk = undefined}) => {
1386
- let client = !sdk ? await sdkForProject() : sdk;
1502
+ const databasesDeleteAttribute = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1503
+ let client = !sdk ? await sdkForProject() :
1504
+ sdk;
1387
1505
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1388
1506
  let payload = {};
1389
1507
 
@@ -1397,8 +1515,9 @@ const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOu
1397
1515
  parse(response)
1398
1516
  success()
1399
1517
  }
1400
-
1518
+
1401
1519
  return response;
1520
+
1402
1521
  }
1403
1522
 
1404
1523
  /**
@@ -1407,6 +1526,7 @@ const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOu
1407
1526
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1408
1527
  * @property {string} key Attribute Key.
1409
1528
  * @property {RelationMutate} onDelete Constraints option
1529
+ * @property {boolean} overrideForCli
1410
1530
  * @property {boolean} parseOutput
1411
1531
  * @property {libClient | undefined} sdk
1412
1532
  */
@@ -1414,8 +1534,9 @@ const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOu
1414
1534
  /**
1415
1535
  * @param {DatabasesUpdateRelationshipAttributeRequestParams} params
1416
1536
  */
1417
- const databasesUpdateRelationshipAttribute = async ({ databaseId, collectionId, key, onDelete, parseOutput = true, sdk = undefined}) => {
1418
- let client = !sdk ? await sdkForProject() : sdk;
1537
+ const databasesUpdateRelationshipAttribute = async ({databaseId,collectionId,key,onDelete,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1538
+ let client = !sdk ? await sdkForProject() :
1539
+ sdk;
1419
1540
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1420
1541
  let payload = {};
1421
1542
  if (typeof onDelete !== 'undefined') {
@@ -1432,8 +1553,9 @@ const databasesUpdateRelationshipAttribute = async ({ databaseId, collectionId,
1432
1553
  parse(response)
1433
1554
  success()
1434
1555
  }
1435
-
1556
+
1436
1557
  return response;
1558
+
1437
1559
  }
1438
1560
 
1439
1561
  /**
@@ -1441,6 +1563,7 @@ const databasesUpdateRelationshipAttribute = async ({ databaseId, collectionId,
1441
1563
  * @property {string} databaseId Database ID.
1442
1564
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1443
1565
  * @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.
1566
+ * @property {boolean} overrideForCli
1444
1567
  * @property {boolean} parseOutput
1445
1568
  * @property {libClient | undefined} sdk
1446
1569
  */
@@ -1448,8 +1571,9 @@ const databasesUpdateRelationshipAttribute = async ({ databaseId, collectionId,
1448
1571
  /**
1449
1572
  * @param {DatabasesListDocumentsRequestParams} params
1450
1573
  */
1451
- const databasesListDocuments = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
1452
- let client = !sdk ? await sdkForProject() : sdk;
1574
+ const databasesListDocuments = async ({databaseId,collectionId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1575
+ let client = !sdk ? await sdkForProject() :
1576
+ sdk;
1453
1577
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1454
1578
  let payload = {};
1455
1579
  if (typeof queries !== 'undefined') {
@@ -1463,11 +1587,16 @@ const databasesListDocuments = async ({ databaseId, collectionId, queries, parse
1463
1587
  }, payload);
1464
1588
 
1465
1589
  if (parseOutput) {
1466
- parse(response)
1467
- success()
1590
+ if(console) {
1591
+ showConsoleLink('databases', 'listDocuments', databaseId, collectionId);
1592
+ } else {
1593
+ parse(response)
1594
+ success()
1595
+ }
1468
1596
  }
1469
-
1597
+
1470
1598
  return response;
1599
+
1471
1600
  }
1472
1601
 
1473
1602
  /**
@@ -1477,6 +1606,7 @@ const databasesListDocuments = async ({ databaseId, collectionId, queries, parse
1477
1606
  * @property {string} documentId Document ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1478
1607
  * @property {object} data Document data as JSON object.
1479
1608
  * @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).
1609
+ * @property {boolean} overrideForCli
1480
1610
  * @property {boolean} parseOutput
1481
1611
  * @property {libClient | undefined} sdk
1482
1612
  */
@@ -1484,8 +1614,9 @@ const databasesListDocuments = async ({ databaseId, collectionId, queries, parse
1484
1614
  /**
1485
1615
  * @param {DatabasesCreateDocumentRequestParams} params
1486
1616
  */
1487
- const databasesCreateDocument = async ({ databaseId, collectionId, documentId, data, permissions, parseOutput = true, sdk = undefined}) => {
1488
- let client = !sdk ? await sdkForProject() : sdk;
1617
+ const databasesCreateDocument = async ({databaseId,collectionId,documentId,data,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1618
+ let client = !sdk ? await sdkForProject() :
1619
+ sdk;
1489
1620
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1490
1621
  let payload = {};
1491
1622
  if (typeof documentId !== 'undefined') {
@@ -1509,8 +1640,9 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
1509
1640
  parse(response)
1510
1641
  success()
1511
1642
  }
1512
-
1643
+
1513
1644
  return response;
1645
+
1514
1646
  }
1515
1647
 
1516
1648
  /**
@@ -1519,6 +1651,7 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
1519
1651
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1520
1652
  * @property {string} documentId Document ID.
1521
1653
  * @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.
1654
+ * @property {boolean} overrideForCli
1522
1655
  * @property {boolean} parseOutput
1523
1656
  * @property {libClient | undefined} sdk
1524
1657
  */
@@ -1526,8 +1659,9 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
1526
1659
  /**
1527
1660
  * @param {DatabasesGetDocumentRequestParams} params
1528
1661
  */
1529
- const databasesGetDocument = async ({ databaseId, collectionId, documentId, queries, parseOutput = true, sdk = undefined}) => {
1530
- let client = !sdk ? await sdkForProject() : sdk;
1662
+ const databasesGetDocument = async ({databaseId,collectionId,documentId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1663
+ let client = !sdk ? await sdkForProject() :
1664
+ sdk;
1531
1665
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
1532
1666
  let payload = {};
1533
1667
  if (typeof queries !== 'undefined') {
@@ -1541,11 +1675,16 @@ const databasesGetDocument = async ({ databaseId, collectionId, documentId, quer
1541
1675
  }, payload);
1542
1676
 
1543
1677
  if (parseOutput) {
1544
- parse(response)
1545
- success()
1678
+ if(console) {
1679
+ showConsoleLink('databases', 'getDocument', databaseId, collectionId, documentId);
1680
+ } else {
1681
+ parse(response)
1682
+ success()
1683
+ }
1546
1684
  }
1547
-
1685
+
1548
1686
  return response;
1687
+
1549
1688
  }
1550
1689
 
1551
1690
  /**
@@ -1555,6 +1694,7 @@ const databasesGetDocument = async ({ databaseId, collectionId, documentId, quer
1555
1694
  * @property {string} documentId Document ID.
1556
1695
  * @property {object} data Document data as JSON object. Include only attribute and value pairs to be updated.
1557
1696
  * @property {string[]} permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
1697
+ * @property {boolean} overrideForCli
1558
1698
  * @property {boolean} parseOutput
1559
1699
  * @property {libClient | undefined} sdk
1560
1700
  */
@@ -1562,8 +1702,9 @@ const databasesGetDocument = async ({ databaseId, collectionId, documentId, quer
1562
1702
  /**
1563
1703
  * @param {DatabasesUpdateDocumentRequestParams} params
1564
1704
  */
1565
- const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, data, permissions, parseOutput = true, sdk = undefined}) => {
1566
- let client = !sdk ? await sdkForProject() : sdk;
1705
+ const databasesUpdateDocument = async ({databaseId,collectionId,documentId,data,permissions,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1706
+ let client = !sdk ? await sdkForProject() :
1707
+ sdk;
1567
1708
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
1568
1709
  let payload = {};
1569
1710
  if (typeof data !== 'undefined') {
@@ -1584,8 +1725,9 @@ const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, d
1584
1725
  parse(response)
1585
1726
  success()
1586
1727
  }
1587
-
1728
+
1588
1729
  return response;
1730
+
1589
1731
  }
1590
1732
 
1591
1733
  /**
@@ -1593,6 +1735,7 @@ const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, d
1593
1735
  * @property {string} databaseId Database ID.
1594
1736
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1595
1737
  * @property {string} documentId Document ID.
1738
+ * @property {boolean} overrideForCli
1596
1739
  * @property {boolean} parseOutput
1597
1740
  * @property {libClient | undefined} sdk
1598
1741
  */
@@ -1600,8 +1743,9 @@ const databasesUpdateDocument = async ({ databaseId, collectionId, documentId, d
1600
1743
  /**
1601
1744
  * @param {DatabasesDeleteDocumentRequestParams} params
1602
1745
  */
1603
- const databasesDeleteDocument = async ({ databaseId, collectionId, documentId, parseOutput = true, sdk = undefined}) => {
1604
- let client = !sdk ? await sdkForProject() : sdk;
1746
+ const databasesDeleteDocument = async ({databaseId,collectionId,documentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1747
+ let client = !sdk ? await sdkForProject() :
1748
+ sdk;
1605
1749
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
1606
1750
  let payload = {};
1607
1751
 
@@ -1615,8 +1759,9 @@ const databasesDeleteDocument = async ({ databaseId, collectionId, documentId, p
1615
1759
  parse(response)
1616
1760
  success()
1617
1761
  }
1618
-
1762
+
1619
1763
  return response;
1764
+
1620
1765
  }
1621
1766
 
1622
1767
  /**
@@ -1625,6 +1770,7 @@ const databasesDeleteDocument = async ({ databaseId, collectionId, documentId, p
1625
1770
  * @property {string} collectionId Collection ID.
1626
1771
  * @property {string} documentId Document ID.
1627
1772
  * @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
1773
+ * @property {boolean} overrideForCli
1628
1774
  * @property {boolean} parseOutput
1629
1775
  * @property {libClient | undefined} sdk
1630
1776
  */
@@ -1632,8 +1778,9 @@ const databasesDeleteDocument = async ({ databaseId, collectionId, documentId, p
1632
1778
  /**
1633
1779
  * @param {DatabasesListDocumentLogsRequestParams} params
1634
1780
  */
1635
- const databasesListDocumentLogs = async ({ databaseId, collectionId, documentId, queries, parseOutput = true, sdk = undefined}) => {
1636
- let client = !sdk ? await sdkForProject() : sdk;
1781
+ const databasesListDocumentLogs = async ({databaseId,collectionId,documentId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1782
+ let client = !sdk ? await sdkForProject() :
1783
+ sdk;
1637
1784
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);
1638
1785
  let payload = {};
1639
1786
  if (typeof queries !== 'undefined') {
@@ -1650,8 +1797,9 @@ const databasesListDocumentLogs = async ({ databaseId, collectionId, documentId,
1650
1797
  parse(response)
1651
1798
  success()
1652
1799
  }
1653
-
1800
+
1654
1801
  return response;
1802
+
1655
1803
  }
1656
1804
 
1657
1805
  /**
@@ -1659,6 +1807,7 @@ const databasesListDocumentLogs = async ({ databaseId, collectionId, documentId,
1659
1807
  * @property {string} databaseId Database ID.
1660
1808
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1661
1809
  * @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
1810
+ * @property {boolean} overrideForCli
1662
1811
  * @property {boolean} parseOutput
1663
1812
  * @property {libClient | undefined} sdk
1664
1813
  */
@@ -1666,8 +1815,9 @@ const databasesListDocumentLogs = async ({ databaseId, collectionId, documentId,
1666
1815
  /**
1667
1816
  * @param {DatabasesListIndexesRequestParams} params
1668
1817
  */
1669
- const databasesListIndexes = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
1670
- let client = !sdk ? await sdkForProject() : sdk;
1818
+ const databasesListIndexes = async ({databaseId,collectionId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1819
+ let client = !sdk ? await sdkForProject() :
1820
+ sdk;
1671
1821
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1672
1822
  let payload = {};
1673
1823
  if (typeof queries !== 'undefined') {
@@ -1681,11 +1831,16 @@ const databasesListIndexes = async ({ databaseId, collectionId, queries, parseOu
1681
1831
  }, payload);
1682
1832
 
1683
1833
  if (parseOutput) {
1684
- parse(response)
1685
- success()
1834
+ if(console) {
1835
+ showConsoleLink('databases', 'listIndexes', databaseId, collectionId);
1836
+ } else {
1837
+ parse(response)
1838
+ success()
1839
+ }
1686
1840
  }
1687
-
1841
+
1688
1842
  return response;
1843
+
1689
1844
  }
1690
1845
 
1691
1846
  /**
@@ -1696,6 +1851,7 @@ const databasesListIndexes = async ({ databaseId, collectionId, queries, parseOu
1696
1851
  * @property {IndexType} type Index type.
1697
1852
  * @property {string[]} attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
1698
1853
  * @property {string[]} orders Array of index orders. Maximum of 100 orders are allowed.
1854
+ * @property {boolean} overrideForCli
1699
1855
  * @property {boolean} parseOutput
1700
1856
  * @property {libClient | undefined} sdk
1701
1857
  */
@@ -1703,8 +1859,9 @@ const databasesListIndexes = async ({ databaseId, collectionId, queries, parseOu
1703
1859
  /**
1704
1860
  * @param {DatabasesCreateIndexRequestParams} params
1705
1861
  */
1706
- const databasesCreateIndex = async ({ databaseId, collectionId, key, type, attributes, orders, parseOutput = true, sdk = undefined}) => {
1707
- let client = !sdk ? await sdkForProject() : sdk;
1862
+ const databasesCreateIndex = async ({databaseId,collectionId,key,type,attributes,orders,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1863
+ let client = !sdk ? await sdkForProject() :
1864
+ sdk;
1708
1865
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1709
1866
  let payload = {};
1710
1867
  if (typeof key !== 'undefined') {
@@ -1732,8 +1889,9 @@ const databasesCreateIndex = async ({ databaseId, collectionId, key, type, attri
1732
1889
  parse(response)
1733
1890
  success()
1734
1891
  }
1735
-
1892
+
1736
1893
  return response;
1894
+
1737
1895
  }
1738
1896
 
1739
1897
  /**
@@ -1741,6 +1899,7 @@ const databasesCreateIndex = async ({ databaseId, collectionId, key, type, attri
1741
1899
  * @property {string} databaseId Database ID.
1742
1900
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1743
1901
  * @property {string} key Index Key.
1902
+ * @property {boolean} overrideForCli
1744
1903
  * @property {boolean} parseOutput
1745
1904
  * @property {libClient | undefined} sdk
1746
1905
  */
@@ -1748,8 +1907,9 @@ const databasesCreateIndex = async ({ databaseId, collectionId, key, type, attri
1748
1907
  /**
1749
1908
  * @param {DatabasesGetIndexRequestParams} params
1750
1909
  */
1751
- const databasesGetIndex = async ({ databaseId, collectionId, key, parseOutput = true, sdk = undefined}) => {
1752
- let client = !sdk ? await sdkForProject() : sdk;
1910
+ const databasesGetIndex = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1911
+ let client = !sdk ? await sdkForProject() :
1912
+ sdk;
1753
1913
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1754
1914
  let payload = {};
1755
1915
 
@@ -1763,8 +1923,9 @@ const databasesGetIndex = async ({ databaseId, collectionId, key, parseOutput =
1763
1923
  parse(response)
1764
1924
  success()
1765
1925
  }
1766
-
1926
+
1767
1927
  return response;
1928
+
1768
1929
  }
1769
1930
 
1770
1931
  /**
@@ -1772,6 +1933,7 @@ const databasesGetIndex = async ({ databaseId, collectionId, key, parseOutput =
1772
1933
  * @property {string} databaseId Database ID.
1773
1934
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1774
1935
  * @property {string} key Index Key.
1936
+ * @property {boolean} overrideForCli
1775
1937
  * @property {boolean} parseOutput
1776
1938
  * @property {libClient | undefined} sdk
1777
1939
  */
@@ -1779,8 +1941,9 @@ const databasesGetIndex = async ({ databaseId, collectionId, key, parseOutput =
1779
1941
  /**
1780
1942
  * @param {DatabasesDeleteIndexRequestParams} params
1781
1943
  */
1782
- const databasesDeleteIndex = async ({ databaseId, collectionId, key, parseOutput = true, sdk = undefined}) => {
1783
- let client = !sdk ? await sdkForProject() : sdk;
1944
+ const databasesDeleteIndex = async ({databaseId,collectionId,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1945
+ let client = !sdk ? await sdkForProject() :
1946
+ sdk;
1784
1947
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);
1785
1948
  let payload = {};
1786
1949
 
@@ -1794,8 +1957,9 @@ const databasesDeleteIndex = async ({ databaseId, collectionId, key, parseOutput
1794
1957
  parse(response)
1795
1958
  success()
1796
1959
  }
1797
-
1960
+
1798
1961
  return response;
1962
+
1799
1963
  }
1800
1964
 
1801
1965
  /**
@@ -1803,6 +1967,7 @@ const databasesDeleteIndex = async ({ databaseId, collectionId, key, parseOutput
1803
1967
  * @property {string} databaseId Database ID.
1804
1968
  * @property {string} collectionId Collection ID.
1805
1969
  * @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
1970
+ * @property {boolean} overrideForCli
1806
1971
  * @property {boolean} parseOutput
1807
1972
  * @property {libClient | undefined} sdk
1808
1973
  */
@@ -1810,8 +1975,9 @@ const databasesDeleteIndex = async ({ databaseId, collectionId, key, parseOutput
1810
1975
  /**
1811
1976
  * @param {DatabasesListCollectionLogsRequestParams} params
1812
1977
  */
1813
- const databasesListCollectionLogs = async ({ databaseId, collectionId, queries, parseOutput = true, sdk = undefined}) => {
1814
- let client = !sdk ? await sdkForProject() : sdk;
1978
+ const databasesListCollectionLogs = async ({databaseId,collectionId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1979
+ let client = !sdk ? await sdkForProject() :
1980
+ sdk;
1815
1981
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1816
1982
  let payload = {};
1817
1983
  if (typeof queries !== 'undefined') {
@@ -1828,8 +1994,9 @@ const databasesListCollectionLogs = async ({ databaseId, collectionId, queries,
1828
1994
  parse(response)
1829
1995
  success()
1830
1996
  }
1831
-
1997
+
1832
1998
  return response;
1999
+
1833
2000
  }
1834
2001
 
1835
2002
  /**
@@ -1837,6 +2004,7 @@ const databasesListCollectionLogs = async ({ databaseId, collectionId, queries,
1837
2004
  * @property {string} databaseId Database ID.
1838
2005
  * @property {string} collectionId Collection ID.
1839
2006
  * @property {DatabaseUsageRange} range Date range.
2007
+ * @property {boolean} overrideForCli
1840
2008
  * @property {boolean} parseOutput
1841
2009
  * @property {libClient | undefined} sdk
1842
2010
  */
@@ -1844,8 +2012,9 @@ const databasesListCollectionLogs = async ({ databaseId, collectionId, queries,
1844
2012
  /**
1845
2013
  * @param {DatabasesGetCollectionUsageRequestParams} params
1846
2014
  */
1847
- const databasesGetCollectionUsage = async ({ databaseId, collectionId, range, parseOutput = true, sdk = undefined}) => {
1848
- let client = !sdk ? await sdkForProject() : sdk;
2015
+ const databasesGetCollectionUsage = async ({databaseId,collectionId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2016
+ let client = !sdk ? await sdkForProject() :
2017
+ sdk;
1849
2018
  let apiPath = '/databases/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
1850
2019
  let payload = {};
1851
2020
  if (typeof range !== 'undefined') {
@@ -1862,14 +2031,16 @@ const databasesGetCollectionUsage = async ({ databaseId, collectionId, range, pa
1862
2031
  parse(response)
1863
2032
  success()
1864
2033
  }
1865
-
2034
+
1866
2035
  return response;
2036
+
1867
2037
  }
1868
2038
 
1869
2039
  /**
1870
2040
  * @typedef {Object} DatabasesListLogsRequestParams
1871
2041
  * @property {string} databaseId Database ID.
1872
2042
  * @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
2043
+ * @property {boolean} overrideForCli
1873
2044
  * @property {boolean} parseOutput
1874
2045
  * @property {libClient | undefined} sdk
1875
2046
  */
@@ -1877,8 +2048,9 @@ const databasesGetCollectionUsage = async ({ databaseId, collectionId, range, pa
1877
2048
  /**
1878
2049
  * @param {DatabasesListLogsRequestParams} params
1879
2050
  */
1880
- const databasesListLogs = async ({ databaseId, queries, parseOutput = true, sdk = undefined}) => {
1881
- let client = !sdk ? await sdkForProject() : sdk;
2051
+ const databasesListLogs = async ({databaseId,queries,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2052
+ let client = !sdk ? await sdkForProject() :
2053
+ sdk;
1882
2054
  let apiPath = '/databases/{databaseId}/logs'.replace('{databaseId}', databaseId);
1883
2055
  let payload = {};
1884
2056
  if (typeof queries !== 'undefined') {
@@ -1895,14 +2067,16 @@ const databasesListLogs = async ({ databaseId, queries, parseOutput = true, sdk
1895
2067
  parse(response)
1896
2068
  success()
1897
2069
  }
1898
-
2070
+
1899
2071
  return response;
2072
+
1900
2073
  }
1901
2074
 
1902
2075
  /**
1903
2076
  * @typedef {Object} DatabasesGetDatabaseUsageRequestParams
1904
2077
  * @property {string} databaseId Database ID.
1905
2078
  * @property {DatabaseUsageRange} range 'Date range.
2079
+ * @property {boolean} overrideForCli
1906
2080
  * @property {boolean} parseOutput
1907
2081
  * @property {libClient | undefined} sdk
1908
2082
  */
@@ -1910,8 +2084,9 @@ const databasesListLogs = async ({ databaseId, queries, parseOutput = true, sdk
1910
2084
  /**
1911
2085
  * @param {DatabasesGetDatabaseUsageRequestParams} params
1912
2086
  */
1913
- const databasesGetDatabaseUsage = async ({ databaseId, range, parseOutput = true, sdk = undefined}) => {
1914
- let client = !sdk ? await sdkForProject() : sdk;
2087
+ const databasesGetDatabaseUsage = async ({databaseId,range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
2088
+ let client = !sdk ? await sdkForProject() :
2089
+ sdk;
1915
2090
  let apiPath = '/databases/{databaseId}/usage'.replace('{databaseId}', databaseId);
1916
2091
  let payload = {};
1917
2092
  if (typeof range !== 'undefined') {
@@ -1925,11 +2100,16 @@ const databasesGetDatabaseUsage = async ({ databaseId, range, parseOutput = true
1925
2100
  }, payload);
1926
2101
 
1927
2102
  if (parseOutput) {
1928
- parse(response)
1929
- success()
2103
+ if(console) {
2104
+ showConsoleLink('databases', 'getDatabaseUsage', databaseId);
2105
+ } else {
2106
+ parse(response)
2107
+ success()
2108
+ }
1930
2109
  }
1931
-
2110
+
1932
2111
  return response;
2112
+
1933
2113
  }
1934
2114
 
1935
2115
  databases
@@ -1937,6 +2117,7 @@ databases
1937
2117
  .description(`Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.`)
1938
2118
  .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`)
1939
2119
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2120
+ .option(`--console`, `Get the resource console url`)
1940
2121
  .action(actionRunner(databasesList))
1941
2122
 
1942
2123
  databases
@@ -1957,6 +2138,7 @@ databases
1957
2138
  .command(`get`)
1958
2139
  .description(`Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.`)
1959
2140
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2141
+ .option(`--console`, `Get the resource console url`)
1960
2142
  .action(actionRunner(databasesGet))
1961
2143
 
1962
2144
  databases
@@ -1979,6 +2161,7 @@ databases
1979
2161
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1980
2162
  .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`)
1981
2163
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2164
+ .option(`--console`, `Get the resource console url`)
1982
2165
  .action(actionRunner(databasesListCollections))
1983
2166
 
1984
2167
  databases
@@ -1997,6 +2180,7 @@ databases
1997
2180
  .description(`Get a collection by its unique ID. This endpoint response returns a JSON object with the collection metadata.`)
1998
2181
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
1999
2182
  .requiredOption(`--collectionId <collectionId>`, `Collection ID.`)
2183
+ .option(`--console`, `Get the resource console url`)
2000
2184
  .action(actionRunner(databasesGetCollection))
2001
2185
 
2002
2186
  databases
@@ -2023,6 +2207,7 @@ databases
2023
2207
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2024
2208
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2025
2209
  .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`)
2210
+ .option(`--console`, `Get the resource console url`)
2026
2211
  .action(actionRunner(databasesListAttributes))
2027
2212
 
2028
2213
  databases
@@ -2270,6 +2455,7 @@ databases
2270
2455
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2271
2456
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2272
2457
  .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.`)
2458
+ .option(`--console`, `Get the resource console url`)
2273
2459
  .action(actionRunner(databasesListDocuments))
2274
2460
 
2275
2461
  databases
@@ -2289,6 +2475,7 @@ databases
2289
2475
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2290
2476
  .requiredOption(`--documentId <documentId>`, `Document ID.`)
2291
2477
  .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.`)
2478
+ .option(`--console`, `Get the resource console url`)
2292
2479
  .action(actionRunner(databasesGetDocument))
2293
2480
 
2294
2481
  databases
@@ -2324,6 +2511,7 @@ databases
2324
2511
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2325
2512
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2326
2513
  .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`)
2514
+ .option(`--console`, `Get the resource console url`)
2327
2515
  .action(actionRunner(databasesListIndexes))
2328
2516
 
2329
2517
  databases
@@ -2381,6 +2569,7 @@ databases
2381
2569
  .description(``)
2382
2570
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2383
2571
  .option(`--range <range>`, `'Date range.`)
2572
+ .option(`--console`, `Get the resource console url`)
2384
2573
  .action(actionRunner(databasesGetDatabaseUsage))
2385
2574
 
2386
2575
  module.exports = {
@@ -2433,4 +2622,4 @@ module.exports = {
2433
2622
  databasesGetCollectionUsage,
2434
2623
  databasesListLogs,
2435
2624
  databasesGetDatabaseUsage
2436
- };
2625
+ };