@dishantlangayan/solace-cloud-cli 0.4.0 → 0.5.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.
package/README.md CHANGED
@@ -40,7 +40,7 @@ $ npm install -g @dishantlangayan/solace-cloud-cli
40
40
  $ sc COMMAND
41
41
  running command...
42
42
  $ sc (--version)
43
- @dishantlangayan/solace-cloud-cli/0.4.0 darwin-arm64 node-v24.1.0
43
+ @dishantlangayan/solace-cloud-cli/0.5.0 linux-x64 node-v22.22.1
44
44
  $ sc --help [COMMAND]
45
45
  USAGE
46
46
  $ sc COMMAND
@@ -142,7 +142,7 @@ EXAMPLES
142
142
  $ sc account list
143
143
  ```
144
144
 
145
- _See code: [src/commands/account/list.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/account/list.ts)_
145
+ _See code: [src/commands/account/list.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/account/list.ts)_
146
146
 
147
147
  ## `sc account login`
148
148
 
@@ -192,7 +192,7 @@ EXAMPLES
192
192
  $ sc account login --org=my-org-id --base-url=https://api.custom.solace.cloud
193
193
  ```
194
194
 
195
- _See code: [src/commands/account/login.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/account/login.ts)_
195
+ _See code: [src/commands/account/login.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/account/login.ts)_
196
196
 
197
197
  ## `sc account logout`
198
198
 
@@ -230,7 +230,7 @@ EXAMPLES
230
230
  $ sc account logout --org=my-org-id --no-prompt
231
231
  ```
232
232
 
233
- _See code: [src/commands/account/logout.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/account/logout.ts)_
233
+ _See code: [src/commands/account/logout.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/account/logout.ts)_
234
234
 
235
235
  ## `sc autocomplete [SHELL]`
236
236
 
@@ -379,7 +379,7 @@ EXAMPLES
379
379
  $ sc missionctrl broker create --alias=my-alias --name=MyBrokerName --datacenter-id=eks-ca-central-1a --service-class-id=DEVELOPER
380
380
  ```
381
381
 
382
- _See code: [src/commands/missionctrl/broker/create.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/missionctrl/broker/create.ts)_
382
+ _See code: [src/commands/missionctrl/broker/create.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/missionctrl/broker/create.ts)_
383
383
 
384
384
  ## `sc missionctrl broker delete`
385
385
 
@@ -388,7 +388,7 @@ Delete a service using its unique identifier.
388
388
  ```
389
389
  USAGE
390
390
  $ sc missionctrl broker delete [--json] [--log-level debug|warn|error|info|trace] [-a <value> | -o <value>] [-b <value>] [-n
391
- <value>]
391
+ <value>] [--no-prompt]
392
392
 
393
393
  FLAGS
394
394
  -a, --alias=<value> Organization alias to use. If not specified, uses the default organization.
@@ -396,6 +396,7 @@ FLAGS
396
396
  -n, --name=<value> Name of the event broker service.
397
397
  -o, --org=<value> Organization ID to use. If not specified, uses the default organization or alias if
398
398
  specified.
399
+ --no-prompt Skip confirmation prompt and assume Yes
399
400
 
400
401
  GLOBAL FLAGS
401
402
  --json Format output as json.
@@ -417,9 +418,11 @@ EXAMPLES
417
418
  $ sc missionctrl broker delete --org=my-org --broker-id=MyBrokerId
418
419
 
419
420
  $ sc missionctrl broker delete --alias=my-alias --name=MyBrokerName
421
+
422
+ $ sc missionctrl broker delete --broker-id=MyBrokerId --no-prompt
420
423
  ```
421
424
 
422
- _See code: [src/commands/missionctrl/broker/delete.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/missionctrl/broker/delete.ts)_
425
+ _See code: [src/commands/missionctrl/broker/delete.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/missionctrl/broker/delete.ts)_
423
426
 
424
427
  ## `sc missionctrl broker display`
425
428
 
