appwrite-cli 5.0.5 → 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 (53) 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/projects/create-j-w-t.md +4 -0
  9. package/docs/examples/projects/update-mock-numbers.md +3 -0
  10. package/docs/examples/projects/update-session-alerts.md +3 -0
  11. package/docs/examples/users/create-j-w-t.md +4 -0
  12. package/docs/examples/vcs/get-repository-contents.md +4 -0
  13. package/index.js +34 -7
  14. package/install.ps1 +3 -3
  15. package/install.sh +2 -2
  16. package/lib/client.js +17 -3
  17. package/lib/commands/account.js +306 -152
  18. package/lib/commands/assistant.js +8 -5
  19. package/lib/commands/avatars.js +114 -58
  20. package/lib/commands/console.js +8 -5
  21. package/lib/commands/databases.js +353 -164
  22. package/lib/commands/functions.js +310 -100
  23. package/lib/commands/generic.js +206 -54
  24. package/lib/commands/graphql.js +14 -8
  25. package/lib/commands/health.js +140 -71
  26. package/lib/commands/init.js +250 -155
  27. package/lib/commands/locale.js +50 -26
  28. package/lib/commands/messaging.js +334 -156
  29. package/lib/commands/migrations.js +98 -50
  30. package/lib/commands/project.js +38 -20
  31. package/lib/commands/projects.js +449 -144
  32. package/lib/commands/proxy.js +32 -17
  33. package/lib/commands/pull.js +231 -0
  34. package/lib/commands/push.js +1518 -0
  35. package/lib/commands/run.js +282 -0
  36. package/lib/commands/storage.js +160 -76
  37. package/lib/commands/teams.js +102 -50
  38. package/lib/commands/users.js +324 -134
  39. package/lib/commands/vcs.js +102 -29
  40. package/lib/config.js +190 -18
  41. package/lib/emulation/docker.js +187 -0
  42. package/lib/emulation/utils.js +177 -0
  43. package/lib/id.js +30 -0
  44. package/lib/paginate.js +1 -2
  45. package/lib/parser.js +69 -12
  46. package/lib/questions.js +452 -80
  47. package/lib/sdks.js +1 -1
  48. package/lib/spinner.js +103 -0
  49. package/lib/utils.js +242 -4
  50. package/lib/validations.js +17 -0
  51. package/package.json +6 -2
  52. package/scoop/appwrite.json +3 -3
  53. package/lib/commands/deploy.js +0 -940
