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 projects = new Command("projects").description(commandDescriptions['projec
43
43
  * @typedef {Object} ProjectsListRequestParams
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, teamId
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 projects = new Command("projects").description(commandDescriptions['projec
50
51
  /**
51
52
  * @param {ProjectsListRequestParams} params
52
53
  */
53
- const projectsList = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
54
- let client = !sdk ? await sdkForConsole() : sdk;
54
+ const projectsList = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
55
+ let client = !sdk ? await sdkForConsole() :
56
+ sdk;
55
57
  let apiPath = '/projects';
56
58
  let payload = {};
57
59
  if (typeof queries !== 'undefined') {
@@ -68,11 +70,16 @@ const projectsList = async ({ queries, search, parseOutput = true, sdk = undefin
68
70
  }, payload);
69
71
 
70
72
  if (parseOutput) {
71
- parse(response)
72
- success()
73
+ if(console) {
74
+ showConsoleLink('projects', 'list');
75
+ } else {
76
+ parse(response)
77
+ success()
78
+ }
73
79
  }
74
-
80
+
75
81
  return response;
82
+
76
83
  }
77
84
 
78
85
  /**
@@ -90,6 +97,7 @@ const projectsList = async ({ queries, search, parseOutput = true, sdk = undefin
90
97
  * @property {string} legalCity Project legal City. Max length: 256 chars.
91
98
  * @property {string} legalAddress Project legal Address. Max length: 256 chars.
92
99
  * @property {string} legalTaxId Project legal Tax ID. Max length: 256 chars.
100
+ * @property {boolean} overrideForCli
93
101
  * @property {boolean} parseOutput
94
102
  * @property {libClient | undefined} sdk
95
103
  */
@@ -97,8 +105,9 @@ const projectsList = async ({ queries, search, parseOutput = true, sdk = undefin
97
105
  /**
98
106
  * @param {ProjectsCreateRequestParams} params
99
107
  */
100
- const projectsCreate = async ({ projectId, name, teamId, region, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId, parseOutput = true, sdk = undefined}) => {
101
- let client = !sdk ? await sdkForConsole() : sdk;
108
+ const projectsCreate = async ({projectId,name,teamId,region,description,logo,url,legalName,legalCountry,legalState,legalCity,legalAddress,legalTaxId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
109
+ let client = !sdk ? await sdkForConsole() :
110
+ sdk;
102
111
  let apiPath = '/projects';
103
112
  let payload = {};
104
113
  if (typeof projectId !== 'undefined') {
@@ -151,13 +160,15 @@ const projectsCreate = async ({ projectId, name, teamId, region, description, lo
151
160
  parse(response)
152
161
  success()
153
162
  }
154
-
163
+
155
164
  return response;
165
+
156
166
  }
157
167
 
158
168
  /**
159
169
  * @typedef {Object} ProjectsGetRequestParams
160
170
  * @property {string} projectId Project unique ID.
171
+ * @property {boolean} overrideForCli
161
172
  * @property {boolean} parseOutput
162
173
  * @property {libClient | undefined} sdk
163
174
  */
@@ -165,8 +176,9 @@ const projectsCreate = async ({ projectId, name, teamId, region, description, lo
165
176
  /**
166
177
  * @param {ProjectsGetRequestParams} params
167
178
  */
168
- const projectsGet = async ({ projectId, parseOutput = true, sdk = undefined}) => {
169
- let client = !sdk ? await sdkForConsole() : sdk;
179
+ const projectsGet = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
180
+ let client = !sdk ? await sdkForConsole() :
181
+ sdk;
170
182
  let apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
171
183
  let payload = {};
172
184
 
@@ -177,11 +189,16 @@ const projectsGet = async ({ projectId, parseOutput = true, sdk = undefined}) =>
177
189
  }, payload);
178
190
 
179
191
  if (parseOutput) {
180
- parse(response)
181
- success()
192
+ if(console) {
193
+ showConsoleLink('projects', 'get', projectId);
194
+ } else {
195
+ parse(response)
196
+ success()
197
+ }
182
198
  }
183
-
199
+
184
200
  return response;
201
+
185
202
  }
186
203
 
187
204
  /**
@@ -197,6 +214,7 @@ const projectsGet = async ({ projectId, parseOutput = true, sdk = undefined}) =>
197
214
  * @property {string} legalCity Project legal city. Max length: 256 chars.
198
215
  * @property {string} legalAddress Project legal address. Max length: 256 chars.
199
216
  * @property {string} legalTaxId Project legal tax ID. Max length: 256 chars.
217
+ * @property {boolean} overrideForCli
200
218
  * @property {boolean} parseOutput
201
219
  * @property {libClient | undefined} sdk
202
220
  */
@@ -204,8 +222,9 @@ const projectsGet = async ({ projectId, parseOutput = true, sdk = undefined}) =>
204
222
  /**
205
223
  * @param {ProjectsUpdateRequestParams} params
206
224
  */
207
- const projectsUpdate = async ({ projectId, name, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId, parseOutput = true, sdk = undefined}) => {
208
- let client = !sdk ? await sdkForConsole() : sdk;
225
+ const projectsUpdate = async ({projectId,name,description,logo,url,legalName,legalCountry,legalState,legalCity,legalAddress,legalTaxId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
226
+ let client = !sdk ? await sdkForConsole() :
227
+ sdk;
209
228
  let apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
210
229
  let payload = {};
211
230
  if (typeof name !== 'undefined') {
@@ -249,13 +268,15 @@ const projectsUpdate = async ({ projectId, name, description, logo, url, legalNa
249
268
  parse(response)
250
269
  success()
251
270
  }
252
-
271
+
253
272
  return response;
273
+
254
274
  }
255
275
 
256
276
  /**
257
277
  * @typedef {Object} ProjectsDeleteRequestParams
258
278
  * @property {string} projectId Project unique ID.
279
+ * @property {boolean} overrideForCli
259
280
  * @property {boolean} parseOutput
260
281
  * @property {libClient | undefined} sdk
261
282
  */
@@ -263,8 +284,9 @@ const projectsUpdate = async ({ projectId, name, description, logo, url, legalNa
263
284
  /**
264
285
  * @param {ProjectsDeleteRequestParams} params
265
286
  */
266
- const projectsDelete = async ({ projectId, parseOutput = true, sdk = undefined}) => {
267
- let client = !sdk ? await sdkForConsole() : sdk;
287
+ const projectsDelete = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
288
+ let client = !sdk ? await sdkForConsole() :
289
+ sdk;
268
290
  let apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
269
291
  let payload = {};
270
292
 
@@ -278,8 +300,9 @@ const projectsDelete = async ({ projectId, parseOutput = true, sdk = undefined})
278
300
  parse(response)
279
301
  success()
280
302
  }
281
-
303
+
282
304
  return response;
305
+
283
306
  }
284
307
 
285
308
  /**
@@ -287,6 +310,7 @@ const projectsDelete = async ({ projectId, parseOutput = true, sdk = undefined})
287
310
  * @property {string} projectId Project unique ID.
288
311
  * @property {Api} api API name.
289
312
  * @property {boolean} status API status.
313
+ * @property {boolean} overrideForCli
290
314
  * @property {boolean} parseOutput
291
315
  * @property {libClient | undefined} sdk
292
316
  */
@@ -294,8 +318,9 @@ const projectsDelete = async ({ projectId, parseOutput = true, sdk = undefined})
294
318
  /**
295
319
  * @param {ProjectsUpdateApiStatusRequestParams} params
296
320
  */
297
- const projectsUpdateApiStatus = async ({ projectId, api, status, parseOutput = true, sdk = undefined}) => {
298
- let client = !sdk ? await sdkForConsole() : sdk;
321
+ const projectsUpdateApiStatus = async ({projectId,api,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
322
+ let client = !sdk ? await sdkForConsole() :
323
+ sdk;
299
324
  let apiPath = '/projects/{projectId}/api'.replace('{projectId}', projectId);
300
325
  let payload = {};
301
326
  if (typeof api !== 'undefined') {
@@ -315,14 +340,16 @@ const projectsUpdateApiStatus = async ({ projectId, api, status, parseOutput = t
315
340
  parse(response)
316
341
  success()
317
342
  }
318
-
343
+
319
344
  return response;
345
+
320
346
  }
321
347
 
322
348
  /**
323
349
  * @typedef {Object} ProjectsUpdateApiStatusAllRequestParams
324
350
  * @property {string} projectId Project unique ID.
325
351
  * @property {boolean} status API status.
352
+ * @property {boolean} overrideForCli
326
353
  * @property {boolean} parseOutput
327
354
  * @property {libClient | undefined} sdk
328
355
  */
@@ -330,8 +357,9 @@ const projectsUpdateApiStatus = async ({ projectId, api, status, parseOutput = t
330
357
  /**
331
358
  * @param {ProjectsUpdateApiStatusAllRequestParams} params
332
359
  */
333
- const projectsUpdateApiStatusAll = async ({ projectId, status, parseOutput = true, sdk = undefined}) => {
334
- let client = !sdk ? await sdkForConsole() : sdk;
360
+ const projectsUpdateApiStatusAll = async ({projectId,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
361
+ let client = !sdk ? await sdkForConsole() :
362
+ sdk;
335
363
  let apiPath = '/projects/{projectId}/api/all'.replace('{projectId}', projectId);
336
364
  let payload = {};
337
365
  if (typeof status !== 'undefined') {
@@ -348,14 +376,16 @@ const projectsUpdateApiStatusAll = async ({ projectId, status, parseOutput = tru
348
376
  parse(response)
349
377
  success()
350
378
  }
351
-
379
+
352
380
  return response;
381
+
353
382
  }
354
383
 
355
384
  /**
356
385
  * @typedef {Object} ProjectsUpdateAuthDurationRequestParams
357
386
  * @property {string} projectId Project unique ID.
358
387
  * @property {number} duration Project session length in seconds. Max length: 31536000 seconds.
388
+ * @property {boolean} overrideForCli
359
389
  * @property {boolean} parseOutput
360
390
  * @property {libClient | undefined} sdk
361
391
  */
@@ -363,8 +393,9 @@ const projectsUpdateApiStatusAll = async ({ projectId, status, parseOutput = tru
363
393
  /**
364
394
  * @param {ProjectsUpdateAuthDurationRequestParams} params
365
395
  */
366
- const projectsUpdateAuthDuration = async ({ projectId, duration, parseOutput = true, sdk = undefined}) => {
367
- let client = !sdk ? await sdkForConsole() : sdk;
396
+ const projectsUpdateAuthDuration = async ({projectId,duration,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
397
+ let client = !sdk ? await sdkForConsole() :
398
+ sdk;
368
399
  let apiPath = '/projects/{projectId}/auth/duration'.replace('{projectId}', projectId);
369
400
  let payload = {};
370
401
  if (typeof duration !== 'undefined') {
@@ -381,14 +412,16 @@ const projectsUpdateAuthDuration = async ({ projectId, duration, parseOutput = t
381
412
  parse(response)
382
413
  success()
383
414
  }
384
-
415
+
385
416
  return response;
417
+
386
418
  }
387
419
 
388
420
  /**
389
421
  * @typedef {Object} ProjectsUpdateAuthLimitRequestParams
390
422
  * @property {string} projectId Project unique ID.
391
423
  * @property {number} limit Set the max number of users allowed in this project. Use 0 for unlimited.
424
+ * @property {boolean} overrideForCli
392
425
  * @property {boolean} parseOutput
393
426
  * @property {libClient | undefined} sdk
394
427
  */
@@ -396,8 +429,9 @@ const projectsUpdateAuthDuration = async ({ projectId, duration, parseOutput = t
396
429
  /**
397
430
  * @param {ProjectsUpdateAuthLimitRequestParams} params
398
431
  */
399
- const projectsUpdateAuthLimit = async ({ projectId, limit, parseOutput = true, sdk = undefined}) => {
400
- let client = !sdk ? await sdkForConsole() : sdk;
432
+ const projectsUpdateAuthLimit = async ({projectId,limit,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
433
+ let client = !sdk ? await sdkForConsole() :
434
+ sdk;
401
435
  let apiPath = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId);
402
436
  let payload = {};
403
437
  if (typeof limit !== 'undefined') {
@@ -414,14 +448,16 @@ const projectsUpdateAuthLimit = async ({ projectId, limit, parseOutput = true, s
414
448
  parse(response)
415
449
  success()
416
450
  }
417
-
451
+
418
452
  return response;
453
+
419
454
  }
420
455
 
421
456
  /**
422
457
  * @typedef {Object} ProjectsUpdateAuthSessionsLimitRequestParams
423
458
  * @property {string} projectId Project unique ID.
424
459
  * @property {number} limit Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10
460
+ * @property {boolean} overrideForCli
425
461
  * @property {boolean} parseOutput
426
462
  * @property {libClient | undefined} sdk
427
463
  */
@@ -429,8 +465,9 @@ const projectsUpdateAuthLimit = async ({ projectId, limit, parseOutput = true, s
429
465
  /**
430
466
  * @param {ProjectsUpdateAuthSessionsLimitRequestParams} params
431
467
  */
432
- const projectsUpdateAuthSessionsLimit = async ({ projectId, limit, parseOutput = true, sdk = undefined}) => {
433
- let client = !sdk ? await sdkForConsole() : sdk;
468
+ const projectsUpdateAuthSessionsLimit = async ({projectId,limit,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
469
+ let client = !sdk ? await sdkForConsole() :
470
+ sdk;
434
471
  let apiPath = '/projects/{projectId}/auth/max-sessions'.replace('{projectId}', projectId);
435
472
  let payload = {};
436
473
  if (typeof limit !== 'undefined') {
@@ -447,14 +484,53 @@ const projectsUpdateAuthSessionsLimit = async ({ projectId, limit, parseOutput =
447
484
  parse(response)
448
485
  success()
449
486
  }
450
-
487
+
488
+ return response;
489
+
490
+ }
491
+
492
+ /**
493
+ * @typedef {Object} ProjectsUpdateMockNumbersRequestParams
494
+ * @property {string} projectId Project unique ID.
495
+ * @property {object[]} numbers An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.
496
+ * @property {boolean} overrideForCli
497
+ * @property {boolean} parseOutput
498
+ * @property {libClient | undefined} sdk
499
+ */
500
+
501
+ /**
502
+ * @param {ProjectsUpdateMockNumbersRequestParams} params
503
+ */
504
+ const projectsUpdateMockNumbers = async ({projectId,numbers,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
505
+ let client = !sdk ? await sdkForConsole() :
506
+ sdk;
507
+ let apiPath = '/projects/{projectId}/auth/mock-numbers'.replace('{projectId}', projectId);
508
+ let payload = {};
509
+ numbers = numbers === true ? [] : numbers;
510
+ if (typeof numbers !== 'undefined') {
511
+ payload['numbers'] = numbers;
512
+ }
513
+
514
+ let response = undefined;
515
+
516
+ response = await client.call('patch', apiPath, {
517
+ 'content-type': 'application/json',
518
+ }, payload);
519
+
520
+ if (parseOutput) {
521
+ parse(response)
522
+ success()
523
+ }
524
+
451
525
  return response;
526
+
452
527
  }
453
528
 
454
529
  /**
455
530
  * @typedef {Object} ProjectsUpdateAuthPasswordDictionaryRequestParams
456
531
  * @property {string} projectId Project unique ID.
457
532
  * @property {boolean} enabled Set whether or not to enable checking user's password against most commonly used passwords. Default is false.
533
+ * @property {boolean} overrideForCli
458
534
  * @property {boolean} parseOutput
459
535
  * @property {libClient | undefined} sdk
460
536
  */
@@ -462,8 +538,9 @@ const projectsUpdateAuthSessionsLimit = async ({ projectId, limit, parseOutput =
462
538
  /**
463
539
  * @param {ProjectsUpdateAuthPasswordDictionaryRequestParams} params
464
540
  */
465
- const projectsUpdateAuthPasswordDictionary = async ({ projectId, enabled, parseOutput = true, sdk = undefined}) => {
466
- let client = !sdk ? await sdkForConsole() : sdk;
541
+ const projectsUpdateAuthPasswordDictionary = async ({projectId,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
542
+ let client = !sdk ? await sdkForConsole() :
543
+ sdk;
467
544
  let apiPath = '/projects/{projectId}/auth/password-dictionary'.replace('{projectId}', projectId);
468
545
  let payload = {};
469
546
  if (typeof enabled !== 'undefined') {
@@ -480,14 +557,16 @@ const projectsUpdateAuthPasswordDictionary = async ({ projectId, enabled, parseO
480
557
  parse(response)
481
558
  success()
482
559
  }
483
-
560
+
484
561
  return response;
562
+
485
563
  }
486
564
 
487
565
  /**
488
566
  * @typedef {Object} ProjectsUpdateAuthPasswordHistoryRequestParams
489
567
  * @property {string} projectId Project unique ID.
490
568
  * @property {number} limit Set the max number of passwords to store in user history. User can't choose a new password that is already stored in the password history list. Max number of passwords allowed in history is20. Default value is 0
569
+ * @property {boolean} overrideForCli
491
570
  * @property {boolean} parseOutput
492
571
  * @property {libClient | undefined} sdk
493
572
  */
@@ -495,8 +574,9 @@ const projectsUpdateAuthPasswordDictionary = async ({ projectId, enabled, parseO
495
574
  /**
496
575
  * @param {ProjectsUpdateAuthPasswordHistoryRequestParams} params
497
576
  */
498
- const projectsUpdateAuthPasswordHistory = async ({ projectId, limit, parseOutput = true, sdk = undefined}) => {
499
- let client = !sdk ? await sdkForConsole() : sdk;
577
+ const projectsUpdateAuthPasswordHistory = async ({projectId,limit,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
578
+ let client = !sdk ? await sdkForConsole() :
579
+ sdk;
500
580
  let apiPath = '/projects/{projectId}/auth/password-history'.replace('{projectId}', projectId);
501
581
  let payload = {};
502
582
  if (typeof limit !== 'undefined') {
@@ -513,14 +593,16 @@ const projectsUpdateAuthPasswordHistory = async ({ projectId, limit, parseOutput
513
593
  parse(response)
514
594
  success()
515
595
  }
516
-
596
+
517
597
  return response;
598
+
518
599
  }
519
600
 
520
601
  /**
521
602
  * @typedef {Object} ProjectsUpdatePersonalDataCheckRequestParams
522
603
  * @property {string} projectId Project unique ID.
523
604
  * @property {boolean} enabled Set whether or not to check a password for similarity with personal data. Default is false.
605
+ * @property {boolean} overrideForCli
524
606
  * @property {boolean} parseOutput
525
607
  * @property {libClient | undefined} sdk
526
608
  */
@@ -528,8 +610,9 @@ const projectsUpdateAuthPasswordHistory = async ({ projectId, limit, parseOutput
528
610
  /**
529
611
  * @param {ProjectsUpdatePersonalDataCheckRequestParams} params
530
612
  */
531
- const projectsUpdatePersonalDataCheck = async ({ projectId, enabled, parseOutput = true, sdk = undefined}) => {
532
- let client = !sdk ? await sdkForConsole() : sdk;
613
+ const projectsUpdatePersonalDataCheck = async ({projectId,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
614
+ let client = !sdk ? await sdkForConsole() :
615
+ sdk;
533
616
  let apiPath = '/projects/{projectId}/auth/personal-data'.replace('{projectId}', projectId);
534
617
  let payload = {};
535
618
  if (typeof enabled !== 'undefined') {
@@ -546,8 +629,45 @@ const projectsUpdatePersonalDataCheck = async ({ projectId, enabled, parseOutput
546
629
  parse(response)
547
630
  success()
548
631
  }
549
-
632
+
550
633
  return response;
634
+
635
+ }
636
+
637
+ /**
638
+ * @typedef {Object} ProjectsUpdateSessionAlertsRequestParams
639
+ * @property {string} projectId Project unique ID.
640
+ * @property {boolean} alerts Set to true to enable session emails.
641
+ * @property {boolean} overrideForCli
642
+ * @property {boolean} parseOutput
643
+ * @property {libClient | undefined} sdk
644
+ */
645
+
646
+ /**
647
+ * @param {ProjectsUpdateSessionAlertsRequestParams} params
648
+ */
649
+ const projectsUpdateSessionAlerts = async ({projectId,alerts,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
650
+ let client = !sdk ? await sdkForConsole() :
651
+ sdk;
652
+ let apiPath = '/projects/{projectId}/auth/session-alerts'.replace('{projectId}', projectId);
653
+ let payload = {};
654
+ if (typeof alerts !== 'undefined') {
655
+ payload['alerts'] = alerts;
656
+ }
657
+
658
+ let response = undefined;
659
+
660
+ response = await client.call('patch', apiPath, {
661
+ 'content-type': 'application/json',
662
+ }, payload);
663
+
664
+ if (parseOutput) {
665
+ parse(response)
666
+ success()
667
+ }
668
+
669
+ return response;
670
+
551
671
  }
552
672
 
553
673
  /**
@@ -555,6 +675,7 @@ const projectsUpdatePersonalDataCheck = async ({ projectId, enabled, parseOutput
555
675
  * @property {string} projectId Project unique ID.
556
676
  * @property {AuthMethod} method Auth Method. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone
557
677
  * @property {boolean} status Set the status of this auth method.
678
+ * @property {boolean} overrideForCli
558
679
  * @property {boolean} parseOutput
559
680
  * @property {libClient | undefined} sdk
560
681
  */
@@ -562,8 +683,9 @@ const projectsUpdatePersonalDataCheck = async ({ projectId, enabled, parseOutput
562
683
  /**
563
684
  * @param {ProjectsUpdateAuthStatusRequestParams} params
564
685
  */
565
- const projectsUpdateAuthStatus = async ({ projectId, method, status, parseOutput = true, sdk = undefined}) => {
566
- let client = !sdk ? await sdkForConsole() : sdk;
686
+ const projectsUpdateAuthStatus = async ({projectId,method,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
687
+ let client = !sdk ? await sdkForConsole() :
688
+ sdk;
567
689
  let apiPath = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method);
568
690
  let payload = {};
569
691
  if (typeof status !== 'undefined') {
@@ -580,13 +702,56 @@ const projectsUpdateAuthStatus = async ({ projectId, method, status, parseOutput
580
702
  parse(response)
581
703
  success()
582
704
  }
583
-
705
+
706
+ return response;
707
+
708
+ }
709
+
710
+ /**
711
+ * @typedef {Object} ProjectsCreateJWTRequestParams
712
+ * @property {string} projectId Project unique ID.
713
+ * @property {string[]} scopes List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.
714
+ * @property {number} duration Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
715
+ * @property {boolean} overrideForCli
716
+ * @property {boolean} parseOutput
717
+ * @property {libClient | undefined} sdk
718
+ */
719
+
720
+ /**
721
+ * @param {ProjectsCreateJWTRequestParams} params
722
+ */
723
+ const projectsCreateJWT = async ({projectId,scopes,duration,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
724
+ let client = !sdk ? await sdkForConsole() :
725
+ sdk;
726
+ let apiPath = '/projects/{projectId}/jwts'.replace('{projectId}', projectId);
727
+ let payload = {};
728
+ scopes = scopes === true ? [] : scopes;
729
+ if (typeof scopes !== 'undefined') {
730
+ payload['scopes'] = scopes;
731
+ }
732
+ if (typeof duration !== 'undefined') {
733
+ payload['duration'] = duration;
734
+ }
735
+
736
+ let response = undefined;
737
+
738
+ response = await client.call('post', apiPath, {
739
+ 'content-type': 'application/json',
740
+ }, payload);
741
+
742
+ if (parseOutput) {
743
+ parse(response)
744
+ success()
745
+ }
746
+
584
747
  return response;
748
+
585
749
  }
586
750
 
587
751
  /**
588
752
  * @typedef {Object} ProjectsListKeysRequestParams
589
753
  * @property {string} projectId Project unique ID.
754
+ * @property {boolean} overrideForCli
590
755
  * @property {boolean} parseOutput
591
756
  * @property {libClient | undefined} sdk
592
757
  */
@@ -594,8 +759,9 @@ const projectsUpdateAuthStatus = async ({ projectId, method, status, parseOutput
594
759
  /**
595
760
  * @param {ProjectsListKeysRequestParams} params
596
761
  */
597
- const projectsListKeys = async ({ projectId, parseOutput = true, sdk = undefined}) => {
598
- let client = !sdk ? await sdkForConsole() : sdk;
762
+ const projectsListKeys = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
763
+ let client = !sdk ? await sdkForConsole() :
764
+ sdk;
599
765
  let apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
600
766
  let payload = {};
601
767
 
@@ -606,11 +772,16 @@ const projectsListKeys = async ({ projectId, parseOutput = true, sdk = undefined
606
772
  }, payload);
607
773
 
608
774
  if (parseOutput) {
609
- parse(response)
610
- success()
775
+ if(console) {
776
+ showConsoleLink('projects', 'listKeys', projectId);
777
+ } else {
778
+ parse(response)
779
+ success()
780
+ }
611
781
  }
612
-
782
+
613
783
  return response;
784
+
614
785
  }
615
786
 
616
787
  /**
@@ -619,6 +790,7 @@ const projectsListKeys = async ({ projectId, parseOutput = true, sdk = undefined
619
790
  * @property {string} name Key name. Max length: 128 chars.
620
791
  * @property {string[]} scopes Key scopes list. Maximum of 100 scopes are allowed.
621
792
  * @property {string} expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
793
+ * @property {boolean} overrideForCli
622
794
  * @property {boolean} parseOutput
623
795
  * @property {libClient | undefined} sdk
624
796
  */
@@ -626,8 +798,9 @@ const projectsListKeys = async ({ projectId, parseOutput = true, sdk = undefined
626
798
  /**
627
799
  * @param {ProjectsCreateKeyRequestParams} params
628
800
  */
629
- const projectsCreateKey = async ({ projectId, name, scopes, expire, parseOutput = true, sdk = undefined}) => {
630
- let client = !sdk ? await sdkForConsole() : sdk;
801
+ const projectsCreateKey = async ({projectId,name,scopes,expire,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
802
+ let client = !sdk ? await sdkForConsole() :
803
+ sdk;
631
804
  let apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
632
805
  let payload = {};
633
806
  if (typeof name !== 'undefined') {
@@ -651,14 +824,16 @@ const projectsCreateKey = async ({ projectId, name, scopes, expire, parseOutput
651
824
  parse(response)
652
825
  success()
653
826
  }
654
-
827
+
655
828
  return response;
829
+
656
830
  }
657
831
 
658
832
  /**
659
833
  * @typedef {Object} ProjectsGetKeyRequestParams
660
834
  * @property {string} projectId Project unique ID.
661
835
  * @property {string} keyId Key unique ID.
836
+ * @property {boolean} overrideForCli
662
837
  * @property {boolean} parseOutput
663
838
  * @property {libClient | undefined} sdk
664
839
  */
@@ -666,8 +841,9 @@ const projectsCreateKey = async ({ projectId, name, scopes, expire, parseOutput
666
841
  /**
667
842
  * @param {ProjectsGetKeyRequestParams} params
668
843
  */
669
- const projectsGetKey = async ({ projectId, keyId, parseOutput = true, sdk = undefined}) => {
670
- let client = !sdk ? await sdkForConsole() : sdk;
844
+ const projectsGetKey = async ({projectId,keyId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
845
+ let client = !sdk ? await sdkForConsole() :
846
+ sdk;
671
847
  let apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
672
848
  let payload = {};
673
849
 
@@ -678,11 +854,16 @@ const projectsGetKey = async ({ projectId, keyId, parseOutput = true, sdk = unde
678
854
  }, payload);
679
855
 
680
856
  if (parseOutput) {
681
- parse(response)
682
- success()
857
+ if(console) {
858
+ showConsoleLink('projects', 'getKey', projectId, keyId);
859
+ } else {
860
+ parse(response)
861
+ success()
862
+ }
683
863
  }
684
-
864
+
685
865
  return response;
866
+
686
867
  }
687
868
 
688
869
  /**
@@ -692,6 +873,7 @@ const projectsGetKey = async ({ projectId, keyId, parseOutput = true, sdk = unde
692
873
  * @property {string} name Key name. Max length: 128 chars.
693
874
  * @property {string[]} scopes Key scopes list. Maximum of 100 events are allowed.
694
875
  * @property {string} expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
876
+ * @property {boolean} overrideForCli
695
877
  * @property {boolean} parseOutput
696
878
  * @property {libClient | undefined} sdk
697
879
  */
@@ -699,8 +881,9 @@ const projectsGetKey = async ({ projectId, keyId, parseOutput = true, sdk = unde
699
881
  /**
700
882
  * @param {ProjectsUpdateKeyRequestParams} params
701
883
  */
702
- const projectsUpdateKey = async ({ projectId, keyId, name, scopes, expire, parseOutput = true, sdk = undefined}) => {
703
- let client = !sdk ? await sdkForConsole() : sdk;
884
+ const projectsUpdateKey = async ({projectId,keyId,name,scopes,expire,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
885
+ let client = !sdk ? await sdkForConsole() :
886
+ sdk;
704
887
  let apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
705
888
  let payload = {};
706
889
  if (typeof name !== 'undefined') {
@@ -724,14 +907,16 @@ const projectsUpdateKey = async ({ projectId, keyId, name, scopes, expire, parse
724
907
  parse(response)
725
908
  success()
726
909
  }
727
-
910
+
728
911
  return response;
912
+
729
913
  }
730
914
 
731
915
  /**
732
916
  * @typedef {Object} ProjectsDeleteKeyRequestParams
733
917
  * @property {string} projectId Project unique ID.
734
918
  * @property {string} keyId Key unique ID.
919
+ * @property {boolean} overrideForCli
735
920
  * @property {boolean} parseOutput
736
921
  * @property {libClient | undefined} sdk
737
922
  */
@@ -739,8 +924,9 @@ const projectsUpdateKey = async ({ projectId, keyId, name, scopes, expire, parse
739
924
  /**
740
925
  * @param {ProjectsDeleteKeyRequestParams} params
741
926
  */
742
- const projectsDeleteKey = async ({ projectId, keyId, parseOutput = true, sdk = undefined}) => {
743
- let client = !sdk ? await sdkForConsole() : sdk;
927
+ const projectsDeleteKey = async ({projectId,keyId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
928
+ let client = !sdk ? await sdkForConsole() :
929
+ sdk;
744
930
  let apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
745
931
  let payload = {};
746
932
 
@@ -754,8 +940,9 @@ const projectsDeleteKey = async ({ projectId, keyId, parseOutput = true, sdk = u
754
940
  parse(response)
755
941
  success()
756
942
  }
757
-
943
+
758
944
  return response;
945
+
759
946
  }
760
947
 
761
948
  /**
@@ -765,6 +952,7 @@ const projectsDeleteKey = async ({ projectId, keyId, parseOutput = true, sdk = u
765
952
  * @property {string} appId Provider app ID. Max length: 256 chars.
766
953
  * @property {string} secret Provider secret key. Max length: 512 chars.
767
954
  * @property {boolean} enabled Provider status. Set to 'false' to disable new session creation.
955
+ * @property {boolean} overrideForCli
768
956
  * @property {boolean} parseOutput
769
957
  * @property {libClient | undefined} sdk
770
958
  */
@@ -772,8 +960,9 @@ const projectsDeleteKey = async ({ projectId, keyId, parseOutput = true, sdk = u
772
960
  /**
773
961
  * @param {ProjectsUpdateOAuth2RequestParams} params
774
962
  */
775
- const projectsUpdateOAuth2 = async ({ projectId, provider, appId, secret, enabled, parseOutput = true, sdk = undefined}) => {
776
- let client = !sdk ? await sdkForConsole() : sdk;
963
+ const projectsUpdateOAuth2 = async ({projectId,provider,appId,secret,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
964
+ let client = !sdk ? await sdkForConsole() :
965
+ sdk;
777
966
  let apiPath = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId);
778
967
  let payload = {};
779
968
  if (typeof provider !== 'undefined') {
@@ -799,13 +988,15 @@ const projectsUpdateOAuth2 = async ({ projectId, provider, appId, secret, enable
799
988
  parse(response)
800
989
  success()
801
990
  }
802
-
991
+
803
992
  return response;
993
+
804
994
  }
805
995
 
806
996
  /**
807
997
  * @typedef {Object} ProjectsListPlatformsRequestParams
808
998
  * @property {string} projectId Project unique ID.
999
+ * @property {boolean} overrideForCli
809
1000
  * @property {boolean} parseOutput
810
1001
  * @property {libClient | undefined} sdk
811
1002
  */
@@ -813,8 +1004,9 @@ const projectsUpdateOAuth2 = async ({ projectId, provider, appId, secret, enable
813
1004
  /**
814
1005
  * @param {ProjectsListPlatformsRequestParams} params
815
1006
  */
816
- const projectsListPlatforms = async ({ projectId, parseOutput = true, sdk = undefined}) => {
817
- let client = !sdk ? await sdkForConsole() : sdk;
1007
+ const projectsListPlatforms = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1008
+ let client = !sdk ? await sdkForConsole() :
1009
+ sdk;
818
1010
  let apiPath = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
819
1011
  let payload = {};
820
1012
 
@@ -825,11 +1017,16 @@ const projectsListPlatforms = async ({ projectId, parseOutput = true, sdk = unde
825
1017
  }, payload);
826
1018
 
827
1019
  if (parseOutput) {
828
- parse(response)
829
- success()
1020
+ if(console) {
1021
+ showConsoleLink('projects', 'listPlatforms', projectId);
1022
+ } else {
1023
+ parse(response)
1024
+ success()
1025
+ }
830
1026
  }
831
-
1027
+
832
1028
  return response;
1029
+
833
1030
  }
834
1031
 
835
1032
  /**
@@ -840,6 +1037,7 @@ const projectsListPlatforms = async ({ projectId, parseOutput = true, sdk = unde
840
1037
  * @property {string} key Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.
841
1038
  * @property {string} store App store or Google Play store ID. Max length: 256 chars.
842
1039
  * @property {string} hostname Platform client hostname. Max length: 256 chars.
1040
+ * @property {boolean} overrideForCli
843
1041
  * @property {boolean} parseOutput
844
1042
  * @property {libClient | undefined} sdk
845
1043
  */
@@ -847,8 +1045,9 @@ const projectsListPlatforms = async ({ projectId, parseOutput = true, sdk = unde
847
1045
  /**
848
1046
  * @param {ProjectsCreatePlatformRequestParams} params
849
1047
  */
850
- const projectsCreatePlatform = async ({ projectId, type, name, key, store, hostname, parseOutput = true, sdk = undefined}) => {
851
- let client = !sdk ? await sdkForConsole() : sdk;
1048
+ const projectsCreatePlatform = async ({projectId,type,name,key,store,hostname,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1049
+ let client = !sdk ? await sdkForConsole() :
1050
+ sdk;
852
1051
  let apiPath = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
853
1052
  let payload = {};
854
1053
  if (typeof type !== 'undefined') {
@@ -877,14 +1076,16 @@ const projectsCreatePlatform = async ({ projectId, type, name, key, store, hostn
877
1076
  parse(response)
878
1077
  success()
879
1078
  }
880
-
1079
+
881
1080
  return response;
1081
+
882
1082
  }
883
1083
 
884
1084
  /**
885
1085
  * @typedef {Object} ProjectsGetPlatformRequestParams
886
1086
  * @property {string} projectId Project unique ID.
887
1087
  * @property {string} platformId Platform unique ID.
1088
+ * @property {boolean} overrideForCli
888
1089
  * @property {boolean} parseOutput
889
1090
  * @property {libClient | undefined} sdk
890
1091
  */
@@ -892,8 +1093,9 @@ const projectsCreatePlatform = async ({ projectId, type, name, key, store, hostn
892
1093
  /**
893
1094
  * @param {ProjectsGetPlatformRequestParams} params
894
1095
  */
895
- const projectsGetPlatform = async ({ projectId, platformId, parseOutput = true, sdk = undefined}) => {
896
- let client = !sdk ? await sdkForConsole() : sdk;
1096
+ const projectsGetPlatform = async ({projectId,platformId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1097
+ let client = !sdk ? await sdkForConsole() :
1098
+ sdk;
897
1099
  let apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
898
1100
  let payload = {};
899
1101
 
@@ -904,11 +1106,16 @@ const projectsGetPlatform = async ({ projectId, platformId, parseOutput = true,
904
1106
  }, payload);
905
1107
 
906
1108
  if (parseOutput) {
907
- parse(response)
908
- success()
1109
+ if(console) {
1110
+ showConsoleLink('projects', 'getPlatform', projectId, platformId);
1111
+ } else {
1112
+ parse(response)
1113
+ success()
1114
+ }
909
1115
  }
910
-
1116
+
911
1117
  return response;
1118
+
912
1119
  }
913
1120
 
914
1121
  /**
@@ -919,6 +1126,7 @@ const projectsGetPlatform = async ({ projectId, platformId, parseOutput = true,
919
1126
  * @property {string} key Package name for android or bundle ID for iOS. Max length: 256 chars.
920
1127
  * @property {string} store App store or Google Play store ID. Max length: 256 chars.
921
1128
  * @property {string} hostname Platform client URL. Max length: 256 chars.
1129
+ * @property {boolean} overrideForCli
922
1130
  * @property {boolean} parseOutput
923
1131
  * @property {libClient | undefined} sdk
924
1132
  */
@@ -926,8 +1134,9 @@ const projectsGetPlatform = async ({ projectId, platformId, parseOutput = true,
926
1134
  /**
927
1135
  * @param {ProjectsUpdatePlatformRequestParams} params
928
1136
  */
929
- const projectsUpdatePlatform = async ({ projectId, platformId, name, key, store, hostname, parseOutput = true, sdk = undefined}) => {
930
- let client = !sdk ? await sdkForConsole() : sdk;
1137
+ const projectsUpdatePlatform = async ({projectId,platformId,name,key,store,hostname,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1138
+ let client = !sdk ? await sdkForConsole() :
1139
+ sdk;
931
1140
  let apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
932
1141
  let payload = {};
933
1142
  if (typeof name !== 'undefined') {
@@ -953,14 +1162,16 @@ const projectsUpdatePlatform = async ({ projectId, platformId, name, key, store,
953
1162
  parse(response)
954
1163
  success()
955
1164
  }
956
-
1165
+
957
1166
  return response;
1167
+
958
1168
  }
959
1169
 
960
1170
  /**
961
1171
  * @typedef {Object} ProjectsDeletePlatformRequestParams
962
1172
  * @property {string} projectId Project unique ID.
963
1173
  * @property {string} platformId Platform unique ID.
1174
+ * @property {boolean} overrideForCli
964
1175
  * @property {boolean} parseOutput
965
1176
  * @property {libClient | undefined} sdk
966
1177
  */
@@ -968,8 +1179,9 @@ const projectsUpdatePlatform = async ({ projectId, platformId, name, key, store,
968
1179
  /**
969
1180
  * @param {ProjectsDeletePlatformRequestParams} params
970
1181
  */
971
- const projectsDeletePlatform = async ({ projectId, platformId, parseOutput = true, sdk = undefined}) => {
972
- let client = !sdk ? await sdkForConsole() : sdk;
1182
+ const projectsDeletePlatform = async ({projectId,platformId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1183
+ let client = !sdk ? await sdkForConsole() :
1184
+ sdk;
973
1185
  let apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
974
1186
  let payload = {};
975
1187
 
@@ -983,8 +1195,9 @@ const projectsDeletePlatform = async ({ projectId, platformId, parseOutput = tru
983
1195
  parse(response)
984
1196
  success()
985
1197
  }
986
-
1198
+
987
1199
  return response;
1200
+
988
1201
  }
989
1202
 
990
1203
  /**
@@ -992,6 +1205,7 @@ const projectsDeletePlatform = async ({ projectId, platformId, parseOutput = tru
992
1205
  * @property {string} projectId Project unique ID.
993
1206
  * @property {ApiService} service Service name.
994
1207
  * @property {boolean} status Service status.
1208
+ * @property {boolean} overrideForCli
995
1209
  * @property {boolean} parseOutput
996
1210
  * @property {libClient | undefined} sdk
997
1211
  */
@@ -999,8 +1213,9 @@ const projectsDeletePlatform = async ({ projectId, platformId, parseOutput = tru
999
1213
  /**
1000
1214
  * @param {ProjectsUpdateServiceStatusRequestParams} params
1001
1215
  */
1002
- const projectsUpdateServiceStatus = async ({ projectId, service, status, parseOutput = true, sdk = undefined}) => {
1003
- let client = !sdk ? await sdkForConsole() : sdk;
1216
+ const projectsUpdateServiceStatus = async ({projectId,service,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1217
+ let client = !sdk ? await sdkForConsole() :
1218
+ sdk;
1004
1219
  let apiPath = '/projects/{projectId}/service'.replace('{projectId}', projectId);
1005
1220
  let payload = {};
1006
1221
  if (typeof service !== 'undefined') {
@@ -1020,14 +1235,16 @@ const projectsUpdateServiceStatus = async ({ projectId, service, status, parseOu
1020
1235
  parse(response)
1021
1236
  success()
1022
1237
  }
1023
-
1238
+
1024
1239
  return response;
1240
+
1025
1241
  }
1026
1242
 
1027
1243
  /**
1028
1244
  * @typedef {Object} ProjectsUpdateServiceStatusAllRequestParams
1029
1245
  * @property {string} projectId Project unique ID.
1030
1246
  * @property {boolean} status Service status.
1247
+ * @property {boolean} overrideForCli
1031
1248
  * @property {boolean} parseOutput
1032
1249
  * @property {libClient | undefined} sdk
1033
1250
  */
@@ -1035,8 +1252,9 @@ const projectsUpdateServiceStatus = async ({ projectId, service, status, parseOu
1035
1252
  /**
1036
1253
  * @param {ProjectsUpdateServiceStatusAllRequestParams} params
1037
1254
  */
1038
- const projectsUpdateServiceStatusAll = async ({ projectId, status, parseOutput = true, sdk = undefined}) => {
1039
- let client = !sdk ? await sdkForConsole() : sdk;
1255
+ const projectsUpdateServiceStatusAll = async ({projectId,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1256
+ let client = !sdk ? await sdkForConsole() :
1257
+ sdk;
1040
1258
  let apiPath = '/projects/{projectId}/service/all'.replace('{projectId}', projectId);
1041
1259
  let payload = {};
1042
1260
  if (typeof status !== 'undefined') {
@@ -1053,8 +1271,9 @@ const projectsUpdateServiceStatusAll = async ({ projectId, status, parseOutput =
1053
1271
  parse(response)
1054
1272
  success()
1055
1273
  }
1056
-
1274
+
1057
1275
  return response;
1276
+
1058
1277
  }
1059
1278
 
1060
1279
  /**
@@ -1069,6 +1288,7 @@ const projectsUpdateServiceStatusAll = async ({ projectId, status, parseOutput =
1069
1288
  * @property {string} username SMTP server username
1070
1289
  * @property {string} password SMTP server password
1071
1290
  * @property {SMTPSecure} secure Does SMTP server use secure connection
1291
+ * @property {boolean} overrideForCli
1072
1292
  * @property {boolean} parseOutput
1073
1293
  * @property {libClient | undefined} sdk
1074
1294
  */
@@ -1076,8 +1296,9 @@ const projectsUpdateServiceStatusAll = async ({ projectId, status, parseOutput =
1076
1296
  /**
1077
1297
  * @param {ProjectsUpdateSmtpRequestParams} params
1078
1298
  */
1079
- const projectsUpdateSmtp = async ({ projectId, enabled, senderName, senderEmail, replyTo, host, port, username, password, secure, parseOutput = true, sdk = undefined}) => {
1080
- let client = !sdk ? await sdkForConsole() : sdk;
1299
+ const projectsUpdateSmtp = async ({projectId,enabled,senderName,senderEmail,replyTo,host,port,username,password,secure,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1300
+ let client = !sdk ? await sdkForConsole() :
1301
+ sdk;
1081
1302
  let apiPath = '/projects/{projectId}/smtp'.replace('{projectId}', projectId);
1082
1303
  let payload = {};
1083
1304
  if (typeof enabled !== 'undefined') {
@@ -1118,8 +1339,9 @@ const projectsUpdateSmtp = async ({ projectId, enabled, senderName, senderEmail,
1118
1339
  parse(response)
1119
1340
  success()
1120
1341
  }
1121
-
1342
+
1122
1343
  return response;
1344
+
1123
1345
  }
1124
1346
 
1125
1347
  /**
@@ -1134,6 +1356,7 @@ const projectsUpdateSmtp = async ({ projectId, enabled, senderName, senderEmail,
1134
1356
  * @property {string} username SMTP server username
1135
1357
  * @property {string} password SMTP server password
1136
1358
  * @property {SMTPSecure} secure Does SMTP server use secure connection
1359
+ * @property {boolean} overrideForCli
1137
1360
  * @property {boolean} parseOutput
1138
1361
  * @property {libClient | undefined} sdk
1139
1362
  */
@@ -1141,8 +1364,9 @@ const projectsUpdateSmtp = async ({ projectId, enabled, senderName, senderEmail,
1141
1364
  /**
1142
1365
  * @param {ProjectsCreateSmtpTestRequestParams} params
1143
1366
  */
1144
- const projectsCreateSmtpTest = async ({ projectId, emails, senderName, senderEmail, host, replyTo, port, username, password, secure, parseOutput = true, sdk = undefined}) => {
1145
- let client = !sdk ? await sdkForConsole() : sdk;
1367
+ const projectsCreateSmtpTest = async ({projectId,emails,senderName,senderEmail,host,replyTo,port,username,password,secure,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1368
+ let client = !sdk ? await sdkForConsole() :
1369
+ sdk;
1146
1370
  let apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId);
1147
1371
  let payload = {};
1148
1372
  emails = emails === true ? [] : emails;
@@ -1184,14 +1408,16 @@ const projectsCreateSmtpTest = async ({ projectId, emails, senderName, senderEma
1184
1408
  parse(response)
1185
1409
  success()
1186
1410
  }
1187
-
1411
+
1188
1412
  return response;
1413
+
1189
1414
  }
1190
1415
 
1191
1416
  /**
1192
1417
  * @typedef {Object} ProjectsUpdateTeamRequestParams
1193
1418
  * @property {string} projectId Project unique ID.
1194
1419
  * @property {string} teamId Team ID of the team to transfer project to.
1420
+ * @property {boolean} overrideForCli
1195
1421
  * @property {boolean} parseOutput
1196
1422
  * @property {libClient | undefined} sdk
1197
1423
  */
@@ -1199,8 +1425,9 @@ const projectsCreateSmtpTest = async ({ projectId, emails, senderName, senderEma
1199
1425
  /**
1200
1426
  * @param {ProjectsUpdateTeamRequestParams} params
1201
1427
  */
1202
- const projectsUpdateTeam = async ({ projectId, teamId, parseOutput = true, sdk = undefined}) => {
1203
- let client = !sdk ? await sdkForConsole() : sdk;
1428
+ const projectsUpdateTeam = async ({projectId,teamId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1429
+ let client = !sdk ? await sdkForConsole() :
1430
+ sdk;
1204
1431
  let apiPath = '/projects/{projectId}/team'.replace('{projectId}', projectId);
1205
1432
  let payload = {};
1206
1433
  if (typeof teamId !== 'undefined') {
@@ -1217,8 +1444,9 @@ const projectsUpdateTeam = async ({ projectId, teamId, parseOutput = true, sdk =
1217
1444
  parse(response)
1218
1445
  success()
1219
1446
  }
1220
-
1447
+
1221
1448
  return response;
1449
+
1222
1450
  }
1223
1451
 
1224
1452
  /**
@@ -1226,6 +1454,7 @@ const projectsUpdateTeam = async ({ projectId, teamId, parseOutput = true, sdk =
1226
1454
  * @property {string} projectId Project unique ID.
1227
1455
  * @property {EmailTemplateType} type Template type
1228
1456
  * @property {EmailTemplateLocale} locale Template locale
1457
+ * @property {boolean} overrideForCli
1229
1458
  * @property {boolean} parseOutput
1230
1459
  * @property {libClient | undefined} sdk
1231
1460
  */
@@ -1233,8 +1462,9 @@ const projectsUpdateTeam = async ({ projectId, teamId, parseOutput = true, sdk =
1233
1462
  /**
1234
1463
  * @param {ProjectsGetEmailTemplateRequestParams} params
1235
1464
  */
1236
- const projectsGetEmailTemplate = async ({ projectId, type, locale, parseOutput = true, sdk = undefined}) => {
1237
- let client = !sdk ? await sdkForConsole() : sdk;
1465
+ const projectsGetEmailTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1466
+ let client = !sdk ? await sdkForConsole() :
1467
+ sdk;
1238
1468
  let apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1239
1469
  let payload = {};
1240
1470
 
@@ -1248,8 +1478,9 @@ const projectsGetEmailTemplate = async ({ projectId, type, locale, parseOutput =
1248
1478
  parse(response)
1249
1479
  success()
1250
1480
  }
1251
-
1481
+
1252
1482
  return response;
1483
+
1253
1484
  }
1254
1485
 
1255
1486
  /**
@@ -1262,6 +1493,7 @@ const projectsGetEmailTemplate = async ({ projectId, type, locale, parseOutput =
1262
1493
  * @property {string} senderName Name of the email sender
1263
1494
  * @property {string} senderEmail Email of the sender
1264
1495
  * @property {string} replyTo Reply to email
1496
+ * @property {boolean} overrideForCli
1265
1497
  * @property {boolean} parseOutput
1266
1498
  * @property {libClient | undefined} sdk
1267
1499
  */
@@ -1269,8 +1501,9 @@ const projectsGetEmailTemplate = async ({ projectId, type, locale, parseOutput =
1269
1501
  /**
1270
1502
  * @param {ProjectsUpdateEmailTemplateRequestParams} params
1271
1503
  */
1272
- const projectsUpdateEmailTemplate = async ({ projectId, type, locale, subject, message, senderName, senderEmail, replyTo, parseOutput = true, sdk = undefined}) => {
1273
- let client = !sdk ? await sdkForConsole() : sdk;
1504
+ const projectsUpdateEmailTemplate = async ({projectId,type,locale,subject,message,senderName,senderEmail,replyTo,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1505
+ let client = !sdk ? await sdkForConsole() :
1506
+ sdk;
1274
1507
  let apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1275
1508
  let payload = {};
1276
1509
  if (typeof subject !== 'undefined') {
@@ -1299,8 +1532,9 @@ const projectsUpdateEmailTemplate = async ({ projectId, type, locale, subject, m
1299
1532
  parse(response)
1300
1533
  success()
1301
1534
  }
1302
-
1535
+
1303
1536
  return response;
1537
+
1304
1538
  }
1305
1539
 
1306
1540
  /**
@@ -1308,6 +1542,7 @@ const projectsUpdateEmailTemplate = async ({ projectId, type, locale, subject, m
1308
1542
  * @property {string} projectId Project unique ID.
1309
1543
  * @property {EmailTemplateType} type Template type
1310
1544
  * @property {EmailTemplateLocale} locale Template locale
1545
+ * @property {boolean} overrideForCli
1311
1546
  * @property {boolean} parseOutput
1312
1547
  * @property {libClient | undefined} sdk
1313
1548
  */
@@ -1315,8 +1550,9 @@ const projectsUpdateEmailTemplate = async ({ projectId, type, locale, subject, m
1315
1550
  /**
1316
1551
  * @param {ProjectsDeleteEmailTemplateRequestParams} params
1317
1552
  */
1318
- const projectsDeleteEmailTemplate = async ({ projectId, type, locale, parseOutput = true, sdk = undefined}) => {
1319
- let client = !sdk ? await sdkForConsole() : sdk;
1553
+ const projectsDeleteEmailTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1554
+ let client = !sdk ? await sdkForConsole() :
1555
+ sdk;
1320
1556
  let apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1321
1557
  let payload = {};
1322
1558
 
@@ -1330,8 +1566,9 @@ const projectsDeleteEmailTemplate = async ({ projectId, type, locale, parseOutpu
1330
1566
  parse(response)
1331
1567
  success()
1332
1568
  }
1333
-
1569
+
1334
1570
  return response;
1571
+
1335
1572
  }
1336
1573
 
1337
1574
  /**
@@ -1339,6 +1576,7 @@ const projectsDeleteEmailTemplate = async ({ projectId, type, locale, parseOutpu
1339
1576
  * @property {string} projectId Project unique ID.
1340
1577
  * @property {SmsTemplateType} type Template type
1341
1578
  * @property {SmsTemplateLocale} locale Template locale
1579
+ * @property {boolean} overrideForCli
1342
1580
  * @property {boolean} parseOutput
1343
1581
  * @property {libClient | undefined} sdk
1344
1582
  */
@@ -1346,8 +1584,9 @@ const projectsDeleteEmailTemplate = async ({ projectId, type, locale, parseOutpu
1346
1584
  /**
1347
1585
  * @param {ProjectsGetSmsTemplateRequestParams} params
1348
1586
  */
1349
- const projectsGetSmsTemplate = async ({ projectId, type, locale, parseOutput = true, sdk = undefined}) => {
1350
- let client = !sdk ? await sdkForConsole() : sdk;
1587
+ const projectsGetSmsTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1588
+ let client = !sdk ? await sdkForConsole() :
1589
+ sdk;
1351
1590
  let apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1352
1591
  let payload = {};
1353
1592
 
@@ -1361,8 +1600,9 @@ const projectsGetSmsTemplate = async ({ projectId, type, locale, parseOutput = t
1361
1600
  parse(response)
1362
1601
  success()
1363
1602
  }
1364
-
1603
+
1365
1604
  return response;
1605
+
1366
1606
  }
1367
1607
 
1368
1608
  /**
@@ -1371,6 +1611,7 @@ const projectsGetSmsTemplate = async ({ projectId, type, locale, parseOutput = t
1371
1611
  * @property {SmsTemplateType} type Template type
1372
1612
  * @property {SmsTemplateLocale} locale Template locale
1373
1613
  * @property {string} message Template message
1614
+ * @property {boolean} overrideForCli
1374
1615
  * @property {boolean} parseOutput
1375
1616
  * @property {libClient | undefined} sdk
1376
1617
  */
@@ -1378,8 +1619,9 @@ const projectsGetSmsTemplate = async ({ projectId, type, locale, parseOutput = t
1378
1619
  /**
1379
1620
  * @param {ProjectsUpdateSmsTemplateRequestParams} params
1380
1621
  */
1381
- const projectsUpdateSmsTemplate = async ({ projectId, type, locale, message, parseOutput = true, sdk = undefined}) => {
1382
- let client = !sdk ? await sdkForConsole() : sdk;
1622
+ const projectsUpdateSmsTemplate = async ({projectId,type,locale,message,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1623
+ let client = !sdk ? await sdkForConsole() :
1624
+ sdk;
1383
1625
  let apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1384
1626
  let payload = {};
1385
1627
  if (typeof message !== 'undefined') {
@@ -1396,8 +1638,9 @@ const projectsUpdateSmsTemplate = async ({ projectId, type, locale, message, par
1396
1638
  parse(response)
1397
1639
  success()
1398
1640
  }
1399
-
1641
+
1400
1642
  return response;
1643
+
1401
1644
  }
1402
1645
 
1403
1646
  /**
@@ -1405,6 +1648,7 @@ const projectsUpdateSmsTemplate = async ({ projectId, type, locale, message, par
1405
1648
  * @property {string} projectId Project unique ID.
1406
1649
  * @property {SmsTemplateType} type Template type
1407
1650
  * @property {SmsTemplateLocale} locale Template locale
1651
+ * @property {boolean} overrideForCli
1408
1652
  * @property {boolean} parseOutput
1409
1653
  * @property {libClient | undefined} sdk
1410
1654
  */
@@ -1412,8 +1656,9 @@ const projectsUpdateSmsTemplate = async ({ projectId, type, locale, message, par
1412
1656
  /**
1413
1657
  * @param {ProjectsDeleteSmsTemplateRequestParams} params
1414
1658
  */
1415
- const projectsDeleteSmsTemplate = async ({ projectId, type, locale, parseOutput = true, sdk = undefined}) => {
1416
- let client = !sdk ? await sdkForConsole() : sdk;
1659
+ const projectsDeleteSmsTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1660
+ let client = !sdk ? await sdkForConsole() :
1661
+ sdk;
1417
1662
  let apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1418
1663
  let payload = {};
1419
1664
 
@@ -1427,13 +1672,15 @@ const projectsDeleteSmsTemplate = async ({ projectId, type, locale, parseOutput
1427
1672
  parse(response)
1428
1673
  success()
1429
1674
  }
1430
-
1675
+
1431
1676
  return response;
1677
+
1432
1678
  }
1433
1679
 
1434
1680
  /**
1435
1681
  * @typedef {Object} ProjectsListWebhooksRequestParams
1436
1682
  * @property {string} projectId Project unique ID.
1683
+ * @property {boolean} overrideForCli
1437
1684
  * @property {boolean} parseOutput
1438
1685
  * @property {libClient | undefined} sdk
1439
1686
  */
@@ -1441,8 +1688,9 @@ const projectsDeleteSmsTemplate = async ({ projectId, type, locale, parseOutput
1441
1688
  /**
1442
1689
  * @param {ProjectsListWebhooksRequestParams} params
1443
1690
  */
1444
- const projectsListWebhooks = async ({ projectId, parseOutput = true, sdk = undefined}) => {
1445
- let client = !sdk ? await sdkForConsole() : sdk;
1691
+ const projectsListWebhooks = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1692
+ let client = !sdk ? await sdkForConsole() :
1693
+ sdk;
1446
1694
  let apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1447
1695
  let payload = {};
1448
1696
 
@@ -1453,11 +1701,16 @@ const projectsListWebhooks = async ({ projectId, parseOutput = true, sdk = undef
1453
1701
  }, payload);
1454
1702
 
1455
1703
  if (parseOutput) {
1456
- parse(response)
1457
- success()
1704
+ if(console) {
1705
+ showConsoleLink('projects', 'listWebhooks', projectId);
1706
+ } else {
1707
+ parse(response)
1708
+ success()
1709
+ }
1458
1710
  }
1459
-
1711
+
1460
1712
  return response;
1713
+
1461
1714
  }
1462
1715
 
1463
1716
  /**
@@ -1470,6 +1723,7 @@ const projectsListWebhooks = async ({ projectId, parseOutput = true, sdk = undef
1470
1723
  * @property {boolean} enabled Enable or disable a webhook.
1471
1724
  * @property {string} httpUser Webhook HTTP user. Max length: 256 chars.
1472
1725
  * @property {string} httpPass Webhook HTTP password. Max length: 256 chars.
1726
+ * @property {boolean} overrideForCli
1473
1727
  * @property {boolean} parseOutput
1474
1728
  * @property {libClient | undefined} sdk
1475
1729
  */
@@ -1477,8 +1731,9 @@ const projectsListWebhooks = async ({ projectId, parseOutput = true, sdk = undef
1477
1731
  /**
1478
1732
  * @param {ProjectsCreateWebhookRequestParams} params
1479
1733
  */
1480
- const projectsCreateWebhook = async ({ projectId, name, events, url, security, enabled, httpUser, httpPass, parseOutput = true, sdk = undefined}) => {
1481
- let client = !sdk ? await sdkForConsole() : sdk;
1734
+ const projectsCreateWebhook = async ({projectId,name,events,url,security,enabled,httpUser,httpPass,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1735
+ let client = !sdk ? await sdkForConsole() :
1736
+ sdk;
1482
1737
  let apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1483
1738
  let payload = {};
1484
1739
  if (typeof name !== 'undefined') {
@@ -1514,14 +1769,16 @@ const projectsCreateWebhook = async ({ projectId, name, events, url, security, e
1514
1769
  parse(response)
1515
1770
  success()
1516
1771
  }
1517
-
1772
+
1518
1773
  return response;
1774
+
1519
1775
  }
1520
1776
 
1521
1777
  /**
1522
1778
  * @typedef {Object} ProjectsGetWebhookRequestParams
1523
1779
  * @property {string} projectId Project unique ID.
1524
1780
  * @property {string} webhookId Webhook unique ID.
1781
+ * @property {boolean} overrideForCli
1525
1782
  * @property {boolean} parseOutput
1526
1783
  * @property {libClient | undefined} sdk
1527
1784
  */
@@ -1529,8 +1786,9 @@ const projectsCreateWebhook = async ({ projectId, name, events, url, security, e
1529
1786
  /**
1530
1787
  * @param {ProjectsGetWebhookRequestParams} params
1531
1788
  */
1532
- const projectsGetWebhook = async ({ projectId, webhookId, parseOutput = true, sdk = undefined}) => {
1533
- let client = !sdk ? await sdkForConsole() : sdk;
1789
+ const projectsGetWebhook = async ({projectId,webhookId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1790
+ let client = !sdk ? await sdkForConsole() :
1791
+ sdk;
1534
1792
  let apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1535
1793
  let payload = {};
1536
1794
 
@@ -1541,11 +1799,16 @@ const projectsGetWebhook = async ({ projectId, webhookId, parseOutput = true, sd
1541
1799
  }, payload);
1542
1800
 
1543
1801
  if (parseOutput) {
1544
- parse(response)
1545
- success()
1802
+ if(console) {
1803
+ showConsoleLink('projects', 'getWebhook', projectId, webhookId);
1804
+ } else {
1805
+ parse(response)
1806
+ success()
1807
+ }
1546
1808
  }
1547
-
1809
+
1548
1810
  return response;
1811
+
1549
1812
  }
1550
1813
 
1551
1814
  /**
@@ -1559,6 +1822,7 @@ const projectsGetWebhook = async ({ projectId, webhookId, parseOutput = true, sd
1559
1822
  * @property {boolean} enabled Enable or disable a webhook.
1560
1823
  * @property {string} httpUser Webhook HTTP user. Max length: 256 chars.
1561
1824
  * @property {string} httpPass Webhook HTTP password. Max length: 256 chars.
1825
+ * @property {boolean} overrideForCli
1562
1826
  * @property {boolean} parseOutput
1563
1827
  * @property {libClient | undefined} sdk
1564
1828
  */
@@ -1566,8 +1830,9 @@ const projectsGetWebhook = async ({ projectId, webhookId, parseOutput = true, sd
1566
1830
  /**
1567
1831
  * @param {ProjectsUpdateWebhookRequestParams} params
1568
1832
  */
1569
- const projectsUpdateWebhook = async ({ projectId, webhookId, name, events, url, security, enabled, httpUser, httpPass, parseOutput = true, sdk = undefined}) => {
1570
- let client = !sdk ? await sdkForConsole() : sdk;
1833
+ const projectsUpdateWebhook = async ({projectId,webhookId,name,events,url,security,enabled,httpUser,httpPass,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1834
+ let client = !sdk ? await sdkForConsole() :
1835
+ sdk;
1571
1836
  let apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1572
1837
  let payload = {};
1573
1838
  if (typeof name !== 'undefined') {
@@ -1603,14 +1868,16 @@ const projectsUpdateWebhook = async ({ projectId, webhookId, name, events, url,
1603
1868
  parse(response)
1604
1869
  success()
1605
1870
  }
1606
-
1871
+
1607
1872
  return response;
1873
+
1608
1874
  }
1609
1875
 
1610
1876
  /**
1611
1877
  * @typedef {Object} ProjectsDeleteWebhookRequestParams
1612
1878
  * @property {string} projectId Project unique ID.
1613
1879
  * @property {string} webhookId Webhook unique ID.
1880
+ * @property {boolean} overrideForCli
1614
1881
  * @property {boolean} parseOutput
1615
1882
  * @property {libClient | undefined} sdk
1616
1883
  */
@@ -1618,8 +1885,9 @@ const projectsUpdateWebhook = async ({ projectId, webhookId, name, events, url,
1618
1885
  /**
1619
1886
  * @param {ProjectsDeleteWebhookRequestParams} params
1620
1887
  */
1621
- const projectsDeleteWebhook = async ({ projectId, webhookId, parseOutput = true, sdk = undefined}) => {
1622
- let client = !sdk ? await sdkForConsole() : sdk;
1888
+ const projectsDeleteWebhook = async ({projectId,webhookId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1889
+ let client = !sdk ? await sdkForConsole() :
1890
+ sdk;
1623
1891
  let apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1624
1892
  let payload = {};
1625
1893
 
@@ -1633,14 +1901,16 @@ const projectsDeleteWebhook = async ({ projectId, webhookId, parseOutput = true,
1633
1901
  parse(response)
1634
1902
  success()
1635
1903
  }
1636
-
1904
+
1637
1905
  return response;
1906
+
1638
1907
  }
1639
1908
 
1640
1909
  /**
1641
1910
  * @typedef {Object} ProjectsUpdateWebhookSignatureRequestParams
1642
1911
  * @property {string} projectId Project unique ID.
1643
1912
  * @property {string} webhookId Webhook unique ID.
1913
+ * @property {boolean} overrideForCli
1644
1914
  * @property {boolean} parseOutput
1645
1915
  * @property {libClient | undefined} sdk
1646
1916
  */
@@ -1648,8 +1918,9 @@ const projectsDeleteWebhook = async ({ projectId, webhookId, parseOutput = true,
1648
1918
  /**
1649
1919
  * @param {ProjectsUpdateWebhookSignatureRequestParams} params
1650
1920
  */
1651
- const projectsUpdateWebhookSignature = async ({ projectId, webhookId, parseOutput = true, sdk = undefined}) => {
1652
- let client = !sdk ? await sdkForConsole() : sdk;
1921
+ const projectsUpdateWebhookSignature = async ({projectId,webhookId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1922
+ let client = !sdk ? await sdkForConsole() :
1923
+ sdk;
1653
1924
  let apiPath = '/projects/{projectId}/webhooks/{webhookId}/signature'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1654
1925
  let payload = {};
1655
1926
 
@@ -1663,8 +1934,9 @@ const projectsUpdateWebhookSignature = async ({ projectId, webhookId, parseOutpu
1663
1934
  parse(response)
1664
1935
  success()
1665
1936
  }
1666
-
1937
+
1667
1938
  return response;
1939
+
1668
1940
  }
1669
1941
 
1670
1942
  projects
@@ -1672,6 +1944,7 @@ projects
1672
1944
  .description(``)
1673
1945
  .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, teamId`)
1674
1946
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1947
+ .option(`--console`, `Get the resource console url`)
1675
1948
  .action(actionRunner(projectsList))
1676
1949
 
1677
1950
  projects
@@ -1696,6 +1969,7 @@ projects
1696
1969
  .command(`get`)
1697
1970
  .description(``)
1698
1971
  .requiredOption(`--projectId <projectId>`, `Project unique ID.`)
1972
+ .option(`--console`, `Get the resource console url`)
1699
1973
  .action(actionRunner(projectsGet))
1700
1974
 
1701
1975
  projects
@@ -1756,6 +2030,13 @@ projects
1756
2030
  .requiredOption(`--limit <limit>`, `Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10`, parseInteger)
1757
2031
  .action(actionRunner(projectsUpdateAuthSessionsLimit))
1758
2032
 
2033
+ projects
2034
+ .command(`updateMockNumbers`)
2035
+ .description(``)
2036
+ .requiredOption(`--projectId <projectId>`, `Project unique ID.`)
2037
+ .requiredOption(`--numbers [numbers...]`, `An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.`)
2038
+ .action(actionRunner(projectsUpdateMockNumbers))
2039
+
1759
2040
  projects
1760
2041
  .command(`updateAuthPasswordDictionary`)
1761
2042
  .description(``)
@@ -1777,6 +2058,13 @@ projects
1777
2058
  .requiredOption(`--enabled <enabled>`, `Set whether or not to check a password for similarity with personal data. Default is false.`, parseBool)
1778
2059
  .action(actionRunner(projectsUpdatePersonalDataCheck))
1779
2060
 
2061
+ projects
2062
+ .command(`updateSessionAlerts`)
2063
+ .description(``)
2064
+ .requiredOption(`--projectId <projectId>`, `Project unique ID.`)
2065
+ .requiredOption(`--alerts <alerts>`, `Set to true to enable session emails.`, parseBool)
2066
+ .action(actionRunner(projectsUpdateSessionAlerts))
2067
+
1780
2068
  projects
1781
2069
  .command(`updateAuthStatus`)
1782
2070
  .description(``)
@@ -1785,10 +2073,19 @@ projects
1785
2073
  .requiredOption(`--status <status>`, `Set the status of this auth method.`, parseBool)
1786
2074
  .action(actionRunner(projectsUpdateAuthStatus))
1787
2075
 
2076
+ projects
2077
+ .command(`createJWT`)
2078
+ .description(``)
2079
+ .requiredOption(`--projectId <projectId>`, `Project unique ID.`)
2080
+ .requiredOption(`--scopes [scopes...]`, `List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.`)
2081
+ .option(`--duration <duration>`, `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`, parseInteger)
2082
+ .action(actionRunner(projectsCreateJWT))
2083
+
1788
2084
  projects
1789
2085
  .command(`listKeys`)
1790
2086
  .description(``)
1791
2087
  .requiredOption(`--projectId <projectId>`, `Project unique ID.`)
2088
+ .option(`--console`, `Get the resource console url`)
1792
2089
  .action(actionRunner(projectsListKeys))
1793
2090
 
1794
2091
  projects
@@ -1805,6 +2102,7 @@ projects
1805
2102
  .description(``)
1806
2103
  .requiredOption(`--projectId <projectId>`, `Project unique ID.`)
1807
2104
  .requiredOption(`--keyId <keyId>`, `Key unique ID.`)
2105
+ .option(`--console`, `Get the resource console url`)
1808
2106
  .action(actionRunner(projectsGetKey))
1809
2107
 
1810
2108
  projects
@@ -1838,6 +2136,7 @@ projects
1838
2136
  .command(`listPlatforms`)
1839
2137
  .description(``)
1840
2138
  .requiredOption(`--projectId <projectId>`, `Project unique ID.`)
2139
+ .option(`--console`, `Get the resource console url`)
1841
2140
  .action(actionRunner(projectsListPlatforms))
1842
2141
 
1843
2142
  projects
@@ -1856,6 +2155,7 @@ projects
1856
2155
  .description(``)
1857
2156
  .requiredOption(`--projectId <projectId>`, `Project unique ID.`)
1858
2157
  .requiredOption(`--platformId <platformId>`, `Platform unique ID.`)
2158
+ .option(`--console`, `Get the resource console url`)
1859
2159
  .action(actionRunner(projectsGetPlatform))
1860
2160
 
1861
2161
  projects
@@ -1986,6 +2286,7 @@ projects
1986
2286
  .command(`listWebhooks`)
1987
2287
  .description(``)
1988
2288
  .requiredOption(`--projectId <projectId>`, `Project unique ID.`)
2289
+ .option(`--console`, `Get the resource console url`)
1989
2290
  .action(actionRunner(projectsListWebhooks))
1990
2291
 
1991
2292
  projects
@@ -2006,6 +2307,7 @@ projects
2006
2307
  .description(``)
2007
2308
  .requiredOption(`--projectId <projectId>`, `Project unique ID.`)
2008
2309
  .requiredOption(`--webhookId <webhookId>`, `Webhook unique ID.`)
2310
+ .option(`--console`, `Get the resource console url`)
2009
2311
  .action(actionRunner(projectsGetWebhook))
2010
2312
 
2011
2313
  projects
@@ -2048,10 +2350,13 @@ module.exports = {
2048
2350
  projectsUpdateAuthDuration,
2049
2351
  projectsUpdateAuthLimit,
2050
2352
  projectsUpdateAuthSessionsLimit,
2353
+ projectsUpdateMockNumbers,
2051
2354
  projectsUpdateAuthPasswordDictionary,
2052
2355
  projectsUpdateAuthPasswordHistory,
2053
2356
  projectsUpdatePersonalDataCheck,
2357
+ projectsUpdateSessionAlerts,
2054
2358
  projectsUpdateAuthStatus,
2359
+ projectsCreateJWT,
2055
2360
  projectsListKeys,
2056
2361
  projectsCreateKey,
2057
2362
  projectsGetKey,
@@ -2080,4 +2385,4 @@ module.exports = {
2080
2385
  projectsUpdateWebhook,
2081
2386
  projectsDeleteWebhook,
2082
2387
  projectsUpdateWebhookSignature
2083
- };
2388
+ };