clever-tools 3.13.1 → 4.0.0

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 (93) hide show
  1. package/README.md +130 -37
  2. package/bin/clever.js +1427 -718
  3. package/package.json +62 -77
  4. package/src/clever-client/auth-bridge.js +9 -12
  5. package/src/clever-client/ng.js +1 -1
  6. package/src/clever-client/operators.js +7 -7
  7. package/src/command-options.js +6 -6
  8. package/src/command-promise-handler.js +6 -6
  9. package/src/commands/accesslogs.js +38 -29
  10. package/src/commands/activity.js +62 -40
  11. package/src/commands/addon.js +65 -69
  12. package/src/commands/applications.js +33 -31
  13. package/src/commands/cancel-deploy.js +7 -7
  14. package/src/commands/config.js +9 -7
  15. package/src/commands/console.js +3 -3
  16. package/src/commands/create.js +33 -32
  17. package/src/commands/curl.js +14 -36
  18. package/src/commands/database.js +10 -30
  19. package/src/commands/delete.js +8 -8
  20. package/src/commands/deploy.js +60 -46
  21. package/src/commands/diag.js +27 -25
  22. package/src/commands/domain.js +89 -91
  23. package/src/commands/drain.js +26 -14
  24. package/src/commands/emails.js +24 -28
  25. package/src/commands/env.js +18 -18
  26. package/src/commands/features.js +12 -18
  27. package/src/commands/keycloak.js +11 -11
  28. package/src/commands/kv.js +13 -13
  29. package/src/commands/link.js +9 -8
  30. package/src/commands/login.js +19 -27
  31. package/src/commands/logout.js +1 -1
  32. package/src/commands/logs.js +20 -12
  33. package/src/commands/makeDefault.js +5 -5
  34. package/src/commands/matomo.js +7 -7
  35. package/src/commands/metabase.js +9 -9
  36. package/src/commands/ng.js +32 -32
  37. package/src/commands/notify-email.js +11 -15
  38. package/src/commands/open.js +1 -1
  39. package/src/commands/otoroshi.js +11 -11
  40. package/src/commands/profile.js +8 -8
  41. package/src/commands/published-config.js +11 -11
  42. package/src/commands/restart.js +15 -8
  43. package/src/commands/scale.js +25 -16
  44. package/src/commands/service.js +28 -11
  45. package/src/commands/ssh-keys.js +25 -29
  46. package/src/commands/ssh.js +1 -2
  47. package/src/commands/status.js +31 -22
  48. package/src/commands/stop.js +3 -3
  49. package/src/commands/tcp-redirs.js +27 -26
  50. package/src/commands/tokens.js +44 -43
  51. package/src/commands/unlink.js +7 -5
  52. package/src/commands/version.js +2 -4
  53. package/src/commands/webhooks.js +8 -10
  54. package/src/experimental-features.js +7 -5
  55. package/src/format-table.js +46 -15
  56. package/src/initial-setup.js +2 -32
  57. package/src/initial-update-notifier.js +18 -0
  58. package/src/lib/has-param.js +16 -0
  59. package/src/lib/ng-print.js +21 -24
  60. package/src/lib/operator-commands.js +58 -53
  61. package/src/lib/prompts.js +5 -5
  62. package/src/lib/slugify.js +1 -1
  63. package/src/logger.js +26 -21
  64. package/src/models/activity.js +3 -3
  65. package/src/models/addon.js +54 -56
  66. package/src/models/app_configuration.js +34 -32
  67. package/src/models/application.js +90 -77
  68. package/src/models/application_configuration.js +19 -27
  69. package/src/models/configuration.js +30 -32
  70. package/src/models/deployments.js +9 -19
  71. package/src/models/domain.js +10 -9
  72. package/src/models/drain.js +16 -15
  73. package/src/models/exit-strategy-option.js +15 -5
  74. package/src/models/fs-utils.js +4 -3
  75. package/src/models/git.js +26 -32
  76. package/src/models/ids-resolver.js +37 -41
  77. package/src/models/isomorphic-http-with-agent.js +3 -3
  78. package/src/models/json-array.js +5 -6
  79. package/src/models/log-v4.js +44 -52
  80. package/src/models/log.js +40 -45
  81. package/src/models/namespaces.js +4 -4
  82. package/src/models/ng-resources.js +49 -39
  83. package/src/models/ng.js +41 -40
  84. package/src/models/node-dns-resolver.js +3 -3
  85. package/src/models/notification.js +7 -10
  86. package/src/models/operator.js +8 -10
  87. package/src/models/organisation.js +5 -8
  88. package/src/models/send-to-api.js +18 -11
  89. package/src/models/user.js +6 -5
  90. package/src/models/utils.js +5 -8
  91. package/src/models/variables.js +18 -20
  92. package/src/parsers.js +34 -34
  93. package/src/load-package-json.cjs +0 -5
package/bin/clever.js CHANGED
@@ -1,36 +1,26 @@
1
- #! /usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  // WARNING: this needs to run before other imports
4
4
  import '../src/initial-setup.js';
5
-
5
+ import '../src/initial-update-notifier.js';
6
+ // Other imports
6
7
  import cliparse from 'cliparse';
7
- import colors from 'colors/safe.js';
8
8
  import cliparseCommands from 'cliparse/src/command.js';
9
9
  import _sortBy from 'lodash/sortBy.js';
10
-
11
- import { getPackageJson } from '../src/load-package-json.cjs';
12
- import * as git from '../src/models/git.js';
13
- import * as Parsers from '../src/parsers.js';
14
- import { handleCommandPromise } from '../src/command-promise-handler.js';
15
- import * as Application from '../src/models/application.js';
16
- import { AVAILABLE_ZONES } from '../src/models/application.js';
17
- import { EXPERIMENTAL_FEATURES } from '../src/experimental-features.js';
10
+ import { styleText } from 'node:util';
11
+ import pkg from '../package.json' with { type: 'json' };
18
12
  import { getExitOnOption, getOutputFormatOption, getSameCommitPolicyOption } from '../src/command-options.js';
19
- import { getFeatures, conf } from '../src/models/configuration.js';
20
-
21
- import * as Addon from '../src/models/addon.js';
22
- import * as ApplicationConfiguration from '../src/models/application_configuration.js';
23
- import * as Drain from '../src/models/drain.js';
24
- import * as Notification from '../src/models/notification.js';
25
- import * as Namespaces from '../src/models/namespaces.js';
26
-
13
+ import { handleCommandPromise } from '../src/command-promise-handler.js';
27
14
  import * as accesslogsModule from '../src/commands/accesslogs.js';
28
15
  import * as activity from '../src/commands/activity.js';
29
16
  import * as addon from '../src/commands/addon.js';
30
17
  import * as applications from '../src/commands/applications.js';
31
18
  import * as cancelDeploy from '../src/commands/cancel-deploy.js';
32
19
  import * as config from '../src/commands/config.js';
20
+ import * as consoleModule from '../src/commands/console.js';
33
21
  import * as create from '../src/commands/create.js';
22
+ import { curl } from '../src/commands/curl.js';
23
+ import * as database from '../src/commands/database.js';
34
24
  import * as deleteCommandModule from '../src/commands/delete.js';
35
25
  import * as deploy from '../src/commands/deploy.js';
36
26
  import * as diag from '../src/commands/diag.js';
@@ -45,21 +35,20 @@ import * as link from '../src/commands/link.js';
45
35
  import * as login from '../src/commands/login.js';
46
36
  import * as logout from '../src/commands/logout.js';
47
37
  import * as logs from '../src/commands/logs.js';
38
+ import * as makeDefault from '../src/commands/makeDefault.js';
48
39
  import * as matomo from '../src/commands/matomo.js';
49
40
  import * as metabase from '../src/commands/metabase.js';
50
- import * as makeDefault from '../src/commands/makeDefault.js';
51
41
  import * as ng from '../src/commands/ng.js';
52
42
  import * as notifyEmail from '../src/commands/notify-email.js';
53
43
  import * as open from '../src/commands/open.js';
54
- import * as consoleModule from '../src/commands/console.js';
55
44
  import * as otoroshi from '../src/commands/otoroshi.js';
56
45
  import * as profile from '../src/commands/profile.js';
57
46
  import * as publishedConfig from '../src/commands/published-config.js';
58
47
  import * as restart from '../src/commands/restart.js';
59
48
  import * as scale from '../src/commands/scale.js';
60
49
  import * as service from '../src/commands/service.js';
61
- import * as ssh from '../src/commands/ssh.js';
62
50
  import * as sshKeys from '../src/commands/ssh-keys.js';
51
+ import * as ssh from '../src/commands/ssh.js';
63
52
  import * as status from '../src/commands/status.js';
64
53
  import * as stop from '../src/commands/stop.js';
65
54
  import * as tcpRedirs from '../src/commands/tcp-redirs.js';
@@ -67,8 +56,17 @@ import * as tokens from '../src/commands/tokens.js';
67
56
  import * as unlink from '../src/commands/unlink.js';
68
57
  import * as version from '../src/commands/version.js';
69
58
  import * as webhooks from '../src/commands/webhooks.js';
70
- import * as database from '../src/commands/database.js';
71
- import { curl } from '../src/commands/curl.js';
59
+ import { EXPERIMENTAL_FEATURES } from '../src/experimental-features.js';
60
+ import * as Addon from '../src/models/addon.js';
61
+ import * as Application from '../src/models/application.js';
62
+ import { AVAILABLE_ZONES } from '../src/models/application.js';
63
+ import * as ApplicationConfiguration from '../src/models/application_configuration.js';
64
+ import { conf, getFeatures } from '../src/models/configuration.js';
65
+ import * as Drain from '../src/models/drain.js';
66
+ import * as git from '../src/models/git.js';
67
+ import * as Namespaces from '../src/models/namespaces.js';
68
+ import * as Notification from '../src/models/notification.js';
69
+ import * as Parsers from '../src/parsers.js';
72
70
 
73
71
  // Exit cleanly if the program we pipe to exits abruptly
