apiblaze 0.4.7 → 0.4.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 +7 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var import_commander = require("commander");
|
|
|
28
28
|
var import_chalk27 = __toESM(require("chalk"));
|
|
29
29
|
|
|
30
30
|
// package.json
|
|
31
|
-
var version = "0.4.
|
|
31
|
+
var version = "0.4.9";
|
|
32
32
|
|
|
33
33
|
// src/types.ts
|
|
34
34
|
var ApiError = class extends Error {
|
|
@@ -855,7 +855,7 @@ function printTunnelEndpoints(restore, targets) {
|
|
|
855
855
|
const internalEnvs = Object.keys(r.environments ?? {}).filter((e) => isInternalTarget(r.environments[e]?.target));
|
|
856
856
|
const envs = internalEnvs.includes("dev") ? ["dev"] : internalEnvs.length ? internalEnvs : ["dev"];
|
|
857
857
|
for (const env of envs) {
|
|
858
|
-
console.log(` ${import_chalk4.default.dim("API: ")} ${import_chalk4.default.cyan(`https://${r.projectId}.
|
|
858
|
+
console.log(` ${import_chalk4.default.dim("API: ")} ${import_chalk4.default.cyan(`https://${r.projectId}.abz.run/${r.apiVersion}/${env}/`)}`);
|
|
859
859
|
}
|
|
860
860
|
if (r.tenant) {
|
|
861
861
|
console.log(` ${import_chalk4.default.dim("Portal:")} ${import_chalk4.default.cyan(`https://${r.tenant}.portal.apiblaze.com/${r.apiVersion}`)}`);
|
|
@@ -1165,7 +1165,7 @@ async function runCreate(opts = {}) {
|
|
|
1165
1165
|
const { rawName } = await inquirer2.prompt([{
|
|
1166
1166
|
type: "input",
|
|
1167
1167
|
name: "rawName",
|
|
1168
|
-
message: "Proxy name (your API will live at <name>.
|
|
1168
|
+
message: "Proxy name (your API will live at <name>.abz.run):",
|
|
1169
1169
|
transformer: (v) => normalizeName(v)
|
|
1170
1170
|
}]);
|
|
1171
1171
|
name = normalizeName(rawName);
|
|
@@ -1186,7 +1186,7 @@ async function runCreate(opts = {}) {
|
|
|
1186
1186
|
spinner2.stop();
|
|
1187
1187
|
console.log(import_chalk6.default.dim(" (could not verify availability; continuing)"));
|
|
1188
1188
|
}
|
|
1189
|
-
console.log(`${import_chalk6.default.cyan("\u2192")} Your API will live at ${import_chalk6.default.bold(`https://${name}.
|
|
1189
|
+
console.log(`${import_chalk6.default.cyan("\u2192")} Your API will live at ${import_chalk6.default.bold(`https://${name}.abz.run`)}
|
|
1190
1190
|
`);
|
|
1191
1191
|
break;
|
|
1192
1192
|
}
|
|
@@ -1241,7 +1241,7 @@ async function runCreate(opts = {}) {
|
|
|
1241
1241
|
const version2 = result.api_version || "1.0.0";
|
|
1242
1242
|
const keys = result.api_keys ?? {};
|
|
1243
1243
|
const adminKey = keys.dev ?? Object.values(keys)[0];
|
|
1244
|
-
const proxyUrl = `https://${name}.
|
|
1244
|
+
const proxyUrl = `https://${name}.abz.run/${version2}/dev`;
|
|
1245
1245
|
const devPortal = result.devPortal ? stripTenantFromPortal(result.devPortal) : void 0;
|
|
1246
1246
|
if (opts.json) {
|
|
1247
1247
|
process.stdout.write(JSON.stringify({
|
|
@@ -2589,7 +2589,7 @@ var TOOLS = [
|
|
|
2589
2589
|
const version2 = res.api_version || "1.0.0";
|
|
2590
2590
|
const keys = res.api_keys ?? {};
|
|
2591
2591
|
const key = keys.dev ?? Object.values(keys)[0];
|
|
2592
|
-
const url = `https://${a.name}.
|
|
2592
|
+
const url = `https://${a.name}.abz.run/${version2}/dev`;
|
|
2593
2593
|
const tryIt = buildTryItCurl(url, auth, key);
|
|
2594
2594
|
const lines = [` ${import_chalk24.default.dim("Proxy URL:")} ${import_chalk24.default.bold(url)}`];
|
|
2595
2595
|
if (res.devPortal) lines.push(` ${import_chalk24.default.dim("Dev portal:")} ${res.devPortal}`);
|
|
@@ -3009,7 +3009,7 @@ program.command("login").description("Authenticate with APIblaze").action(async
|
|
|
3009
3009
|
process.exit(1);
|
|
3010
3010
|
}
|
|
3011
3011
|
});
|
|
3012
|
-
program.command("create").description("Create a new API proxy (no login needed \u2014 without auth it creates an anonymous proxy and prints a claim URL)").option("--name <name>", "Proxy name (becomes <name>.
|
|
3012
|
+
program.command("create").description("Create a new API proxy (no login needed \u2014 without auth it creates an anonymous proxy and prints a claim URL)").option("--name <name>", "Proxy name (becomes <name>.abz.run)").option("--target <url>", "Target URL to forward requests to").option("--team <id|name>", "Team to create under (defaults to your active team)").option("--auth <type>", "Auth type: api_key | none | oauth", "api_key").option("--apiversion <version>", "API version to create (e.g. 2.0.0). Creating a new version of a proxy you own adds a version to the existing project.").option("--product <slug>", "Product tag to group this project under in the portal (team-scoped; anonymous create). Defaults to your team's existing/placeholder tag.").option("--display-name <name>", "Human-friendly display name").option("--subdomain <slug>", "Explicit subdomain (defaults to --name)").option("--config <file>", "JSON file with the full request body (anonymous create): requests_auth, login providers + client/server token types, scopes, callback URLs, etc. See apiblaze_anonymous.yaml. Flags override its fields.").option("-y, --yes", "Skip the confirmation prompt").option("--json", "Output machine-readable JSON (non-interactive)").action(async (opts) => {
|
|
3013
3013
|
try {
|
|
3014
3014
|
await runCreate(opts);
|
|
3015
3015
|
} catch (err) {
|