@@ -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 migrations = new Command("migrations").description(commandDescriptions['mi
43
43
  * @typedef {Object} MigrationsListRequestParams
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/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, resources, statusCounters, resourceData, errors
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 migrations = new Command("migrations").description(commandDescriptions['mi
50
51
  /**
51
52
  * @param {MigrationsListRequestParams} params
52
53
  */
53
- const migrationsList = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
54
- let client = !sdk ? await sdkForProject() : sdk;
54
+ const migrationsList = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
55
+ let client = !sdk ? await sdkForProject() :
56
+ sdk;
55
57
  let apiPath = '/migrations';
56
58
  let payload = {};
57
59
  if (typeof queries !== 'undefined') {
@@ -71,8 +73,9 @@ const migrationsList = async ({ queries, search, parseOutput = true, sdk = undef
71
73
  parse(response)
72
74
  success()
73
75
  }
74
-
76
+
75
77
  return response;
78
+
76
79
  }
77
80
 
78
81
  /**
@@ -81,6 +84,7 @@ const migrationsList = async ({ queries, search, parseOutput = true, sdk = undef
81
84
  * @property {string} endpoint Source's Appwrite Endpoint
82
85
  * @property {string} projectId Source's Project ID
83
86
  * @property {string} apiKey Source's API Key
87
+ * @property {boolean} overrideForCli
84
88
  * @property {boolean} parseOutput
85
89
  * @property {libClient | undefined} sdk
86
90
  */
@@ -88,8 +92,9 @@ const migrationsList = async ({ queries, search, parseOutput = true, sdk = undef
88
92
  /**
89
93
  * @param {MigrationsCreateAppwriteMigrationRequestParams} params
90
94
  */
91
- const migrationsCreateAppwriteMigration = async ({ resources, endpoint, projectId, apiKey, parseOutput = true, sdk = undefined}) => {
92
- let client = !sdk ? await sdkForProject() : sdk;
95
+ const migrationsCreateAppwriteMigration = async ({resources,endpoint,projectId,apiKey,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
96
+ let client = !sdk ? await sdkForProject() :
97
+ sdk;
93
98
  let apiPath = '/migrations/appwrite';
94
99
  let payload = {};
95
100
  resources = resources === true ? [] : resources;
@@ -116,8 +121,9 @@ const migrationsCreateAppwriteMigration = async ({ resources, endpoint, projectI
116
121
  parse(response)
117
122
  success()
118
123
  }
119
-
124
+
120
125
  return response;
126
+
121
127
  }
122
128
 
123
129
  /**
@@ -126,6 +132,7 @@ const migrationsCreateAppwriteMigration = async ({ resources, endpoint, projectI
126
132
  * @property {string} endpoint Source's Appwrite Endpoint
127
133
  * @property {string} projectID Source's Project ID
128
134
  * @property {string} key Source's API Key
135
+ * @property {boolean} overrideForCli
129
136
  * @property {boolean} parseOutput
130
137
  * @property {libClient | undefined} sdk
131
138
  */
@@ -133,8 +140,9 @@ const migrationsCreateAppwriteMigration = async ({ resources, endpoint, projectI
133
140
  /**
134
141
  * @param {MigrationsGetAppwriteReportRequestParams} params
135
142
  */
136
- const migrationsGetAppwriteReport = async ({ resources, endpoint, projectID, key, parseOutput = true, sdk = undefined}) => {
137
- let client = !sdk ? await sdkForProject() : sdk;
143
+ const migrationsGetAppwriteReport = async ({resources,endpoint,projectID,key,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
144
+ let client = !sdk ? await sdkForProject() :
145
+ sdk;
138
146
  let apiPath = '/migrations/appwrite/report';
139
147
  let payload = {};
140
148
  if (typeof resources !== 'undefined') {
@@ -160,14 +168,16 @@ const migrationsGetAppwriteReport = async ({ resources, endpoint, projectID, key
160
168
  parse(response)
161
169
  success()
162
170
  }
163
-
171
+
164
172
  return response;
173
+
165
174
  }
166
175
 
167
176
  /**
168
177
  * @typedef {Object} MigrationsCreateFirebaseMigrationRequestParams
169
178
  * @property {string[]} resources List of resources to migrate
170
179
  * @property {string} serviceAccount JSON of the Firebase service account credentials
180
+ * @property {boolean} overrideForCli
171
181
  * @property {boolean} parseOutput
172
182
  * @property {libClient | undefined} sdk
173
183
  */
@@ -175,8 +185,9 @@ const migrationsGetAppwriteReport = async ({ resources, endpoint, projectID, key
175
185
  /**
176
186
  * @param {MigrationsCreateFirebaseMigrationRequestParams} params
177
187
  */
178
- const migrationsCreateFirebaseMigration = async ({ resources, serviceAccount, parseOutput = true, sdk = undefined}) => {
179
- let client = !sdk ? await sdkForProject() : sdk;
188
+ const migrationsCreateFirebaseMigration = async ({resources,serviceAccount,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
189
+ let client = !sdk ? await sdkForProject() :
190
+ sdk;
180
191
  let apiPath = '/migrations/firebase';
181
192
  let payload = {};
182
193
  resources = resources === true ? [] : resources;
@@ -197,12 +208,14 @@ const migrationsCreateFirebaseMigration = async ({ resources, serviceAccount, pa
197
208
  parse(response)
198
209
  success()
199
210
  }
200
-
211
+
201
212
  return response;
213
+
202
214
  }
203
215
 
204
216
  /**
205
217
  * @typedef {Object} MigrationsDeleteFirebaseAuthRequestParams
218
+ * @property {boolean} overrideForCli
206
219
  * @property {boolean} parseOutput
207
220
  * @property {libClient | undefined} sdk
208
221
  */
@@ -210,8 +223,9 @@ const migrationsCreateFirebaseMigration = async ({ resources, serviceAccount, pa
210
223
  /**
211
224
  * @param {MigrationsDeleteFirebaseAuthRequestParams} params
212
225
  */
213
- const migrationsDeleteFirebaseAuth = async ({ parseOutput = true, sdk = undefined}) => {
214
- let client = !sdk ? await sdkForProject() : sdk;
226
+ const migrationsDeleteFirebaseAuth = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
227
+ let client = !sdk ? await sdkForProject() :
228
+ sdk;
215
229
  let apiPath = '/migrations/firebase/deauthorize';
216
230
  let payload = {};
217
231
 
@@ -225,14 +239,16 @@ const migrationsDeleteFirebaseAuth = async ({ parseOutput = true, sdk = undefine
225
239
  parse(response)
226
240
  success()
227
241
  }
228
-
242
+
229
243
  return response;
244
+
230
245
  }
231
246
 
232
247
  /**
233
248
  * @typedef {Object} MigrationsCreateFirebaseOAuthMigrationRequestParams
234
249
  * @property {string[]} resources List of resources to migrate
235
250
  * @property {string} projectId Project ID of the Firebase Project
251
+ * @property {boolean} overrideForCli
236
252
  * @property {boolean} parseOutput
237
253
  * @property {libClient | undefined} sdk
238
254
  */
@@ -240,8 +256,9 @@ const migrationsDeleteFirebaseAuth = async ({ parseOutput = true, sdk = undefine
240
256
  /**
241
257
  * @param {MigrationsCreateFirebaseOAuthMigrationRequestParams} params
242
258
  */
243
- const migrationsCreateFirebaseOAuthMigration = async ({ resources, projectId, parseOutput = true, sdk = undefined}) => {
244
- let client = !sdk ? await sdkForProject() : sdk;
259
+ const migrationsCreateFirebaseOAuthMigration = async ({resources,projectId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
260
+ let client = !sdk ? await sdkForProject() :
261
+ sdk;
245
262
  let apiPath = '/migrations/firebase/oauth';
246
263
  let payload = {};
247
264
  resources = resources === true ? [] : resources;
@@ -262,12 +279,14 @@ const migrationsCreateFirebaseOAuthMigration = async ({ resources, projectId, pa
262
279
  parse(response)
263
280
  success()
264
281
  }
265
-
282
+
266
283
  return response;
284
+
267
285
  }
268
286
 
269
287
  /**
270
288
  * @typedef {Object} MigrationsListFirebaseProjectsRequestParams
289
+ * @property {boolean} overrideForCli
271
290
  * @property {boolean} parseOutput
272
291
  * @property {libClient | undefined} sdk
273
292
  */
@@ -275,8 +294,9 @@ const migrationsCreateFirebaseOAuthMigration = async ({ resources, projectId, pa
275
294
  /**
276
295
  * @param {MigrationsListFirebaseProjectsRequestParams} params
277
296
  */
278
- const migrationsListFirebaseProjects = async ({ parseOutput = true, sdk = undefined}) => {
279
- let client = !sdk ? await sdkForProject() : sdk;
297
+ const migrationsListFirebaseProjects = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
298
+ let client = !sdk ? await sdkForProject() :
299
+ sdk;
280
300
  let apiPath = '/migrations/firebase/projects';
281
301
  let payload = {};
282
302
 
@@ -290,14 +310,16 @@ const migrationsListFirebaseProjects = async ({ parseOutput = true, sdk = undefi
290
310
  parse(response)
291
311
  success()
292
312
  }
293
-
313
+
294
314
  return response;
315
+
295
316
  }
296
317
 
297
318
  /**
298
319
  * @typedef {Object} MigrationsGetFirebaseReportRequestParams
299
320
  * @property {string[]} resources List of resources to migrate
300
321
  * @property {string} serviceAccount JSON of the Firebase service account credentials
322
+ * @property {boolean} overrideForCli
301
323
  * @property {boolean} parseOutput
302
324
  * @property {libClient | undefined} sdk
303
325
  */
@@ -305,8 +327,9 @@ const migrationsListFirebaseProjects = async ({ parseOutput = true, sdk = undefi
305
327
  /**
306
328
  * @param {MigrationsGetFirebaseReportRequestParams} params
307
329
  */
308
- const migrationsGetFirebaseReport = async ({ resources, serviceAccount, parseOutput = true, sdk = undefined}) => {
309
- let client = !sdk ? await sdkForProject() : sdk;
330
+ const migrationsGetFirebaseReport = async ({resources,serviceAccount,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
331
+ let client = !sdk ? await sdkForProject() :
332
+ sdk;
310
333
  let apiPath = '/migrations/firebase/report';
311
334
  let payload = {};
312
335
  if (typeof resources !== 'undefined') {
@@ -326,14 +349,16 @@ const migrationsGetFirebaseReport = async ({ resources, serviceAccount, parseOut
326
349
  parse(response)
327
350
  success()
328
351
  }
329
-
352
+
330
353
  return response;
354
+
331
355
  }
332
356
 
333
357
  /**
334
358
  * @typedef {Object} MigrationsGetFirebaseReportOAuthRequestParams
335
359
  * @property {string[]} resources List of resources to migrate
336
360
  * @property {string} projectId Project ID
361
+ * @property {boolean} overrideForCli
337
362
  * @property {boolean} parseOutput
338
363
  * @property {libClient | undefined} sdk
339
364
  */
@@ -341,8 +366,9 @@ const migrationsGetFirebaseReport = async ({ resources, serviceAccount, parseOut
341
366
  /**
342
367
  * @param {MigrationsGetFirebaseReportOAuthRequestParams} params
343
368
  */
344
- const migrationsGetFirebaseReportOAuth = async ({ resources, projectId, parseOutput = true, sdk = undefined}) => {
345
- let client = !sdk ? await sdkForProject() : sdk;
369
+ const migrationsGetFirebaseReportOAuth = async ({resources,projectId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
370
+ let client = !sdk ? await sdkForProject() :
371
+ sdk;
346
372
  let apiPath = '/migrations/firebase/report/oauth';
347
373
  let payload = {};
348
374
  if (typeof resources !== 'undefined') {
@@ -362,8 +388,9 @@ const migrationsGetFirebaseReportOAuth = async ({ resources, projectId, parseOut
362
388
  parse(response)
363
389
  success()
364
390
  }
365
-
391
+
366
392
  return response;
393
+
367
394
  }
368
395
 
369
396
  /**
@@ -376,6 +403,7 @@ const migrationsGetFirebaseReportOAuth = async ({ resources, projectId, parseOut
376
403
  * @property {string} username Source's Database Username
377
404
  * @property {string} password Source's Database Password
378
405
  * @property {number} port Source's Database Port
406
+ * @property {boolean} overrideForCli
379
407
  * @property {boolean} parseOutput
380
408
  * @property {libClient | undefined} sdk
381
409
  */
@@ -383,8 +411,9 @@ const migrationsGetFirebaseReportOAuth = async ({ resources, projectId, parseOut
383
411
  /**
384
412
  * @param {MigrationsCreateNHostMigrationRequestParams} params
385
413
  */
386
- const migrationsCreateNHostMigration = async ({ resources, subdomain, region, adminSecret, database, username, password, port, parseOutput = true, sdk = undefined}) => {
387
- let client = !sdk ? await sdkForProject() : sdk;
414
+ const migrationsCreateNHostMigration = async ({resources,subdomain,region,adminSecret,database,username,password,port,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
415
+ let client = !sdk ? await sdkForProject() :
416
+ sdk;
388
417
  let apiPath = '/migrations/nhost';
389
418
  let payload = {};
390
419
  resources = resources === true ? [] : resources;
@@ -423,8 +452,9 @@ const migrationsCreateNHostMigration = async ({ resources, subdomain, region, ad
423
452
  parse(response)
424
453
  success()
425
454
  }
426
-
455
+
427
456
  return response;
457
+
428
458
  }
429
459
 
430
460
  /**
@@ -437,6 +467,7 @@ const migrationsCreateNHostMigration = async ({ resources, subdomain, region, ad
437
467
  * @property {string} username Source's Database Username.
438
468
  * @property {string} password Source's Database Password.
439
469
  * @property {number} port Source's Database Port.
470
+ * @property {boolean} overrideForCli
440
471
  * @property {boolean} parseOutput
441
472
  * @property {libClient | undefined} sdk
442
473
  */
@@ -444,8 +475,9 @@ const migrationsCreateNHostMigration = async ({ resources, subdomain, region, ad
444
475
  /**
445
476
  * @param {MigrationsGetNHostReportRequestParams} params
446
477
  */
447
- const migrationsGetNHostReport = async ({ resources, subdomain, region, adminSecret, database, username, password, port, parseOutput = true, sdk = undefined}) => {
448
- let client = !sdk ? await sdkForProject() : sdk;
478
+ const migrationsGetNHostReport = async ({resources,subdomain,region,adminSecret,database,username,password,port,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
479
+ let client = !sdk ? await sdkForProject() :
480
+ sdk;
449
481
  let apiPath = '/migrations/nhost/report';
450
482
  let payload = {};
451
483
  if (typeof resources !== 'undefined') {
@@ -483,8 +515,9 @@ const migrationsGetNHostReport = async ({ resources, subdomain, region, adminSec
483
515
  parse(response)
484
516
  success()
485
517
  }
486
-
518
+
487
519
  return response;
520
+
488
521
  }
489
522
 
490
523
  /**
@@ -496,6 +529,7 @@ const migrationsGetNHostReport = async ({ resources, subdomain, region, adminSec
496
529
  * @property {string} username Source's Database Username
497
530
  * @property {string} password Source's Database Password
498
531
  * @property {number} port Source's Database Port
532
+ * @property {boolean} overrideForCli
499
533
  * @property {boolean} parseOutput
500
534
  * @property {libClient | undefined} sdk
501
535
  */
@@ -503,8 +537,9 @@ const migrationsGetNHostReport = async ({ resources, subdomain, region, adminSec
503
537
  /**
504
538
  * @param {MigrationsCreateSupabaseMigrationRequestParams} params
505
539
  */
506
- const migrationsCreateSupabaseMigration = async ({ resources, endpoint, apiKey, databaseHost, username, password, port, parseOutput = true, sdk = undefined}) => {
507
- let client = !sdk ? await sdkForProject() : sdk;
540
+ const migrationsCreateSupabaseMigration = async ({resources,endpoint,apiKey,databaseHost,username,password,port,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
541
+ let client = !sdk ? await sdkForProject() :
542
+ sdk;
508
543
  let apiPath = '/migrations/supabase';
509
544
  let payload = {};
510
545
  resources = resources === true ? [] : resources;
@@ -540,8 +575,9 @@ const migrationsCreateSupabaseMigration = async ({ resources, endpoint, apiKey,
540
575
  parse(response)
541
576
  success()
542
577
  }
543
-
578
+
544
579
  return response;
580
+
545
581
  }
546
582
 
547
583
  /**
@@ -553,6 +589,7 @@ const migrationsCreateSupabaseMigration = async ({ resources, endpoint, apiKey,
553
589
  * @property {string} username Source's Database Username.
554
590
  * @property {string} password Source's Database Password.
555
591
  * @property {number} port Source's Database Port.
592
+ * @property {boolean} overrideForCli
556
593
  * @property {boolean} parseOutput
557
594
  * @property {libClient | undefined} sdk
558
595
  */
@@ -560,8 +597,9 @@ const migrationsCreateSupabaseMigration = async ({ resources, endpoint, apiKey,
560
597
  /**
561
598
  * @param {MigrationsGetSupabaseReportRequestParams} params
562
599
  */
563
- const migrationsGetSupabaseReport = async ({ resources, endpoint, apiKey, databaseHost, username, password, port, parseOutput = true, sdk = undefined}) => {
564
- let client = !sdk ? await sdkForProject() : sdk;
600
+ const migrationsGetSupabaseReport = async ({resources,endpoint,apiKey,databaseHost,username,password,port,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
601
+ let client = !sdk ? await sdkForProject() :
602
+ sdk;
565
603
  let apiPath = '/migrations/supabase/report';
566
604
  let payload = {};
567
605
  if (typeof resources !== 'undefined') {
@@ -596,13 +634,15 @@ const migrationsGetSupabaseReport = async ({ resources, endpoint, apiKey, databa
596
634
  parse(response)
597
635
  success()
598
636
  }
599
-
637
+
600
638
  return response;
639
+
601
640
  }
602
641
 
603
642
  /**
604
643
  * @typedef {Object} MigrationsGetRequestParams
605
644
  * @property {string} migrationId Migration unique ID.
645
+ * @property {boolean} overrideForCli
606
646
  * @property {boolean} parseOutput
607
647
  * @property {libClient | undefined} sdk
608
648
  */
@@ -610,8 +650,9 @@ const migrationsGetSupabaseReport = async ({ resources, endpoint, apiKey, databa
610
650
  /**
611
651
  * @param {MigrationsGetRequestParams} params
612
652
  */
613
- const migrationsGet = async ({ migrationId, parseOutput = true, sdk = undefined}) => {
614
- let client = !sdk ? await sdkForProject() : sdk;
653
+ const migrationsGet = async ({migrationId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
654
+ let client = !sdk ? await sdkForProject() :
655
+ sdk;
615
656
  let apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
616
657
  let payload = {};
617
658
 
@@ -625,13 +666,15 @@ const migrationsGet = async ({ migrationId, parseOutput = true, sdk = undefined}
625
666
  parse(response)
626
667
  success()
627
668
  }
628
-
669
+
629
670
  return response;
671
+
630
672
  }
631
673
 
632
674
  /**
633
675
  * @typedef {Object} MigrationsRetryRequestParams
634
676
  * @property {string} migrationId Migration unique ID.
677
+ * @property {boolean} overrideForCli
635
678
  * @property {boolean} parseOutput
636
679
  * @property {libClient | undefined} sdk
637
680
  */
@@ -639,8 +682,9 @@ const migrationsGet = async ({ migrationId, parseOutput = true, sdk = undefined}
639
682
  /**
640
683
  * @param {MigrationsRetryRequestParams} params
641
684
  */
642
- const migrationsRetry = async ({ migrationId, parseOutput = true, sdk = undefined}) => {
643
- let client = !sdk ? await sdkForProject() : sdk;
685
+ const migrationsRetry = async ({migrationId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
686
+ let client = !sdk ? await sdkForProject() :
687
+ sdk;
644
688
  let apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
645
689
  let payload = {};
646
690
 
@@ -654,13 +698,15 @@ const migrationsRetry = async ({ migrationId, parseOutput = true, sdk = undefine
654
698
  parse(response)
655
699
  success()
656
700
  }
657
-
701
+
658
702
  return response;
703
+
659
704
  }
660
705
 
661
706
  /**
662
707
  * @typedef {Object} MigrationsDeleteRequestParams
663
708
  * @property {string} migrationId Migration ID.
709
+ * @property {boolean} overrideForCli
664
710
  * @property {boolean} parseOutput
665
711
  * @property {libClient | undefined} sdk
666
712
  */
@@ -668,8 +714,9 @@ const migrationsRetry = async ({ migrationId, parseOutput = true, sdk = undefine
668
714
  /**
669
715
  * @param {MigrationsDeleteRequestParams} params
670
716
  */
671
- const migrationsDelete = async ({ migrationId, parseOutput = true, sdk = undefined}) => {
672
- let client = !sdk ? await sdkForProject() : sdk;
717
+ const migrationsDelete = async ({migrationId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
718
+ let client = !sdk ? await sdkForProject() :
719
+ sdk;
673
720
  let apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
674
721
  let payload = {};
675
722
 
@@ -683,8 +730,9 @@ const migrationsDelete = async ({ migrationId, parseOutput = true, sdk = undefin
683
730
  parse(response)
684
731
  success()
685
732
  }
686
-
733
+
687
734
  return response;
735
+
688
736
  }
689
737
 
690
738
  migrations
@@ -836,4 +884,4 @@ module.exports = {
836
884
  migrationsGet,
837
885
  migrationsRetry,
838
886
  migrationsDelete
839
- };
887
+ };
@@ -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')
@@ -44,6 +44,7 @@ const project = new Command("project").description(commandDescriptions['project'
44
44
  * @property {string} startDate Starting date for the usage
45
45
  * @property {string} endDate End date for the usage
46
46
  * @property {ProjectUsageRange} period Period used
47
+ * @property {boolean} overrideForCli
47
48
  * @property {boolean} parseOutput
48
49
  * @property {libClient | undefined} sdk
49
50
  */
@@ -51,8 +52,9 @@ const project = new Command("project").description(commandDescriptions['project'
51
52
  /**
52
53
  * @param {ProjectGetUsageRequestParams} params
53
54
  */
54
- const projectGetUsage = async ({ startDate, endDate, period, parseOutput = true, sdk = undefined}) => {
55
- let client = !sdk ? await sdkForProject() : sdk;
55
+ const projectGetUsage = async ({startDate,endDate,period,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
56
+ let client = !sdk ? await sdkForProject() :
57
+ sdk;
56
58
  let apiPath = '/project/usage';
57
59
  let payload = {};
58
60
  if (typeof startDate !== 'undefined') {
@@ -75,12 +77,14 @@ const projectGetUsage = async ({ startDate, endDate, period, parseOutput = true,
75
77
  parse(response)
76
78
  success()
77
79
  }
78
-
80
+
79
81
  return response;
82
+
80
83
  }
81
84
 
82
85
  /**
83
86
  * @typedef {Object} ProjectListVariablesRequestParams
87
+ * @property {boolean} overrideForCli
84
88
  * @property {boolean} parseOutput
85
89
  * @property {libClient | undefined} sdk
86
90
  */
@@ -88,8 +92,9 @@ const projectGetUsage = async ({ startDate, endDate, period, parseOutput = true,
88
92
  /**
89
93
  * @param {ProjectListVariablesRequestParams} params
90
94
  */
91
- const projectListVariables = async ({ parseOutput = true, sdk = undefined}) => {
92
- let client = !sdk ? await sdkForProject() : sdk;
95
+ const projectListVariables = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
96
+ let client = !sdk ? await sdkForProject() :
97
+ sdk;
93
98
  let apiPath = '/project/variables';
94
99
  let payload = {};
95
100
 
@@ -103,14 +108,16 @@ const projectListVariables = async ({ parseOutput = true, sdk = undefined}) => {
103
108
  parse(response)
104
109
  success()
105
110
  }
106
-
111
+
107
112
  return response;
113
+
108
114
  }
109
115
 
110
116
  /**
111
117
  * @typedef {Object} ProjectCreateVariableRequestParams
112
118
  * @property {string} key Variable key. Max length: 255 chars.
113
119
  * @property {string} value Variable value. Max length: 8192 chars.
120
+ * @property {boolean} overrideForCli
114
121
  * @property {boolean} parseOutput
115
122
  * @property {libClient | undefined} sdk
116
123
  */
@@ -118,8 +125,9 @@ const projectListVariables = async ({ parseOutput = true, sdk = undefined}) => {
118
125
  /**
119
126
  * @param {ProjectCreateVariableRequestParams} params
120
127
  */
121
- const projectCreateVariable = async ({ key, value, parseOutput = true, sdk = undefined}) => {
122
- let client = !sdk ? await sdkForProject() : sdk;
128
+ const projectCreateVariable = async ({key,value,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
129
+ let client = !sdk ? await sdkForProject() :
130
+ sdk;
123
131
  let apiPath = '/project/variables';
124
132
  let payload = {};
125
133
  if (typeof key !== 'undefined') {
@@ -139,13 +147,15 @@ const projectCreateVariable = async ({ key, value, parseOutput = true, sdk = und
139
147
  parse(response)
140
148
  success()
141
149
  }
142
-
150
+
143
151
  return response;
152
+
144
153
  }
145
154
 
146
155
  /**
147
156
  * @typedef {Object} ProjectGetVariableRequestParams
148
157
  * @property {string} variableId Variable unique ID.
158
+ * @property {boolean} overrideForCli
149
159
  * @property {boolean} parseOutput
150
160
  * @property {libClient | undefined} sdk
151
161
  */
@@ -153,8 +163,9 @@ const projectCreateVariable = async ({ key, value, parseOutput = true, sdk = und
153
163
  /**
154
164
  * @param {ProjectGetVariableRequestParams} params
155
165
  */
156
- const projectGetVariable = async ({ variableId, parseOutput = true, sdk = undefined}) => {
157
- let client = !sdk ? await sdkForProject() : sdk;
166
+ const projectGetVariable = async ({variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
167
+ let client = !sdk ? await sdkForProject() :
168
+ sdk;
158
169
  let apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
159
170
  let payload = {};
160
171
 
@@ -168,8 +179,9 @@ const projectGetVariable = async ({ variableId, parseOutput = true, sdk = undefi
168
179
  parse(response)
169
180
  success()
170
181
  }
171
-
182
+
172
183
  return response;
184
+
173
185
  }
174
186
 
175
187
  /**
@@ -177,6 +189,7 @@ const projectGetVariable = async ({ variableId, parseOutput = true, sdk = undefi
177
189
  * @property {string} variableId Variable unique ID.
178
190
  * @property {string} key Variable key. Max length: 255 chars.
179
191
  * @property {string} value Variable value. Max length: 8192 chars.
192
+ * @property {boolean} overrideForCli
180
193
  * @property {boolean} parseOutput
181
194
  * @property {libClient | undefined} sdk
182
195
  */
@@ -184,8 +197,9 @@ const projectGetVariable = async ({ variableId, parseOutput = true, sdk = undefi
184
197
  /**
185
198
  * @param {ProjectUpdateVariableRequestParams} params
186
199
  */
187
- const projectUpdateVariable = async ({ variableId, key, value, parseOutput = true, sdk = undefined}) => {
188
- let client = !sdk ? await sdkForProject() : sdk;
200
+ const projectUpdateVariable = async ({variableId,key,value,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
201
+ let client = !sdk ? await sdkForProject() :
202
+ sdk;
189
203
  let apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
190
204
  let payload = {};
191
205
  if (typeof key !== 'undefined') {
@@ -205,13 +219,15 @@ const projectUpdateVariable = async ({ variableId, key, value, parseOutput = tru
205
219
  parse(response)
206
220
  success()
207
221
  }
208
-
222
+
209
223
  return response;
224
+
210
225
  }
211
226
 
212
227
  /**
213
228
  * @typedef {Object} ProjectDeleteVariableRequestParams
214
229
  * @property {string} variableId Variable unique ID.
230
+ * @property {boolean} overrideForCli
215
231
  * @property {boolean} parseOutput
216
232
  * @property {libClient | undefined} sdk
217
233
  */
@@ -219,8 +235,9 @@ const projectUpdateVariable = async ({ variableId, key, value, parseOutput = tru
219
235
  /**
220
236
  * @param {ProjectDeleteVariableRequestParams} params
221
237
  */
222
- const projectDeleteVariable = async ({ variableId, parseOutput = true, sdk = undefined}) => {
223
- let client = !sdk ? await sdkForProject() : sdk;
238
+ const projectDeleteVariable = async ({variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
239
+ let client = !sdk ? await sdkForProject() :
240
+ sdk;
224
241
  let apiPath = '/project/variables/{variableId}'.replace('{variableId}', variableId);
225
242
  let payload = {};
226
243
 
@@ -234,8 +251,9 @@ const projectDeleteVariable = async ({ variableId, parseOutput = true, sdk = und
234
251
  parse(response)
235
252
  success()
236
253
  }
237
-
254
+
238
255
  return response;
256
+
239
257
  }
240
258
 
241
259
  project
@@ -286,4 +304,4 @@ module.exports = {
286
304
  projectGetVariable,
287
305
  projectUpdateVariable,
288
306
  projectDeleteVariable
289
- };
307
+ };