viza 1.7.49 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { resolveEnv } from "../../../context/env.js";
2
- import { resolveResourceHubIntent } from "../../../context/hubIntent.js";
2
+ import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../core/dispatch.js";
4
4
  /**
5
5
  * Target teams for `viza login aws`.
@@ -29,7 +29,7 @@ const TARGET_TEAMS = {
29
29
  export async function bootstrapAgeCommand(options) {
30
30
  // 1) Resolve environment
31
31
  const env = resolveEnv(options);
32
- const intent = resolveResourceHubIntent(env);
32
+ const intent = RESOURCE_HUB_INTENT_BY_ENV;
33
33
  // Resolve allowed teams
34
34
  // - Dispatch mode: restrict by targetEnv
35
35
  // - Status mode: allow union of all env teams (read-only query)
@@ -1,5 +1,5 @@
1
1
  import { resolveEnv } from "../../../../context/env.js";
2
- import { resolveResourceHubIntent } from "../../../../context/hubIntent.js";
2
+ import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  /**
5
5
  * Target teams for `viza aws rolesanywhere bootstrap`.
@@ -22,7 +22,7 @@ const TARGET_TEAMS = {
22
22
  export async function bootstrapAwsRolesAnywhereCommand(options) {
23
23
  // 1) Resolve environment
24
24
  const env = resolveEnv(options);
25
- const intent = resolveResourceHubIntent(env);
25
+ const intent = RESOURCE_HUB_INTENT_BY_ENV;
26
26
  // 2) Resolve allowed teams (no status mode for bootstrap)
27
27
  const allowedTeams = TARGET_TEAMS[env];
28
28
  // 3) Dispatch intent (freeze)
@@ -1,5 +1,5 @@
1
1
  import { resolveEnv } from "../../../../context/env.js";
2
- import { resolveResourceHubIntent } from "../../../../context/hubIntent.js";
2
+ import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  /**
5
5
  * Target teams for `viza aws rolesanywhere bootstrap`.
@@ -26,7 +26,7 @@ const TARGET_TEAMS = {
26
26
  export async function rebootstrapAwsRolesAnywhereCommand(options) {
27
27
  // 1) Resolve environment
28
28
  const env = resolveEnv(options);
29
- const intent = resolveResourceHubIntent(env);
29
+ const intent = RESOURCE_HUB_INTENT_BY_ENV;
30
30
  // 2) Resolve allowed teams (no status mode for bootstrap)
31
31
  const allowedTeams = TARGET_TEAMS[env];
32
32
  // 3) Dispatch intent (freeze)
@@ -1,5 +1,5 @@
1
1
  import { resolveEnv } from "../../../../context/env.js";
2
- import { resolveResourceHubIntent } from "../../../../context/hubIntent.js";
2
+ import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  /**
5
5
  * Target teams for `viza aws rolesanywhere rotate`.
@@ -29,7 +29,7 @@ const TARGET_TEAMS = {
29
29
  export async function rotateAwsRolesAnywhereCommand(options) {
30
30
  // 1) Resolve environment
31
31
  const env = resolveEnv(options);
32
- const intent = resolveResourceHubIntent(env);
32
+ const intent = RESOURCE_HUB_INTENT_BY_ENV;
33
33
  // 2) Resolve allowed teams (no status mode for rotate)
34
34
  const allowedTeams = TARGET_TEAMS[env];
35
35
  // 3) Dispatch intent (freeze)
@@ -1,5 +1,5 @@
1
1
  import { resolveEnv } from "../../../../context/env.js";
2
- import { resolveResourceHubIntent } from "../../../../context/hubIntent.js";
2
+ import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  /**
5
5
  * Target teams for `viza aws rolesanywhere update-role`.
@@ -26,7 +26,7 @@ const TARGET_TEAMS = {
26
26
  export async function updateAwsRolesAnywhereRoleCommand(options) {
27
27
  // 1) Resolve environment
28
28
  const env = resolveEnv(options);
29
- const intent = resolveResourceHubIntent(env);
29
+ const intent = RESOURCE_HUB_INTENT_BY_ENV;
30
30
  // 2) Resolve allowed teams (no status mode for rotate)
31
31
  const allowedTeams = TARGET_TEAMS[env];
32
32
  // 3) Dispatch intent (freeze)
@@ -1,4 +1,4 @@
1
- import { resolveRuntimeHubIntent } from "../../../../context/hubIntent.js";
1
+ import { RUNTIME_HUB_INTENT } from "../../../../context/hubIntent.js";
2
2
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
3
3
  import { showSsoLinkMenu } from "../../../../ui/sso/awsLoginMenu.js";
4
4
  /**
@@ -23,7 +23,7 @@ const TARGET_TEAMS = [
23
23
  */
