@solidactions/cli 0.2.5 → 0.2.6
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.
- package/dist/commands/deploy.js +13 -4
- package/dist/commands/env-list.js +37 -10
- package/package.json +1 -1
package/dist/commands/deploy.js
CHANGED
|
@@ -129,15 +129,23 @@ function parseYamlEnvVars(config) {
|
|
|
129
129
|
for (const item of config.env) {
|
|
130
130
|
if (typeof item === 'string') {
|
|
131
131
|
// Simple string: - VAR_NAME (declared only, needs configuration)
|
|
132
|
-
parsedVars.push({ key: item, mappedTo: null });
|
|
132
|
+
parsedVars.push({ key: item, mappedTo: null, oauthName: null });
|
|
133
133
|
}
|
|
134
134
|
else if (typeof item === 'object' && item !== null) {
|
|
135
|
-
// Object: - VAR_NAME: GLOBAL_NAME
|
|
135
|
+
// Object: - VAR_NAME: GLOBAL_NAME or - VAR_NAME: { oauth: connection-name }
|
|
136
136
|
const keys = Object.keys(item);
|
|
137
137
|
if (keys.length === 1) {
|
|
138
138
|
const key = keys[0];
|
|
139
|
-
const
|
|
140
|
-
|
|
139
|
+
const value = item[key];
|
|
140
|
+
if (typeof value === 'object' && value !== null && 'oauth' in value) {
|
|
141
|
+
if (typeof value.oauth !== 'string' || !value.oauth) {
|
|
142
|
+
throw new Error(`Invalid env config for ${key}: 'oauth' must be a non-empty string`);
|
|
143
|
+
}
|
|
144
|
+
parsedVars.push({ key, mappedTo: null, oauthName: value.oauth });
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
parsedVars.push({ key, mappedTo: value || null, oauthName: null });
|
|
148
|
+
}
|
|
141
149
|
}
|
|
142
150
|
}
|
|
143
151
|
}
|
|
@@ -171,6 +179,7 @@ async function pushYamlDeclarations(host, apiKey, projectSlug, yamlConfig) {
|
|
|
171
179
|
const declarations = parsedVars.map(v => ({
|
|
172
180
|
env_name: v.key,
|
|
173
181
|
yaml_default_global_key: v.mappedTo,
|
|
182
|
+
yaml_default_oauth_name: v.oauthName,
|
|
174
183
|
source: 'yaml',
|
|
175
184
|
}));
|
|
176
185
|
try {
|
|
@@ -52,18 +52,45 @@ async function envList(projectName, options = {}) {
|
|
|
52
52
|
return;
|
|
53
53
|
}
|
|
54
54
|
console.log('');
|
|
55
|
-
console.log(chalk_1.default.gray('KEY'.padEnd(
|
|
56
|
-
console.log(chalk_1.default.gray('-'.repeat(
|
|
55
|
+
console.log(chalk_1.default.gray('KEY'.padEnd(28) + 'VALUE'.padEnd(24) + 'TYPE'.padEnd(14) + 'SOURCE'));
|
|
56
|
+
console.log(chalk_1.default.gray('-'.repeat(90)));
|
|
57
57
|
for (const mapping of mappings) {
|
|
58
58
|
const key = mapping.env_name || '?';
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
// Value display (resolved_value includes global/oauth resolution)
|
|
60
|
+
const rawValue = mapping.resolved_value ?? mapping.value;
|
|
61
|
+
let value;
|
|
62
|
+
if (mapping.is_secret) {
|
|
63
|
+
value = chalk_1.default.yellow('••••••');
|
|
64
|
+
}
|
|
65
|
+
else if (rawValue) {
|
|
66
|
+
value = rawValue.toString().substring(0, 22);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
value = chalk_1.default.gray('-');
|
|
70
|
+
}
|
|
71
|
+
// Type & source (mirrors UI getMappingType)
|
|
72
|
+
let type;
|
|
73
|
+
let source;
|
|
74
|
+
if (mapping.source_type === 'oauth_connection' && mapping.oauth_connection_id) {
|
|
75
|
+
type = chalk_1.default.blue('oauth');
|
|
76
|
+
source = chalk_1.default.blue(mapping.oauth_connection_name || 'OAuth');
|
|
77
|
+
}
|
|
78
|
+
else if (mapping.global_variable_key) {
|
|
79
|
+
type = chalk_1.default.green('global');
|
|
80
|
+
source = chalk_1.default.green(mapping.global_variable_key);
|
|
81
|
+
}
|
|
82
|
+
else if (mapping.has_value) {
|
|
83
|
+
type = chalk_1.default.gray('project var');
|
|
84
|
+
source = chalk_1.default.gray('local');
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
type = chalk_1.default.gray('-');
|
|
88
|
+
source = chalk_1.default.gray('-');
|
|
89
|
+
}
|
|
90
|
+
console.log(key.padEnd(28) +
|
|
91
|
+
value.padEnd(24) +
|
|
92
|
+
type.padEnd(14) +
|
|
93
|
+
source);
|
|
67
94
|
}
|
|
68
95
|
console.log('');
|
|
69
96
|
console.log(chalk_1.default.gray(`${mappings.length} variable(s)`));
|