apiblaze 0.21.64 → 0.21.66

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 +103 -63
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__
34
34
  var version;
35
35
  var init_package = __esm({
36
36
  "package.json"() {
37
- version = "0.21.64";
37
+ version = "0.21.66";
38
38
  }
39
39
  });
40
40
 
@@ -7072,7 +7072,7 @@ __export(agent_exports, {
7072
7072
  });
7073
7073
  async function callAgent(messages, teamId) {
7074
7074
  const token = getAccessToken();
7075
- const res = await fetch(`${DASHBOARD_BASE6}/api/cli/agent`, {
7075
+ const res = await fetch(`${DASHBOARD_BASE7}/api/cli/agent`, {
7076
7076
  method: "POST",
7077
7077
  headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` },
7078
7078
  body: JSON.stringify({ messages: messages.slice(-20), tools: toolCatalogue(), team_id: teamId })
@@ -7167,7 +7167,7 @@ async function runAgent(opts) {
7167
7167
  }
7168
7168
  console.log(import_chalk25.default.dim("\nBye."));
7169
7169
  }
7170
- var import_chalk25, import_ora9, DASHBOARD_BASE6, MAX_TOOL_STEPS;
7170
+ var import_chalk25, import_ora9, DASHBOARD_BASE7, MAX_TOOL_STEPS;
7171
7171
  var init_agent = __esm({
7172
7172
  "src/commands/agent.ts"() {
7173
7173
  "use strict";
@@ -7181,7 +7181,7 @@ var init_agent = __esm({
7181
7181
  init_types();
7182
7182
  init_problem();
7183
7183
  init_brand();
7184
- DASHBOARD_BASE6 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
7184
+ DASHBOARD_BASE7 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
7185
7185
  MAX_TOOL_STEPS = 6;
7186
7186
  }
7187
7187
  });
@@ -7719,7 +7719,7 @@ var init_exercise = __esm({
7719
7719
  // src/commands/connector-exercise.ts
7720
7720
  var connector_exercise_exports = {};
7721
7721
  __export(connector_exercise_exports, {
7722
- DASHBOARD_BASE: () => DASHBOARD_BASE7,
7722
+ DASHBOARD_BASE: () => DASHBOARD_BASE8,
7723
7723
  RUN_HEADER: () => RUN_HEADER,
7724
7724
  RUN_META_KEY: () => RUN_META_KEY,
7725
7725
  reportLink: () => reportLink,
@@ -7727,7 +7727,7 @@ __export(connector_exercise_exports, {
7727
7727
  runConnectorExercise: () => runConnectorExercise
7728
7728
  });
7729
7729
  function reportLink(projectId, apiVersion = "1.0.0") {
7730
- return `${DASHBOARD_BASE7}/directory/${encodeURIComponent(projectId)}/${encodeURIComponent(apiVersion)}`;
7730
+ return `${DASHBOARD_BASE8}/directory/${encodeURIComponent(projectId)}/${encodeURIComponent(apiVersion)}`;
7731
7731
  }
7732
7732
  async function confirm(message, interactive2) {
7733
7733
  if (!interactive2) return false;
@@ -7754,9 +7754,9 @@ async function runConnectorExercise(project, opts = {}) {
7754
7754
  const target2 = r.target ?? {};
7755
7755
  const tools = orderTools(target2.tools ?? []);
7756
7756
  const publishedUrl = r.report.project.publishedUrl;
7757
- if (!publishedUrl) throw new Error(`${proj2.projectName} has no published MCP URL yet (run \`${B.cli} connector ${proj2.projectName}\` first).`);
7757
+ if (!publishedUrl) throw new Error(`${proj2.projectName} has no published MCP URL yet (run \`${B.cli} connector ${proj2.projectId}\` first).`);
7758
7758
  if (!tools.length) throw new Error(`${proj2.projectName} exposes no tools to exercise.`);
7759
- if (target2.project?.directoryReady === false) throw new Error(`Directory-ready mode is off for ${proj2.projectName} v${proj2.apiVersion}: nothing is recorded and the sign-in door is shut. Turn it on first (\`${B.cli} connector ${proj2.projectName}\`, or the switch on the dashboard) and run again.`);
7759
+ if (target2.project?.directoryReady === false) throw new Error(`Directory-ready mode is off for ${proj2.projectName} v${proj2.apiVersion}: nothing is recorded and the sign-in door is shut. Turn it on first (\`${B.cli} connector ${proj2.projectId}\`, or the switch on the dashboard) and run again.`);
7760
7760
  const open = target2.project?.authMode === "open";
7761
7761
  const opened = await producer(caller, { method: "POST", path: `${projectPath2(proj2)}/directory-runs`, body: { runner: "cli-direct" }, summary: "Open an exercise run" });
7762
7762
  const runId2 = opened.run.run_id;
@@ -7769,7 +7769,7 @@ async function runConnectorExercise(project, opts = {}) {
7769
7769
  if (!open) {
7770
7770
  const packet = await producer(caller, { method: "GET", path: `${projectPath2(proj2)}/directory-packet?probe=0&force=1`, summary: "Reviewer account (for the login)" });
7771
7771
  const acct = packet.json?.test_account ?? null;
7772
- if (!acct) throw new Error(`No reviewer account on ${proj2.projectName}: create it first (\`${B.cli} connector reviewer ${proj2.projectName}\`), or declare open mode for public read-only data.`);
7772
+ if (!acct) throw new Error(`No reviewer account on ${proj2.projectName}: create it first (\`${B.cli} connector reviewer ${proj2.projectId}\`), or declare open mode for public read-only data.`);
7773
7773
  const login = await headlessPasswordLogin({ mcpUrl: publishedUrl, username: acct.username, password: acct.password }, deps);
7774
7774
  if (!login.accessToken) throw new Error(`The reviewer could not sign in at ${login.failedAt}: ${login.detail}. Fix the sign-in and run again.`);
7775
7775
  bearer = login.accessToken;
@@ -7852,7 +7852,7 @@ async function runConnectorExercise(project, opts = {}) {
7852
7852
  await revokeToken(asMeta, bearer, void 0, deps).catch(() => false);
7853
7853
  }
7854
7854
  }
7855
- r = await fetchDirectoryReport(caller, proj2, { publishedUrl });
7855
+ r = await fetchDirectoryReport(caller, proj2, { publishedUrl, ...opts.platforms ? { platforms: opts.platforms } : {} });
7856
7856
  const verdicts = r.report.verdicts ?? null;
7857
7857
  const closed = await producer(caller, { method: "PATCH", path: `${projectPath2(proj2)}/directory-runs/${encodeURIComponent(runId2)}`, body: { verdicts, scores: verdicts?.groups ?? null, notes, runner: "cli-direct", ...opts.noEmail ? { email: false } : {} }, summary: "Close the exercise run" });
7858
7858
  if (json) {
@@ -7860,7 +7860,7 @@ async function runConnectorExercise(project, opts = {}) {
7860
7860
  return;
7861
7861
  }
7862
7862
  console.log();
7863
- printReport(r, false);
7863
+ if (opts.report !== false) printReport(r, false);
7864
7864
  console.log(import_chalk27.default.cyan(` Report: ${reportLink(proj2.projectId, proj2.apiVersion)}`));
7865
7865
  console.log(import_chalk27.default.dim(opts.noEmail ? " (no email for this run)" : closed?.emailed ? " (the result was emailed to you; --no-email or the project setting turns it off)" : " (no email: the run has no address to send to)"));
7866
7866
  }
@@ -7900,20 +7900,30 @@ async function runConnectorAnswers(project, opts = {}) {
7900
7900
  const current = await producer(caller, { method: "POST", path: `${projectPath2(proj2)}/directory-report`, body: { probe: false }, summary: "Current answers" });
7901
7901
  const have = current.target?.metadata?.portalAnswers ?? {};
7902
7902
  const { default: inquirer3 } = await import("inquirer");
7903
+ const saveNow = async (part) => {
7904
+ try {
7905
+ await producer(caller, { method: "PATCH", path: projectPath2(proj2), body: part, summary: "Save an answer" });
7906
+ } catch (e) {
7907
+ console.log(import_chalk27.default.yellow(` not saved: ${e instanceof Error ? e.message : String(e)}`));
7908
+ }
7909
+ };
7903
7910
  for (const q of QUESTIONS) {
7904
7911
  if (answers[q.field] !== void 0) continue;
7905
7912
  const existing = typeof have[q.field] === "string" ? String(have[q.field]) : "";
7906
7913
  if (existing.length >= (q.min ?? 1)) continue;
7907
7914
  const a = await inquirer3.prompt([{ type: "input", name: "value", message: q.message, default: existing || void 0, validate: (v) => v.trim().length >= (q.min ?? 1) ? true : `${q.min ?? 1}+ characters` }]);
7908
7915
  answers[q.field] = a.value.trim();
7916
+ await saveNow({ directory_portal_answers: { [q.field]: a.value.trim() } });
7909
7917
  }
7910
7918
  if (answers.access === void 0 && !have.access) {
7911
7919
  const a = await inquirer3.prompt([{ type: "list", name: "value", message: "What the tools do:", choices: ["read", "write", "both"] }]);
7912
7920
  answers.access = a.value;
7921
+ await saveNow({ directory_portal_answers: { access: a.value } });
7913
7922
  }
7914
7923
  if (answers.categories === void 0 && !(Array.isArray(have.categories) && have.categories.length)) {
7915
7924
  const a = await inquirer3.prompt([{ type: "input", name: "value", message: "Category suggestions (1\u20135, comma-separated; you pick the closest in the portal):", validate: (v) => v.trim() ? true : "one at least" }]);
7916
7925
  answers.categories = a.value.split(",").map((c) => c.trim()).filter(Boolean).slice(0, 5);
7926
+ await saveNow({ directory_portal_answers: { categories: answers.categories } });
7917
7927
  }
7918
7928
  if (!meta.data_handling && !current.target?.metadata?.dataHandling) {
7919
7929
  const a = await inquirer3.prompt([
@@ -7921,14 +7931,17 @@ async function runConnectorAnswers(project, opts = {}) {
7921
7931
  { type: "input", name: "statement", message: "The permission you hold (who granted what, and when; goes into portal step 7):", when: (ans) => ans.mode === "proxied", validate: (v) => v.trim().length >= 20 ? true : "a sentence, please" }
7922
7932
  ]);
7923
7933
  meta.data_handling = { mode: a.mode, ...a.statement?.trim() ? { statement: a.statement.trim() } : {} };
7934
+ await saveNow({ directory_metadata: { data_handling: meta.data_handling } });
7924
7935
  }
7925
7936
  if (!meta.health_data && !current.target?.metadata?.healthData) {
7926
7937
  const a = await inquirer3.prompt([{ type: "confirm", name: "value", message: "Do the tools handle health data?", default: false }]);
7927
7938
  meta.health_data = a.value ? "yes" : "no";
7939
+ await saveNow({ directory_metadata: { health_data: meta.health_data } });
7928
7940
  }
7929
7941
  if (!meta.sponsored_content && !current.target?.metadata?.sponsoredContent) {
7930
7942
  const a = await inquirer3.prompt([{ type: "confirm", name: "value", message: "Do tool results carry sponsored content?", default: false }]);
7931
7943
  meta.sponsored_content = a.value ? "yes" : "no";
7944
+ await saveNow({ directory_metadata: { sponsored_content: meta.sponsored_content } });
7932
7945
  }
7933
7946
  }
7934
7947
  const body = {};
@@ -7948,7 +7961,7 @@ async function runConnectorAnswers(project, opts = {}) {
7948
7961
  console.log(import_chalk27.default.green(` \u2713 recorded: ${Object.keys({ ...answers, ...meta }).join(", ")}`));
7949
7962
  console.log(import_chalk27.default.dim(` ${r.rendered.headline}`));
7950
7963
  }
7951
- var import_chalk27, import_fs6, import_os3, import_path5, import_child_process6, DASHBOARD_BASE7, RUN_META_KEY, RUN_HEADER, projectPath2, QUESTIONS;
7964
+ var import_chalk27, import_fs6, import_os3, import_path5, import_child_process6, DASHBOARD_BASE8, RUN_META_KEY, RUN_HEADER, projectPath2, QUESTIONS;
7952
7965
  var init_connector_exercise = __esm({
7953
7966
  "src/commands/connector-exercise.ts"() {
7954
7967
  "use strict";
@@ -7964,7 +7977,7 @@ var init_connector_exercise = __esm({
7964
7977
  init_exercise();
7965
7978
  init_brand();
7966
7979
  init_external_mcp();
7967
- DASHBOARD_BASE7 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
7980
+ DASHBOARD_BASE8 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
7968
7981
  RUN_META_KEY = "com.apiblaze/run";
7969
7982
  RUN_HEADER = "apiblaze-directory-run";
7970
7983
  projectPath2 = (p) => `/projects/${encodeURIComponent(p.projectId)}/${encodeURIComponent(p.apiVersion)}`;
@@ -11578,6 +11591,31 @@ Not ready: ${lines.length} blocker${lines.length === 1 ? "" : "s"} (${r.rendered
11578
11591
  process.exit(1);
11579
11592
  }
11580
11593
 
11594
+ // src/lib/op-call.ts
11595
+ init_auth();
11596
+ init_trace();
11597
+ init_types();
11598
+ var DASHBOARD_BASE6 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
11599
+ async function opCall(call3) {
11600
+ const token = getAccessToken();
11601
+ const res = await fetch(`${DASHBOARD_BASE6}/api/cli/op`, {
11602
+ method: "POST",
11603
+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` },
11604
+ body: JSON.stringify({ path: call3.path, method: call3.method, body: call3.body })
11605
+ });
11606
+ let data = null;
11607
+ try {
11608
+ data = await res.json();
11609
+ } catch {
11610
+ }
11611
+ recordCall({ method: call3.method, path: call3.path, body: call3.body, status: res.status, summary: call3.summary });
11612
+ if (!res.ok) {
11613
+ const msg = data?.details ?? data?.error ?? res.statusText;
11614
+ throw new ApiError(res.status, typeof msg === "string" ? msg : JSON.stringify(msg), data);
11615
+ }
11616
+ return data;
11617
+ }
11618
+
11581
11619
  // src/commands/connector.ts
11582
11620
  var import_fs8 = __toESM(require("fs"));
11583
11621
  var import_path6 = __toESM(require("path"));
@@ -12219,21 +12257,12 @@ async function runConnector(target2, opts) {
12219
12257
  }
12220
12258
  r = await fetchDirectoryReport(caller, proj2, { platforms });
12221
12259
  }
12222
- if (!readyExceptSnapshot(r, platforms)) {
12223
- printReport(r, json);
12224
- if (!domain2.active && domain2.hostname && !json) {
12225
- console.error(import_chalk30.default.yellow(`
12226
- ${domain2.hostname} is not active yet. Once the CNAME is in place, run again: ${B.cli} connector ${proj2.projectName}`));
12227
- }
12228
- exitNotReady(r, platforms, json);
12260
+ if (interactive2 && r.report.results.some((x) => ANSWER_RULES.includes(x.id) && !x.pass)) {
12261
+ const { runConnectorAnswers: runConnectorAnswers2 } = await Promise.resolve().then(() => (init_connector_exercise(), connector_exercise_exports));
12262
+ say(import_chalk30.default.bold(" The review answers the portal asks for (saved as you go):"));
12263
+ await runConnectorAnswers2(proj2.projectName, { team: opts.team, apiversion: opts.apiversion });
12264
+ r = await fetchDirectoryReport(caller, proj2, { platforms });
12229
12265
  }
12230
- r = await fetchDirectoryReport(caller, proj2, { platforms, refreshSnapshot: true, publishedUrl: r.report.project.publishedUrl ?? null });
12231
- const packet = await producer(caller, { method: "GET", path: `${projectPath3(proj2)}/directory-packet`, summary: "Submission packet" });
12232
- const dir = opts.out ?? process.cwd();
12233
- const mdPath = import_path6.default.join(dir, `connector-packet-${proj2.projectId}.md`);
12234
- const jsonPath = import_path6.default.join(dir, `connector-packet-${proj2.projectId}.json`);
12235
- import_fs8.default.writeFileSync(mdPath, packet.markdown, { mode: 384 });
12236
- import_fs8.default.writeFileSync(jsonPath, JSON.stringify(packet.json, null, 2) + "\n", { mode: 384 });
12237
12266
  if (opts.exercise !== false) {
12238
12267
  let run2 = !!opts.yes;
12239
12268
  if (interactive2) {
@@ -12242,10 +12271,24 @@ async function runConnector(target2, opts) {
12242
12271
  }
12243
12272
  if (run2) {
12244
12273
  const { runConnectorExercise: runConnectorExercise2 } = await Promise.resolve().then(() => (init_connector_exercise(), connector_exercise_exports));
12245
- await runConnectorExercise2(proj2.projectName, { team: opts.team, apiversion: opts.apiversion, json, yes: opts.yes, noEmail: opts.email === false });
12274
+ await runConnectorExercise2(proj2.projectName, { team: opts.team, apiversion: opts.apiversion, json, yes: opts.yes, noEmail: opts.email === false, report: false, platforms: [...platforms] });
12246
12275
  r = await fetchDirectoryReport(caller, proj2, { platforms, publishedUrl: r.report.project.publishedUrl ?? null });
12247
12276
  }
12248
12277
  }
12278
+ if (!readyExceptSnapshot(r, platforms)) {
12279
+ if (!domain2.active && domain2.hostname && !json) {
12280
+ console.error(import_chalk30.default.yellow(`
12281
+ ${domain2.hostname} is not active yet. Once the CNAME is in place, run again: ${B.cli} connector ${proj2.projectId}`));
12282
+ }
12283
+ exitWithReport(r, proj2, platforms, json, interactive2);
12284
+ }
12285
+ r = await fetchDirectoryReport(caller, proj2, { platforms, refreshSnapshot: true, publishedUrl: r.report.project.publishedUrl ?? null });
12286
+ const packet = await producer(caller, { method: "GET", path: `${projectPath3(proj2)}/directory-packet`, summary: "Submission packet" });
12287
+ const dir = opts.out ?? process.cwd();
12288
+ const mdPath = import_path6.default.join(dir, `connector-packet-${proj2.projectId}.md`);
12289
+ const jsonPath = import_path6.default.join(dir, `connector-packet-${proj2.projectId}.json`);
12290
+ import_fs8.default.writeFileSync(mdPath, packet.markdown, { mode: 384 });
12291
+ import_fs8.default.writeFileSync(jsonPath, JSON.stringify(packet.json, null, 2) + "\n", { mode: 384 });
12249
12292
  if (json) {
12250
12293
  process.stdout.write(JSON.stringify({ ready: true, project: proj2.projectId, headline: r.rendered.headline, report: r.report, packet: { markdown: mdPath, json: jsonPath }, portals: PORTALS, ...reviewer ? { reviewer } : {} }) + "\n");
12251
12294
  return;
@@ -12264,6 +12307,25 @@ async function runConnector(target2, opts) {
12264
12307
  console.log(import_chalk30.default.dim(` ${r.report.disclaimer}`));
12265
12308
  }
12266
12309
  var SNAPSHOT_RULE = "LISTING_SNAPSHOT_MATCH";
12310
+ var ANSWER_RULES = ["PORTAL_ANSWERS_COMPLETE", "HEALTH_SPONSORED_DECLARED", "API_OWNERSHIP_DOMAIN"];
12311
+ function exitWithReport(r, proj2, platforms, json, interactive2 = false) {
12312
+ if (json) {
12313
+ process.stdout.write(JSON.stringify({ ready: false, project: proj2.projectId, headline: r.rendered.headline, report: r.report }) + "\n");
12314
+ process.exit(1);
12315
+ }
12316
+ printReport(r, false);
12317
+ const want = platforms;
12318
+ const blocking = r.report.results.filter((x) => !x.pass && x.severity === "block" && !x.unverified && x.platforms.some((p) => want.includes(p)));
12319
+ const real = blocking.filter((x) => x.id !== SNAPSHOT_RULE);
12320
+ const first = real.find((x) => x.tier !== "review") ?? real[0] ?? blocking[0];
12321
+ console.error(import_chalk30.default.red(`
12322
+ Not ready: ${blocking.length} blocker${blocking.length === 1 ? "" : "s"} (${blocking.map((x) => x.id).join(", ")}).`));
12323
+ const name = proj2.projectId;
12324
+ if (!interactive2 && real.some((x) => ANSWER_RULES.includes(x.id))) console.error(` Next: the review answers \u2014 run \`${B.cli} connector ${name}\` in a terminal (it asks them), or pass them: \`${B.cli} connector answers ${name} --use-cases \u2026 --data-handling own --health-data no --sponsored-content no\`.`);
12325
+ else if (first) console.error(` Next: ${first.fix ?? first.message ?? first.title}`);
12326
+ console.error(import_chalk30.default.dim(` Report page: ${DASHBOARD_BASE6}/directory/${encodeURIComponent(proj2.projectId)}/${encodeURIComponent(proj2.apiVersion)}`));
12327
+ process.exit(1);
12328
+ }
12267
12329
  var TOOL_DESC_RULE = "TOOL_DESC_NONEMPTY_SPECIFIC";
12268
12330
  var UTILITY_PATH = /(health|ping|status|openapi|swagger|docs|spec|whoami|version)/i;
12269
12331
  var SPECIFIC_MIN = 12;
@@ -12323,10 +12385,13 @@ async function fixToolDescriptions(proj2, environment, interactive2, say) {
12323
12385
  return true;
12324
12386
  }
12325
12387
  function readyExceptSnapshot(r, platforms) {
12388
+ return readyExcept(r, platforms, [SNAPSHOT_RULE]);
12389
+ }
12390
+ function readyExcept(r, platforms, ignore) {
12326
12391
  if (isReady(r, platforms)) return true;
12327
12392
  const want = platforms ?? r.report.platformsRequested ?? ["claude", "chatgpt"];
12328
12393
  const blocking = r.report.results.filter((x) => !x.pass && x.severity === "block" && x.platforms.some((p) => want.includes(p)));
12329
- return blocking.length > 0 && blocking.every((x) => x.id === SNAPSHOT_RULE && /no listing snapshot/i.test(x.message ?? ""));
12394
+ return blocking.length > 0 && blocking.every((x) => ignore.includes(x.id) && (x.id !== SNAPSHOT_RULE || /no listing snapshot/i.test(x.message ?? "")));
12330
12395
  }
12331
12396
  async function probeConventionalUrls(apexDomain, fetchFn = headStatus) {
12332
12397
  if (!apexDomain) return {};
@@ -14295,7 +14360,7 @@ var import_fs12 = require("fs");
14295
14360
  init_admin();
14296
14361
  init_auth();
14297
14362
  init_resolve();
14298
- var DASHBOARD_BASE8 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
14363
+ var DASHBOARD_BASE9 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
14299
14364
  async function runExport(projectArg, versionArg, opts) {
14300
14365
  const token = getAccessToken();
14301
14366
  if (!token) throw new Error("Not authenticated. Run `apiblaze login` first.");
@@ -14333,7 +14398,7 @@ async function runExport(projectArg, versionArg, opts) {
14333
14398
  }
14334
14399
  process.stdout.write("\n");
14335
14400
  const outFile = opts.out || `apiblaze-export-${projectId}-${version2}-${target2}.zip`;
14336
- const res = await fetch(`${DASHBOARD_BASE8}/api/cli/admin/download`, {
14401
+ const res = await fetch(`${DASHBOARD_BASE9}/api/cli/admin/download`, {
14337
14402
  method: "POST",
14338
14403
  headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` },
14339
14404
  body: JSON.stringify({ path: `${statusPath}?download=1` })
@@ -16099,7 +16164,7 @@ var import_ora20 = __toESM(require("ora"));
16099
16164
  init_admin();
16100
16165
  init_resolve();
16101
16166
  init_brand();
16102
- var DASHBOARD_BASE9 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
16167
+ var DASHBOARD_BASE10 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
16103
16168
  var TOPUP_MIN_USD = 10;
16104
16169
  var TOPUP_MAX_USD = 1e3;
16105
16170
  var money = (cents2) => typeof cents2 === "number" ? `$${usdStr(cents2)}` : "\u2014";
@@ -16161,7 +16226,7 @@ async function runBillingBalance(opts) {
16161
16226
  console.log("");
16162
16227
  }
16163
16228
  function walletUrl(teamId) {
16164
- return teamId ? `${DASHBOARD_BASE9}/topup?teamId=${encodeURIComponent(teamId)}` : `${DASHBOARD_BASE9}/account?section=wallet`;
16229
+ return teamId ? `${DASHBOARD_BASE10}/topup?teamId=${encodeURIComponent(teamId)}` : `${DASHBOARD_BASE10}/account?section=wallet`;
16165
16230
  }
16166
16231
  async function runBillingTopup(amount, opts) {
16167
16232
  const usd2 = Number(amount);
@@ -18736,7 +18801,7 @@ init_tenant_choice();
18736
18801
  init_resolve();
18737
18802
  init_types();
18738
18803
  init_paging();
18739
- var DASHBOARD_BASE10 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
18804
+ var DASHBOARD_BASE11 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
18740
18805
  var IAM_BASE = process.env.APIBLAZE_IAM_BASE || "https://iam.apiblaze.com";
18741
18806
  async function resolveTransport(opts) {
18742
18807
  const producer2 = loadCredentials();
@@ -18760,7 +18825,7 @@ async function resolveTransport(opts) {
18760
18825
  return {
18761
18826
  tenant: tenant2,
18762
18827
  call: async (path19, method = "GET", body) => {
18763
- const res = await fetch(`${DASHBOARD_BASE10}/api/cli/iam`, {
18828
+ const res = await fetch(`${DASHBOARD_BASE11}/api/cli/iam`, {
18764
18829
  method: "POST",
18765
18830
  headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` },
18766
18831
  body: JSON.stringify({ tenant: tenant2, path: path19, method, body })
@@ -19636,31 +19701,6 @@ async function runOriginsRemove(origin, opts) {
19636
19701
  var import_chalk77 = __toESM(require("chalk"));
19637
19702
  init_auth();
19638
19703
 
19639
- // src/lib/op-call.ts
19640
- init_auth();
19641
- init_trace();
19642
- init_types();
19643
- var DASHBOARD_BASE11 = process.env.APIBLAZE_DASHBOARD_BASE || "https://dashboard.apiblaze.com";
19644
- async function opCall(call3) {
19645
- const token = getAccessToken();
19646
- const res = await fetch(`${DASHBOARD_BASE11}/api/cli/op`, {
19647
- method: "POST",
19648
- headers: { "Content-Type": "application/json", Authorization: `Bearer ${token}` },
19649
- body: JSON.stringify({ path: call3.path, method: call3.method, body: call3.body })
19650
- });
19651
- let data = null;
19652
- try {
19653
- data = await res.json();
19654
- } catch {
19655
- }
19656
- recordCall({ method: call3.method, path: call3.path, body: call3.body, status: res.status, summary: call3.summary });
19657
- if (!res.ok) {
19658
- const msg = data?.details ?? data?.error ?? res.statusText;
19659
- throw new ApiError(res.status, typeof msg === "string" ? msg : JSON.stringify(msg), data);
19660
- }
19661
- return data;
19662
- }
19663
-
19664
19704
  // src/commands/op-money.ts
19665
19705
  var import_chalk70 = __toESM(require("chalk"));
19666
19706
  init_admin();
@@ -19749,8 +19789,8 @@ function lastLedgerSendAtMs(st) {
19749
19789
  const v = st.lastLedgerSendAtMs !== void 0 ? st.lastLedgerSendAtMs : st.lastFlushAtMs;
19750
19790
  return typeof v === "number" && Number.isFinite(v) ? v : null;
19751
19791
  }
19752
- var walletPage = (ba) => `${DASHBOARD_BASE11}/operator/wallets/${encodeURIComponent(ba)}`;
19753
- var incidentPage = () => `${DASHBOARD_BASE11}/operator/incident`;
19792
+ var walletPage = (ba) => `${DASHBOARD_BASE6}/operator/wallets/${encodeURIComponent(ba)}`;
19793
+ var incidentPage = () => `${DASHBOARD_BASE6}/operator/incident`;
19754
19794
  var WALLET_MUTATIONS = {
19755
19795
  "freeze": "a reason (required, \u2264 500 chars). Sets frozen; epoch++ recalls every shard \u2014 serving stops within seconds.",
19756
19796
  "unfreeze": "a reason (required, \u2264 500 chars).",
@@ -19764,7 +19804,7 @@ var WALLET_MUTATIONS = {
19764
19804
  function opWalletMutation(action2, ref, opts) {
19765
19805
  const need = WALLET_MUTATIONS[action2];
19766
19806
  const target2 = ref ?? "<wallet>";
19767
- const url = ref && !isTeamId(ref) ? walletPage(ref) : `${DASHBOARD_BASE11}/operator/wallets`;
19807
+ const url = ref && !isTeamId(ref) ? walletPage(ref) : `${DASHBOARD_BASE6}/operator/wallets`;
19768
19808
  if (opts.json) return void console.log(JSON.stringify({ action: action2, wallet: ref ?? null, dashboard_only: true, url, requires: need ?? "a reason" }));
19769
19809
  console.log(import_chalk70.default.yellow(`
19770
19810
  \`op wallet ${action2}\` is dashboard-only \u2014 it writes an operator_audit row with YOUR reason before touching the root.`));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apiblaze",
3
- "version": "0.21.64",
3
+ "version": "0.21.66",
4
4
  "description": "APIblaze CLI — Chat with your APIs, Manage your API keys, users and groups with the APIblaze serverless proxy",
5
5
  "keywords": [
6
6
  "apiblaze",