@uniformdev/cli 20.50.2-alpha.117 → 20.50.2-alpha.149
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-KJOJNPDF.mjs → chunk-7P2U2VCH.mjs} +25 -6
- package/dist/defaultConfig.mjs +1 -1
- package/dist/index.mjs +850 -541
- package/package.json +10 -11
|
@@ -22,7 +22,7 @@ import { fetch as undiciFetch, ProxyAgent } from "undici";
|
|
|
22
22
|
// package.json
|
|
23
23
|
var package_default = {
|
|
24
24
|
name: "@uniformdev/cli",
|
|
25
|
-
version: "20.
|
|
25
|
+
version: "20.68.0",
|
|
26
26
|
description: "Uniform command line interface tool",
|
|
27
27
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
28
28
|
main: "./cli.js",
|
|
@@ -50,6 +50,7 @@ var package_default = {
|
|
|
50
50
|
"@inquirer/prompts": "^7.10.1",
|
|
51
51
|
"@thi.ng/mime": "^2.2.23",
|
|
52
52
|
"@uniformdev/assets": "workspace:*",
|
|
53
|
+
"@uniformdev/automations-sdk": "workspace:*",
|
|
53
54
|
"@uniformdev/canvas": "workspace:*",
|
|
54
55
|
"@uniformdev/context": "workspace:*",
|
|
55
56
|
"@uniformdev/files": "workspace:*",
|
|
@@ -66,8 +67,6 @@ var package_default = {
|
|
|
66
67
|
execa: "5.1.1",
|
|
67
68
|
"file-type": "^21.3.2",
|
|
68
69
|
"fs-jetpack": "5.1.0",
|
|
69
|
-
graphql: "16.9.0",
|
|
70
|
-
"graphql-request": "6.1.0",
|
|
71
70
|
"image-size": "2.0.2",
|
|
72
71
|
"isomorphic-git": "1.35.0",
|
|
73
72
|
"js-yaml": "^4.1.0",
|
|
@@ -163,12 +162,20 @@ function withConfiguration(yargs) {
|
|
|
163
162
|
hidden: true
|
|
164
163
|
});
|
|
165
164
|
}
|
|
165
|
+
function maskApiKey(apiKey) {
|
|
166
|
+
const separatorIndex = apiKey.indexOf("1");
|
|
167
|
+
const prefix = separatorIndex > 0 ? apiKey.slice(0, separatorIndex) : apiKey.slice(0, 3);
|
|
168
|
+
return `${prefix}...${apiKey.slice(-4)}`;
|
|
169
|
+
}
|
|
166
170
|
function withApiOptions(yargs) {
|
|
171
|
+
const resolvedApiKey = process.env.UNIFORM_CLI_API_KEY ?? // deprecated
|
|
172
|
+
process.env.CANVAS_CLI_API_KEY ?? // deprecated
|
|
173
|
+
process.env.UPM_CLI_API_KEY ?? process.env.UNIFORM_API_KEY;
|
|
167
174
|
return yargs.option("apiKey", {
|
|
168
175
|
describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
|
|
169
|
-
default:
|
|
170
|
-
|
|
171
|
-
|
|
176
|
+
default: resolvedApiKey,
|
|
177
|
+
// Mask the resolved key in --help output so the secret is never printed verbatim.
|
|
178
|
+
defaultDescription: resolvedApiKey ? maskApiKey(resolvedApiKey) : void 0,
|
|
172
179
|
demandOption: true,
|
|
173
180
|
type: "string"
|
|
174
181
|
}).option("apiHost", {
|
|
@@ -277,6 +284,16 @@ ${e.message}`;
|
|
|
277
284
|
}
|
|
278
285
|
return wrappedFetch;
|
|
279
286
|
}
|
|
287
|
+
function exitOnCliError(error) {
|
|
288
|
+
if (error instanceof ApiClientError) {
|
|
289
|
+
console.error(error.message);
|
|
290
|
+
} else if (error instanceof Error) {
|
|
291
|
+
console.error(error.message);
|
|
292
|
+
} else {
|
|
293
|
+
console.error(String(error));
|
|
294
|
+
}
|
|
295
|
+
process.exit(1);
|
|
296
|
+
}
|
|
280
297
|
function withProjectOptions(yargs) {
|
|
281
298
|
return yargs.option("project", {
|
|
282
299
|
describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
|
|
@@ -534,9 +551,11 @@ export {
|
|
|
534
551
|
package_default,
|
|
535
552
|
CLI_USER_AGENT,
|
|
536
553
|
withConfiguration,
|
|
554
|
+
maskApiKey,
|
|
537
555
|
withApiOptions,
|
|
538
556
|
withDebugOptions,
|
|
539
557
|
nodeFetchProxy,
|
|
558
|
+
exitOnCliError,
|
|
540
559
|
withProjectOptions,
|
|
541
560
|
withTeamOptions,
|
|
542
561
|
withFormatOptions,
|
package/dist/defaultConfig.mjs
CHANGED