bitfab-cli 0.2.435 → 0.2.436

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -31274,6 +31274,13 @@ Run ${platform2.loginHint} to re-authenticate.`);
31274
31274
  }
31275
31275
 
31276
31276
  // ../bitfab-plugin-lib/dist/commands/switchOrg.js
31277
+ async function switchFailureMessage(res) {
31278
+ const body = await res.json().catch(() => null);
31279
+ if (typeof body?.error === "string") {
31280
+ return body.error;
31281
+ }
31282
+ return `Failed to switch organization (HTTP ${res.status})`;
31283
+ }
31277
31284
  async function requestSwitch(serviceUrl, apiKey, authOrganizationId) {
31278
31285
  const res = await fetch(`${serviceUrl}/api/plugin/organizations/switch`, {
31279
31286
  method: "POST",
@@ -31281,13 +31288,10 @@ async function requestSwitch(serviceUrl, apiKey, authOrganizationId) {
31281
31288
  Authorization: `Bearer ${apiKey}`,
31282
31289
  "Content-Type": "application/json"
31283
31290
  },
31284
- body: JSON.stringify({
31285
- authOrganizationId,
31286
- clerkOrganizationId: authOrganizationId
31287
- })
31291
+ body: JSON.stringify({ authOrganizationId })
31288
31292
  });
31289
31293
  if (!res.ok) {
31290
- throw new Error(`Failed to switch organization (HTTP ${res.status})`);
31294
+ throw new Error(await switchFailureMessage(res));
31291
31295
  }
31292
31296
  return await res.json();
31293
31297
  }
@@ -31318,7 +31322,7 @@ async function runSwitchOrg(platform2) {
31318
31322
  emitJson({
31319
31323
  event: "switched",
31320
31324
  status: result.status,
31321
- authOrganizationId: result.authOrganizationId ?? result.clerkOrganizationId ?? target,
31325
+ authOrganizationId: result.authOrganizationId,
31322
31326
  organizationName: result.organizationName,
31323
31327
  apiKey: result.apiKey
31324
31328
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitfab-cli",
3
- "version": "0.2.435",
3
+ "version": "0.2.436",
4
4
  "description": "Install and configure the Bitfab plugin in Claude Code, Codex, or Cursor, or the Bitfab skill pack in Amp (Alpha).",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",