74
72
  process.stdout.on('error', (error) => {
@@ -88,17 +86,18 @@ cliparse.command = function (name, options, commandFunction) {
88
86
  };
89
87
 
90
88
  // Add a yellow color and status tag to the description of an experimental command
91
- function colorizeExperimentalCommand (command, id) {
89
+ function colorizeExperimentalCommand(command, id) {
92
90
  const status = EXPERIMENTAL_FEATURES[id].status;
93
- command.description = colors.yellow(command.description + ' [' + status.toUpperCase() + ']');
91
+ command.description = styleText('yellow', command.description + ' [' + status.toUpperCase() + ']');
94
92
  return command;
95
93
  }
96
94
 
97
- async function run () {
98
-
95
+ async function run() {
99
96
  // ARGUMENTS
100
97
  const args = {
101
- kvRawCommand: cliparse.argument('command', { description: 'The raw command to send to the Materia KV or Redis® add-on' }),
98
+ kvRawCommand: cliparse.argument('command', {
99
+ description: 'The raw command to send to the Materia KV or Redis® add-on',
100
+ }),
102
101
  kvIdOrName: cliparse.argument('kv-id', {
103
102
  description: 'Add-on/Real ID (or name, if unambiguous) of a Materia KV or Redis® add-on',
104
103
  }),
@@ -157,7 +156,9 @@ async function run () {
157
156
  default: '',
158
157
  }),
159
158
  backupId: cliparse.argument('backup-id', { description: 'A Database backup ID (format: UUID)' }),
160
- databaseId: cliparse.argument('database-id', { description: 'Any database ID (format: addon_UUID, postgresql_UUID, mysql_UUID, ...)' }),
159
+ databaseId: cliparse.argument('database-id', {
160
+ description: 'Any database ID (format: addon_UUID, postgresql_UUID, mysql_UUID, ...)',
161
+ }),
161
162
  drainId: cliparse.argument('drain-id', { description: 'Drain ID' }),
162
163
  drainType: cliparse.argument('drain-type', {
163
164
  description: 'Drain type',
@@ -185,7 +186,7 @@ async function run () {
185
186
  }),
186
187
  configurationName: cliparse.argument('configuration-name', {
187
188
  description: `Configuration to manage: ${ApplicationConfiguration.listAvailableIds(true)}`,
188
- complete () {
189
+ complete() {
189
190
  return cliparse.autocomplete.words(ApplicationConfiguration.listAvailableIds());
190
191
  },
191
192
  }),
@@ -211,7 +212,8 @@ async function run () {
211
212
  }),
212
213
  ngMembersIdsToLink: cliparse.option('link', {
213
214
  metavar: 'members_ids',
214
- description: "Comma separated list of members IDs to link to a Network Group ('app_xxx', 'addon_xxx', 'external_xxx')",
215
+ description:
216
+ "Comma separated list of members IDs to link to a Network Group ('app_xxx', 'addon_xxx', 'external_xxx')",
215
217
  parser: Parsers.commaSeparated,
216
218
  }),
217
219
  ngMemberLabel: cliparse.option('label', {
@@ -278,7 +280,7 @@ async function run () {
278
280
  default: '',
279
281
  metavar: 'branch',
280
282
  description: 'Branch to push (current branch by default)',
281
- complete () {
283
+ complete() {
282
284
  return git.completeBranches();
283
285
  },
284
286
  }),
@@ -316,7 +318,7 @@ async function run () {
316
318
  metavar: 'flavor',
317
319
  parser: Parsers.flavor,
318
320
  description: 'The instance size of your application',
319
- complete () {
321
+ complete() {
320
322
  return cliparse.autocomplete.words(Application.listAvailableFlavors());
321
323
  },
322
324
  }),
@@ -326,14 +328,14 @@ async function run () {
326
328
  }),
327
329
  forceDeploy: cliparse.flag('force', {
328
330
  aliases: ['f'],
329
- description: 'Force deploy even if it\'s not fast-forwardable',
331
+ description: "Force deploy even if it's not fast-forwardable",
330
332
  }),
331
333
  exitOnDeploy: getExitOnOption(),
332
334
  sameCommitPolicy: getSameCommitPolicyOption(),
333
335
  webhookFormat: cliparse.option('format', {
334
336
  metavar: 'format',
335
337
  default: 'raw',
336
- description: 'Format of the body sent to the webhook (\'raw\', \'slack\', \'gitter\', or \'flowdock\')',
338
+ description: "Format of the body sent to the webhook ('raw', 'slack', 'gitter', or 'flowdock')",
337
339
  }),
338
340
  github: cliparse.option('github', {
339
341
  metavar: 'OWNER/REPO',
@@ -355,19 +357,21 @@ async function run () {
355
357
  description: 'Link the created add-on to the app with the specified alias',
356
358
  complete: Application.listAvailableAliases,
357
359
  }),
358
- listAllNotifications: cliparse.flag('list-all', { description: 'List all notifications for your user or for an organisation with the \'--org\' option' }),
360
+ listAllNotifications: cliparse.flag('list-all', {
361
+ description: "List all notifications for your user or for an organisation with the '--org' option",
362
+ }),
359
363
  maxFlavor: cliparse.option('max-flavor', {
360
364
  metavar: 'maxflavor',
361
365
  parser: Parsers.flavor,
362
366
  description: 'The maximum instance size of your application',
363
- complete () {
367
+ complete() {
364
368
  return cliparse.autocomplete.words(Application.listAvailableFlavors());
365
369
  },
366
370
  }),
367
371
  buildFlavor: cliparse.option('build-flavor', {
368
372
  metavar: 'buildflavor',
369
373
  parser: Parsers.buildFlavor,
370
- description: 'The size of the build instance, or \'disabled\' if you want to disable dedicated build instances',
374
+ description: "The size of the build instance, or 'disabled' if you want to disable dedicated build instances",
371
375
  }),
372
376
  maxInstances: cliparse.option('max-instances', {
373
377
  metavar: 'maxinstances',
@@ -378,7 +382,7 @@ async function run () {
378
382
  metavar: 'minflavor',
379
383
  parser: Parsers.flavor,
380
384
  description: 'The minimum scale size of your application',
381
- complete () {
385
+ complete() {
382
386
  return cliparse.autocomplete.words(Application.listAvailableFlavors());
383
387
  },
384
388
  }),
@@ -393,7 +397,8 @@ async function run () {
393
397
  }),
394
398
  emailNotificationTarget: cliparse.option('notify', {
395
399
  metavar: '<email_address>|<user_id>|"organisation"',
396
- description: 'Notify a user, a specific email address or the whole organisation (multiple values allowed, comma separated)',
400
+ description:
401
+ 'Notify a user, a specific email address or the whole organisation (multiple values allowed, comma separated)',
397
402
  required: true,
398
403
  parser: Parsers.commaSeparated,
399
404
  }),
@@ -427,7 +432,7 @@ async function run () {
427
432
  description: 'Add-on plan, depends on the provider',
428
433
  complete: Addon.completePlan,
429
434
  }),
430
- quiet: cliparse.flag('quiet', { aliases: ['q'], description: 'Don\'t show logs during deployment' }),
435
+ quiet: cliparse.flag('quiet', { aliases: ['q'], description: "Don't show logs during deployment" }),
431
436
  followDeployLogs: cliparse.flag('follow', {
432
437
  description: 'Continue to follow logs after deployment has ended',
433
438
  }),
@@ -445,7 +450,8 @@ async function run () {
445
450
  addonOptions: cliparse.option('option', {
446
451
  metavar: 'option',
447
452
  parser: Parsers.addonOptions,
448
- description: 'Option to enable for the add-on. Multiple --option argument can be passed to enable multiple options',
453
+ description:
454
+ 'Option to enable for the add-on. Multiple --option argument can be passed to enable multiple options',
449
455
  }),
450
456
  region: cliparse.option('region', {
451
457
  aliases: ['r'],
@@ -570,766 +576,1470 @@ async function run () {
570
576
  };
571
577
 
572
578
  // ACCESSLOGS COMMAND
573
- const accesslogsCommand = cliparse.command('accesslogs', {
574
- description: 'Fetch access logs',
575
- options: [opts.alias, opts.appIdOrName, opts.logsFormat, opts.before, opts.after, opts.addonId],
576
- }, accesslogsModule.accessLogs);
579
+ const accesslogsCommand = cliparse.command(
580
+ 'accesslogs',
581
+ {
582
+ description: 'Fetch access logs',
583
+ options: [opts.alias, opts.appIdOrName, opts.logsFormat, opts.before, opts.after, opts.addonId],
584
+ },
585
+ accesslogsModule.accessLogs,
586
+ );
577
587
 
578
588
  // ACTIVITY COMMAND
579
- const activityCommand = cliparse.command('activity', {
580
- description: 'Show last deployments of an application',
581
- options: [opts.alias, opts.appIdOrName, opts.follow, opts.showAllActivity, opts.activityFormat],
582
- }, activity.activity);
589
+ const activityCommand = cliparse.command(
590
+ 'activity',
591
+ {
592
+ description: 'Show last deployments of an application',
593
+ options: [opts.alias, opts.appIdOrName, opts.follow, opts.showAllActivity, opts.activityFormat],
594
+ },
595
+ activity.activity,
596
+ );
583
597
 
584
598
  // ADDON COMMANDS
585
- const addonCreateCommand = cliparse.command('create', {
586
- description: 'Create an add-on',
587
- args: [args.addonProvider, args.addonName],
588
- options: [opts.linkAddon, opts.confirmAddonCreation, opts.addonPlan, opts.addonRegion, opts.addonVersion, opts.addonOptions, opts.humanJsonOutputFormat],
589
- }, addon.create);
590
- const addonDeleteCommand = cliparse.command('delete', {
591
- description: 'Delete an add-on',
592
- args: [args.addonIdOrName],
593
- options: [opts.confirmAddonDeletion],
594
- }, addon.deleteAddon);
595
- const addonRenameCommand = cliparse.command('rename', {
596
- description: 'Rename an add-on',
597
- args: [args.addonIdOrName, args.addonName],
598
- }, addon.rename);
599
- const addonShowProviderCommand = cliparse.command('show', {
600
- description: 'Show information about an add-on provider',
601
- args: [args.addonProvider],
602
- }, addon.showProvider);
603
- const addonProvidersCommand = cliparse.command('providers', {
604
- description: 'List available add-on providers',
605
- commands: [addonShowProviderCommand],
606
- options: [opts.humanJsonOutputFormat],
607
- }, addon.listProviders);
608
- const addonEnvCommand = cliparse.command('env', {
609
- description: 'List environment variables for an add-on',
610
- options: [opts.envFormat],
611
- args: [opts.addonId],
612
- }, addon.env);
613
- const addonListCommand = cliparse.command('list', {
614
- description: 'List available add-ons',
615
- options: [opts.humanJsonOutputFormat],
616
- }, addon.list);
617
-
618
- const addonCommands = cliparse.command('addon', {
619
- description: 'Manage add-ons',
620
- options: [opts.orgaIdOrName],
621
- privateOptions: [opts.humanJsonOutputFormat],
622
- commands: [addonCreateCommand, addonDeleteCommand, addonRenameCommand, addonListCommand, addonProvidersCommand, addonEnvCommand],
623
- }, addon.list);
599
+ const addonCreateCommand = cliparse.command(
600
+ 'create',
601
+ {
602
+ description: 'Create an add-on',
603
+ args: [args.addonProvider, args.addonName],
604
+ options: [
605
+ opts.linkAddon,
606
+ opts.confirmAddonCreation,
607
+ opts.addonPlan,
608
+ opts.addonRegion,
609
+ opts.addonVersion,
610
+ opts.addonOptions,
611
+ opts.humanJsonOutputFormat,
612
+ ],
613
+ },
614
+ addon.create,
615
+ );
616
+ const addonDeleteCommand = cliparse.command(
617
+ 'delete',
618
+ {
619
+ description: 'Delete an add-on',
620
+ args: [args.addonIdOrName],
621
+ options: [opts.confirmAddonDeletion],
622
+ },
623
+ addon.deleteAddon,
624
+ );
625
+ const addonRenameCommand = cliparse.command(
626
+ 'rename',
627
+ {
628
+ description: 'Rename an add-on',
629
+ args: [args.addonIdOrName, args.addonName],
630
+ },
631
+ addon.rename,
632
+ );
633
+ const addonShowProviderCommand = cliparse.command(
634
+ 'show',
635
+ {
636
+ description: 'Show information about an add-on provider',
637
+ args: [args.addonProvider],
638
+ },
639
+ addon.showProvider,
640
+ );
641
+ const addonProvidersCommand = cliparse.command(
642
+ 'providers',
643
+ {
644
+ description: 'List available add-on providers',
645
+ commands: [addonShowProviderCommand],
646
+ options: [opts.humanJsonOutputFormat],
647
+ },
648
+ addon.listProviders,
649
+ );
650
+ const addonEnvCommand = cliparse.command(
651
+ 'env',
652
+ {
653
+ description: 'List environment variables for an add-on',
654
+ options: [opts.envFormat],
655
+ args: [opts.addonId],
656
+ },
657
+ addon.env,
658
+ );
659
+ const addonListCommand = cliparse.command(
660
+ 'list',
661
+ {
662
+ description: 'List available add-ons',
663
+ options: [opts.humanJsonOutputFormat],
664
+ },
665
+ addon.list,
666
+ );
667
+
668
+ const addonCommands = cliparse.command(
669
+ 'addon',
670
+ {
671
+ description: 'Manage add-ons',
672
+ options: [opts.orgaIdOrName],
673
+ privateOptions: [opts.humanJsonOutputFormat],
674
+ commands: [
675
+ addonCreateCommand,
676
+ addonDeleteCommand,
677
+ addonRenameCommand,
678
+ addonListCommand,
679
+ addonProvidersCommand,
680
+ addonEnvCommand,
681
+ ],
682
+ },
683
+ addon.list,
684
+ );
624
685
 
625
686
  // APPLICATIONS COMMAND
626
- const applicationsListRemoteCommand = cliparse.command('list', {
627
- description: 'List all applications',
628
- options: [opts.orgaIdOrName, opts.humanJsonOutputFormat],
629
- }, applications.listAll);
630
- const applicationsCommand = cliparse.command('applications', {
631
- description: 'List linked applications',
632
- privateOptions: [opts.onlyAliases, opts.jsonFormat],
633
- commands: [applicationsListRemoteCommand],
634
- }, applications.list);
687
+ const applicationsListRemoteCommand = cliparse.command(
688
+ 'list',
689
+ {
690
+ description: 'List all applications',
691
+ options: [opts.orgaIdOrName, opts.humanJsonOutputFormat],
692
+ },
693
+ applications.listAll,
694
+ );
695
+ const applicationsCommand = cliparse.command(
696
+ 'applications',
697
+ {
698
+ description: 'List linked applications',
699
+ privateOptions: [opts.onlyAliases, opts.jsonFormat],
700
+ commands: [applicationsListRemoteCommand],
701
+ },
702
+ applications.list,
703
+ );
635
704
 
636
705
  // CANCEL DEPLOY COMMAND
637
- const cancelDeployCommand = cliparse.command('cancel-deploy', {
638
- description: 'Cancel an ongoing deployment',
639
- options: [opts.alias, opts.appIdOrName],
640
- }, cancelDeploy.cancelDeploy);
706
+ const cancelDeployCommand = cliparse.command(
707
+ 'cancel-deploy',
708
+ {
709
+ description: 'Cancel an ongoing deployment',
710
+ options: [opts.alias, opts.appIdOrName],
711
+ },
712
+ cancelDeploy.cancelDeploy,
713
+ );
641
714
 
642
715
  // CONFIG COMMAND
643
- const configGetCommand = cliparse.command('get', {
644
- description: 'Display the current configuration',
645
- args: [args.configurationName],
646
- }, config.get);
647
- const configSetCommand = cliparse.command('set', {
648
- description: 'Edit one configuration setting',
649
- args: [args.configurationName, args.configurationValue],
650
- }, config.set);
651
- const configUpdateCommand = cliparse.command('update', {
652
- description: 'Edit multiple configuration settings at once',
653
- options: ApplicationConfiguration.getUpdateOptions(),
654
- }, config.update);
655
- const configCommands = cliparse.command('config', {
656
- description: 'Display or edit the configuration of your application',
657
- options: [opts.alias, opts.appIdOrName],
658
- commands: [configGetCommand, configSetCommand, configUpdateCommand],
659
- }, config.list);
716
+ const configGetCommand = cliparse.command(
717
+ 'get',
718
+ {
719
+ description: 'Display the current configuration',
720
+ args: [args.configurationName],
721
+ },
722
+ config.get,
723
+ );
724
+ const configSetCommand = cliparse.command(
725
+ 'set',
726
+ {
727
+ description: 'Edit one configuration setting',
728
+ args: [args.configurationName, args.configurationValue],
729
+ },
730
+ config.set,
731
+ );
732
+ const configUpdateCommand = cliparse.command(
733
+ 'update',
734
+ {
735
+ description: 'Edit multiple configuration settings at once',
736
+ options: ApplicationConfiguration.getUpdateOptions(),
737
+ },
738
+ config.update,
739
+ );
740
+ const configCommands = cliparse.command(
741
+ 'config',
742
+ {
743
+ description: 'Display or edit the configuration of your application',
744
+ options: [opts.alias, opts.appIdOrName],
745
+ commands: [configGetCommand, configSetCommand, configUpdateCommand],
746
+ },
747
+ config.list,
748
+ );
660
749
 
661
750
  // CREATE COMMAND
662
- const appCreateCommand = cliparse.command('create', {
663
- description: 'Create an application',
664
- args: [args.appNameCreation],
665
- options: [opts.instanceType, opts.orgaIdOrName, opts.aliasCreation, opts.region, opts.github, opts.taskCommand, opts.humanJsonOutputFormat],
666
- }, create.create);
751
+ const appCreateCommand = cliparse.command(
752
+ 'create',
753
+ {
754
+ description: 'Create an application',
755
+ args: [args.appNameCreation],
756
+ options: [
757
+ opts.instanceType,
758
+ opts.orgaIdOrName,
759
+ opts.aliasCreation,
760
+ opts.region,
761
+ opts.github,
762
+ opts.taskCommand,
763
+ opts.humanJsonOutputFormat,
764
+ ],
765
+ },
766
+ create.create,
767
+ );
667
768
 
668
769
  // CURL COMMAND
669
770
  // NOTE: it's just here for documentation purposes, look at the bottom of the file for the real "clever curl" command
670
- const curlCommand = cliparse.command('curl', {
671
- description: 'Query Clever Cloud\'s API using Clever Tools credentials',
672
- }, () => null);
771
+ const curlCommand = cliparse.command(
772
+ 'curl',
773
+ {
774
+ description: "Query Clever Cloud's API using Clever Tools credentials",
775
+ },
776
+ () => null,
777
+ );
673
778
 
674
779
  // DELETE COMMAND
675
- const deleteCommand = cliparse.command('delete', {
676
- description: 'Delete an application',
677
- options: [opts.alias, opts.appIdOrName, opts.confirmApplicationDeletion],
678
- }, deleteCommandModule.deleteApp);
780
+ const deleteCommand = cliparse.command(
781
+ 'delete',
782
+ {
783
+ description: 'Delete an application',
784
+ options: [opts.alias, opts.appIdOrName, opts.confirmApplicationDeletion],
785
+ },
786
+ deleteCommandModule.deleteApp,
787
+ );
679
788
 
680
789
  // DEPLOY COMMAND
681
- const deployCommand = cliparse.command('deploy', {
682
- description: 'Deploy an application',
683
- options: [opts.alias, opts.branch, opts.gitTag, opts.quiet, opts.forceDeploy, opts.followDeployLogs, opts.sameCommitPolicy, opts.exitOnDeploy],
684
- }, deploy.deploy);
790
+ const deployCommand = cliparse.command(
791
+ 'deploy',
792
+ {
793
+ description: 'Deploy an application',
794
+ options: [
795
+ opts.alias,
796
+ opts.branch,
797
+ opts.gitTag,
798
+ opts.quiet,
799
+ opts.forceDeploy,
800
+ opts.followDeployLogs,
801
+ opts.sameCommitPolicy,
802
+ opts.exitOnDeploy,
803
+ ],
804
+ },
805
+ deploy.deploy,
806
+ );
685
807
 
686
808
  // DIAG COMMAND
687
- const diagCommand = cliparse.command('diag', {
688
- description: 'Diagnose the current installation (prints various informations for support)',
689
- args: [],
690
- options: [opts.humanJsonOutputFormat],
691
- }, diag.diag);
809
+ const diagCommand = cliparse.command(
810
+ 'diag',
811
+ {
812
+ description: 'Diagnose the current installation (prints various informations for support)',
813
+ args: [],
814
+ options: [opts.humanJsonOutputFormat],
815
+ },
816
+ diag.diag,
817
+ );
692
818
 
693
819
  // DOMAIN COMMANDS
694
- const domainCreateCommand = cliparse.command('add', {
695
- description: 'Add a domain name to an application',
696
- args: [args.fqdn],
697
- options: [opts.alias, opts.appIdOrName],
698
- }, domain.add);
699
- const domainRemoveCommand = cliparse.command('rm', {
700
- description: 'Remove a domain name from an application',
701
- args: [args.fqdn],
702
- options: [opts.alias, opts.appIdOrName],
703
- }, domain.rm);
704
- const domainSetFavouriteCommand = cliparse.command('set', {
705
- description: 'Set the favourite domain for an application',
706
- args: [args.fqdn],
707
- }, domain.setFavourite);
708
- const domainUnsetFavouriteCommand = cliparse.command('unset', {
709
- description: 'Unset the favourite domain for an application',
710
- }, domain.unsetFavourite);
711
- const domainFavouriteCommands = cliparse.command('favourite', {
712
- description: 'Manage the favourite domain name for an application',
713
- options: [opts.alias, opts.appIdOrName],
714
- commands: [domainSetFavouriteCommand, domainUnsetFavouriteCommand],
715
- }, domain.getFavourite);
716
- const domainDiagApplicationCommand = cliparse.command('diag', {
717
- description: 'Check if domains associated to a specific app are properly configured',
718
- options: [opts.alias, opts.appIdOrName, opts.humanJsonOutputFormat, opts.domain],
719
- }, domain.diagApplication);
720
- const domainOverviewCommand = cliparse.command('overview', {
721
- description: 'Get an overview of all your domains (all orgas, all apps)',
722
- options: [opts.humanJsonOutputFormat, opts.domainOverviewFilter],
723
- }, domain.overview);
724
- const domainCommands = cliparse.command('domain', {
725
- description: 'Manage domain names for an application',
726
- privateOptions: [opts.alias, opts.appIdOrName],
727
- commands: [domainCreateCommand, domainFavouriteCommands, domainRemoveCommand, domainDiagApplicationCommand, domainOverviewCommand],
728
- }, domain.list);
820
+ const domainCreateCommand = cliparse.command(
821
+ 'add',
822
+ {
823
+ description: 'Add a domain name to an application',
824
+ args: [args.fqdn],
825
+ options: [opts.alias, opts.appIdOrName],
826
+ },
827
+ domain.add,
828
+ );
829
+ const domainRemoveCommand = cliparse.command(
830
+ 'rm',
831
+ {
832
+ description: 'Remove a domain name from an application',
833
+ args: [args.fqdn],
834
+ options: [opts.alias, opts.appIdOrName],
835
+ },
836
+ domain.rm,
837
+ );
838
+ const domainSetFavouriteCommand = cliparse.command(
839
+ 'set',
840
+ {
841
+ description: 'Set the favourite domain for an application',
842
+ args: [args.fqdn],
843
+ },
844
+ domain.setFavourite,
845
+ );
846
+ const domainUnsetFavouriteCommand = cliparse.command(
847
+ 'unset',
848
+ {
849
+ description: 'Unset the favourite domain for an application',
850
+ },
851
+ domain.unsetFavourite,
852
+ );
853
+ const domainFavouriteCommands = cliparse.command(
854
+ 'favourite',
855
+ {
856
+ description: 'Manage the favourite domain name for an application',
857
+ options: [opts.alias, opts.appIdOrName],
858
+ commands: [domainSetFavouriteCommand, domainUnsetFavouriteCommand],
859
+ },
860
+ domain.getFavourite,
861
+ );
862
+ const domainDiagApplicationCommand = cliparse.command(
863
+ 'diag',
864
+ {
865
+ description: 'Check if domains associated to a specific app are properly configured',
866
+ options: [opts.alias, opts.appIdOrName, opts.humanJsonOutputFormat, opts.domain],
867
+ },
868
+ domain.diagApplication,
869
+ );
870
+ const domainOverviewCommand = cliparse.command(
871
+ 'overview',
872
+ {
873
+ description: 'Get an overview of all your domains (all orgas, all apps)',
874
+ options: [opts.humanJsonOutputFormat, opts.domainOverviewFilter],
875
+ },
876
+ domain.overview,
877
+ );
878
+ const domainCommands = cliparse.command(
879
+ 'domain',
880
+ {
881
+ description: 'Manage domain names for an application',
882
+ privateOptions: [opts.alias, opts.appIdOrName],
883
+ commands: [
884
+ domainCreateCommand,
885
+ domainFavouriteCommands,
886
+ domainRemoveCommand,
887
+ domainDiagApplicationCommand,
888
+ domainOverviewCommand,
889
+ ],
890
+ },
891
+ domain.list,
892
+ );
729
893
 
730
894
  // DRAIN COMMANDS
731
- const drainCreateCommand = cliparse.command('create', {
732
- description: 'Create a drain',
733
- args: [args.drainType, args.drainUrl],
734
- options: [opts.drainUsername, opts.drainPassword, opts.drainAPIKey, opts.drainIndexPrefix, opts.drainSDParameters],
735
- }, drain.create);
736
- const drainRemoveCommand = cliparse.command('remove', {
737
- description: 'Remove a drain',
738
- args: [args.drainId],
739
- }, drain.rm);
740
- const drainEnableCommand = cliparse.command('enable', {
741
- description: 'Enable a drain',
742
- args: [args.drainId],
743
- }, drain.enable);
744
- const drainDisableCommand = cliparse.command('disable', {
745
- description: 'Disable a drain',
746
- args: [args.drainId],
747
- }, drain.disable);
748
- const drainCommands = cliparse.command('drain', {
749
- description: 'Manage drains',
750
- options: [opts.alias, opts.appIdOrName, opts.addonId],
751
- privateOptions: [opts.humanJsonOutputFormat],
752
- commands: [drainCreateCommand, drainRemoveCommand, drainEnableCommand, drainDisableCommand],
753
- }, drain.list);
895
+ const drainCreateCommand = cliparse.command(
896
+ 'create',
897
+ {
898
+ description: 'Create a drain',
899
+ args: [args.drainType, args.drainUrl],
900
+ options: [
901
+ opts.drainUsername,
902
+ opts.drainPassword,
903
+ opts.drainAPIKey,
904
+ opts.drainIndexPrefix,
905
+ opts.drainSDParameters,
906
+ ],
907
+ },
908
+ drain.create,
909
+ );
910
+ const drainRemoveCommand = cliparse.command(
911
+ 'remove',
912
+ {
913
+ description: 'Remove a drain',
914
+ args: [args.drainId],
915
+ },
916
+ drain.rm,
917
+ );
918
+ const drainEnableCommand = cliparse.command(
919
+ 'enable',
920
+ {
921
+ description: 'Enable a drain',
922
+ args: [args.drainId],
923
+ },
924
+ drain.enable,
925
+ );
926
+ const drainDisableCommand = cliparse.command(
927
+ 'disable',
928
+ {
929
+ description: 'Disable a drain',
930
+ args: [args.drainId],
931
+ },
932
+ drain.disable,
933
+ );
934
+ const drainCommands = cliparse.command(
935
+ 'drain',
936
+ {
937
+ description: 'Manage drains',
938
+ options: [opts.alias, opts.appIdOrName, opts.addonId],
939
+ privateOptions: [opts.humanJsonOutputFormat],
940
+ commands: [drainCreateCommand, drainRemoveCommand, drainEnableCommand, drainDisableCommand],
941
+ },
942
+ drain.list,
943
+ );
754
944
 
755
945
  // EMAILS COMMANDS
756
- const emailsAddCommand = cliparse.command('add', {
757
- description: 'Add a new secondary email address to the current user',
758
- args: [args.email],
759
- }, emails.addSecondary);
760
- const emailsPrimaryCommand = cliparse.command('primary', {
761
- description: 'Set the primary email address of the current user',
762
- args: [args.email],
763
- }, emails.setPrimary);
764
- const emailsRemoveCommand = cliparse.command('remove', {
765
- description: 'Remove a secondary email address from the current user',
766
- args: [args.email],
767
- }, emails.removeSecondary);
768
- const emailsClearCommand = cliparse.command('remove-all', {
769
- description: 'Remove all secondary email addresses from the current user',
770
- options: [opts.yes],
771
- }, emails.removeAllSecondary);
772
- const emailsOpenConsoleCommand = cliparse.command('open', {
773
- description: 'Open the email addresses management page in the Console',
774
- }, emails.openConsole);
775
- const emailsCommands = cliparse.command('emails', {
776
- description: 'Manage email addresses of the current user',
777
- privateOptions: [opts.humanJsonOutputFormat],
778
- commands: [emailsAddCommand, emailsPrimaryCommand, emailsRemoveCommand, emailsClearCommand, emailsOpenConsoleCommand],
779
- }, emails.list);
946
+ const emailsAddCommand = cliparse.command(
947
+ 'add',
948
+ {
949
+ description: 'Add a new secondary email address to the current user',
950
+ args: [args.email],
951
+ },
952
+ emails.addSecondary,
953
+ );
954
+ const emailsPrimaryCommand = cliparse.command(
955
+ 'primary',
956
+ {
957
+ description: 'Set the primary email address of the current user',
958
+ args: [args.email],
959
+ },
960
+ emails.setPrimary,
961
+ );
962
+ const emailsRemoveCommand = cliparse.command(
963
+ 'remove',
964
+ {
965
+ description: 'Remove a secondary email address from the current user',
966
+ args: [args.email],
967
+ },
968
+ emails.removeSecondary,
969
+ );
970
+ const emailsClearCommand = cliparse.command(
971
+ 'remove-all',
972
+ {
973
+ description: 'Remove all secondary email addresses from the current user',
974
+ options: [opts.yes],
975
+ },
976
+ emails.removeAllSecondary,
977
+ );
978
+ const emailsOpenConsoleCommand = cliparse.command(
979
+ 'open',
980
+ {
981
+ description: 'Open the email addresses management page in the Console',
982
+ },
983
+ emails.openConsole,
984
+ );
985
+ const emailsCommands = cliparse.command(
986
+ 'emails',
987
+ {
988
+ description: 'Manage email addresses of the current user',
989
+ privateOptions: [opts.humanJsonOutputFormat],
990
+ commands: [
991
+ emailsAddCommand,
992
+ emailsPrimaryCommand,
993
+ emailsRemoveCommand,
994
+ emailsClearCommand,
995
+ emailsOpenConsoleCommand,
996
+ ],
997
+ },
998
+ emails.list,
999
+ );
780
1000
 
781
1001
  // ENV COMMANDS
782
- const envSetCommand = cliparse.command('set', {
783
- description: 'Add or update an environment variable named <variable-name> with the value <variable-value>',
784
- args: [args.envVariableName, args.envVariableValue],
785
- }, env.set);
786
- const envRemoveCommand = cliparse.command('rm', {
787
- description: 'Remove an environment variable from an application',
788
- args: [args.envVariableName],
789
- }, env.rm);
790
- const envImportCommand = cliparse.command('import', {
791
- description: 'Load environment variables from STDIN\n(WARNING: this deletes all current variables and replace them with the new list loaded from STDIN)',
792
- options: [opts.importAsJson],
793
- }, env.importEnv);
794
- const envImportVarsFromLocalEnvCommand = cliparse.command('import-vars', {
795
- description: 'Add or update environment variables named <variable-names> (comma-separated), taking their values from the current environment',
796
- args: [args.envVariableNames],
797
- }, env.importVarsFromLocalEnv);
798
- const envCommands = cliparse.command('env', {
799
- description: 'Manage environment variables of an application',
800
- options: [opts.alias, opts.appIdOrName, opts.sourceableEnvVarsList],
801
- privateOptions: [opts.envFormat],
802
- commands: [envSetCommand, envRemoveCommand, envImportCommand, envImportVarsFromLocalEnvCommand],
803
- }, env.list);
1002
+ const envSetCommand = cliparse.command(
1003
+ 'set',
1004
+ {
1005
+ description: 'Add or update an environment variable named <variable-name> with the value <variable-value>',
1006
+ args: [args.envVariableName, args.envVariableValue],
1007
+ },
1008
+ env.set,
1009
+ );
1010
+ const envRemoveCommand = cliparse.command(
1011
+ 'rm',
1012
+ {
1013
+ description: 'Remove an environment variable from an application',
1014
+ args: [args.envVariableName],
1015
+ },
1016
+ env.rm,
1017
+ );
1018
+ const envImportCommand = cliparse.command(
1019
+ 'import',
1020
+ {
1021
+ description:
1022
+ 'Load environment variables from STDIN\n(WARNING: this deletes all current variables and replace them with the new list loaded from STDIN)',
1023
+ options: [opts.importAsJson],
1024
+ },
1025
+ env.importEnv,
1026
+ );
1027
+ const envImportVarsFromLocalEnvCommand = cliparse.command(
1028
+ 'import-vars',
1029
+ {
1030
+ description:
1031
+ 'Add or update environment variables named <variable-names> (comma-separated), taking their values from the current environment',
1032
+ args: [args.envVariableNames],
1033
+ },
1034
+ env.importVarsFromLocalEnv,
1035
+ );
1036
+ const envCommands = cliparse.command(
1037
+ 'env',
1038
+ {
1039
+ description: 'Manage environment variables of an application',
1040
+ options: [opts.alias, opts.appIdOrName, opts.sourceableEnvVarsList],
1041
+ privateOptions: [opts.envFormat],
1042
+ commands: [envSetCommand, envRemoveCommand, envImportCommand, envImportVarsFromLocalEnvCommand],
1043
+ },
1044
+ env.list,
1045
+ );
804
1046
 
805
1047
  // EXPERIMENTAL FEATURES COMMAND
806
- const listFeaturesCommand = cliparse.command('list', {
807
- description: 'List available experimental features',
808
- options: [opts.humanJsonOutputFormat],
809
- }, features.list);
810
- const infoFeaturesCommand = cliparse.command('info', {
811
- description: 'Display info about an experimental feature',
812
- args: [args.featureId],
813
- }, features.info);
814
- const enableFeatureCommand = cliparse.command('enable', {
815
- description: 'Enable experimental features',
816
- args: [args.features],
817
- }, features.enable);
818
- const disableFeatureCommand = cliparse.command('disable', {
819
- description: 'Disable experimental features',
820
- args: [args.features],
821
- }, features.disable);
822
- const featuresCommands = cliparse.command('features', {
823
- description: 'Manage Clever Tools experimental features',
824
- commands: [enableFeatureCommand, disableFeatureCommand, listFeaturesCommand, infoFeaturesCommand],
825
- }, features.list);
1048
+ const listFeaturesCommand = cliparse.command(
1049
+ 'list',
1050
+ {
1051
+ description: 'List available experimental features',
1052
+ options: [opts.humanJsonOutputFormat],
1053
+ },
1054
+ features.list,
1055
+ );
1056
+ const infoFeaturesCommand = cliparse.command(
1057
+ 'info',
1058
+ {
1059
+ description: 'Display info about an experimental feature',
1060
+ args: [args.featureId],
1061
+ },
1062
+ features.info,
1063
+ );
1064
+ const enableFeatureCommand = cliparse.command(
1065
+ 'enable',
1066
+ {
1067
+ description: 'Enable experimental features',
1068
+ args: [args.features],
1069
+ },
1070
+ features.enable,
1071
+ );
1072
+ const disableFeatureCommand = cliparse.command(
1073
+ 'disable',
1074
+ {
1075
+ description: 'Disable experimental features',
1076
+ args: [args.features],
1077
+ },
1078
+ features.disable,
1079
+ );
1080
+ const featuresCommands = cliparse.command(
1081
+ 'features',
1082
+ {
1083
+ description: 'Manage Clever Tools experimental features',
1084
+ commands: [enableFeatureCommand, disableFeatureCommand, listFeaturesCommand, infoFeaturesCommand],
1085
+ },
1086
+ features.list,
1087
+ );
826
1088
 
827
1089
  // KEYCLOAK COMMAND
828
- const keycloakGetCommand = cliparse.command('get', {
829
- description: 'Get information about a deployed Keycloak',
830
- args: [args.addonIdOrName],
831
- options: [opts.humanJsonOutputFormat],
832
- }, keycloak.get);
833
- const keycloakEnableNgCommand = cliparse.command('enable-ng', {
834
- description: 'Link Keycloak to a Network Group, used for multi-instances secure communication',
835
- args: [args.addonIdOrName],
836
- }, keycloak.ngEnable);
837
- const keycloakDisableNgCommand = cliparse.command('disable-ng', {
838
- description: 'Unlink Keycloak from its Network Group',
839
- args: [args.addonIdOrName],
840
- }, keycloak.ngDisable);
841
- const keycloakOpenLogsCommand = cliparse.command('logs', {
842
- description: 'Open the Keycloak application logs in Clever Cloud Console',
843
- args: [args.addonIdOrName],
844
- }, keycloak.openLogs);
845
- const keycloakOpenWebUiCommand = cliparse.command('webui', {
846
- description: 'Open the Keycloak admin console in your browser',
847
- args: [args.addonIdOrName],
848
- }, keycloak.openWebUi);
849
- const keycloakOpenCommand = cliparse.command('open', {
850
- description: 'Open the Keycloak dashboard in Clever Cloud Console',
851
- args: [args.addonIdOrName],
852
- commands: [keycloakOpenLogsCommand, keycloakOpenWebUiCommand],
853
- }, keycloak.open);
854
- const keycloakRestartCommand = cliparse.command('restart', {
855
- description: 'Restart Keycloak',
856
- args: [args.addonIdOrName],
857
- }, keycloak.reboot);
858
- const keycloakRebuildCommand = cliparse.command('rebuild', {
859
- description: 'Rebuild Keycloak',
860
- args: [args.addonIdOrName],
861
- }, keycloak.rebuild);
862
- const keycloakVersionCheckCommand = cliparse.command('check', {
863
- description: 'Check Keycloak deployed version',
864
- args: [args.addonIdOrName],
865
- options: [opts.humanJsonOutputFormat],
866
- }, keycloak.checkVersion);
867
- const keycloakVersionUpdateCommand = cliparse.command('update', {
868
- description: 'Update Keycloak deployed version',
869
- args: [args.addonIdOrName],
870
- options: [opts.targetVersion],
871
- }, keycloak.updateVersion);
872
- const keycloakVersionsCommands = cliparse.command('version', {
873
- description: 'Check Keycloak deployed version',
874
- args: [args.addonIdOrName],
875
- options: [opts.humanJsonOutputFormat],
876
- commands: [keycloakVersionCheckCommand, keycloakVersionUpdateCommand],
877
- }, keycloak.checkVersion);
878
- const keycloakCommand = cliparse.command('keycloak', {
879
- description: 'Manage Clever Cloud Keycloak services',
880
- privateOptions: [opts.humanJsonOutputFormat],
881
- commands: [keycloakGetCommand, keycloakEnableNgCommand, keycloakDisableNgCommand, keycloakOpenCommand, keycloakRestartCommand, keycloakRebuildCommand, keycloakVersionsCommands],
882
- }, keycloak.list);
1090
+ const keycloakGetCommand = cliparse.command(
1091
+ 'get',
1092
+ {
1093
+ description: 'Get information about a deployed Keycloak',
1094
+ args: [args.addonIdOrName],
1095
+ options: [opts.humanJsonOutputFormat],
1096
+ },
1097
+ keycloak.get,
1098
+ );
1099
+ const keycloakEnableNgCommand = cliparse.command(
1100
+ 'enable-ng',
1101
+ {
1102
+ description: 'Link Keycloak to a Network Group, used for multi-instances secure communication',
1103
+ args: [args.addonIdOrName],
1104
+ },
1105
+ keycloak.ngEnable,
1106
+ );
1107
+ const keycloakDisableNgCommand = cliparse.command(
1108
+ 'disable-ng',
1109
+ {
1110
+ description: 'Unlink Keycloak from its Network Group',
1111
+ args: [args.addonIdOrName],
1112
+ },
1113
+ keycloak.ngDisable,
1114
+ );
1115
+ const keycloakOpenLogsCommand = cliparse.command(
1116
+ 'logs',
1117
+ {
1118
+ description: 'Open the Keycloak application logs in Clever Cloud Console',
1119
+ args: [args.addonIdOrName],
1120
+ },
1121
+ keycloak.openLogs,
1122
+ );
1123
+ const keycloakOpenWebUiCommand = cliparse.command(
1124
+ 'webui',
1125
+ {
1126
+ description: 'Open the Keycloak admin console in your browser',
1127
+ args: [args.addonIdOrName],
1128
+ },
1129
+ keycloak.openWebUi,
1130
+ );
1131
+ const keycloakOpenCommand = cliparse.command(
1132
+ 'open',
1133
+ {
1134
+ description: 'Open the Keycloak dashboard in Clever Cloud Console',
1135
+ args: [args.addonIdOrName],
1136
+ commands: [keycloakOpenLogsCommand, keycloakOpenWebUiCommand],
1137
+ },
1138
+ keycloak.open,
1139
+ );
1140
+ const keycloakRestartCommand = cliparse.command(
1141
+ 'restart',
1142
+ {
1143
+ description: 'Restart Keycloak',
1144
+ args: [args.addonIdOrName],
1145
+ },
1146
+ keycloak.reboot,
1147
+ );
1148
+ const keycloakRebuildCommand = cliparse.command(
1149
+ 'rebuild',
1150
+ {
1151
+ description: 'Rebuild Keycloak',
1152
+ args: [args.addonIdOrName],
1153
+ },
1154
+ keycloak.rebuild,
1155
+ );
1156
+ const keycloakVersionCheckCommand = cliparse.command(
1157
+ 'check',
1158
+ {
1159
+ description: 'Check Keycloak deployed version',
1160
+ args: [args.addonIdOrName],
1161
+ options: [opts.humanJsonOutputFormat],
1162
+ },
1163
+ keycloak.checkVersion,
1164
+ );
1165
+ const keycloakVersionUpdateCommand = cliparse.command(
1166
+ 'update',
1167
+ {
1168
+ description: 'Update Keycloak deployed version',
1169
+ args: [args.addonIdOrName],
1170
+ options: [opts.targetVersion],
1171
+ },
1172
+ keycloak.updateVersion,
1173
+ );
1174
+ const keycloakVersionsCommands = cliparse.command(
1175
+ 'version',
1176
+ {
1177
+ description: 'Check Keycloak deployed version',
1178
+ args: [args.addonIdOrName],
1179
+ privateOptions: [opts.humanJsonOutputFormat],
1180
+ commands: [keycloakVersionCheckCommand, keycloakVersionUpdateCommand],
1181
+ },
1182
+ keycloak.checkVersion,
1183
+ );
1184
+ const keycloakCommand = cliparse.command(
1185
+ 'keycloak',
1186
+ {
1187
+ description: 'Manage Clever Cloud Keycloak services',
1188
+ privateOptions: [opts.humanJsonOutputFormat],
1189
+ commands: [
1190
+ keycloakGetCommand,
1191
+ keycloakEnableNgCommand,
1192
+ keycloakDisableNgCommand,
1193
+ keycloakOpenCommand,
1194
+ keycloakRestartCommand,
1195
+ keycloakRebuildCommand,
1196
+ keycloakVersionsCommands,
1197
+ ],
1198
+ },
1199
+ keycloak.list,
1200
+ );
883
1201
 
884
1202
  // KV COMMAND
885
- const kvRawCommand = cliparse.command('kv', {
886
- description: 'Send a raw command to a Materia KV or Redis® add-on',
887
- args: [args.kvIdOrName, args.kvRawCommand],
888
- options: [opts.orgaIdOrName, opts.humanJsonOutputFormat],
889
- }, kv.sendRawCommand);
1203
+ const kvRawCommand = cliparse.command(
1204
+ 'kv',
1205
+ {
1206
+ description: 'Send a raw command to a Materia KV or Redis® add-on',
1207
+ args: [args.kvIdOrName, args.kvRawCommand],
1208
+ options: [opts.orgaIdOrName, opts.humanJsonOutputFormat],
1209
+ },
1210
+ kv.sendRawCommand,
1211
+ );
890
1212
 
891
1213
  // LINK COMMAND
892
- const appLinkCommand = cliparse.command('link', {
893
- description: 'Link this repo to an existing application',
894
- args: [args.appIdOrName],
895
- options: [opts.aliasCreation, opts.orgaIdOrName],
896
- }, link.link);
1214
+ const appLinkCommand = cliparse.command(
1215
+ 'link',
1216
+ {
1217
+ description: 'Link this repo to an existing application',
1218
+ args: [args.appIdOrName],
1219
+ options: [opts.aliasCreation, opts.orgaIdOrName],
1220
+ },
1221
+ link.link,
1222
+ );
897
1223
 
898
1224
  // LOGIN COMMAND
899
- const loginCommand = cliparse.command('login', {
900
- description: 'Login to Clever Cloud',
901
- options: [opts.loginToken, opts.loginSecret],
902
- }, login.login);
1225
+ const loginCommand = cliparse.command(
1226
+ 'login',
1227
+ {
1228
+ description: 'Login to Clever Cloud',
1229
+ options: [opts.loginToken, opts.loginSecret],
1230
+ },
1231
+ login.login,
1232
+ );
903
1233
 
904
1234
  // LOGOUT COMMAND
905
- const logoutCommand = cliparse.command('logout', {
906
- description: 'Logout from Clever Cloud',
907
- }, logout.logout);
1235
+ const logoutCommand = cliparse.command(
1236
+ 'logout',
1237
+ {
1238
+ description: 'Logout from Clever Cloud',
1239
+ },
1240
+ logout.logout,
1241
+ );
908
1242
 
909
1243
  // LOGS COMMAND
910
- const logsCommand = cliparse.command('logs', {
911
- description: 'Fetch application logs, continuously',
912
- options: [opts.alias, opts.appIdOrName, opts.before, opts.after, opts.search, opts.deploymentId, opts.addonId, opts.logsFormat],
913
- }, logs.appLogs);
1244
+ const logsCommand = cliparse.command(
1245
+ 'logs',
1246
+ {
1247
+ description: 'Fetch application logs, continuously',
1248
+ options: [
1249
+ opts.alias,
1250
+ opts.appIdOrName,
1251
+ opts.before,
1252
+ opts.after,
1253
+ opts.search,
1254
+ opts.deploymentId,
1255
+ opts.addonId,
1256
+ opts.logsFormat,
1257
+ ],
1258
+ },
1259
+ logs.appLogs,
1260
+ );
914
1261
 
915
1262
  // MAKE DEFAULT COMMAND
916
- const makeDefaultCommand = cliparse.command('make-default', {
917
- description: 'Make a linked application the default one',
918
- args: [args.alias],
919
- }, makeDefault.makeDefault);
1263
+ const makeDefaultCommand = cliparse.command(
1264
+ 'make-default',
1265
+ {
1266
+ description: 'Make a linked application the default one',
1267
+ args: [args.alias],
1268
+ },
1269
+ makeDefault.makeDefault,
1270
+ );
920
1271
 
921
1272
  // MATOMO COMMAND
922
- const matomoGetCommand = cliparse.command('get', {
923
- description: 'Get information about a deployed Matomo',
924
- args: [args.addonIdOrName],
925
- options: [opts.humanJsonOutputFormat],
926
- }, matomo.get);
927
- const matomoOpenLogsCommand = cliparse.command('logs', {
928
- description: 'Open the Matomo application logs in Clever Cloud Console',
929
- args: [args.addonIdOrName],
930
- }, matomo.openLogs);
931
- const matomoOpenWebUiCommand = cliparse.command('webui', {
932
- description: 'Open the Matomo admin console in your browser',
933
- args: [args.addonIdOrName],
934
- }, matomo.openWebUi);
935
- const matomoOpenCommand = cliparse.command('open', {
936
- description: 'Open the Matomo dashboard in Clever Cloud Console',
937
- args: [args.addonIdOrName],
938
- commands: [matomoOpenLogsCommand, matomoOpenWebUiCommand],
939
- }, matomo.open);
940
- const matomoRestartCommand = cliparse.command('restart', {
941
- description: 'Restart Matomo',
942
- args: [args.addonIdOrName],
943
- }, matomo.reboot);
944
- const matomoRebuildCommand = cliparse.command('rebuild', {
945
- description: 'Rebuild Matomo',
946
- args: [args.addonIdOrName],
947
- }, matomo.rebuild);
948
- const matomoCommand = cliparse.command('matomo', {
949
- description: 'Manage Clever Cloud Matomo services',
950
- privateOptions: [opts.humanJsonOutputFormat],
951
- commands: [matomoGetCommand, matomoOpenCommand, matomoRestartCommand, matomoRebuildCommand],
952
- }, matomo.list);
1273
+ const matomoGetCommand = cliparse.command(
1274
+ 'get',
1275
+ {
1276
+ description: 'Get information about a deployed Matomo',
1277
+ args: [args.addonIdOrName],
1278
+ options: [opts.humanJsonOutputFormat],
1279
+ },
1280
+ matomo.get,
1281
+ );
1282
+ const matomoOpenLogsCommand = cliparse.command(
1283
+ 'logs',
1284
+ {
1285
+ description: 'Open the Matomo application logs in Clever Cloud Console',
1286
+ args: [args.addonIdOrName],
1287
+ },
1288
+ matomo.openLogs,
1289
+ );
1290
+ const matomoOpenWebUiCommand = cliparse.command(
1291
+ 'webui',
1292
+ {
1293
+ description: 'Open the Matomo admin console in your browser',
1294
+ args: [args.addonIdOrName],
1295
+ },
1296
+ matomo.openWebUi,
1297
+ );
1298
+ const matomoOpenCommand = cliparse.command(
1299
+ 'open',
1300
+ {
1301
+ description: 'Open the Matomo dashboard in Clever Cloud Console',
1302
+ args: [args.addonIdOrName],
1303
+ commands: [matomoOpenLogsCommand, matomoOpenWebUiCommand],
1304
+ },
1305
+ matomo.open,
1306
+ );
1307
+ const matomoRestartCommand = cliparse.command(
1308
+ 'restart',
1309
+ {
1310
+ description: 'Restart Matomo',
1311
+ args: [args.addonIdOrName],
1312
+ },
1313
+ matomo.reboot,
1314
+ );
1315
+ const matomoRebuildCommand = cliparse.command(
1316
+ 'rebuild',
1317
+ {
1318
+ description: 'Rebuild Matomo',
1319
+ args: [args.addonIdOrName],
1320
+ },
1321
+ matomo.rebuild,
1322
+ );
1323
+ const matomoCommand = cliparse.command(
1324
+ 'matomo',
1325
+ {
1326
+ description: 'Manage Clever Cloud Matomo services',
1327
+ privateOptions: [opts.humanJsonOutputFormat],
1328
+ commands: [matomoGetCommand, matomoOpenCommand, matomoRestartCommand, matomoRebuildCommand],
1329
+ },
1330
+ matomo.list,
1331
+ );
953
1332
 
954
1333
  // METABASE COMMAND
955
- const metabaseGetCommand = cliparse.command('get', {
956
- description: 'Get information about a deployed Metabase',
957
- args: [args.addonIdOrName],
958
- options: [opts.humanJsonOutputFormat],
959
- }, metabase.get);
960
- const metabaseOpenLogsCommand = cliparse.command('logs', {
961
- description: 'Open the Metabase application logs in Clever Cloud Console',
962
- args: [args.addonIdOrName],
963
- }, metabase.openLogs);
964
- const metabaseOpenWebUiCommand = cliparse.command('webui', {
965
- description: 'Open the Metabase admin console in your browser',
966
- args: [args.addonIdOrName],
967
- }, metabase.openWebUi);
968
- const metabaseOpenCommand = cliparse.command('open', {
969
- description: 'Open the Metabase dashboard in Clever Cloud Console',
970
- args: [args.addonIdOrName],
971
- commands: [metabaseOpenLogsCommand, metabaseOpenWebUiCommand],
972
- }, metabase.open);
973
- const metabaseRestartCommand = cliparse.command('restart', {
974
- description: 'Restart Metabase',
975
- args: [args.addonIdOrName],
976
- }, metabase.reboot);
977
- const metabaseRebuildCommand = cliparse.command('rebuild', {
978
- description: 'Rebuild Metabase',
979
- args: [args.addonIdOrName],
980
- }, metabase.rebuild);
981
- const metabaseVersionCheckCommand = cliparse.command('check', {
982
- description: 'Check Metabase deployed version',
983
- args: [args.addonIdOrName],
984
- options: [opts.humanJsonOutputFormat],
985
- }, metabase.checkVersion);
986
- const metabaseVersionUpdateCommand = cliparse.command('update', {
987
- description: 'Update Metabase deployed version',
988
- args: [args.addonIdOrName],
989
- options: [opts.targetVersion],
990
- }, metabase.updateVersion);
991
- const metabaseVersionsCommands = cliparse.command('version', {
992
- description: 'Manage Metabase deployed version',
993
- args: [args.addonIdOrName],
994
- options: [opts.humanJsonOutputFormat],
995
- commands: [metabaseVersionCheckCommand, metabaseVersionUpdateCommand],
996
- }, metabase.checkVersion);
997
- const metabaseCommand = cliparse.command('metabase', {
998
- description: 'Manage Clever Cloud Metabase services',
999
- privateOptions: [opts.humanJsonOutputFormat],
1000
- commands: [metabaseGetCommand, metabaseOpenCommand, metabaseRestartCommand, metabaseRebuildCommand, metabaseVersionsCommands],
1001
- }, metabase.list);
1334
+ const metabaseGetCommand = cliparse.command(
1335
+ 'get',
1336
+ {
1337
+ description: 'Get information about a deployed Metabase',
1338
+ args: [args.addonIdOrName],
1339
+ options: [opts.humanJsonOutputFormat],
1340
+ },
1341
+ metabase.get,
1342
+ );
1343
+ const metabaseOpenLogsCommand = cliparse.command(
1344
+ 'logs',
1345
+ {
1346
+ description: 'Open the Metabase application logs in Clever Cloud Console',
1347
+ args: [args.addonIdOrName],
1348
+ },
1349
+ metabase.openLogs,
1350
+ );
1351
+ const metabaseOpenWebUiCommand = cliparse.command(
1352
+ 'webui',
1353
+ {
1354
+ description: 'Open the Metabase admin console in your browser',
1355
+ args: [args.addonIdOrName],
1356
+ },
1357
+ metabase.openWebUi,
1358
+ );
1359
+ const metabaseOpenCommand = cliparse.command(
1360
+ 'open',
1361
+ {
1362
+ description: 'Open the Metabase dashboard in Clever Cloud Console',
1363
+ args: [args.addonIdOrName],
1364
+ commands: [metabaseOpenLogsCommand, metabaseOpenWebUiCommand],
1365
+ },
1366
+ metabase.open,
1367
+ );
1368
+ const metabaseRestartCommand = cliparse.command(
1369
+ 'restart',
1370
+ {
1371
+ description: 'Restart Metabase',
1372
+ args: [args.addonIdOrName],
1373
+ },
1374
+ metabase.reboot,
1375
+ );
1376
+ const metabaseRebuildCommand = cliparse.command(
1377
+ 'rebuild',
1378
+ {
1379
+ description: 'Rebuild Metabase',
1380
+ args: [args.addonIdOrName],
1381
+ },
1382
+ metabase.rebuild,
1383
+ );
1384
+ const metabaseVersionCheckCommand = cliparse.command(
1385
+ 'check',
1386
+ {
1387
+ description: 'Check Metabase deployed version',
1388
+ args: [args.addonIdOrName],
1389
+ options: [opts.humanJsonOutputFormat],
1390
+ },
1391
+ metabase.checkVersion,
1392
+ );
1393
+ const metabaseVersionUpdateCommand = cliparse.command(
1394
+ 'update',
1395
+ {
1396
+ description: 'Update Metabase deployed version',
1397
+ args: [args.addonIdOrName],
1398
+ options: [opts.targetVersion],
1399
+ },
1400
+ metabase.updateVersion,
1401
+ );
1402
+ const metabaseVersionsCommands = cliparse.command(
1403
+ 'version',
1404
+ {
1405
+ description: 'Manage Metabase deployed version',
1406
+ args: [args.addonIdOrName],
1407
+ privateOptions: [opts.humanJsonOutputFormat],
1408
+ commands: [metabaseVersionCheckCommand, metabaseVersionUpdateCommand],
1409
+ },
1410
+ metabase.checkVersion,
1411
+ );
1412
+ const metabaseCommand = cliparse.command(
1413
+ 'metabase',
1414
+ {
1415
+ description: 'Manage Clever Cloud Metabase services',
1416
+ privateOptions: [opts.humanJsonOutputFormat],
1417
+ commands: [
1418
+ metabaseGetCommand,
1419
+ metabaseOpenCommand,
1420
+ metabaseRestartCommand,
1421
+ metabaseRebuildCommand,
1422
+ metabaseVersionsCommands,
1423
+ ],
1424
+ },
1425
+ metabase.list,
1426
+ );
1002
1427
 
1003
1428
  // NETWORK GROUP COMMANDS
1004
- const ngCreateExternalPeerCommand = cliparse.command('external', {
1005
- description: 'Create an external peer in a Network Group',
1006
- args: [args.ngExternalPeerLabel, args.ngIdOrLabel, args.wgPublicKey],
1007
- }, ng.createExternalPeer);
1008
- const ngDeleteExternalPeerCommand = cliparse.command('external', {
1009
- description: 'Delete an external peer from a Network Group',
1010
- args: [args.ngExternalIdOrLabel, args.ngIdOrLabel],
1011
- }, ng.deleteExternalPeer);
1012
- const ngCreateCommand = cliparse.command('create', {
1013
- description: 'Create a Network Group',
1014
- args: [args.ngLabel],
1015
- privateOptions: [opts.ngMembersIdsToLink, opts.ngDescription, opts.optTags],
1016
- commands: [ngCreateExternalPeerCommand],
1017
- }, ng.createNg);
1018
- const ngDeleteCommand = cliparse.command('delete', {
1019
- description: 'Delete a Network Group',
1020
- args: [args.ngIdOrLabel],
1021
- commands: [ngDeleteExternalPeerCommand],
1022
- }, ng.deleteNg);
1023
- const ngLinkCommand = cliparse.command('link', {
1024
- description: 'Link an application or a database add-on by its ID to a Network Group',
1025
- args: [args.ngAnyIdOrLabel, args.ngIdOrLabel],
1026
- }, ng.linkToNg);
1027
- const ngUnlinkCommand = cliparse.command('unlink', {
1028
- description: 'Unlink an application or a database add-on by its ID from a Network Group',
1029
- args: [args.ngAnyIdOrLabel, args.ngIdOrLabel],
1030
- }, ng.unlinkFromNg);
1031
- const ngGetCommand = cliparse.command('get', {
1032
- description: 'Get details about a Network Group, a member or a peer',
1033
- args: [args.ngAnyIdOrLabel],
1034
- options: [opts.ngResourceType, opts.humanJsonOutputFormat],
1035
- }, ng.get);
1036
- const ngGetConfigCommand = cliparse.command('get-config', {
1037
- description: 'Get the Wireguard configuration of a peer in a Network Group',
1038
- args: [args.ngExternalIdOrLabel, args.ngIdOrLabel],
1039
- options: [opts.humanJsonOutputFormat],
1040
- }, ng.getPeerConfig);
1041
- const ngSearchCommand = cliparse.command('search', {
1042
- description: 'Search Network Groups, members or peers and get their details',
1043
- args: [args.ngAnyIdOrLabel],
1044
- options: [opts.ngResourceType, opts.humanJsonOutputFormat],
1045
- }, ng.search);
1046
- const networkGroupsCommand = cliparse.command('ng', {
1047
- description: 'List Network Groups',
1048
- options: [opts.orgaIdOrName],
1049
- privateOptions: [opts.humanJsonOutputFormat],
1050
- commands: [ngCreateCommand, ngDeleteCommand, ngLinkCommand, ngUnlinkCommand, ngGetCommand, ngGetConfigCommand, ngSearchCommand],
1051
- }, ng.listNg);
1429
+ const ngCreateExternalPeerCommand = cliparse.command(
1430
+ 'external',
1431
+ {
1432
+ description: 'Create an external peer in a Network Group',
1433
+ args: [args.ngExternalPeerLabel, args.ngIdOrLabel, args.wgPublicKey],
1434
+ },
1435
+ ng.createExternalPeer,
1436
+ );
1437
+ const ngDeleteExternalPeerCommand = cliparse.command(
1438
+ 'external',
1439
+ {
1440
+ description: 'Delete an external peer from a Network Group',
1441
+ args: [args.ngExternalIdOrLabel, args.ngIdOrLabel],
1442
+ },
1443
+ ng.deleteExternalPeer,
1444
+ );
1445
+ const ngCreateCommand = cliparse.command(
1446
+ 'create',
1447
+ {
1448
+ description: 'Create a Network Group',
1449
+ args: [args.ngLabel],
1450
+ privateOptions: [opts.ngMembersIdsToLink, opts.ngDescription, opts.optTags],
1451
+ commands: [ngCreateExternalPeerCommand],
1452
+ },
1453
+ ng.createNg,
1454
+ );
1455
+ const ngDeleteCommand = cliparse.command(
1456
+ 'delete',
1457
+ {
1458
+ description: 'Delete a Network Group',
1459
+ args: [args.ngIdOrLabel],
1460
+ commands: [ngDeleteExternalPeerCommand],
1461
+ },
1462
+ ng.deleteNg,
1463
+ );
1464
+ const ngLinkCommand = cliparse.command(
1465
+ 'link',
1466
+ {
1467
+ description: 'Link an application or a database add-on by its ID to a Network Group',
1468
+ args: [args.ngAnyIdOrLabel, args.ngIdOrLabel],
1469
+ },
1470
+ ng.linkToNg,
1471
+ );
1472
+ const ngUnlinkCommand = cliparse.command(
1473
+ 'unlink',
1474
+ {
1475
+ description: 'Unlink an application or a database add-on by its ID from a Network Group',
1476
+ args: [args.ngAnyIdOrLabel, args.ngIdOrLabel],
1477
+ },
1478
+ ng.unlinkFromNg,
1479
+ );
1480
+ const ngGetCommand = cliparse.command(
1481
+ 'get',
1482
+ {
1483
+ description: 'Get details about a Network Group, a member or a peer',
1484
+ args: [args.ngAnyIdOrLabel],
1485
+ options: [opts.ngResourceType, opts.humanJsonOutputFormat],
1486
+ },
1487
+ ng.get,
1488
+ );
1489
+ const ngGetConfigCommand = cliparse.command(
1490
+ 'get-config',
1491
+ {
1492
+ description: 'Get the Wireguard configuration of a peer in a Network Group',
1493
+ args: [args.ngExternalIdOrLabel, args.ngIdOrLabel],
1494
+ options: [opts.humanJsonOutputFormat],
1495
+ },
1496
+ ng.getPeerConfig,
1497
+ );
1498
+ const ngSearchCommand = cliparse.command(
1499
+ 'search',
1500
+ {
1501
+ description: 'Search Network Groups, members or peers and get their details',
1502
+ args: [args.ngAnyIdOrLabel],
1503
+ options: [opts.ngResourceType, opts.humanJsonOutputFormat],
1504
+ },
1505
+ ng.search,
1506
+ );
1507
+ const networkGroupsCommand = cliparse.command(
1508
+ 'ng',
1509
+ {
1510
+ description: 'List Network Groups',
1511
+ options: [opts.orgaIdOrName],
1512
+ privateOptions: [opts.humanJsonOutputFormat],
1513
+ commands: [
1514
+ ngCreateCommand,
1515
+ ngDeleteCommand,
1516
+ ngLinkCommand,
1517
+ ngUnlinkCommand,
1518
+ ngGetCommand,
1519
+ ngGetConfigCommand,
1520
+ ngSearchCommand,
1521
+ ],
1522
+ },
1523
+ ng.listNg,
1524
+ );
1052
1525
 
1053
1526
  // NOTIFY-EMAIL COMMAND
1054
- const addEmailNotificationCommand = cliparse.command('add', {
1055
- description: 'Add a new email notification',
1056
- options: [opts.notificationEventType, opts.notificationScope, opts.emailNotificationTarget],
1057
- args: [args.notificationName],
1058
- }, notifyEmail.add);
1059
- const removeEmailNotificationCommand = cliparse.command('remove', {
1060
- description: 'Remove an existing email notification',
1061
- args: [args.notificationId],
1062
- }, notifyEmail.remove);
1063
- const emailNotificationsCommand = cliparse.command('notify-email', {
1064
- description: 'Manage email notifications',
1065
- options: [opts.orgaIdOrName, opts.listAllNotifications],
1066
- privateOptions: [opts.humanJsonOutputFormat],
1067
- commands: [addEmailNotificationCommand, removeEmailNotificationCommand],
1068
- }, notifyEmail.list);
1527
+ const addEmailNotificationCommand = cliparse.command(
1528
+ 'add',
1529
+ {
1530
+ description: 'Add a new email notification',
1531
+ options: [opts.notificationEventType, opts.notificationScope, opts.emailNotificationTarget],
1532
+ args: [args.notificationName],
1533
+ },
1534
+ notifyEmail.add,
1535
+ );
1536
+ const removeEmailNotificationCommand = cliparse.command(
1537
+ 'remove',
1538
+ {
1539
+ description: 'Remove an existing email notification',
1540
+ args: [args.notificationId],
1541
+ },
1542
+ notifyEmail.remove,
1543
+ );
1544
+ const emailNotificationsCommand = cliparse.command(
1545
+ 'notify-email',
1546
+ {
1547
+ description: 'Manage email notifications',
1548
+ options: [opts.orgaIdOrName, opts.listAllNotifications],
1549
+ privateOptions: [opts.humanJsonOutputFormat],
1550
+ commands: [addEmailNotificationCommand, removeEmailNotificationCommand],
1551
+ },
1552
+ notifyEmail.list,
1553
+ );
1069
1554
 
1070
1555
  // OPEN COMMAND
1071
- const openCommand = cliparse.command('open', {
1072
- description: 'Open an application in the Console',
1073
- options: [opts.alias, opts.appIdOrName],
1074
- }, open.open);
1556
+ const openCommand = cliparse.command(
1557
+ 'open',
1558
+ {
1559
+ description: 'Open an application in the Console',
1560
+ options: [opts.alias, opts.appIdOrName],
1561
+ },
1562
+ open.open,
1563
+ );
1075
1564
 
1076
1565
  // OTOROSHI COMMAND
1077
- const otoroshiGetCommand = cliparse.command('get', {
1078
- description: 'Get information about a deployed Otoroshi',
1079
- args: [args.addonIdOrName],
1080
- options: [opts.humanJsonOutputFormat],
1081
- }, otoroshi.get);
1082
- const otoroshiEnableNgCommand = cliparse.command('enable-ng', {
1083
- description: 'Link Otoroshi to a Network Group',
1084
- args: [args.addonIdOrName],
1085
- }, otoroshi.ngEnable);
1086
- const otoroshiDisableNgCommand = cliparse.command('disable-ng', {
1087
- description: 'Unlink Otoroshi from its Network Group',
1088
- args: [args.addonIdOrName],
1089
- }, otoroshi.ngDisable);
1090
- const otoroshiOpenLogsCommand = cliparse.command('logs', {
1091
- description: 'Open the Otoroshi application logs in Clever Cloud Console',
1092
- args: [args.addonIdOrName],
1093
- }, otoroshi.openLogs);
1094
- const otoroshiOpenWebUiCommand = cliparse.command('webui', {
1095
- description: 'Open the Otoroshi admin console in your browser',
1096
- args: [args.addonIdOrName],
1097
- }, otoroshi.openWebUi);
1098
- const otoroshiOpenCommand = cliparse.command('open', {
1099
- description: 'Open the Otoroshi dashboard in Clever Cloud Console',
1100
- args: [args.addonIdOrName],
1101
- commands: [otoroshiOpenLogsCommand, otoroshiOpenWebUiCommand],
1102
- }, otoroshi.open);
1103
- const otoroshiRestartCommand = cliparse.command('restart', {
1104
- description: 'Restart Otoroshi',
1105
- args: [args.addonIdOrName],
1106
- }, otoroshi.reboot);
1107
- const otoroshiRebuildCommand = cliparse.command('rebuild', {
1108
- description: 'Rebuild Otoroshi',
1109
- args: [args.addonIdOrName],
1110
- }, otoroshi.rebuild);
1111
- const otoroshiVersionCheckCommand = cliparse.command('check', {
1112
- description: 'Check Otoroshi deployed version',
1113
- args: [args.addonIdOrName],
1114
- options: [opts.humanJsonOutputFormat],
1115
- }, otoroshi.checkVersion);
1116
- const otoroshiVersionUpdateCommand = cliparse.command('update', {
1117
- description: 'Update Otoroshi deployed version',
1118
- args: [args.addonIdOrName],
1119
- options: [opts.targetVersion],
1120
- }, otoroshi.updateVersion);
1121
- const otoroshiVersionsCommands = cliparse.command('version', {
1122
- description: 'Manage Otoroshi deployed version',
1123
- args: [args.addonIdOrName],
1124
- options: [opts.humanJsonOutputFormat],
1125
- commands: [otoroshiVersionCheckCommand, otoroshiVersionUpdateCommand],
1126
- }, otoroshi.checkVersion);
1127
- const otoroshiCommand = cliparse.command('otoroshi', {
1128
- description: 'Manage Clever Cloud Otoroshi services',
1129
- privateOptions: [opts.humanJsonOutputFormat],
1130
- commands: [otoroshiGetCommand, otoroshiEnableNgCommand, otoroshiDisableNgCommand, otoroshiOpenCommand, otoroshiRestartCommand, otoroshiRebuildCommand, otoroshiVersionsCommands],
1131
- }, otoroshi.list);
1566
+ const otoroshiGetCommand = cliparse.command(
1567
+ 'get',
1568
+ {
1569
+ description: 'Get information about a deployed Otoroshi',
1570
+ args: [args.addonIdOrName],
1571
+ options: [opts.humanJsonOutputFormat],
1572
+ },
1573
+ otoroshi.get,
1574
+ );
1575
+ const otoroshiEnableNgCommand = cliparse.command(
1576
+ 'enable-ng',
1577
+ {
1578
+ description: 'Link Otoroshi to a Network Group',
1579
+ args: [args.addonIdOrName],
1580
+ },
1581
+ otoroshi.ngEnable,
1582
+ );
1583
+ const otoroshiDisableNgCommand = cliparse.command(
1584
+ 'disable-ng',
1585
+ {
1586
+ description: 'Unlink Otoroshi from its Network Group',
1587
+ args: [args.addonIdOrName],
1588
+ },
1589
+ otoroshi.ngDisable,
1590
+ );
1591
+ const otoroshiOpenLogsCommand = cliparse.command(
1592
+ 'logs',
1593
+ {
1594
+ description: 'Open the Otoroshi application logs in Clever Cloud Console',
1595
+ args: [args.addonIdOrName],
1596
+ },
1597
+ otoroshi.openLogs,
1598
+ );
1599
+ const otoroshiOpenWebUiCommand = cliparse.command(
1600
+ 'webui',
1601
+ {
1602
+ description: 'Open the Otoroshi admin console in your browser',
1603
+ args: [args.addonIdOrName],
1604
+ },
1605
+ otoroshi.openWebUi,
1606
+ );
1607
+ const otoroshiOpenCommand = cliparse.command(
1608
+ 'open',
1609
+ {
1610
+ description: 'Open the Otoroshi dashboard in Clever Cloud Console',
1611
+ args: [args.addonIdOrName],
1612
+ commands: [otoroshiOpenLogsCommand, otoroshiOpenWebUiCommand],
1613
+ },
1614
+ otoroshi.open,
1615
+ );
1616
+ const otoroshiRestartCommand = cliparse.command(
1617
+ 'restart',
1618
+ {
1619
+ description: 'Restart Otoroshi',
1620
+ args: [args.addonIdOrName],
1621
+ },
1622
+ otoroshi.reboot,
1623
+ );
1624
+ const otoroshiRebuildCommand = cliparse.command(
1625
+ 'rebuild',
1626
+ {
1627
+ description: 'Rebuild Otoroshi',
1628
+ args: [args.addonIdOrName],
1629
+ },
1630
+ otoroshi.rebuild,
1631
+ );
1632
+ const otoroshiVersionCheckCommand = cliparse.command(
1633
+ 'check',
1634
+ {
1635
+ description: 'Check Otoroshi deployed version',
1636
+ args: [args.addonIdOrName],
1637
+ options: [opts.humanJsonOutputFormat],
1638
+ },
1639
+ otoroshi.checkVersion,
1640
+ );
1641
+ const otoroshiVersionUpdateCommand = cliparse.command(
1642
+ 'update',
1643
+ {
1644
+ description: 'Update Otoroshi deployed version',
1645
+ args: [args.addonIdOrName],
1646
+ options: [opts.targetVersion],
1647
+ },
1648
+ otoroshi.updateVersion,
1649
+ );
1650
+ const otoroshiVersionsCommands = cliparse.command(
1651
+ 'version',
1652
+ {
1653
+ description: 'Manage Otoroshi deployed version',
1654
+ args: [args.addonIdOrName],
1655
+ privateOptions: [opts.humanJsonOutputFormat],
1656
+ commands: [otoroshiVersionCheckCommand, otoroshiVersionUpdateCommand],
1657
+ },
1658
+ otoroshi.checkVersion,
1659
+ );
1660
+ const otoroshiCommand = cliparse.command(
1661
+ 'otoroshi',
1662
+ {
1663
+ description: 'Manage Clever Cloud Otoroshi services',
1664
+ privateOptions: [opts.humanJsonOutputFormat],
1665
+ commands: [
1666
+ otoroshiGetCommand,
1667
+ otoroshiEnableNgCommand,
1668
+ otoroshiDisableNgCommand,
1669
+ otoroshiOpenCommand,
1670
+ otoroshiRestartCommand,
1671
+ otoroshiRebuildCommand,
1672
+ otoroshiVersionsCommands,
1673
+ ],
1674
+ },
1675
+ otoroshi.list,
1676
+ );
1132
1677
 
1133
1678
  // CONSOLE COMMAND
1134
- const consoleCommand = cliparse.command('console', {
1135
- description: 'Open an application in the Console',
1136
- options: [opts.alias, opts.appIdOrName],
1137
- }, consoleModule.openConsole);
1679
+ const consoleCommand = cliparse.command(
1680
+ 'console',
1681
+ {
1682
+ description: 'Open an application in the Console',
1683
+ options: [opts.alias, opts.appIdOrName],
1684
+ },
1685
+ consoleModule.openConsole,
1686
+ );
1138
1687
 
1139
1688
  // PROFILE COMMAND
1140
- const profileOpenCommand = cliparse.command('open', {
1141
- description: 'Open your profile in the Console',
1142
- }, profile.openProfile);
1143
- const profileCommand = cliparse.command('profile', {
1144
- description: 'Display the profile of the current user',
1145
- options: [opts.humanJsonOutputFormat],
1146
- commands: [profileOpenCommand],
1147
- }, profile.profile);
1689
+ const profileOpenCommand = cliparse.command(
1690
+ 'open',
1691
+ {
1692
+ description: 'Open your profile in the Console',
1693
+ },
1694
+ profile.openProfile,
1695
+ );
1696
+ const profileCommand = cliparse.command(
1697
+ 'profile',
1698
+ {
1699
+ description: 'Display the profile of the current user',
1700
+ options: [opts.humanJsonOutputFormat],
1701
+ commands: [profileOpenCommand],
1702
+ },
1703
+ profile.profile,
1704
+ );
1148
1705
 
1149
1706
  // PUBLISHED CONFIG COMMANDS
1150
- const publishedConfigSetCommand = cliparse.command('set', {
1151
- description: 'Add or update a published configuration item named <variable-name> with the value <variable-value>',
1152
- args: [args.envVariableName, args.envVariableValue],
1153
- }, publishedConfig.set);
1154
- const publishedConfigRemoveCommand = cliparse.command('rm', {
1155
- description: 'Remove a published configuration variable from an application',
1156
- args: [args.envVariableName],
1157
- }, publishedConfig.rm);
1158
- const publishedConfigImportCommand = cliparse.command('import', {
1159
- description: 'Load published configuration from STDIN\n(WARNING: this deletes all current variables and replace them with the new list loaded from STDIN)',
1160
- options: [opts.importAsJson],
1161
- }, publishedConfig.importEnv);
1162
- const publishedConfigCommands = cliparse.command('published-config', {
1163
- description: 'Manage the configuration made available to other applications by this application',
1164
- options: [opts.alias, opts.appIdOrName],
1165
- privateOptions: [opts.envFormat],
1166
- commands: [publishedConfigSetCommand, publishedConfigRemoveCommand, publishedConfigImportCommand],
1167
- }, publishedConfig.list);
1707
+ const publishedConfigSetCommand = cliparse.command(
1708
+ 'set',
1709
+ {
1710
+ description: 'Add or update a published configuration item named <variable-name> with the value <variable-value>',
1711
+ args: [args.envVariableName, args.envVariableValue],
1712
+ },
1713
+ publishedConfig.set,
1714
+ );
1715
+ const publishedConfigRemoveCommand = cliparse.command(
1716
+ 'rm',
1717
+ {
1718
+ description: 'Remove a published configuration variable from an application',
1719
+ args: [args.envVariableName],
1720
+ },
1721
+ publishedConfig.rm,
1722
+ );
1723
+ const publishedConfigImportCommand = cliparse.command(
1724
+ 'import',
1725
+ {
1726
+ description:
1727
+ 'Load published configuration from STDIN\n(WARNING: this deletes all current variables and replace them with the new list loaded from STDIN)',
1728
+ options: [opts.importAsJson],
1729
+ },
1730
+ publishedConfig.importEnv,
1731
+ );
1732
+ const publishedConfigCommands = cliparse.command(
1733
+ 'published-config',
1734
+ {
1735
+ description: 'Manage the configuration made available to other applications by this application',
1736
+ options: [opts.alias, opts.appIdOrName],
1737
+ privateOptions: [opts.envFormat],
1738
+ commands: [publishedConfigSetCommand, publishedConfigRemoveCommand, publishedConfigImportCommand],
1739
+ },
1740
+ publishedConfig.list,
1741
+ );
1168
1742
 
1169
1743
  // RESTART COMMAND
1170
- const restartCommand = cliparse.command('restart', {
1171
- description: 'Start or restart an application',
1172
- options: [opts.alias, opts.appIdOrName, opts.commit, opts.withoutCache, opts.quiet, opts.followDeployLogs, opts.exitOnDeploy],
1173
- }, restart.restart);
1744
+ const restartCommand = cliparse.command(
1745
+ 'restart',
1746
+ {
1747
+ description: 'Start or restart an application',
1748
+ options: [
1749
+ opts.alias,
1750
+ opts.appIdOrName,
1751
+ opts.commit,
1752
+ opts.withoutCache,
1753
+ opts.quiet,
1754
+ opts.followDeployLogs,
1755
+ opts.exitOnDeploy,
1756
+ ],
1757
+ },
1758
+ restart.restart,
1759
+ );
1174
1760
 
1175
1761
  // SCALE COMMAND
1176
- const scaleCommand = cliparse.command('scale', {
1177
- description: 'Change scalability of an application',
1178
- options: [opts.alias, opts.appIdOrName, opts.flavor, opts.minFlavor, opts.maxFlavor, opts.instances, opts.minInstances, opts.maxInstances, opts.buildFlavor],
1179
- }, scale.scale);
1762
+ const scaleCommand = cliparse.command(
1763
+ 'scale',
1764
+ {
1765
+ description: 'Change scalability of an application',
1766
+ options: [
1767
+ opts.alias,
1768
+ opts.appIdOrName,
1769
+ opts.flavor,
1770
+ opts.minFlavor,
1771
+ opts.maxFlavor,
1772
+ opts.instances,
1773
+ opts.minInstances,
1774
+ opts.maxInstances,
1775
+ opts.buildFlavor,
1776
+ ],
1777
+ },
1778
+ scale.scale,
1779
+ );
1180
1780
 
1181
1781
  // SERVICE COMMANDS
1182
- const serviceLinkAppCommand = cliparse.command('link-app', {
1183
- description: 'Add an existing app as a dependency',
1184
- args: [args.appIdOrName],
1185
- }, service.linkApp);
1186
- const serviceUnlinkAppCommand = cliparse.command('unlink-app', {
1187
- description: 'Remove an app from the dependencies',
1188
- args: [args.appIdOrName],
1189
- }, service.unlinkApp);
1190
- const serviceLinkAddonCommand = cliparse.command('link-addon', {
1191
- description: 'Link an existing add-on to this application',
1192
- args: [args.addonIdOrName],
1193
- }, service.linkAddon);
1194
- const serviceUnlinkAddonCommand = cliparse.command('unlink-addon', {
1195
- description: 'Unlink an add-on from this application',
1196
- args: [args.addonIdOrName],
1197
- }, service.unlinkAddon);
1198
- const serviceCommands = cliparse.command('service', {
1199
- description: 'Manage service dependencies',
1200
- options: [opts.alias, opts.appIdOrName, opts.onlyApps, opts.onlyAddons, opts.showAll],
1201
- privateOptions: [opts.humanJsonOutputFormat],
1202
- commands: [serviceLinkAppCommand, serviceUnlinkAppCommand, serviceLinkAddonCommand, serviceUnlinkAddonCommand],
1203
- }, service.list);
1782
+ const serviceLinkAppCommand = cliparse.command(
1783
+ 'link-app',
1784
+ {
1785
+ description: 'Add an existing app as a dependency',
1786
+ args: [args.appIdOrName],
1787
+ },
1788
+ service.linkApp,
1789
+ );
1790
+ const serviceUnlinkAppCommand = cliparse.command(
1791
+ 'unlink-app',
1792
+ {
1793
+ description: 'Remove an app from the dependencies',
1794
+ args: [args.appIdOrName],
1795
+ },
1796
+ service.unlinkApp,
1797
+ );
1798
+ const serviceLinkAddonCommand = cliparse.command(
1799
+ 'link-addon',
1800
+ {
1801
+ description: 'Link an existing add-on to this application',
1802
+ args: [args.addonIdOrName],
1803
+ },
1804
+ service.linkAddon,
1805
+ );
1806
+ const serviceUnlinkAddonCommand = cliparse.command(
1807
+ 'unlink-addon',
1808
+ {
1809
+ description: 'Unlink an add-on from this application',
1810
+ args: [args.addonIdOrName],
1811
+ },
1812
+ service.unlinkAddon,
1813
+ );
1814
+ const serviceCommands = cliparse.command(
1815
+ 'service',
1816
+ {
1817
+ description: 'Manage service dependencies',
1818
+ options: [opts.alias, opts.appIdOrName, opts.onlyApps, opts.onlyAddons, opts.showAll],
1819
+ privateOptions: [opts.humanJsonOutputFormat],
1820
+ commands: [serviceLinkAppCommand, serviceUnlinkAppCommand, serviceLinkAddonCommand, serviceUnlinkAddonCommand],
1821
+ },
1822
+ service.list,
1823
+ );
1204
1824
 
1205
1825
  // SSH COMMAND
1206
- const sshCommand = cliparse.command('ssh', {
1207
- description: 'Connect to running instances through SSH',
1208
- options: [opts.alias, opts.appIdOrName, opts.sshIdentityFile],
1209
- }, ssh.ssh);
1826
+ const sshCommand = cliparse.command(
1827
+ 'ssh',
1828
+ {
1829
+ description: 'Connect to running instances through SSH',
1830
+ options: [opts.alias, opts.appIdOrName, opts.sshIdentityFile],
1831
+ },
1832
+ ssh.ssh,
1833
+ );
1210
1834
 
1211
1835
  // SSH KEYS COMMANDS
1212
- const sshKeysAddCommand = cliparse.command('add', {
1213
- description: 'Add a new SSH key to the current user',
1214
- args: [args.sshKeyName, args.sshKeyPath],
1215
- }, sshKeys.add);
1216
- const sshKeysRemoveCommand = cliparse.command('remove', {
1217
- description: 'Remove a SSH key from the current user',
1218
- args: [args.sshKeyName],
1219
- }, sshKeys.remove);
1220
- const sshKeysRemoveAllCommand = cliparse.command('remove-all', {
1221
- description: 'Remove all SSH keys from the current user',
1222
- options: [opts.confirmSshKeyClean],
1223
- }, sshKeys.removeAll);
1224
- const sshKeysOpenConsoleCommand = cliparse.command('open', {
1225
- description: 'Open the SSH keys management page in the Console',
1226
- }, sshKeys.openConsole);
1227
- const sshKeysCommands = cliparse.command('ssh-keys', {
1228
- description: 'Manage SSH keys of the current user',
1229
- privateOptions: [opts.humanJsonOutputFormat],
1230
- commands: [sshKeysAddCommand, sshKeysRemoveCommand, sshKeysRemoveAllCommand, sshKeysOpenConsoleCommand],
1231
- }, sshKeys.list);
1836
+ const sshKeysAddCommand = cliparse.command(
1837
+ 'add',
1838
+ {
1839
+ description: 'Add a new SSH key to the current user',
1840
+ args: [args.sshKeyName, args.sshKeyPath],
1841
+ },
1842
+ sshKeys.add,
1843
+ );
1844
+ const sshKeysRemoveCommand = cliparse.command(
1845
+ 'remove',
1846
+ {
1847
+ description: 'Remove a SSH key from the current user',
1848
+ args: [args.sshKeyName],
1849
+ },
1850
+ sshKeys.remove,
1851
+ );
1852
+ const sshKeysRemoveAllCommand = cliparse.command(
1853
+ 'remove-all',
1854
+ {
1855
+ description: 'Remove all SSH keys from the current user',
1856
+ options: [opts.confirmSshKeyClean],
1857
+ },
1858
+ sshKeys.removeAll,
1859
+ );
1860
+ const sshKeysOpenConsoleCommand = cliparse.command(
1861
+ 'open',
1862
+ {
1863
+ description: 'Open the SSH keys management page in the Console',
1864
+ },
1865
+ sshKeys.openConsole,
1866
+ );
1867
+ const sshKeysCommands = cliparse.command(
1868
+ 'ssh-keys',
1869
+ {
1870
+ description: 'Manage SSH keys of the current user',
1871
+ privateOptions: [opts.humanJsonOutputFormat],
1872
+ commands: [sshKeysAddCommand, sshKeysRemoveCommand, sshKeysRemoveAllCommand, sshKeysOpenConsoleCommand],
1873
+ },
1874
+ sshKeys.list,
1875
+ );
1232
1876
 
1233
1877
  // STATUS COMMAND
1234
- const statusCommand = cliparse.command('status', {
1235
- description: 'See the status of an application',
1236
- options: [opts.alias, opts.appIdOrName, opts.humanJsonOutputFormat],
1237
- }, status.status);
1878
+ const statusCommand = cliparse.command(
1879
+ 'status',
1880
+ {
1881
+ description: 'See the status of an application',
1882
+ options: [opts.alias, opts.appIdOrName, opts.humanJsonOutputFormat],
1883
+ },
1884
+ status.status,
1885
+ );
1238
1886
 
1239
1887
  // STOP COMMAND
1240
- const stopCommand = cliparse.command('stop', {
1241
- description: 'Stop a running application',
1242
- options: [opts.alias, opts.appIdOrName],
1243
- }, stop.stop);
1888
+ const stopCommand = cliparse.command(
1889
+ 'stop',
1890
+ {
1891
+ description: 'Stop a running application',
1892
+ options: [opts.alias, opts.appIdOrName],
1893
+ },
1894
+ stop.stop,
1895
+ );
1244
1896
 
1245
1897
  // TCP-REDIRS COMMAND
1246
- const tcpRedirsListNamespacesCommand = cliparse.command('list-namespaces', {
1247
- description: 'List the namespaces in which you can create new TCP redirections',
1248
- options: [opts.humanJsonOutputFormat],
1249
- }, tcpRedirs.listNamespaces);
1250
- const tcpRedirsAddCommand = cliparse.command('add', {
1251
- description: 'Add a new TCP redirection to the application',
1252
- options: [opts.namespace, opts.confirmTcpRedirCreation],
1253
- }, tcpRedirs.add);
1254
- const tcpRedirsRemoveCommand = cliparse.command('remove', {
1255
- description: 'Remove a TCP redirection from the application',
1256
- options: [opts.namespace],
1257
- args: [args.port],
1258
- }, tcpRedirs.remove);
1259
- const tcpRedirsCommands = cliparse.command('tcp-redirs', {
1260
- description: 'Control the TCP redirections from reverse proxies to your application',
1261
- options: [opts.alias, opts.appIdOrName],
1262
- privateOptions: [opts.humanJsonOutputFormat],
1263
- commands: [tcpRedirsListNamespacesCommand, tcpRedirsAddCommand, tcpRedirsRemoveCommand],
1264
- }, tcpRedirs.list);
1898
+ const tcpRedirsListNamespacesCommand = cliparse.command(
1899
+ 'list-namespaces',
1900
+ {
1901
+ description: 'List the namespaces in which you can create new TCP redirections',
1902
+ options: [opts.humanJsonOutputFormat],
1903
+ },
1904
+ tcpRedirs.listNamespaces,
1905
+ );
1906
+ const tcpRedirsAddCommand = cliparse.command(
1907
+ 'add',
1908
+ {
1909
+ description: 'Add a new TCP redirection to the application',
1910
+ options: [opts.namespace, opts.confirmTcpRedirCreation],
1911
+ },
1912
+ tcpRedirs.add,
1913
+ );
1914
+ const tcpRedirsRemoveCommand = cliparse.command(
1915
+ 'remove',
1916
+ {
1917
+ description: 'Remove a TCP redirection from the application',
1918
+ options: [opts.namespace],
1919
+ args: [args.port],
1920
+ },
1921
+ tcpRedirs.remove,
1922
+ );
1923
+ const tcpRedirsCommands = cliparse.command(
1924
+ 'tcp-redirs',
1925
+ {
1926
+ description: 'Control the TCP redirections from reverse proxies to your application',
1927
+ options: [opts.alias, opts.appIdOrName],
1928
+ privateOptions: [opts.humanJsonOutputFormat],
1929
+ commands: [tcpRedirsListNamespacesCommand, tcpRedirsAddCommand, tcpRedirsRemoveCommand],
1930
+ },
1931
+ tcpRedirs.list,
1932
+ );
1265
1933
 
1266
1934
  // TOKENS COMMANDS
1267
- const apiTokenCreateCommand = cliparse.command('create', {
1268
- description: 'Create an API token',
1269
- args: [args.apiTokenName],
1270
- options: [opts.apiTokenExpiration, opts.humanJsonOutputFormat],
1271
- }, tokens.create);
1272
- const apiTokenRevokeCommand = cliparse.command('revoke', {
1273
- description: 'Revoke an API token',
1274
- args: [args.apiTokenId],
1275
- }, tokens.revoke);
1276
- const tokensCommands = cliparse.command('tokens', {
1277
- description: `Manage API tokens to query Clever Cloud API from ${conf.AUTH_BRIDGE_HOST}`,
1278
- commands: [apiTokenCreateCommand, apiTokenRevokeCommand],
1279
- privateOptions: [opts.humanJsonOutputFormat],
1280
- }, tokens.list);
1935
+ const apiTokenCreateCommand = cliparse.command(
1936
+ 'create',
1937
+ {
1938
+ description: 'Create an API token',
1939
+ args: [args.apiTokenName],
1940
+ options: [opts.apiTokenExpiration, opts.humanJsonOutputFormat],
1941
+ },
1942
+ tokens.create,
1943
+ );
1944
+ const apiTokenRevokeCommand = cliparse.command(
1945
+ 'revoke',
1946
+ {
1947
+ description: 'Revoke an API token',
1948
+ args: [args.apiTokenId],
1949
+ },
1950
+ tokens.revoke,
1951
+ );
1952
+ const tokensCommands = cliparse.command(
1953
+ 'tokens',
1954
+ {
1955
+ description: `Manage API tokens to query Clever Cloud API from ${conf.AUTH_BRIDGE_HOST}`,
1956
+ commands: [apiTokenCreateCommand, apiTokenRevokeCommand],
1957
+ privateOptions: [opts.humanJsonOutputFormat],
1958
+ },
1959
+ tokens.list,
1960
+ );
1281
1961
 
1282
1962
  // UNLINK COMMAND
1283
- const appUnlinkCommand = cliparse.command('unlink', {
1284
- description: 'Unlink this repo from an existing application',
1285
- args: [args.alias],
1286
- }, unlink.unlink);
1963
+ const appUnlinkCommand = cliparse.command(
1964
+ 'unlink',
1965
+ {
1966
+ description: 'Unlink this repo from an existing application',
1967
+ args: [args.alias],
1968
+ },
1969
+ unlink.unlink,
1970
+ );
1287
1971
 
1288
1972
  // VERSION COMMAND
1289
- const versionCommand = cliparse.command('version', {
1290
- description: 'Display the clever-tools version',
1291
- args: [],
1292
- }, version.version);
1973
+ const versionCommand = cliparse.command(
1974
+ 'version',
1975
+ {
1976
+ description: 'Display the clever-tools version',
1977
+ args: [],
1978
+ },
1979
+ version.version,
1980
+ );
1293
1981
 
1294
1982
  // WEBHOOKS COMMAND
1295
- const addWebhookCommand = cliparse.command('add', {
1296
- description: 'Register webhook to be called when events happen',
1297
- options: [opts.webhookFormat, opts.notificationEventType, opts.notificationScope],
1298
- args: [args.notificationName, args.webhookUrl],
1299
- }, webhooks.add);
1300
- const removeWebhookCommand = cliparse.command('remove', {
1301
- description: 'Remove an existing webhook',
1302
- args: [args.notificationId],
1303
- }, webhooks.remove);
1304
- const webhooksCommand = cliparse.command('webhooks', {
1305
- description: 'Manage webhooks',
1306
- options: [opts.orgaIdOrName, opts.listAllNotifications],
1307
- privateOptions: [opts.humanJsonOutputFormat],
1308
- commands: [addWebhookCommand, removeWebhookCommand],
1309
- }, webhooks.list);
1983
+ const addWebhookCommand = cliparse.command(
1984
+ 'add',
1985
+ {
1986
+ description: 'Register webhook to be called when events happen',
1987
+ options: [opts.webhookFormat, opts.notificationEventType, opts.notificationScope],
1988
+ args: [args.notificationName, args.webhookUrl],
1989
+ },
1990
+ webhooks.add,
1991
+ );
1992
+ const removeWebhookCommand = cliparse.command(
1993
+ 'remove',
1994
+ {
1995
+ description: 'Remove an existing webhook',
1996
+ args: [args.notificationId],
1997
+ },
1998
+ webhooks.remove,
1999
+ );
2000
+ const webhooksCommand = cliparse.command(
2001
+ 'webhooks',
2002
+ {
2003
+ description: 'Manage webhooks',
2004
+ options: [opts.orgaIdOrName, opts.listAllNotifications],
2005
+ privateOptions: [opts.humanJsonOutputFormat],
2006
+ commands: [addWebhookCommand, removeWebhookCommand],
2007
+ },
2008
+ webhooks.list,
2009
+ );
1310
2010
 
1311
2011
  // DATABASES COMMANDS
1312
- const downloadBackupCommand = cliparse.command('download', {
1313
- description: 'Download a database backup',
1314
- args: [args.databaseId, args.backupId],
1315
- options: [opts.output],
1316
- }, database.downloadBackups);
1317
- const backupsCommand = cliparse.command('backups', {
1318
- description: 'List available database backups',
1319
- args: [args.databaseId],
1320
- options: [opts.orgaIdOrName, opts.humanJsonOutputFormat],
1321
- commands: [
1322
- downloadBackupCommand,
1323
- ],
1324
- }, database.listBackups);
1325
- const databaseCommand = cliparse.command('database', {
1326
- description: 'List available databases',
1327
- commands: [backupsCommand],
1328
- }, async () => {
1329
- console.info('This command is not available, you can try the following commands:');
1330
- console.info('clever database backups');
1331
- console.info('clever database backups download');
1332
- });
2012
+ const downloadBackupCommand = cliparse.command(
2013
+ 'download',
2014
+ {
2015
+ description: 'Download a database backup',
2016
+ args: [args.databaseId, args.backupId],
2017
+ options: [opts.output],
2018
+ },
2019
+ database.downloadBackups,
2020
+ );
2021
+ const backupsCommand = cliparse.command(
2022
+ 'backups',
2023
+ {
2024
+ description: 'List available database backups',
2025
+ args: [args.databaseId],
2026
+ options: [opts.orgaIdOrName, opts.humanJsonOutputFormat],
2027
+ commands: [downloadBackupCommand],
2028
+ },
2029
+ database.listBackups,
2030
+ );
2031
+ const databaseCommand = cliparse.command(
2032
+ 'database',
2033
+ {
2034
+ description: 'List available databases',
2035
+ commands: [backupsCommand],
2036
+ },
2037
+ async () => {
2038
+ console.info('This command is not available, you can try the following commands:');
2039
+ console.info('clever database backups');
2040
+ console.info('clever database backups download');
2041
+ },
2042
+ );
1333
2043
 
1334
2044
  // Patch help command description
1335
2045
  cliparseCommands.helpCommand.description = 'Display help about the Clever Cloud CLI';
@@ -1398,8 +2108,8 @@ async function run () {
1398
2108
  // CLI PARSER
1399
2109
  const cliParser = cliparse.cli({
1400
2110
  name: 'clever',
1401
- description: 'CLI tool to manage Clever Cloud\'s data and products',
1402
- version: getPackageJson().version,
2111
+ description: "CLI tool to manage Clever Cloud's data and products",
2112
+ version: pkg.version,
1403
2113
  options: [opts.color, opts.updateNotifier, opts.verbose],
1404
2114
  helpCommand: false,
1405
2115
  commands: _sortBy(commands, 'name'),
@@ -1415,7 +2125,6 @@ async function run () {
1415
2125
  // cliparse doesn't allow unknown options/arguments
1416
2126
  if (process.argv[2] === 'curl') {
1417
2127
  curl();
1418
- }
1419
- else {
2128
+ } else {
1420
2129
  run();
1421
2130
  }