apiblaze 0.3.5 → 0.3.8

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 +7 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ var import_commander = require("commander");
28
28
  var import_chalk15 = __toESM(require("chalk"));
29
29
 
30
30
  // package.json
31
- var version = "0.3.5";
31
+ var version = "0.3.8";
32
32
 
33
33
  // src/types.ts
34
34
  var ApiError = class extends Error {
@@ -852,8 +852,9 @@ function printTunnelEndpoints(restore, targets) {
852
852
  const label = targets.find((t) => t.projectId === r.projectId)?.projectName ?? r.projectId;
853
853
  console.log(`
854
854
  ${import_chalk4.default.bold(label)}`);
855
- const envs = Object.keys(r.environments ?? {}).filter((e) => isInternalTarget(r.environments[e]?.target));
856
- for (const env of envs.length ? envs : ["dev"]) {
855
+ const internalEnvs = Object.keys(r.environments ?? {}).filter((e) => isInternalTarget(r.environments[e]?.target));
856
+ const envs = internalEnvs.includes("dev") ? ["dev"] : internalEnvs.length ? internalEnvs : ["dev"];
857
+ for (const env of envs) {
857
858
  console.log(` ${import_chalk4.default.dim("API: ")} ${import_chalk4.default.cyan(`https://${r.projectId}.apiblaze.com/${r.apiVersion}/${env}`)}`);
858
859
  }
859
860
  if (r.tenant) {
@@ -1791,6 +1792,7 @@ async function runMcp(projectArg, apiVersionArg, opts) {
1791
1792
  const projectId = match.projectId;
1792
1793
  const apiVersion = apiVersionArg || match.apiVersion;
1793
1794
  const environment = opts.environment || "prod";
1795
+ const mcpHost = match.tenant ? `${projectId}-${match.tenant}` : projectId;
1794
1796
  async function publish(ctx) {
1795
1797
  const spec = ctx.proposal;
1796
1798
  const pub = await agentCall(`/projects/${projectId}/${apiVersion}/mcp/spec`, "PUT", { environment, spec });
@@ -1799,7 +1801,7 @@ async function runMcp(projectArg, apiVersionArg, opts) {
1799
1801
  `));
1800
1802
  return;
1801
1803
  }
1802
- ctx.log(import_chalk14.default.green(` \u2713 Published MCP server \u2014 ${projectId}.mcp.apiblaze.com/${apiVersion}/${environment}.
1804
+ ctx.log(import_chalk14.default.green(` \u2713 Published MCP server \u2014 ${mcpHost}.mcp.apiblaze.com/${apiVersion}/${environment}.
1803
1805
  `));
1804
1806
  }
1805
1807
  await runAgentChatRepl({
@@ -1815,7 +1817,7 @@ async function runMcp(projectArg, apiVersionArg, opts) {
1815
1817
  return `Catalogue ready: ${tools.length} tool(s)${names ? ` \u2014 ${names}${tools.length > 12 ? ", \u2026" : ""}` : ""}.`;
1816
1818
  },
1817
1819
  commands: [
1818
- { name: "publish", describe: `to ${projectId}.mcp.apiblaze.com`, needsProposal: true, run: publish }
1820
+ { name: "publish", describe: `to ${mcpHost}.mcp.apiblaze.com`, needsProposal: true, run: publish }
1819
1821
  ]
1820
1822
  });
1821
1823
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apiblaze",
3
- "version": "0.3.5",
3
+ "version": "0.3.8",
4
4
  "description": "Dev tunnel CLI for APIblaze — route localhost projects through your APIblaze endpoints",
5
5
  "keywords": [
6
6
  "apiblaze",