@dishantlangayan/solace-cloud-cli 0.3.0 → 0.4.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 (29) hide show
  1. package/README.md +98 -52
  2. package/dist/commands/account/login.js +1 -2
  3. package/dist/commands/missionctrl/broker/create.d.ts +1 -0
  4. package/dist/commands/missionctrl/broker/create.js +9 -2
  5. package/dist/commands/missionctrl/broker/delete.d.ts +1 -0
  6. package/dist/commands/missionctrl/broker/delete.js +9 -2
  7. package/dist/commands/missionctrl/broker/display.d.ts +1 -0
  8. package/dist/commands/missionctrl/broker/display.js +9 -2
  9. package/dist/commands/missionctrl/broker/list.d.ts +1 -0
  10. package/dist/commands/missionctrl/broker/list.js +9 -3
  11. package/dist/commands/missionctrl/broker/opstatus.d.ts +1 -0
  12. package/dist/commands/missionctrl/broker/opstatus.js +9 -2
  13. package/dist/commands/missionctrl/broker/state.d.ts +1 -0
  14. package/dist/commands/missionctrl/broker/state.js +9 -2
  15. package/dist/commands/missionctrl/broker/update.d.ts +1 -0
  16. package/dist/commands/missionctrl/broker/update.js +9 -2
  17. package/dist/commands/platform/env/create.d.ts +1 -0
  18. package/dist/commands/platform/env/create.js +9 -2
  19. package/dist/commands/platform/env/delete.d.ts +1 -0
  20. package/dist/commands/platform/env/delete.js +9 -2
  21. package/dist/commands/platform/env/display.d.ts +1 -0
  22. package/dist/commands/platform/env/display.js +9 -2
  23. package/dist/commands/platform/env/list.d.ts +1 -0
  24. package/dist/commands/platform/env/list.js +9 -3
  25. package/dist/commands/platform/env/update.d.ts +1 -0
  26. package/dist/commands/platform/env/update.js +9 -2
  27. package/dist/lib/org-utils.js +2 -6
  28. package/oclif.manifest.json +455 -277
  29. package/package.json +1 -1
@@ -12,8 +12,14 @@ export default class MissionctrlBrokerOpstatus extends ScCommand {
12
12
  '<%= config.bin %> <%= command.id %> -b <broker-id>',
13
13
  '<%= config.bin %> <%= command.id %> -n <broker-name>',
14
14
  '<%= config.bin %> <%= command.id %> --org=my-org -b <broker-id>',
15
+ '<%= config.bin %> <%= command.id %> --alias=my-alias -b <broker-id>',
15
16
  ];
