@uniformdev/cli 20.72.3-alpha.5 → 20.72.3-alpha.52
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/{chunk-ZEP3CK3V.mjs → chunk-5GVY6O7O.mjs} +37 -14
- package/dist/defaultConfig.mjs +1 -1
- package/dist/index.mjs +1209 -829
- package/package.json +10 -11
|
@@ -21,7 +21,7 @@ import { dirname, extname, isAbsolute, resolve, sep } from "path";
|
|
|
21
21
|
// package.json
|
|
22
22
|
var package_default = {
|
|
23
23
|
name: "@uniformdev/cli",
|
|
24
|
-
version: "20.
|
|
24
|
+
version: "20.74.5",
|
|
25
25
|
description: "Uniform command line interface tool",
|
|
26
26
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
27
27
|
main: "./cli.js",
|
|
@@ -49,6 +49,7 @@ var package_default = {
|
|
|
49
49
|
"@inquirer/prompts": "^8.5.2",
|
|
50
50
|
"@thi.ng/mime": "^2.2.23",
|
|
51
51
|
"@uniformdev/assets": "workspace:*",
|
|
52
|
+
"@uniformdev/automations-sdk": "workspace:*",
|
|
52
53
|
"@uniformdev/canvas": "workspace:*",
|
|
53
54
|
"@uniformdev/context": "workspace:*",
|
|
54
55
|
"@uniformdev/files": "workspace:*",
|
|
@@ -65,8 +66,6 @@ var package_default = {
|
|
|
65
66
|
execa: "5.1.1",
|
|
66
67
|
"file-type": "^22.0.1",
|
|
67
68
|
"fs-jetpack": "5.1.0",
|
|
68
|
-
graphql: "17.0.1",
|
|
69
|
-
"graphql-request": "7.4.0",
|
|
70
69
|
"image-size": "2.0.2",
|
|
71
70
|
"isomorphic-git": "1.38.5",
|
|
72
71
|
"js-yaml": "^4.2.0",
|
|
@@ -161,12 +160,20 @@ function withConfiguration(yargs) {
|
|
|
161
160
|
hidden: true
|
|
162
161
|
});
|
|
163
162
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
163
|
+
function maskApiKey(apiKey) {
|
|
164
|
+
const separatorIndex = apiKey.indexOf("1");
|
|
165
|
+
const prefix = separatorIndex > 0 ? apiKey.slice(0, separatorIndex) : apiKey.slice(0, 3);
|
|
166
|
+
return `${prefix}...${apiKey.slice(-4)}`;
|
|
167
|
+
}
|
|
168
|
+
function withApiOptions(yargs, { includeEdgeApiHost = false } = {}) {
|
|
169
|
+
const resolvedApiKey = process.env.UNIFORM_CLI_API_KEY ?? // deprecated
|
|
170
|
+
process.env.CANVAS_CLI_API_KEY ?? // deprecated
|
|
171
|
+
process.env.UPM_CLI_API_KEY ?? process.env.UNIFORM_API_KEY;
|
|
172
|
+
let result = yargs.option("apiKey", {
|
|
166
173
|
describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
|
|
167
|
-
default:
|
|
168
|
-
|
|
169
|
-
|
|
174
|
+
default: resolvedApiKey,
|
|
175
|
+
// Mask the resolved key in --help output so the secret is never printed verbatim.
|
|
176
|
+
defaultDescription: resolvedApiKey ? maskApiKey(resolvedApiKey) : void 0,
|
|
170
177
|
demandOption: true,
|
|
171
178
|
type: "string"
|
|
172
179
|
}).option("apiHost", {
|
|
@@ -174,12 +181,16 @@ function withApiOptions(yargs) {
|
|
|
174
181
|
default: process.env.UNIFORM_CLI_BASE_URL || "https://uniform.app",
|
|
175
182
|
demandOption: true,
|
|
176
183
|
type: "string"
|
|
177
|
-
})
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
184
|
+
});
|
|
185
|
+
if (includeEdgeApiHost) {
|
|
186
|
+
result = result.option("edgeApiHost", {
|
|
187
|
+
describe: "Uniform edge host. Defaults to UNIFORM_CLI_BASE_EDGE_URL env var or https://uniform.global. Supports dotenv.",
|
|
188
|
+
default: process.env.UNIFORM_CLI_BASE_EDGE_URL || "https://uniform.global",
|
|
189
|
+
demandOption: true,
|
|
190
|
+
type: "string"
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
return result.option("proxy", {
|
|
183
194
|
describe: "HTTPS proxy to use for Uniform API calls. Defaults to HTTPS_PROXY, https_proxy, ALL_PROXY, or all_proxy env vars (in that order). Supports dotenv.",
|
|
184
195
|
default: process.env.HTTPS_PROXY || process.env.https_proxy || process.env.ALL_PROXY || process.env.all_proxy,
|
|
185
196
|
type: "string"
|
|
@@ -282,6 +293,16 @@ ${e.message}`;
|
|
|
282
293
|
}
|
|
283
294
|
return wrappedFetch;
|
|
284
295
|
}
|
|
296
|
+
function exitOnCliError(error) {
|
|
297
|
+
if (error instanceof ApiClientError) {
|
|
298
|
+
console.error(error.message);
|
|
299
|
+
} else if (error instanceof Error) {
|
|
300
|
+
console.error(error.message);
|
|
301
|
+
} else {
|
|
302
|
+
console.error(String(error));
|
|
303
|
+
}
|
|
304
|
+
process.exit(1);
|
|
305
|
+
}
|
|
285
306
|
function withProjectOptions(yargs) {
|
|
286
307
|
return yargs.option("project", {
|
|
287
308
|
describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
|
|
@@ -539,9 +560,11 @@ export {
|
|
|
539
560
|
package_default,
|
|
540
561
|
CLI_USER_AGENT,
|
|
541
562
|
withConfiguration,
|
|
563
|
+
maskApiKey,
|
|
542
564
|
withApiOptions,
|
|
543
565
|
withDebugOptions,
|
|
544
566
|
nodeFetchProxy,
|
|
567
|
+
exitOnCliError,
|
|
545
568
|
withProjectOptions,
|
|
546
569
|
withTeamOptions,
|
|
547
570
|
withFormatOptions,
|
package/dist/defaultConfig.mjs
CHANGED