@@ -458,7 +461,7 @@ EXAMPLES
458
461
  $ sc missionctrl broker display --alias=my-alias --name=MyBrokerName
459
462
  ```
460
463
 
461
- _See code: [src/commands/missionctrl/broker/display.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/missionctrl/broker/display.ts)_
464
+ _See code: [src/commands/missionctrl/broker/display.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/missionctrl/broker/display.ts)_
462
465
 
463
466
  ## `sc missionctrl broker list`
464
467
 
@@ -514,7 +517,7 @@ EXAMPLES
514
517
  $ sc missionctrl broker list --alias=my-alias --name=MyBrokerName --pageNumber=1 --pageSize=10 --sort=name:asc
515
518
  ```
516
519
 
517
- _See code: [src/commands/missionctrl/broker/list.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/missionctrl/broker/list.ts)_
520
+ _See code: [src/commands/missionctrl/broker/list.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/missionctrl/broker/list.ts)_
518
521
 
519
522
  ## `sc missionctrl broker opstatus`
520
523
 
@@ -558,7 +561,7 @@ EXAMPLES
558
561
  $ sc missionctrl broker opstatus --alias=my-alias -b <broker-id>
559
562
  ```
560
563
 
561
- _See code: [src/commands/missionctrl/broker/opstatus.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/missionctrl/broker/opstatus.ts)_
564
+ _See code: [src/commands/missionctrl/broker/opstatus.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/missionctrl/broker/opstatus.ts)_
562
565
 
563
566
  ## `sc missionctrl broker state`
564
567
 
@@ -600,7 +603,7 @@ EXAMPLES
600
603
  $ sc missionctrl broker state --alias=my-alias --name=MyBrokerName
601
604
  ```
602
605
 
603
- _See code: [src/commands/missionctrl/broker/state.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/missionctrl/broker/state.ts)_
606
+ _See code: [src/commands/missionctrl/broker/state.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/missionctrl/broker/state.ts)_
604
607
 
605
608
  ## `sc missionctrl broker update`
606
609
 
@@ -645,7 +648,7 @@ EXAMPLES
645
648
  $ sc missionctrl broker update --alias=my-alias --name <name> --new-name <new-name>
646
649
  ```
647
650
 
648
- _See code: [src/commands/missionctrl/broker/update.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/missionctrl/broker/update.ts)_
651
+ _See code: [src/commands/missionctrl/broker/update.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/missionctrl/broker/update.ts)_
649
652
 
650
653
  ## `sc platform env create`
651
654
 
@@ -686,7 +689,7 @@ EXAMPLES
686
689
  $ sc platform env create --alias=my-alias --name=MyEnvironment --isDefault
687
690
  ```
688
691
 
689
- _See code: [src/commands/platform/env/create.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/platform/env/create.ts)_
692
+ _See code: [src/commands/platform/env/create.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/platform/env/create.ts)_
690
693
 
691
694
  ## `sc platform env delete`
692
695
 
@@ -695,13 +698,14 @@ Delete an environment using either its name or unique identifier. The default en
695
698
  ```
696
699
  USAGE
697
700
  $ sc platform env delete [--json] [--log-level debug|warn|error|info|trace] [-a <value> | -o <value>] [-e <value>] [-n
698
- <value>]
701
+ <value>] [--no-prompt]
699
702
 
700
703
  FLAGS
701
704
  -a, --alias=<value> Organization alias to use. If not specified, uses the default organization.
702
705
  -e, --env-id=<value> Id of the environment.
703
706
  -n, --name=<value> Name of the environment.
704
707
  -o, --org=<value> Organization ID to use. If not specified, uses the default organization or alias if specified.
708
+ --no-prompt Skip confirmation prompt and assume Yes
705
709
 
706
710
  GLOBAL FLAGS
707
711
  --json Format output as json.
@@ -721,9 +725,11 @@ EXAMPLES
721
725
  $ sc platform env delete --org=my-org --name=MyEnvName
722
726
 
723
727
  $ sc platform env delete --alias=my-alias --name=MyEnvName
728
+
729
+ $ sc platform env delete --env-id=MyEnvId --no-prompt
724
730
  ```