16
17
  static flags = {
18
+ alias: Flags.string({
19
+ char: 'a',
20
+ description: 'Organization alias to use. If not specified, uses the default organization.',
21
+ exclusive: ['org'],
22
+ }),
17
23
  'broker-id': Flags.string({
18
24
  char: 'b',
19
25
  description: 'Id of the event broker service.',
@@ -26,7 +32,8 @@ export default class MissionctrlBrokerOpstatus extends ScCommand {
26
32
  }),
27
33
  org: Flags.string({
28
34
  char: 'o',
29
- description: 'Organization ID or alias to use. If not specified, uses the default organization.',
35
+ description: 'Organization ID to use. If not specified, uses the default organization or alias if specified.',
36
+ exclusive: ['alias'],
30
37
  }),
31
38
  'show-progress': Flags.boolean({
32
39
  char: 'p',
@@ -43,7 +50,7 @@ export default class MissionctrlBrokerOpstatus extends ScCommand {
43
50
  let brokerId = flags['broker-id'] ?? '';
44
51
  const showProgress = flags['show-progress'] ?? false;
45
52
  const waitMs = flags['wait-ms'] ?? 5000;
46
- const conn = await resolveOrgConnection(this, flags.org);
53
+ const conn = await resolveOrgConnection(this, flags.org ?? flags.alias);
47
54
  // Base API url
48
55
  let apiUrl = `/missionControl/eventBrokerServices`;
49
56
  // If broker name provided, retrieve the broker service id first
@@ -5,6 +5,7 @@ export default class MissionctrlBrokerState extends ScCommand<typeof Missionctrl
5
5
  static description: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
+ alias: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  'broker-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  org: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -12,8 +12,14 @@ export default class MissionctrlBrokerState extends ScCommand {
12
12
  '<%= config.bin %> <%= command.id %> --broker-id=MyBrokerServiceId',
13
13
  '<%= config.bin %> <%= command.id %> --name=MyBrokerName',
14
14
  '<%= config.bin %> <%= command.id %> --org=my-org --broker-id=MyBrokerServiceId',
15
+ '<%= config.bin %> <%= command.id %> --alias=my-alias --name=MyBrokerName',
15
16
  ];
16
17
  static flags = {
18
+ alias: Flags.string({
19
+ char: 'a',
20
+ description: 'Organization alias to use. If not specified, uses the default organization.',
21
+ exclusive: ['org'],
22
+ }),
17
23
  'broker-id': Flags.string({
18
24
  char: 'b',
19
25
  description: 'Id of the event broker service.',
@@ -26,14 +32,15 @@ export default class MissionctrlBrokerState extends ScCommand {
26
32
  }),
27
33
  org: Flags.string({
28
34
  char: 'o',
29
- description: 'Organization ID or alias to use. If not specified, uses the default organization.',
35
+ description: 'Organization ID to use. If not specified, uses the default organization or alias if specified.',
36
+ exclusive: ['alias'],
30
37
  }),
31
38
  };
32
39
  async run() {
33
40
  const { flags } = await this.parse(MissionctrlBrokerState);
34
41
  const name = flags.name ?? '';
35
42
  let brokerId = flags['broker-id'] ?? '';
36
- const conn = await resolveOrgConnection(this, flags.org);
43
+ const conn = await resolveOrgConnection(this, flags.org ?? flags.alias);
37
44
  // API url
38
45
  let apiUrl = `/missionControl/eventBrokerServices`;
39
46
  if (name) {
@@ -5,6 +5,7 @@ export default class MissionctrlBrokerUpdate extends ScCommand<typeof Missionctr
5
5
  static description: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
+ alias: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  'broker-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  locked: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -13,8 +13,14 @@ export default class MissionctrlBrokerUpdate extends ScCommand {
13
13
  '<%= config.bin %> <%= command.id %>',
14
14
  '<%= config.bin %> <%= command.id %> --broker-id <broker-id> --new-name <new-name>',
15
15
  '<%= config.bin %> <%= command.id %> --org=my-org --name <name> --new-name <new-name>',
16
+ '<%= config.bin %> <%= command.id %> --alias=my-alias --name <name> --new-name <new-name>',
16
17
  ];
17
18
  static flags = {
19
+ alias: Flags.string({
20
+ char: 'a',
21
+ description: 'Organization alias to use. If not specified, uses the default organization.',
22
+ exclusive: ['org'],
23
+ }),
18
24
  'broker-id': Flags.string({
19
25
  char: 'b',
20
26
  description: 'Id of the event broker service.',
@@ -34,7 +40,8 @@ export default class MissionctrlBrokerUpdate extends ScCommand {
34
40
  }),
35
41
  org: Flags.string({
36
42
  char: 'o',
37
- description: 'Organization ID or alias to use. If not specified, uses the default organization.',
43
+ description: 'Organization ID to use. If not specified, uses the default organization or alias if specified.',
44
+ exclusive: ['alias'],
38
45
  }),
39
46
  };
40
47
  async run() {
@@ -49,7 +56,7 @@ export default class MissionctrlBrokerUpdate extends ScCommand {
49
56
  ...(locked && { locked: lockedBoolValue }),
50
57
  ...(newName && { name: newName }),
51
58
  };
52
- const conn = await resolveOrgConnection(this, flags.org);
59
+ const conn = await resolveOrgConnection(this, flags.org ?? flags.alias);
53
60
  // API url
54
61
  let apiUrl = `/missionControl/eventBrokerServices`;
55
62
  let brokerIdToUpdate = brokerId;
@@ -5,6 +5,7 @@ export default class PlatformEnvCreate extends ScCommand<typeof PlatformEnvCreat
5
5
  static description: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
+ alias: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  isDefault: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
11
  isProduction: import("@oclif/core/interfaces").BooleanFlag<boolean>;
@@ -9,8 +9,14 @@ export default class PlatformEnvCreate extends ScCommand {
9
9
  static examples = [
10
10
  '<%= config.bin %> <%= command.id %> --name=MyEnvironment',
11
11
  '<%= config.bin %> <%= command.id %> --org=my-org --name=MyEnvironment --description="My environment description" --isDefault --isProduction',
12
+ '<%= config.bin %> <%= command.id %> --alias=my-alias --name=MyEnvironment --isDefault',
12
13
  ];
13
14
  static flags = {
15
+ alias: Flags.string({
16
+ char: 'a',
17
+ description: 'Organization alias to use. If not specified, uses the default organization.',
18
+ exclusive: ['org'],
19
+ }),
14
20
  description: Flags.string({
15
21
  char: 'd',
16
22
  description: 'Description of the environment to create.',
@@ -31,7 +37,8 @@ export default class PlatformEnvCreate extends ScCommand {
31
37
  }),
32
38
  org: Flags.string({
33
39
  char: 'o',
34
- description: 'Organization ID or alias to use. If not specified, uses the default organization.',
40
+ description: 'Organization ID to use. If not specified, uses the default organization or alias if specified.',
41
+ exclusive: ['alias'],
35
42
  }),
36
43
  };
37
44
  async run() {
@@ -40,7 +47,7 @@ export default class PlatformEnvCreate extends ScCommand {
40
47
  const desc = flags.description ?? '';
41
48
  const isDefault = flags.isDefault ?? false;
42
49
  const isProduction = flags.isProduction ?? false;
43
- const conn = await resolveOrgConnection(this, flags.org);
50
+ const conn = await resolveOrgConnection(this, flags.org ?? flags.alias);
44
51
  // API url
45
52
  const apiUrl = `/platform/environments`;
46
53
  // API body
@@ -4,6 +4,7 @@ export default class PlatformEnvDelete extends ScCommand<typeof PlatformEnvDelet
4
4
  static description: string;
5
5
  static examples: string[];
6
6
  static flags: {
7
+ alias: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
8
  'env-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  org: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -10,8 +10,14 @@ export default class PlatformEnvDelete extends ScCommand {
10
10
  '<%= config.bin %> <%= command.id %> --name=MyEnvName',
11
11
  '<%= config.bin %> <%= command.id %> --env-id=MyEnvId',
12
12
  '<%= config.bin %> <%= command.id %> --org=my-org --name=MyEnvName',
13
+ '<%= config.bin %> <%= command.id %> --alias=my-alias --name=MyEnvName',
13
14
  ];
14
15
  static flags = {
16
+ alias: Flags.string({
17
+ char: 'a',
18
+ description: 'Organization alias to use. If not specified, uses the default organization.',
19
+ exclusive: ['org'],
20
+ }),
15
21
  'env-id': Flags.string({
16
22
  char: 'e',
17
23
  description: 'Id of the environment.',
@@ -24,14 +30,15 @@ export default class PlatformEnvDelete extends ScCommand {
24
30
  }),
25
31
  org: Flags.string({
26
32
  char: 'o',
27
- description: 'Organization ID or alias to use. If not specified, uses the default organization.',
33
+ description: 'Organization ID to use. If not specified, uses the default organization or alias if specified.',
34
+ exclusive: ['alias'],
28
35
  }),
29
36
  };
30
37
  async run() {
31
38
  const { flags } = await this.parse(PlatformEnvDelete);
32
39
  const name = flags.name ?? '';
33
40
  const envId = flags['env-id'] ?? '';
34
- const conn = await resolveOrgConnection(this, flags.org);
41
+ const conn = await resolveOrgConnection(this, flags.org ?? flags.alias);
35
42
  // API url
36
43
  let apiUrl = `/platform/environments`;
37
44
  let envIdToDelete = envId;
@@ -5,6 +5,7 @@ export default class PlatformEnvDisplay extends ScCommand<typeof PlatformEnvDisp
5
5
  static description: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
+ alias: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  'env-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  org: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -12,8 +12,14 @@ export default class PlatformEnvDisplay extends ScCommand {
12
12
  '<%= config.bin %> <%= command.id %> --name=MyEnvName',
13
13
  '<%= config.bin %> <%= command.id %> --env-id=MyEnvId',
14
14
  '<%= config.bin %> <%= command.id %> --org=my-org --env-id=MyEnvId',
15
+ '<%= config.bin %> <%= command.id %> --alias=my-alias --name=MyEnvName',
15
16
  ];
16
17
  static flags = {
18
+ alias: Flags.string({
19
+ char: 'a',
20
+ description: 'Organization alias to use. If not specified, uses the default organization.',
21
+ exclusive: ['org'],
22
+ }),
17
23
  'env-id': Flags.string({
18
24
  char: 'e',
19
25
  description: 'Id of the environment.',
@@ -26,14 +32,15 @@ export default class PlatformEnvDisplay extends ScCommand {
26
32
  }),
27
33
  org: Flags.string({
28
34
  char: 'o',
29
- description: 'Organization ID or alias to use. If not specified, uses the default organization.',
35
+ description: 'Organization ID to use. If not specified, uses the default organization or alias if specified.',
36
+ exclusive: ['alias'],
30
37
  }),
31
38
  };
32
39
  async run() {
33
40
  const { flags } = await this.parse(PlatformEnvDisplay);
34
41
  const name = flags.name ?? '';
35
42
  const envId = flags['env-id'] ?? '';
36
- const conn = await resolveOrgConnection(this, flags.org);
43
+ const conn = await resolveOrgConnection(this, flags.org ?? flags.alias);
37
44
  // API url
38
45
  // If env name provided, get all environments matching provided name
39
46
  // If env id provided, get environment with that id
@@ -5,6 +5,7 @@ export default class PlatformEnvList extends ScCommand<typeof PlatformEnvList> {
5
5
  static description: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
+ alias: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  org: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  pageNumber: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -9,16 +9,22 @@ export default class PlatformEnvList extends ScCommand {
9
9
  static examples = [
10
10
  '<%= config.bin %> <%= command.id %>',
11
11
  '<%= config.bin %> <%= command.id %> --org=my-org',
12
- '<%= config.bin %> <%= command.id %> --name=Default --pageNumber=1 --pageSize=10 --sort=name:ASC',
12
+ '<%= config.bin %> <%= command.id %> --alias=my-alias --name=Default --pageNumber=1 --pageSize=10 --sort=name:ASC',
13
13
  ];
14
14
  static flags = {
15
+ alias: Flags.string({
16
+ char: 'a',
17
+ description: 'Organization alias to use. If not specified, uses the default organization.',
18
+ exclusive: ['org'],
19
+ }),
15
20
  name: Flags.string({
16
21
  char: 'n',
17
22
  description: 'Name of the environment to match on.',
18
23
  }),
19
24
  org: Flags.string({
20
25
  char: 'o',
21
- description: 'Organization ID or alias to use. If not specified, uses the default organization.',
26
+ description: 'Organization ID to use. If not specified, uses the default organization or alias if specified.',
27
+ exclusive: ['alias'],
22
28
  }),
23
29
  pageNumber: Flags.integer({
24
30
  char: 'p',
@@ -36,7 +42,7 @@ export default class PlatformEnvList extends ScCommand {
36
42
  };
37
43
  async run() {
38
44
  const { flags } = await this.parse(PlatformEnvList);
39
- const conn = await resolveOrgConnection(this, flags.org);
45
+ const conn = await resolveOrgConnection(this, flags.org ?? flags.alias);
40
46
  const pageSize = flags.pageSize ?? 10;
41
47
  const pageNumber = flags.pageNumber ?? 1;
42
48
  // API url
@@ -5,6 +5,7 @@ export default class PlatformEnvUpdate extends ScCommand<typeof PlatformEnvUpdat
5
5
  static description: string;
6
6
  static examples: string[];
7
7
  static flags: {
8
+ alias: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
9
  description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
10
  'env-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
11
  isDefault: import("@oclif/core/interfaces").BooleanFlag<boolean>;
@@ -13,8 +13,14 @@ export default class PlatformEnvUpdate extends ScCommand {
13
13
  '<%= config.bin %> <%= command.id %> --name=MyEnvName --new-name=MyNewEnvName',
14
14
  '<%= config.bin %> <%= command.id %> --env-id=MyEnvId --new-name=MyNewEnvName --description="My description to update" --isDefault',
15
15
  '<%= config.bin %> <%= command.id %> --org=my-org --name=MyEnvName --isDefault',
16
+ '<%= config.bin %> <%= command.id %> --alias=my-alias --name=MyEnvName --new-name=MyNewEnvName',
16
17
  ];
17
18
  static flags = {
19
+ alias: Flags.string({
20
+ char: 'a',
21
+ description: 'Organization alias to use. If not specified, uses the default organization.',
22
+ exclusive: ['org'],
23
+ }),
18
24
  description: Flags.string({
19
25
  char: 'd',
20
26
  description: 'Description of the environment to update.',
@@ -37,7 +43,8 @@ export default class PlatformEnvUpdate extends ScCommand {
37
43
  }),
38
44
  org: Flags.string({
39
45
  char: 'o',
40
- description: 'Organization ID or alias to use. If not specified, uses the default organization.',
46
+ description: 'Organization ID to use. If not specified, uses the default organization or alias if specified.',
47
+ exclusive: ['alias'],
41
48
  }),
42
49
  };
43
50
  async run() {
@@ -52,7 +59,7 @@ export default class PlatformEnvUpdate extends ScCommand {
52
59
  ...(desc && { description: desc }),
53
60
  ...(newName && { name: newName }),
54
61
  };
55
- const conn = await resolveOrgConnection(this, flags.org);
62
+ const conn = await resolveOrgConnection(this, flags.org ?? flags.alias);
56
63
  // API url
57
64
  let apiUrl = `/platform/environments`;
58
65
  let envIdToUpdate = envId;
@@ -30,9 +30,7 @@ export async function resolveOrgConnection(command, orgIdentifier, timeout) {
30
30
  if (!org) {
31
31
  command.error(`Organization '${orgIdentifier}' not found. Run 'sc account:list' to see available organizations.`, { exit: 2 });
32
32
  }
33
- // Use alias if available, otherwise use orgId
34
- const connectionIdentifier = org.alias || org.orgId;
35
- return await orgManager.createConnection(connectionIdentifier, timeout);
33
+ return await orgManager.createConnection(orgIdentifier, timeout);
36
34
  }
37
35
  // No org specified, try default
38
36
  const defaultOrg = await orgManager.getDefaultOrg();
@@ -45,9 +43,7 @@ export async function resolveOrgConnection(command, orgIdentifier, timeout) {
45
43
  command.error("No default organization set. Please specify --org flag or set a default with 'sc account:login --set-default'.", { exit: 2 });
46
44
  }
47
45
  }
48
- // Use alias if available, otherwise use orgId
49
- const connectionIdentifier = defaultOrg.alias || defaultOrg.orgId;
50
- return await orgManager.createConnection(connectionIdentifier, timeout);
46
+ return await orgManager.createConnection(defaultOrg.orgId, timeout);
51
47
  }
52
48
  catch (error) {
53
49
  // Handle OrgManager-specific errors