viza 1.6.41 → 1.6.45

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.
@@ -1,10 +1,7 @@
1
1
  import { Command } from "commander";
2
2
  import { loginBillingAwsCommand } from "./aws.js";
3
3
  import { getResolvedOptions } from "../../../../cli/resolveOptions.js";
4
- export function registerBillingLoginAwsCommand(parent) {
5
- // billing login
6
- const loginCommand = new Command("login")
7
- .description("Login to billing services");
4
+ export function registerAwsUnderBillingLogin(parent) {
8
5
  // billing login aws
9
6
  const awsCommand = new Command("aws")
10
7
  .description("Login to AWS billing console")
@@ -14,6 +11,5 @@ export function registerBillingLoginAwsCommand(parent) {
14
11
  const fullOpts = getResolvedOptions(command);
15
12
  await loginBillingAwsCommand(fullOpts);
16
13
  });
17
- loginCommand.addCommand(awsCommand);
18
- parent.addCommand(loginCommand);
14
+ parent.addCommand(awsCommand);
19
15
  }
@@ -1,4 +1,10 @@
1
- import { registerBillingLoginAwsCommand } from "./aws/register.js";
2
- export function registerBillingLoginCommand(program) {
3
- registerBillingLoginAwsCommand(program);
1
+ import { Command } from "commander";
2
+ import { registerAwsUnderBillingLogin } from "./aws/register.js";
3
+ export function registerBillingLoginCommand(parent) {
4
+ // billing login
5
+ const loginCommand = new Command("login")
6
+ .description("Login to billing services");
7
+ // attach provider-level commands (e.g. aws)
8
+ registerAwsUnderBillingLogin(loginCommand);
9
+ parent.addCommand(loginCommand);
4
10
  }
@@ -2,9 +2,6 @@ import { Command } from "commander";
2
2
  import { loginBillingAdminAwsCommand } from "./aws.js";
3
3
  import { getResolvedOptions } from "../../../../cli/resolveOptions.js";
4
4
  export function registerBillingLoginAdminAwsCommand(parent) {
5
- // billing login-admin
6
- const loginAdminCommand = new Command("login-admin")
7
- .description("Login to billing services with admin privileges");
8
5
  // billing login-admin aws
9
6
  const awsCommand = new Command("aws")
10
7
  .description("Login to AWS billing console (admin)")
@@ -14,6 +11,5 @@ export function registerBillingLoginAdminAwsCommand(parent) {
14
11
  const fullOpts = getResolvedOptions(command);
15
12
  await loginBillingAdminAwsCommand(fullOpts);
16
13
  });
17
- loginAdminCommand.addCommand(awsCommand);
18
- parent.addCommand(loginAdminCommand);
14
+ parent.addCommand(awsCommand);
19
15
  }
@@ -1,4 +1,10 @@
1
+ import { Command } from "commander";
1
2
  import { registerBillingLoginAdminAwsCommand } from "./aws/register.js";
2
- export function registerBillingLoginAdminCommand(program) {
3
- registerBillingLoginAdminAwsCommand(program);
3
+ export function registerBillingLoginAdminCommand(parent) {
4
+ // billing login-admin
5
+ const loginAdminCommand = new Command("login-admin")
6
+ .description("Login to billing services with admin privileges");
7
+ // attach provider-level commands (e.g. aws)
8
+ registerBillingLoginAdminAwsCommand(loginAdminCommand);
9
+ parent.addCommand(loginAdminCommand);
4
10
  }
@@ -1,6 +1,13 @@
1
+ import { Command } from "commander";
1
2
  import { registerBillingLoginCommand } from "./login/register.js";
2
3
  import { registerBillingLoginAdminCommand } from "./login-admin/register.js";
3
4
  export function registerBillingCommand(program) {
4
- registerBillingLoginCommand(program);
5
- registerBillingLoginAdminCommand(program);
5
+ // Create top-level `billing` command
6
+ const billingCommand = new Command("billing")
7
+ .description("Billing related commands");
8
+ // Attach subcommands under `billing`
9
+ registerBillingLoginCommand(billingCommand);
10
+ registerBillingLoginAdminCommand(billingCommand);
11
+ // Attach `billing` to root program
12
+ program.addCommand(billingCommand);
6
13
  }
@@ -55,7 +55,9 @@ export async function loginAwsCommand(options) {
55
55
  flowGates: {
56
56
  secrets: false,
57
57
  },
58
- payload: {}
58
+ payload: {
59
+ ...(options.ssm ? { intent: "ssm" } : {}),
60
+ }
59
61
  }, {
60
62
  status: options.status === true,
61
63
  log: "hide",
@@ -8,6 +8,7 @@ export function registerLoginAwsCommand(program) {
8
8
  .description("Login to AWS")
9
9
  .option("--prod", "Use production environment")
10
10
  .option("--dev", "Use development environment")
11
+ .option("--ssm", "Open AWS Systems Manager Parameter Store after login")
11
12
  .action(async (_opts, command) => {
12
13
  const fullOpts = getResolvedOptions(command);
13
14
  await loginAwsCommand(fullOpts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viza",
3
- "version": "1.6.41",
3
+ "version": "1.6.45",
4
4
  "type": "module",
5
5
  "description": "Viza unified command line interface",
6
6
  "bin": {