viza 1.8.43 → 1.8.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,5 +1,5 @@
1
1
  import { getEnv } from "../../../../context/env.js";
2
- import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../../context/hubIntent.js";
2
+ import { resolvePrivateHubIntent } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  import { policy } from "./policy.js";
5
5
  /**
@@ -14,7 +14,7 @@ import { policy } from "./policy.js";
14
14
  export async function bootstrapAwsRolesAnywhereCommand(options) {
15
15
  // 1) Resolve environment
16
16
  const env = getEnv();
17
- const intent = RESOURCE_HUB_INTENT_BY_ENV;
17
+ const intent = resolvePrivateHubIntent();
18
18
  // 2) Resolve allowed teams (no status mode for bootstrap)
19
19
  const allowedTeams = Array.from(policy.byEnv[env]);
20
20
  // 3) Dispatch intent (freeze)
@@ -1,5 +1,5 @@
1
1
  import { getEnv } from "../../../../context/env.js";
2
- import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../../context/hubIntent.js";
2
+ import { resolvePrivateHubIntent } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  import { policy } from "./policy.js";
5
5
  /**
@@ -14,7 +14,7 @@ import { policy } from "./policy.js";
14
14
  export async function rebootstrapAwsRolesAnywhereCommand(options) {
15
15
  // 1) Resolve environment
16
16
  const env = getEnv();
17
- const intent = RESOURCE_HUB_INTENT_BY_ENV;
17
+ const intent = resolvePrivateHubIntent();
18
18
  // 2) Resolve allowed teams (no status mode for bootstrap)
19
19
  const allowedTeams = Array.from(policy.byEnv[env]);
20
20
  // 3) Dispatch intent (freeze)
@@ -1,5 +1,5 @@
1
1
  import { getEnv } from "../../../../context/env.js";
2
- import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../../context/hubIntent.js";
2
+ import { resolvePrivateHubIntent } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  import { policy } from "./policy.js";
5
5
  /**
@@ -14,7 +14,7 @@ import { policy } from "./policy.js";
14
14
  export async function rotateAwsRolesAnywhereCommand(options) {
15
15
  // 1) Resolve environment
16
16
  const env = getEnv();
17
- const intent = RESOURCE_HUB_INTENT_BY_ENV;
17
+ const intent = resolvePrivateHubIntent();
18
18
  // 2) Resolve allowed teams (no status mode for rotate)
19
19
  const allowedTeams = Array.from(policy.byEnv[env]);
20
20
  // 3) Dispatch intent (freeze)
@@ -1,5 +1,5 @@
1
1
  import { getEnv } from "../../../../context/env.js";
2
- import { RESOURCE_HUB_INTENT_BY_ENV } from "../../../../context/hubIntent.js";
2
+ import { resolvePrivateHubIntent } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  import { policy } from "./policy.js";
5
5
  /**
@@ -14,7 +14,7 @@ import { policy } from "./policy.js";
14
14
  export async function updateAwsRolesAnywhereRoleCommand(options) {
15
15
  // 1) Resolve environment
16
16
  const env = getEnv();
17
- const intent = RESOURCE_HUB_INTENT_BY_ENV;
17
+ const intent = resolvePrivateHubIntent();
18
18
  // 2) Resolve allowed teams (no status mode for rotate)
19
19
  const allowedTeams = Array.from(policy.byEnv[env]);
20
20
  // 3) Dispatch intent (freeze)
@@ -1,4 +1,4 @@
1
- import { RUNTIME_HUB_INTENT } from "../../../../context/hubIntent.js";
1
+ import { resolveHubWorkerIntent } from "../../../../context/hubIntent.js";
2
2
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
3
3
  import { showSsoLinkMenu } from "../../../../ui/sso/awsLoginMenu.js";
4
4
  import { policy } from "./policy.js";
@@ -14,7 +14,7 @@ import { policy } from "./policy.js";
14
14
  */
