@vm0/cli 9.83.2 → 9.83.3
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/{chunk-37AJL4NM.js → chunk-IFUYTPFH.js} +15 -37
- package/chunk-IFUYTPFH.js.map +1 -0
- package/index.js +12 -13
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +15 -34
- package/zero.js.map +1 -1
- package/chunk-37AJL4NM.js.map +0 -1
|
@@ -47,7 +47,7 @@ if (DSN) {
|
|
|
47
47
|
Sentry.init({
|
|
48
48
|
dsn: DSN,
|
|
49
49
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
50
|
-
release: "9.83.
|
|
50
|
+
release: "9.83.3",
|
|
51
51
|
sendDefaultPii: false,
|
|
52
52
|
tracesSampleRate: 0,
|
|
53
53
|
shutdownTimeout: 500,
|
|
@@ -66,7 +66,7 @@ if (DSN) {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
Sentry.setContext("cli", {
|
|
69
|
-
version: "9.83.
|
|
69
|
+
version: "9.83.3",
|
|
70
70
|
command: process.argv.slice(2).join(" ")
|
|
71
71
|
});
|
|
72
72
|
Sentry.setContext("runtime", {
|
|
@@ -170,9 +170,16 @@ import { existsSync } from "fs";
|
|
|
170
170
|
function decodeCliTokenPayload(token) {
|
|
171
171
|
const raw = token ?? void 0;
|
|
172
172
|
if (!raw) return void 0;
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
const patPrefix = "vm0_pat_";
|
|
174
|
+
const legacyPrefix = "vm0_sandbox_";
|
|
175
|
+
let jwt;
|
|
176
|
+
if (raw.startsWith(patPrefix)) {
|
|
177
|
+
jwt = raw.slice(patPrefix.length);
|
|
178
|
+
} else if (raw.startsWith(legacyPrefix)) {
|
|
179
|
+
jwt = raw.slice(legacyPrefix.length);
|
|
180
|
+
} else {
|
|
181
|
+
return void 0;
|
|
182
|
+
}
|
|
176
183
|
const parts = jwt.split(".");
|
|
177
184
|
if (parts.length !== 3) return void 0;
|
|
178
185
|
try {
|
|
@@ -237,11 +244,7 @@ async function getActiveOrg() {
|
|
|
237
244
|
const token = await getToken();
|
|
238
245
|
const cliPayload = decodeCliTokenPayload(token);
|
|
239
246
|
if (cliPayload) return cliPayload.orgId;
|
|
240
|
-
|
|
241
|
-
return process.env.VM0_ACTIVE_ORG;
|
|
242
|
-
}
|
|
243
|
-
const config = await loadConfig();
|
|
244
|
-
return config.activeOrg;
|
|
247
|
+
return void 0;
|
|
245
248
|
}
|
|
246
249
|
async function clearConfig() {
|
|
247
250
|
const configFile = getConfigFile();
|
|
@@ -17294,7 +17297,6 @@ function parseSkillFrontmatter(content) {
|
|
|
17294
17297
|
import chalk from "chalk";
|
|
17295
17298
|
|
|
17296
17299
|
// src/lib/api/core/client-factory.ts
|
|
17297
|
-
import { tsRestFetchApi } from "@ts-rest/core";
|
|
17298
17300
|
var ApiRequestError = class extends Error {
|
|
17299
17301
|
constructor(message, code, status) {
|
|
17300
17302
|
super(message);
|
|
@@ -17327,30 +17329,7 @@ async function getClientConfig() {
|
|
|
17327
17329
|
throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
|
|
17328
17330
|
}
|
|
17329
17331
|
const baseHeaders = buildHeaders(token);
|
|
17330
|
-
|
|
17331
|
-
if (jwtPayload) {
|
|
17332
|
-
return { baseUrl, baseHeaders, jsonQuery: false };
|
|
17333
|
-
}
|
|
17334
|
-
const activeOrg = await getActiveOrg();
|
|
17335
|
-
if (!activeOrg) {
|
|
17336
|
-
throw new Error(
|
|
17337
|
-
"No active organization configured. Run: zero org use <slug>"
|
|
17338
|
-
);
|
|
17339
|
-
}
|
|
17340
|
-
return {
|
|
17341
|
-
baseUrl,
|
|
17342
|
-
baseHeaders,
|
|
17343
|
-
jsonQuery: false,
|
|
17344
|
-
api: async (args) => {
|
|
17345
|
-
const [pathPart, queryPart] = args.path.split("?");
|
|
17346
|
-
const params = new URLSearchParams(queryPart ?? "");
|
|
17347
|
-
if (!params.has("org")) {
|
|
17348
|
-
params.set("org", activeOrg);
|
|
17349
|
-
}
|
|
17350
|
-
args.path = params.toString() ? `${pathPart}?${params.toString()}` : pathPart;
|
|
17351
|
-
return tsRestFetchApi(args);
|
|
17352
|
-
}
|
|
17353
|
-
};
|
|
17332
|
+
return { baseUrl, baseHeaders, jsonQuery: false };
|
|
17354
17333
|
}
|
|
17355
17334
|
function handleError(result, defaultMessage) {
|
|
17356
17335
|
const errorBody = result.body;
|
|
@@ -18323,7 +18302,6 @@ async function promptPassword(message) {
|
|
|
18323
18302
|
|
|
18324
18303
|
export {
|
|
18325
18304
|
configureGlobalProxyFromEnv,
|
|
18326
|
-
decodeCliTokenPayload,
|
|
18327
18305
|
decodeZeroTokenPayload,
|
|
18328
18306
|
loadConfig,
|
|
18329
18307
|
saveConfig,
|
|
@@ -18441,4 +18419,4 @@ export {
|
|
|
18441
18419
|
promptSelect,
|
|
18442
18420
|
promptPassword
|
|
18443
18421
|
};
|
|
18444
|
-
//# sourceMappingURL=chunk-
|
|
18422
|
+
//# sourceMappingURL=chunk-IFUYTPFH.js.map
|