apiblaze 0.17.8 → 0.17.9
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/index.js +19 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -699,7 +699,7 @@ var import_commander = require("commander");
|
|
|
699
699
|
var import_chalk37 = __toESM(require("chalk"));
|
|
700
700
|
|
|
701
701
|
// package.json
|
|
702
|
-
var version = "0.17.
|
|
702
|
+
var version = "0.17.9";
|
|
703
703
|
|
|
704
704
|
// src/index.ts
|
|
705
705
|
init_types();
|
|
@@ -5060,11 +5060,29 @@ async function provision(spec2, target, opts) {
|
|
|
5060
5060
|
spinner.succeed(`Proxy provisioned${name !== base ? ` as "${name}"` : ""}.`);
|
|
5061
5061
|
break;
|
|
5062
5062
|
} catch (err) {
|
|
5063
|
+
const status = err instanceof ApiError ? err.status : void 0;
|
|
5063
5064
|
const collision = err instanceof ApiError && (err.status === 409 || /exist|taken|available/i.test(err.message));
|
|
5064
5065
|
if (collision && attempt < 3) {
|
|
5065
5066
|
name = `${base}-${salt()}`;
|
|
5066
5067
|
continue;
|
|
5067
5068
|
}
|
|
5069
|
+
if (status === 401) {
|
|
5070
|
+
if (!loggedIn && attempt < 3) {
|
|
5071
|
+
clearAnonCred();
|
|
5072
|
+
continue;
|
|
5073
|
+
}
|
|
5074
|
+
spinner.fail("Provisioning failed.");
|
|
5075
|
+
if (loggedIn) {
|
|
5076
|
+
fail4(
|
|
5077
|
+
"Your login session was rejected \u2014 it may have expired.",
|
|
5078
|
+
"Run `apiblaze login` to refresh, then re-run `apiblaze apichat`."
|
|
5079
|
+
);
|
|
5080
|
+
}
|
|
5081
|
+
fail4(
|
|
5082
|
+
"Could not start an anonymous workspace right now.",
|
|
5083
|
+
"Try again in a moment, or run `apiblaze login` to chat with your account."
|
|
5084
|
+
);
|
|
5085
|
+
}
|
|
5068
5086
|
spinner.fail("Provisioning failed.");
|
|
5069
5087
|
if (collision) fail4(`A proxy named "${name}" already exists.`, "Re-run with --name <other>.");
|
|
5070
5088
|
throw err;
|