15
15
  export async function loginBillingAwsCommand(options) {
16
16
  // 1) Resolve environment
17
- const intent = RUNTIME_HUB_INTENT;
17
+ const intent = resolveHubWorkerIntent();
18
18
  const allowedTeams = Array.from(policy.byEnv["prod"]);
19
19
  // 5) Dispatch intent (freeze)
20
20
  const result = await dispatchIntentAndWait({
@@ -1,5 +1,5 @@
1
1
  import { getEnv } from "../../../context/env.js";
2
- import { getRunner, RUNTIME_HUB_INTENT } from "../../../context/hubIntent.js";
2
+ import { getRunner, resolveHubWorkerIntent } from "../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../core/dispatch.js";
4
4
  import { policy } from "./policy.js";
5
5
  import { showDispatchRuns } from "./show-runs.js";
@@ -14,7 +14,7 @@ import { showDispatchRuns } from "./show-runs.js";
14
14
  export async function runsCommand(options) {
15
15
  // 1️⃣ Resolve environment
16
16
  const env = getEnv();
17
- const intent = RUNTIME_HUB_INTENT;
17
+ const intent = resolveHubWorkerIntent();
18
18
  const runner = getRunner();
19
19
  // Resolve allowed teams (same contract as other commands)
20
20
  const allowedTeams = Array.from(policy.byEnv[env]);
@@ -1,5 +1,5 @@
1
1
  import { getEnv } from "../../../../context/env.js";
2
- import { RUNTIME_HUB_INTENT } from "../../../../context/hubIntent.js";
2
+ import { resolveHubWorkerIntent } from "../../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../../core/dispatch.js";
4
4
  import { policy } from "./policy.js";
5
5
  /**
@@ -15,7 +15,7 @@ import { policy } from "./policy.js";
15
15
  export async function restoreGithubSecretsCommand(options) {
16
16
  // 1) Resolve environment
17
17
  const env = getEnv();
18
- const intent = RUNTIME_HUB_INTENT;
18
+ const intent = resolveHubWorkerIntent();
19
19
  // Resolve allowed teams
20
20
  // - Dispatch mode: restrict by targetEnv
21
21
  // - Status mode: allow union of all env teams (read-only query)
@@ -1,5 +1,5 @@
1
1
  import { getEnv } from "../../../context/env.js";
2
- import { RUNTIME_HUB_INTENT } from "../../../context/hubIntent.js";
2
+ import { resolveHubWorkerIntent } from "../../../context/hubIntent.js";
3
3
  import { dispatchIntentAndWait } from "../../../core/dispatch.js";
4
4
  import { showSsoLinkMenu } from "../../../ui/sso/awsLoginMenu.js";
5
5
  import { policy } from "./policy.js";
@@ -16,7 +16,7 @@ import { policy } from "./policy.js";
16
16
  export async function loginAwsCommand(options) {
17
17
  // 1) Resolve environment
18
18
  const env = getEnv();
19
- const intent = RUNTIME_HUB_INTENT;
19
+ const intent = resolveHubWorkerIntent();
20
20
  // Resolve allowed teams
21
21
  // - Dispatch mode: restrict by targetEnv
22
22
  // - Status mode: allow union of all env teams (read-only query)
@@ -17,20 +17,38 @@ const RESOURCE_DEPLOYER_INTENT_BY_ENV = "deployer";
17
17
  /**
18
18
  * Build & publish application layer
19
19
  */
20
- const RESOURCE_BACKER_INTENT_BY_ENV = "builder";
20
+ const RESOURCE_BUILDER_INTENT_BY_ENV = "builder";
21
21
  /**
22
22
  * Runtime command hub (worker layer)
23
23
  * Single intent for both dev and prod (env derived at gateway)
24
24
  */
25
- export const RUNTIME_HUB_INTENT = "hub-worker";
26
- export function resolveHubIntent(runner) {
27
- const r = runner ?? currentRunner;
25
+ const RUNTIME_HUB_INTENT = "hub-worker";
26
+ export function resolveHubIntent() {
27
+ const r = currentRunner;
28
28
  switch (r) {
29
29
  case "builder":
30
- return RESOURCE_BACKER_INTENT_BY_ENV;
30
+ return RESOURCE_BUILDER_INTENT_BY_ENV;
31
31
  case "deployer":
32
32
  return RESOURCE_DEPLOYER_INTENT_BY_ENV;
33
33
  default:
34
34
  return RESOURCE_HUB_INTENT_BY_ENV;
35
35
  }
36
36
  }
37
+ export function resolvePrivateHubIntent() {
38
+ const r = currentRunner;
39
+ switch (r) {
40
+ case "deployer":
41
+ return RESOURCE_DEPLOYER_INTENT_BY_ENV;
42
+ default:
43
+ return RESOURCE_HUB_INTENT_BY_ENV;
44
+ }
45
+ }
46
+ export function resolveHubWorkerIntent() {
47
+ const r = currentRunner;
48
+ switch (r) {
49
+ case "deployer":
50
+ return RUNTIME_HUB_INTENT;
51
+ default:
52
+ return RUNTIME_HUB_INTENT;
53
+ }
54
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viza",
3
- "version": "1.8.43",
3
+ "version": "1.8.45",
4
4
  "type": "module",
5
5
  "description": "Viza unified command line interface",
6
6
  "bin": {