725
731
 
726
- _See code: [src/commands/platform/env/delete.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/platform/env/delete.ts)_
732
+ _See code: [src/commands/platform/env/delete.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/platform/env/delete.ts)_
727
733
 
728
734
  ## `sc platform env display`
729
735
 
@@ -762,7 +768,7 @@ EXAMPLES
762
768
  $ sc platform env display --alias=my-alias --name=MyEnvName
763
769
  ```
764
770
 
765
- _See code: [src/commands/platform/env/display.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/platform/env/display.ts)_
771
+ _See code: [src/commands/platform/env/display.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/platform/env/display.ts)_
766
772
 
767
773
  ## `sc platform env list`
768
774
 
@@ -800,7 +806,7 @@ EXAMPLES
800
806
  $ sc platform env list --alias=my-alias --name=Default --pageNumber=1 --pageSize=10 --sort=name:ASC
801
807
  ```
802
808
 
803
- _See code: [src/commands/platform/env/list.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/platform/env/list.ts)_
809
+ _See code: [src/commands/platform/env/list.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/platform/env/list.ts)_
804
810
 
805
811
  ## `sc platform env update`
806
812
 
@@ -844,7 +850,7 @@ EXAMPLES
844
850
  $ sc platform env update --alias=my-alias --name=MyEnvName --new-name=MyNewEnvName
