@uniformdev/cli 20.50.2-alpha.167 → 20.50.2-alpha.180
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-6GYRC5EF.mjs → chunk-YUQPI3H4.mjs} +29 -46
- package/dist/defaultConfig.mjs +1 -1
- package/dist/index.mjs +825 -1064
- package/package.json +11 -10
|
@@ -17,12 +17,11 @@ import { ApiClientError } from "@uniformdev/canvas";
|
|
|
17
17
|
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
18
18
|
import { dump, load } from "js-yaml";
|
|
19
19
|
import { dirname, extname, isAbsolute, resolve, sep } from "path";
|
|
20
|
-
import { fetch as undiciFetch, ProxyAgent } from "undici";
|
|
21
20
|
|
|
22
21
|
// package.json
|
|
23
22
|
var package_default = {
|
|
24
23
|
name: "@uniformdev/cli",
|
|
25
|
-
version: "20.71.
|
|
24
|
+
version: "20.71.1",
|
|
26
25
|
description: "Uniform command line interface tool",
|
|
27
26
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
28
27
|
main: "./cli.js",
|
|
@@ -50,7 +49,6 @@ var package_default = {
|
|
|
50
49
|
"@inquirer/prompts": "^8.5.2",
|
|
51
50
|
"@thi.ng/mime": "^2.2.23",
|
|
52
51
|
"@uniformdev/assets": "workspace:*",
|
|
53
|
-
"@uniformdev/automations-sdk": "workspace:*",
|
|
54
52
|
"@uniformdev/canvas": "workspace:*",
|
|
55
53
|
"@uniformdev/context": "workspace:*",
|
|
56
54
|
"@uniformdev/files": "workspace:*",
|
|
@@ -67,6 +65,8 @@ var package_default = {
|
|
|
67
65
|
execa: "5.1.1",
|
|
68
66
|
"file-type": "^22.0.1",
|
|
69
67
|
"fs-jetpack": "5.1.0",
|
|
68
|
+
graphql: "17.0.1",
|
|
69
|
+
"graphql-request": "7.4.0",
|
|
70
70
|
"image-size": "2.0.2",
|
|
71
71
|
"isomorphic-git": "1.38.5",
|
|
72
72
|
"js-yaml": "^4.2.0",
|
|
@@ -161,20 +161,12 @@ function withConfiguration(yargs) {
|
|
|
161
161
|
hidden: true
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
function
|
|
165
|
-
|
|
166
|
-
const prefix = separatorIndex > 0 ? apiKey.slice(0, separatorIndex) : apiKey.slice(0, 3);
|
|
167
|
-
return `${prefix}...${apiKey.slice(-4)}`;
|
|
168
|
-
}
|
|
169
|
-
function withApiOptions(yargs, { includeEdgeApiHost = false } = {}) {
|
|
170
|
-
const resolvedApiKey = process.env.UNIFORM_CLI_API_KEY ?? // deprecated
|
|
171
|
-
process.env.CANVAS_CLI_API_KEY ?? // deprecated
|
|
172
|
-
process.env.UPM_CLI_API_KEY ?? process.env.UNIFORM_API_KEY;
|
|
173
|
-
let result = yargs.option("apiKey", {
|
|
164
|
+
function withApiOptions(yargs) {
|
|
165
|
+
return yargs.option("apiKey", {
|
|
174
166
|
describe: "Uniform API key. Defaults to UNIFORM_CLI_API_KEY or UNIFORM_API_KEY env. Supports dotenv.",
|
|
175
|
-
default:
|
|
176
|
-
|
|
177
|
-
|
|
167
|
+
default: process.env.UNIFORM_CLI_API_KEY ?? // deprecated
|
|
168
|
+
process.env.CANVAS_CLI_API_KEY ?? // deprecated
|
|
169
|
+
process.env.UPM_CLI_API_KEY ?? process.env.UNIFORM_API_KEY,
|
|
178
170
|
demandOption: true,
|
|
179
171
|
type: "string"
|
|
180
172
|
}).option("apiHost", {
|
|
@@ -182,16 +174,12 @@ function withApiOptions(yargs, { includeEdgeApiHost = false } = {}) {
|
|
|
182
174
|
default: process.env.UNIFORM_CLI_BASE_URL || "https://uniform.app",
|
|
183
175
|
demandOption: true,
|
|
184
176
|
type: "string"
|
|
185
|
-
})
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
type: "string"
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
return result.option("proxy", {
|
|
177
|
+
}).option("edgeApiHost", {
|
|
178
|
+
describe: "Uniform edge host. Defaults to UNIFORM_CLI_BASE_EDGE_URL env var or https://uniform.global. Supports dotenv.",
|
|
179
|
+
default: process.env.UNIFORM_CLI_BASE_EDGE_URL || "https://uniform.global",
|
|
180
|
+
demandOption: true,
|
|
181
|
+
type: "string"
|
|
182
|
+
}).option("proxy", {
|
|
195
183
|
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.",
|
|
196
184
|
default: process.env.HTTPS_PROXY || process.env.https_proxy || process.env.ALL_PROXY || process.env.all_proxy,
|
|
197
185
|
type: "string"
|
|
@@ -210,6 +198,13 @@ function withDebugOptions(yargs) {
|
|
|
210
198
|
});
|
|
211
199
|
}
|
|
212
200
|
var fetchIndex = 0;
|
|
201
|
+
var undiciModulePromise;
|
|
202
|
+
function loadUndici() {
|
|
203
|
+
if (!undiciModulePromise) {
|
|
204
|
+
undiciModulePromise = import("undici");
|
|
205
|
+
}
|
|
206
|
+
return undiciModulePromise;
|
|
207
|
+
}
|
|
213
208
|
function nodeFetchProxy(proxy, verbose) {
|
|
214
209
|
if (proxy) {
|
|
215
210
|
console.log(`\u{1F991} Using proxy ${proxy}`);
|
|
@@ -235,15 +230,15 @@ ${e.message}`;
|
|
|
235
230
|
throw e;
|
|
236
231
|
};
|
|
237
232
|
if (proxy) {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
233
|
+
return loadUndici().then(({ fetch: undiciFetch, ProxyAgent }) => {
|
|
234
|
+
const wrappedInit = {
|
|
235
|
+
...init,
|
|
236
|
+
dispatcher: new ProxyAgent(proxy)
|
|
237
|
+
};
|
|
238
|
+
return undiciFetch(input, wrappedInit).catch(handleFetchError);
|
|
239
|
+
});
|
|
243
240
|
}
|
|
244
|
-
return
|
|
245
|
-
handleFetchError
|
|
246
|
-
);
|
|
241
|
+
return globalThis.fetch(input, init).catch(handleFetchError);
|
|
247
242
|
};
|
|
248
243
|
const wrappedFetch = createFetchWithRetry(baseFetch, verbose);
|
|
249
244
|
if (verbose) {
|
|
@@ -287,16 +282,6 @@ ${e.message}`;
|
|
|
287
282
|
}
|
|
288
283
|
return wrappedFetch;
|
|
289
284
|
}
|
|
290
|
-
function exitOnCliError(error) {
|
|
291
|
-
if (error instanceof ApiClientError) {
|
|
292
|
-
console.error(error.message);
|
|
293
|
-
} else if (error instanceof Error) {
|
|
294
|
-
console.error(error.message);
|
|
295
|
-
} else {
|
|
296
|
-
console.error(String(error));
|
|
297
|
-
}
|
|
298
|
-
process.exit(1);
|
|
299
|
-
}
|
|
300
285
|
function withProjectOptions(yargs) {
|
|
301
286
|
return yargs.option("project", {
|
|
302
287
|
describe: "Uniform project ID. Defaults to UNIFORM_CLI_PROJECT_ID or UNIFORM_PROJECT_ID env. Supports dotenv.",
|
|
@@ -554,11 +539,9 @@ export {
|
|
|
554
539
|
package_default,
|
|
555
540
|
CLI_USER_AGENT,
|
|
556
541
|
withConfiguration,
|
|
557
|
-
maskApiKey,
|
|
558
542
|
withApiOptions,
|
|
559
543
|
withDebugOptions,
|
|
560
544
|
nodeFetchProxy,
|
|
561
|
-
exitOnCliError,
|
|
562
545
|
withProjectOptions,
|
|
563
546
|
withTeamOptions,
|
|
564
547
|
withFormatOptions,
|
package/dist/defaultConfig.mjs
CHANGED