supbuddy 3.2.2 → 3.2.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/dist/bin.js +1 -1
- package/dist/daemon/worker.cjs +28 -6
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -19807,7 +19807,7 @@ function cliBuildKind(env3 = process.env) {
|
|
|
19807
19807
|
return raw === "host" || raw === "npm" ? raw : "dev";
|
|
19808
19808
|
}
|
|
19809
19809
|
function cliVersion(env3 = process.env) {
|
|
19810
|
-
return "3.2.
|
|
19810
|
+
return "3.2.3".trim() || "0.0.0-dev";
|
|
19811
19811
|
}
|
|
19812
19812
|
function isDevBuild(env3) {
|
|
19813
19813
|
return cliBuildKind(env3) === "dev";
|
package/dist/daemon/worker.cjs
CHANGED
|
@@ -44918,8 +44918,11 @@ async function clearCloudSession(dir) {
|
|
|
44918
44918
|
}
|
|
44919
44919
|
async function cloudApiError(res, what) {
|
|
44920
44920
|
const body = await res.json().catch(() => ({}));
|
|
44921
|
-
|
|
44922
|
-
return
|
|
44921
|
+
const err = res.status === 401 ? new Error("Not signed in to Supbuddy Cloud") : new Error(body.error ? `${what} failed: ${body.error}` : `${what} failed (${res.status})`);
|
|
44922
|
+
return Object.assign(err, { status: res.status });
|
|
44923
|
+
}
|
|
44924
|
+
function isUnauthenticated(e) {
|
|
44925
|
+
return typeof e === "object" && e !== null && e.status === 401;
|
|
44923
44926
|
}
|
|
44924
44927
|
function bearerJson(session) {
|
|
44925
44928
|
return { Authorization: `Bearer ${session.accessToken}`, "Content-Type": "application/json" };
|
|
@@ -45101,11 +45104,17 @@ const LIVE_STACK_STATUSES = /* @__PURE__ */ new Set(["provisioning", "booting",
|
|
|
45101
45104
|
function shouldReuseStack(existing, force) {
|
|
45102
45105
|
return !force && existing !== null && LIVE_STACK_STATUSES.has(existing.status);
|
|
45103
45106
|
}
|
|
45104
|
-
async function cloudProjectStatus(cfg, session, stackId) {
|
|
45107
|
+
async function cloudProjectStatus(cfg, session, stackId, onSessionRefreshed) {
|
|
45105
45108
|
const f2 = cfg.fetchImpl ?? fetch;
|
|
45106
|
-
const
|
|
45107
|
-
headers: { Authorization: `Bearer ${
|
|
45109
|
+
const get2 = (token) => f2(`${cfg.apiBase}/api/cloud/stacks/${stackId}`, {
|
|
45110
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
45108
45111
|
});
|
|
45112
|
+
let res = await get2(session.accessToken);
|
|
45113
|
+
if (res.status === 401) {
|
|
45114
|
+
const refreshed = await refreshCloudSession(cfg, session);
|
|
45115
|
+
res = await get2(refreshed.accessToken);
|
|
45116
|
+
if (res.ok) onSessionRefreshed?.(refreshed);
|
|
45117
|
+
}
|
|
45109
45118
|
if (res.status === 404) return null;
|
|
45110
45119
|
if (!res.ok) throw await cloudApiError(res, "Get stack");
|
|
45111
45120
|
const raw = await res.json();
|
|
@@ -45268,7 +45277,20 @@ async function daemonCloudProjectStatus(projectId) {
|
|
|
45268
45277
|
if (!cfg || !currentSession) return { global: global2, project: { cloud: link, stack: null } };
|
|
45269
45278
|
currentSession = await ensureValidSession(cfg, currentSession);
|
|
45270
45279
|
await saveCloudSession(currentSession);
|
|
45271
|
-
|
|
45280
|
+
let stack = null;
|
|
45281
|
+
try {
|
|
45282
|
+
stack = await cloudProjectStatus(cfg, currentSession, link.stackId, (next) => {
|
|
45283
|
+
currentSession = next;
|
|
45284
|
+
void saveCloudSession(next);
|
|
45285
|
+
});
|
|
45286
|
+
} catch (e) {
|
|
45287
|
+
if (isUnauthenticated(e)) {
|
|
45288
|
+
currentSession = null;
|
|
45289
|
+
await clearCloudSession().catch(() => {
|
|
45290
|
+
});
|
|
45291
|
+
return { global: getCloudState(), project: { cloud: link, stack: null } };
|
|
45292
|
+
}
|
|
45293
|
+
}
|
|
45272
45294
|
return { global: global2, project: { cloud: link, stack } };
|
|
45273
45295
|
}
|
|
45274
45296
|
async function daemonCloudTeardownProject(projectId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supbuddy",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "Run multiple Supabase projects at once on custom local domains with HTTPS. A headless CLI and daemon (proxy, DNS, Supabase/Compose lifecycle, MCP) for macOS and Linux.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"supabase",
|