@synkro-sh/cli 1.3.27 → 1.3.28
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/bootstrap.js +7 -3
- package/dist/bootstrap.js.map +1 -1
- package/package.json +1 -1
package/dist/bootstrap.js
CHANGED
|
@@ -2373,7 +2373,7 @@ async function refreshToken() {
|
|
|
2373
2373
|
const creds = loadCredentials();
|
|
2374
2374
|
if (!creds?.refresh_token) return false;
|
|
2375
2375
|
try {
|
|
2376
|
-
const response = await fetch(`${
|
|
2376
|
+
const response = await fetch(`${SYNKRO_API_URL}/api/auth/refresh`, {
|
|
2377
2377
|
method: "POST",
|
|
2378
2378
|
headers: { "Content-Type": "application/json" },
|
|
2379
2379
|
body: JSON.stringify({ refresh_token: creds.refresh_token })
|
|
@@ -2382,6 +2382,7 @@ async function refreshToken() {
|
|
|
2382
2382
|
const data = await response.json();
|
|
2383
2383
|
if (data.access_token) {
|
|
2384
2384
|
saveCredentials({
|
|
2385
|
+
...creds,
|
|
2385
2386
|
access_token: data.access_token,
|
|
2386
2387
|
refresh_token: data.refresh_token || creds.refresh_token
|
|
2387
2388
|
});
|
|
@@ -2413,7 +2414,7 @@ function clearCredentials() {
|
|
|
2413
2414
|
unlinkSync2(AUTH_FILE);
|
|
2414
2415
|
}
|
|
2415
2416
|
}
|
|
2416
|
-
var PORT, RAW_WEB_AUTH_URL, SYNKRO_WEB_AUTH_URL, AUTH_FILE, ERROR_HTML, refreshPromise;
|
|
2417
|
+
var PORT, RAW_WEB_AUTH_URL, SYNKRO_WEB_AUTH_URL, AUTH_FILE, RAW_API_URL, SYNKRO_API_URL, ERROR_HTML, refreshPromise;
|
|
2417
2418
|
var init_stub = __esm({
|
|
2418
2419
|
"cli/auth/stub.ts"() {
|
|
2419
2420
|
"use strict";
|
|
@@ -2421,6 +2422,8 @@ var init_stub = __esm({
|
|
|
2421
2422
|
RAW_WEB_AUTH_URL = process.env.SYNKRO_WEB_AUTH_URL;
|
|
2422
2423
|
SYNKRO_WEB_AUTH_URL = RAW_WEB_AUTH_URL && /^https?:\/\//.test(RAW_WEB_AUTH_URL) ? RAW_WEB_AUTH_URL : "https://app.synkro.sh";
|
|
2423
2424
|
AUTH_FILE = process.env.SYNKRO_AUTH_FILE || join3(homedir3(), ".synkro", "credentials.json");
|
|
2425
|
+
RAW_API_URL = process.env.SYNKRO_CRUD_URL || process.env.SYNKRO_API_URL;
|
|
2426
|
+
SYNKRO_API_URL = RAW_API_URL && /^https?:\/\//.test(RAW_API_URL) ? RAW_API_URL : "https://api.synkro.sh";
|
|
2424
2427
|
ERROR_HTML = `
|
|
2425
2428
|
<!DOCTYPE html>
|
|
2426
2429
|
<html>
|
|
@@ -3368,7 +3371,7 @@ function writeConfigEnv(opts) {
|
|
|
3368
3371
|
`SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
|
|
3369
3372
|
`SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
|
|
3370
3373
|
`SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
|
|
3371
|
-
`SYNKRO_VERSION=${shellQuoteSingle("1.3.
|
|
3374
|
+
`SYNKRO_VERSION=${shellQuoteSingle("1.3.28")}`
|
|
3372
3375
|
];
|
|
3373
3376
|
if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
|
|
3374
3377
|
if (safeOrgId) lines.push(`SYNKRO_ORG_ID=${shellQuoteSingle(safeOrgId)}`);
|
|
@@ -4035,6 +4038,7 @@ async function statusCommand() {
|
|
|
4035
4038
|
const gatewayUrl = (config.SYNKRO_GATEWAY_URL || "https://api.synkro.sh").replace(/^['"]|['"]$/g, "");
|
|
4036
4039
|
let serverTier = config.SYNKRO_TIER || "(unset)";
|
|
4037
4040
|
let serverInference = config.SYNKRO_INFERENCE || "fast";
|
|
4041
|
+
await ensureValidToken();
|
|
4038
4042
|
const token = getAccessToken();
|
|
4039
4043
|
if (token) {
|
|
4040
4044
|
try {
|