showpane 0.4.19 → 0.4.20
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
0.4.
|
|
1
|
+
0.4.20
|
package/dist/index.js
CHANGED
|
@@ -1554,11 +1554,18 @@ async function openClaude(args) {
|
|
|
1554
1554
|
async function login() {
|
|
1555
1555
|
printBanner();
|
|
1556
1556
|
ensureShowpaneShim();
|
|
1557
|
+
const config = readShowpaneConfig();
|
|
1557
1558
|
blue("Authenticating with Showpane...");
|
|
1558
1559
|
console.log();
|
|
1559
1560
|
let initRes;
|
|
1560
1561
|
try {
|
|
1561
|
-
initRes = await fetch(`${API_BASE}/api/cli/init`, {
|
|
1562
|
+
initRes = await fetch(`${API_BASE}/api/cli/init`, {
|
|
1563
|
+
method: "POST",
|
|
1564
|
+
headers: { "Content-Type": "application/json" },
|
|
1565
|
+
body: JSON.stringify({
|
|
1566
|
+
orgSlug: typeof config.orgSlug === "string" ? config.orgSlug : ""
|
|
1567
|
+
})
|
|
1568
|
+
});
|
|
1562
1569
|
} catch (errorLike) {
|
|
1563
1570
|
const message = errorLike instanceof Error ? errorLike.message : String(errorLike);
|
|
1564
1571
|
throw new Error(
|
|
@@ -1590,14 +1597,14 @@ async function login() {
|
|
|
1590
1597
|
}
|
|
1591
1598
|
const data = await pollRes.json();
|
|
1592
1599
|
if (data.status !== "approved") continue;
|
|
1593
|
-
const
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
const currentWorkspace = findWorkspaceRoot(process.cwd()) ?? (
|
|
1600
|
+
const config2 = readShowpaneConfig();
|
|
1601
|
+
config2.accessToken = data.accessToken;
|
|
1602
|
+
config2.accessTokenExpiresAt = data.tokenExpiresAt;
|
|
1603
|
+
config2.orgSlug = data.orgSlug;
|
|
1604
|
+
config2.portalUrl = data.portalUrl;
|
|
1605
|
+
const currentWorkspace = findWorkspaceRoot(process.cwd()) ?? (config2.app_path ? findWorkspaceRoot(config2.app_path) ?? resolve(config2.app_path) : null);
|
|
1599
1606
|
if (currentWorkspace) {
|
|
1600
|
-
updateWorkspaceFromConfig(
|
|
1607
|
+
updateWorkspaceFromConfig(config2, currentWorkspace, {
|
|
1601
1608
|
name: basename(currentWorkspace),
|
|
1602
1609
|
deployMode: "cloud",
|
|
1603
1610
|
orgSlug: data.orgSlug
|
|
@@ -1607,9 +1614,9 @@ async function login() {
|
|
|
1607
1614
|
} catch {
|
|
1608
1615
|
}
|
|
1609
1616
|
} else {
|
|
1610
|
-
|
|
1617
|
+
config2.deploy_mode = "cloud";
|
|
1611
1618
|
}
|
|
1612
|
-
writeShowpaneConfig(
|
|
1619
|
+
writeShowpaneConfig(config2);
|
|
1613
1620
|
console.log();
|
|
1614
1621
|
green(`Authenticated! Connected to ${BOLD}${data.orgSlug}${RESET}`);
|
|
1615
1622
|
console.log();
|