845
851
  ```
846
852
 
847
- _See code: [src/commands/platform/env/update.ts](https://github.com/dishantlangayan/solace-cloud-cli/blob/v0.4.0/src/commands/platform/env/update.ts)_
853
+ _See code: [src/commands/platform/env/update.ts](https://github.com/SolaceLabs/solace-cloud-cli/blob/v0.5.0/src/commands/platform/env/update.ts)_
848
854
 
849
855
  ## `sc plugins`
850
856
 
@@ -8,6 +8,7 @@ export default class MissionctrlBrokerDelete extends ScCommand<typeof Missionctr
8
8
  alias: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  'broker-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
10
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ 'no-prompt': import("@oclif/core/interfaces").BooleanFlag<boolean>;
11
12
  org: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
13
  };
13
14
  run(): Promise<EventBrokerOperationApiResponse>;
@@ -1,4 +1,5 @@
1
1
  import { printObjectAsKeyValueTable, ScCommand } from '@dishantlangayan/sc-cli-core';
2
+ import { confirm } from '@inquirer/prompts';
2
3
  import { Flags } from '@oclif/core';
3
4
  import { resolveOrgConnection } from '../../../lib/org-utils.js';
4
5
  export default class MissionctrlBrokerDelete extends ScCommand {
@@ -13,6 +14,7 @@ Token Permissions: [ \`services:delete\` **or** \`services:delete:self\` **or**
13
14
  '<%= config.bin %> <%= command.id %> --name=MyBrokerName',
14
15
  '<%= config.bin %> <%= command.id %> --org=my-org --broker-id=MyBrokerId',
15
16
  '<%= config.bin %> <%= command.id %> --alias=my-alias --name=MyBrokerName',
17
+ '<%= config.bin %> <%= command.id %> --broker-id=MyBrokerId --no-prompt',
16
18
  ];
17
19
  static flags = {
18
20
  alias: Flags.string({
@@ -30,6 +32,10 @@ Token Permissions: [ \`services:delete\` **or** \`services:delete:self\` **or**
30
32
  description: 'Name of the event broker service.',
31
33
  exactlyOne: ['broker-id', 'name'],
32
34
  }),
35
+ 'no-prompt': Flags.boolean({
36
+ default: false,
37
+ description: 'Skip confirmation prompt and assume Yes',
38
+ }),
33
39
  org: Flags.string({
34
40
  char: 'o',
35
41
  description: 'Organization ID to use. If not specified, uses the default organization or alias if specified.',
@@ -57,6 +63,25 @@ Token Permissions: [ \`services:delete\` **or** \`services:delete:self\` **or**
57
63
  brokerIdToDelete = resp.data[0]?.id;
58
64
  }
59
65
  }
66
+ // Confirm deletion unless --no-prompt flag is set
67
+ if (!flags['no-prompt']) {
68
+ const brokerIdentifier = name || brokerId;
69
+ try {
70
+ const shouldProceed = await confirm({
71
+ default: false,
72
+ message: `Are you sure you want to delete the broker '${brokerIdentifier}'?`,
73
+ });
74
+ if (!shouldProceed) {
75
+ this.log('Deletion cancelled.');
76
+ this.exit(0);
77
+ }
78
+ }
79
+ catch {
80
+ // User cancelled the confirmation (Ctrl+C)
81
+ this.log('Deletion cancelled.');
82
+ this.exit(0);
83
+ }
84
+ }
60
85
  // API call to delete environment by id
61
86
  apiUrl += `/${brokerIdToDelete}`;
62
87
  const resp = await conn.delete(apiUrl);
@@ -7,6 +7,7 @@ export default class PlatformEnvDelete extends ScCommand<typeof PlatformEnvDelet
7
7
  alias: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
8
  'env-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
9
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ 'no-prompt': import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
11
  org: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
12
  };
12
13
  run(): Promise<{
@@ -1,4 +1,5 @@
1
1
  import { ScCommand } from '@dishantlangayan/sc-cli-core';
2
+ import { confirm } from '@inquirer/prompts';
2
3
  import { Flags } from '@oclif/core';
3
4
  import { resolveOrgConnection } from '../../../lib/org-utils.js';
4
5
  export default class PlatformEnvDelete extends ScCommand {
@@ -11,6 +12,7 @@ export default class PlatformEnvDelete extends ScCommand {
11
12
  '<%= config.bin %> <%= command.id %> --env-id=MyEnvId',
12
13
  '<%= config.bin %> <%= command.id %> --org=my-org --name=MyEnvName',
13
14
  '<%= config.bin %> <%= command.id %> --alias=my-alias --name=MyEnvName',
15
+ '<%= config.bin %> <%= command.id %> --env-id=MyEnvId --no-prompt',
14
16
  ];
15
17
  static flags = {
16
18
  alias: Flags.string({
@@ -28,6 +30,10 @@ export default class PlatformEnvDelete extends ScCommand {
28
30
  description: 'Name of the environment.',
29
31
  exactlyOne: ['env-id', 'name'],
30
32
  }),
33
+ 'no-prompt': Flags.boolean({
34
+ default: false,
35
+ description: 'Skip confirmation prompt and assume Yes',
36
+ }),
31
37
  org: Flags.string({
32
38
  char: 'o',
33
39
  description: 'Organization ID to use. If not specified, uses the default organization or alias if specified.',
@@ -62,6 +68,25 @@ export default class PlatformEnvDelete extends ScCommand {
62
68
  this.warn(message);
63
69
  }
64
70
  else {
71
+ // Confirm deletion unless --no-prompt flag is set
72
+ if (!flags['no-prompt']) {
73
+ const envIdentifier = name || envId;
74
+ try {
75
+ const shouldProceed = await confirm({
76
+ default: false,
77
+ message: `Are you sure you want to delete the environment '${envIdentifier}'?`,
78
+ });
79
+ if (!shouldProceed) {
80
+ this.log('Deletion cancelled.');
81
+ this.exit(0);
82
+ }
83
+ }
84
+ catch {
85
+ // User cancelled the confirmation (Ctrl+C)
86
+ this.log('Deletion cancelled.');
87
+ this.exit(0);
88
+ }
89
+ }
65
90
  // API call to delete environment by id
66
91
  apiUrl += `/${envIdToDelete}`;
67
92
  await conn.delete(apiUrl);