@neat.is/core 0.4.8 → 0.4.9
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.js
CHANGED
|
@@ -2848,6 +2848,10 @@ var TransportError = class extends Error {
|
|
|
2848
2848
|
this.name = "TransportError";
|
|
2849
2849
|
}
|
|
2850
2850
|
};
|
|
2851
|
+
function resolveAuthToken(env = process.env) {
|
|
2852
|
+
const t = env.NEAT_AUTH_TOKEN;
|
|
2853
|
+
return t && t.length > 0 ? t : void 0;
|
|
2854
|
+
}
|
|
2851
2855
|
function createHttpClient(baseUrl, bearerToken) {
|
|
2852
2856
|
const root = baseUrl.replace(/\/$/, "");
|
|
2853
2857
|
const authHeader = bearerToken && bearerToken.length > 0 ? { authorization: `Bearer ${bearerToken}` } : {};
|
|
@@ -3464,7 +3468,7 @@ async function runSync(opts) {
|
|
|
3464
3468
|
try {
|
|
3465
3469
|
await pushSnapshotToRemote({
|
|
3466
3470
|
baseUrl: daemonUrl,
|
|
3467
|
-
token:
|
|
3471
|
+
token: resolveAuthToken(),
|
|
3468
3472
|
project: entry2.name,
|
|
3469
3473
|
snapshot
|
|
3470
3474
|
});
|
|
@@ -4217,7 +4221,7 @@ function resolveProjectFlag(parsed) {
|
|
|
4217
4221
|
}
|
|
4218
4222
|
async function runQueryVerb(cmd, parsed) {
|
|
4219
4223
|
const baseUrl = process.env.NEAT_API_URL ?? "http://localhost:8080";
|
|
4220
|
-
const client = createHttpClient(baseUrl);
|
|
4224
|
+
const client = createHttpClient(baseUrl, resolveAuthToken());
|
|
4221
4225
|
const project = resolveProjectFlag(parsed);
|
|
4222
4226
|
const positional = parsed.positional;
|
|
4223
4227
|
let work;
|