24
24
  export async function loginBillingAwsCommand(options) {
25
25
  // 1) Resolve environment
26
- const intent = resolveRuntimeHubIntent();
26
+ const intent = RUNTIME_HUB_INTENT;
27
27
  const allowedTeams = TARGET_TEAMS;
28
28
  // 5) Dispatch intent (freeze)
29
29
  const result = await dispatchIntentAndWait({
@@ -1,5 +1,5 @@
1
1
  import { resolveEnv } from "../../../context/env.js";
2
- import { resolveResourceHubIntent } from "../../../context/hubIntent.js";
2
+ import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../core/dispatch.js";
4
4
  const TARGET_TEAMS = {
5
5
  "dev": [
@@ -26,7 +26,7 @@ const TARGET_TEAMS = {
26
26
  export async function logsCommand(runId, options) {
27
27
  // 1️⃣ Resolve environment
28
28
  const env = resolveEnv(options);
29
- const intent = resolveResourceHubIntent(env);
29
+ const intent = RESOURCE_HUB_INTENT_BY_ENV;
30
30
  // Resolve allowed teams (same contract as other commands)
31
31
  const allowedTeams = TARGET_TEAMS[env];
32
32
  // 2️⃣ Handle --app locally (do NOT dispatch)
@@ -1,5 +1,5 @@
1
1
  import { resolveEnv } from "../../../context/env.js";
2
- import { resolveRuntimeHubIntent } from "../../../context/hubIntent.js";
2
+ import { RUNTIME_HUB_INTENT } from "../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../core/dispatch.js";
4
4
  import { showDispatchRuns } from "./show-runs.js";
5
5
  const TARGET_TEAMS = {
@@ -27,7 +27,7 @@ const TARGET_TEAMS = {
27
27
  export async function runsCommand(options) {
28
28
  // 1️⃣ Resolve environment
29
29
  const env = resolveEnv(options);
30
- const intent = resolveRuntimeHubIntent();
30
+ const intent = RUNTIME_HUB_INTENT;
31
31
  // Resolve allowed teams (same contract as other commands)
32
32
  const allowedTeams = TARGET_TEAMS[env];
33
33
  // 2️⃣ Handle --app locally (do NOT dispatch)
@@ -1,5 +1,5 @@
1
1
  import { resolveEnv } from "../../../../context/env.js";
2
- import { resolveResourceHubIntent } from "../../../../context/hubIntent.js";
2
+ import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  /**
5
5
  * Target teams for `viza login aws`.
@@ -27,7 +27,7 @@ const TARGET_TEAMS = {
27
27
  export async function backupGithubSecretsCommand(options) {
28
28
  // 1) Resolve environment
29
29
  const env = resolveEnv(options);
30
- const intent = resolveResourceHubIntent(env);
30
+ const intent = RESOURCE_HUB_INTENT_BY_ENV;
31
31
  // Resolve allowed teams
32
32
  // - Dispatch mode: restrict by targetEnv
33
33
  // - Status mode: allow union of all env teams (read-only query)
@@ -1,5 +1,5 @@
1
1
  import { resolveEnv } from "../../../../context/env.js";
2
- import { resolveRuntimeHubIntent } from "../../../../context/hubIntent.js";
2
+ import { RUNTIME_HUB_INTENT } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  /**
5
5
  * Target teams for `viza login aws`.
@@ -29,7 +29,7 @@ const TARGET_TEAMS = {
29
29
  export async function restoreGithubSecretsCommand(options) {
30
30
  // 1) Resolve environment
31
31
  const env = resolveEnv(options);
32
- const intent = resolveRuntimeHubIntent();
32
+ const intent = RUNTIME_HUB_INTENT;
33
33
  // Resolve allowed teams
34
34
  // - Dispatch mode: restrict by targetEnv
35
35
  // - Status mode: allow union of all env teams (read-only query)
@@ -30,7 +30,7 @@ export async function deployCommandHubCommand(options) {
30
30
  // 1) Resolve environment
31
31
  const env = resolveEnv(options);
32
32
  const cloudRunner = options.cloudRunner === true;
33
- const intent = resolveHubIntent(env, cloudRunner);
33
+ const intent = resolveHubIntent(cloudRunner);
34
34
  // Resolve allowed teams
35
35
  // - Dispatch mode: restrict by targetEnv
36
36
  // - Status mode: allow union of all env teams (read-only query)
@@ -1,5 +1,5 @@
1
1
  import { resolveEnv } from "../../../context/env.js";
2
- import { resolveRuntimeHubIntent } from "../../../context/hubIntent.js";
2
+ import { RUNTIME_HUB_INTENT } from "../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../core/dispatch.js";
4
4
  import { showSsoLinkMenu } from "../../../ui/sso/awsLoginMenu.js";
5
5
  /**
@@ -33,7 +33,7 @@ const TARGET_TEAMS = {
33
33
  export async function loginAwsCommand(options) {
34
34
  // 1) Resolve environment
35
35
  const env = resolveEnv(options);
36
- const intent = resolveRuntimeHubIntent();
36
+ const intent = RUNTIME_HUB_INTENT;
37
37
  // Resolve allowed teams
38
38
  // - Dispatch mode: restrict by targetEnv
39
39
  // - Status mode: allow union of all env teams (read-only query)
@@ -2,34 +2,23 @@
2
2
  /**
3
3
  * Deploy infrastructure resources (hub layer)
4
4
  */
5
- export const RESOURCE_HUB_INTENT_BY_ENV = {
6
- dev: "hub-dev",
7
- prod: "hub",
8
- };
5
+ export const RESOURCE_HUB_INTENT_BY_ENV = "hub";
6
+ /**
7
+ * Deploy infrastructure resources (deployer reserved layer)
8
+ */
9
+ export const RESOURCE_DEPLOYER_INTENT_BY_ENV = "deployer";
9
10
  /**
10
11
  * Build & publish application layer
11
12
  */
12
- export const APP_HUB_INTENT_BY_ENV = {
13
- dev: "builder",
14
- prod: "publisher",
15
- };
13
+ export const RESOURCE_BACKER_INTENT_BY_ENV = "backer";
16
14
  /**
17
15
  * Runtime command hub (worker layer)
18
16
  * Single intent for both dev and prod (env derived at gateway)
19
17
  */
20
18
  export const RUNTIME_HUB_INTENT = "hub-worker";
21
- export function resolveResourceHubIntent(env) {
22
- return RESOURCE_HUB_INTENT_BY_ENV[env];
23
- }
24
- export function resolveAppHubIntent(env) {
25
- return APP_HUB_INTENT_BY_ENV[env];
26
- }
27
- export function resolveRuntimeHubIntent() {
28
- return RUNTIME_HUB_INTENT;
29
- }
30
- export function resolveHubIntent(env, cloudRunner) {
19
+ export function resolveHubIntent(cloudRunner) {
31
20
  if (cloudRunner) {
32
- return resolveAppHubIntent(env);
21
+ return RESOURCE_BACKER_INTENT_BY_ENV;
33
22
  }
34
- return resolveResourceHubIntent(env);
23
+ return RESOURCE_HUB_INTENT_BY_ENV;
35
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viza",
3
- "version": "1.7.49",
3
+ "version": "1.8.1",
4
4
  "type": "module",
5
5
  "description": "Viza unified command line interface",
6
6
  "bin": {