@neat.is/core 0.4.8 → 0.4.10
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/cli.cjs +6 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +6 -2
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -8961,6 +8961,10 @@ var TransportError = class extends Error {
|
|
|
8961
8961
|
this.name = "TransportError";
|
|
8962
8962
|
}
|
|
8963
8963
|
};
|
|
8964
|
+
function resolveAuthToken(env = process.env) {
|
|
8965
|
+
const t = env.NEAT_AUTH_TOKEN;
|
|
8966
|
+
return t && t.length > 0 ? t : void 0;
|
|
8967
|
+
}
|
|
8964
8968
|
function createHttpClient(baseUrl, bearerToken) {
|
|
8965
8969
|
const root = baseUrl.replace(/\/$/, "");
|
|
8966
8970
|
const authHeader = bearerToken && bearerToken.length > 0 ? { authorization: `Bearer ${bearerToken}` } : {};
|
|
@@ -9577,7 +9581,7 @@ async function runSync(opts) {
|
|
|
9577
9581
|
try {
|
|
9578
9582
|
await pushSnapshotToRemote({
|
|
9579
9583
|
baseUrl: daemonUrl,
|
|
9580
|
-
token:
|
|
9584
|
+
token: resolveAuthToken(),
|
|
9581
9585
|
project: entry2.name,
|
|
9582
9586
|
snapshot
|
|
9583
9587
|
});
|
|
@@ -10330,7 +10334,7 @@ function resolveProjectFlag(parsed) {
|
|
|
10330
10334
|
}
|
|
10331
10335
|
async function runQueryVerb(cmd, parsed) {
|
|
10332
10336
|
const baseUrl = process.env.NEAT_API_URL ?? "http://localhost:8080";
|
|
10333
|
-
const client = createHttpClient(baseUrl);
|
|
10337
|
+
const client = createHttpClient(baseUrl, resolveAuthToken());
|
|
10334
10338
|
const project = resolveProjectFlag(parsed);
|
|
10335
10339
|
const positional = parsed.positional;
|
|
10336
10340
|
let work;
|