@vizamodo/viza-cli 1.3.36 → 1.3.43
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.
|
@@ -8,14 +8,13 @@ import { dispatchIntentAndWait } from "../../core/dispatch.js";
|
|
|
8
8
|
*/
|
|
9
9
|
const TARGET_TEAMS = {
|
|
10
10
|
"dev": [
|
|
11
|
-
"viza-
|
|
11
|
+
"viza-deployer",
|
|
12
12
|
"viza-manager",
|
|
13
13
|
"viza-admin",
|
|
14
14
|
"viza-super"
|
|
15
15
|
],
|
|
16
16
|
"prod": [
|
|
17
17
|
"viza-publisher",
|
|
18
|
-
"viza-billing",
|
|
19
18
|
"viza-admin",
|
|
20
19
|
"viza-super"
|
|
21
20
|
]
|
|
@@ -34,13 +33,22 @@ export async function loginAwsCommand(options) {
|
|
|
34
33
|
// 1) Resolve environment
|
|
35
34
|
const env = resolveEnv(options);
|
|
36
35
|
const intent = resolveHubIntent(env);
|
|
36
|
+
// Resolve allowed teams
|
|
37
|
+
// - Dispatch mode: restrict by targetEnv
|
|
38
|
+
// - Status mode: allow union of all env teams (read-only query)
|
|
39
|
+
const allowedTeams = options.status
|
|
40
|
+
? Array.from(new Set([
|
|
41
|
+
...TARGET_TEAMS.dev,
|
|
42
|
+
...TARGET_TEAMS.prod,
|
|
43
|
+
]))
|
|
44
|
+
: TARGET_TEAMS[env];
|
|
37
45
|
// 5) Dispatch intent (freeze)
|
|
38
46
|
await dispatchIntentAndWait({
|
|
39
47
|
intent,
|
|
40
48
|
commandType: "viza.aws.login",
|
|
41
49
|
infraKey: "aws",
|
|
42
50
|
targetEnv: env,
|
|
43
|
-
allowedTeams
|
|
51
|
+
allowedTeams,
|
|
44
52
|
runnerLabel: options.runnerLabel,
|
|
45
53
|
keepLog: options.keepLog === true,
|
|
46
54
|
flowGates: {
|
|
@@ -49,7 +57,7 @@ export async function loginAwsCommand(options) {
|
|
|
49
57
|
},
|
|
50
58
|
payload: {}
|
|
51
59
|
}, {
|
|
52
|
-
|
|
60
|
+
status: options.status === true,
|
|
53
61
|
log: "show",
|
|
54
62
|
});
|
|
55
63
|
}
|
|
@@ -4,6 +4,7 @@ import { startSpinner, stopSpinner } from "../ui/spinner.js";
|
|
|
4
4
|
import { renderLog } from "../ui/logRenderer.js";
|
|
5
5
|
import { showDispatchBanner } from "../ui/banner.js";
|
|
6
6
|
import { getCliVersion, checkForCliUpdateSoft } from "./version.js";
|
|
7
|
+
import { resolveExecutionMode } from "./resolveExecutionMode.js";
|
|
7
8
|
/**
|
|
8
9
|
* KISS log rendering.
|
|
9
10
|
* - success + hide => no log
|
|
@@ -44,7 +45,7 @@ async function dispatchIntent(input, mode = "dispatch") {
|
|
|
44
45
|
*/
|
|
45
46
|
export async function dispatchIntentAndWait(input, opts = {}) {
|
|
46
47
|
const policy = opts.log ?? "hide";
|
|
47
|
-
const mode = opts
|
|
48
|
+
const mode = resolveExecutionMode(opts);
|
|
48
49
|
const cliVersion = getCliVersion();
|
|
49
50
|
const meta = {
|
|
50
51
|
cliVersion,
|
package/dist/src/ui/banner.js
CHANGED
|
@@ -50,15 +50,17 @@ export function showBanner(opts) {
|
|
|
50
50
|
console.log(chalk.gray("Runner:"), chalk.yellowBright("GitHub-hosted"));
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
53
|
-
console.log(chalk.gray("Runner:"), chalk.yellowBright("self-hosted"), runner.label ? chalk.gray("|
|
|
53
|
+
console.log(chalk.gray("Runner:"), chalk.yellowBright("self-hosted"), runner.label ? chalk.gray(" | label:") : "", runner.label ? chalk.cyan(runner.label) : "");
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
// User-friendly info line
|
|
57
57
|
{
|
|
58
58
|
const parts = [];
|
|
59
|
+
parts.push(`Viza CLI`);
|
|
59
60
|
if (meta?.version) {
|
|
60
61
|
parts.push(`Version: ${chalk.cyan(meta.version)}`);
|
|
61
62
|
}
|
|
63
|
+
parts.push(`Install: ${chalk.gray(`npm i -g @vizamodo/viza-cli`)}`);
|
|
62
64
|
if (parts.length) {
|
|
63
65
|
console.log(chalk.gray(parts.join(chalk.gray(" | "))));
|
|
64
66
|
}
|