apiblaze 0.21.65 → 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.
- package/dist/index.js +20 -19
- 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.
|
|
37
|
+
version = "0.21.66";
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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
|
}
|
|
@@ -12263,13 +12263,6 @@ async function runConnector(target2, opts) {
|
|
|
12263
12263
|
await runConnectorAnswers2(proj2.projectName, { team: opts.team, apiversion: opts.apiversion });
|
|
12264
12264
|
r = await fetchDirectoryReport(caller, proj2, { platforms });
|
|
12265
12265
|
}
|
|
12266
|
-
if (!readyExcept(r, platforms, [SNAPSHOT_RULE, ...EVIDENCE_RULES])) {
|
|
12267
|
-
if (!domain2.active && domain2.hostname && !json) {
|
|
12268
|
-
console.error(import_chalk30.default.yellow(`
|
|
12269
|
-
${domain2.hostname} is not active yet. Once the CNAME is in place, run again: ${B.cli} connector ${proj2.projectName}`));
|
|
12270
|
-
}
|
|
12271
|
-
exitWithReport(r, proj2, platforms, json);
|
|
12272
|
-
}
|
|
12273
12266
|
if (opts.exercise !== false) {
|
|
12274
12267
|
let run2 = !!opts.yes;
|
|
12275
12268
|
if (interactive2) {
|
|
@@ -12278,11 +12271,17 @@ async function runConnector(target2, opts) {
|
|
|
12278
12271
|
}
|
|
12279
12272
|
if (run2) {
|
|
12280
12273
|
const { runConnectorExercise: runConnectorExercise2 } = await Promise.resolve().then(() => (init_connector_exercise(), connector_exercise_exports));
|
|
12281
|
-
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] });
|
|
12282
12275
|
r = await fetchDirectoryReport(caller, proj2, { platforms, publishedUrl: r.report.project.publishedUrl ?? null });
|
|
12283
12276
|
}
|
|
12284
12277
|
}
|
|
12285
|
-
if (!readyExceptSnapshot(r, platforms))
|
|
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
|
+
}
|
|
12286
12285
|
r = await fetchDirectoryReport(caller, proj2, { platforms, refreshSnapshot: true, publishedUrl: r.report.project.publishedUrl ?? null });
|
|
12287
12286
|
const packet = await producer(caller, { method: "GET", path: `${projectPath3(proj2)}/directory-packet`, summary: "Submission packet" });
|
|
12288
12287
|
const dir = opts.out ?? process.cwd();
|
|
@@ -12309,8 +12308,7 @@ async function runConnector(target2, opts) {
|
|
|
12309
12308
|
}
|
|
12310
12309
|
var SNAPSHOT_RULE = "LISTING_SNAPSHOT_MATCH";
|
|
12311
12310
|
var ANSWER_RULES = ["PORTAL_ANSWERS_COMPLETE", "HEALTH_SPONSORED_DECLARED", "API_OWNERSHIP_DOMAIN"];
|
|
12312
|
-
|
|
12313
|
-
function exitWithReport(r, proj2, platforms, json) {
|
|
12311
|
+
function exitWithReport(r, proj2, platforms, json, interactive2 = false) {
|
|
12314
12312
|
if (json) {
|
|
12315
12313
|
process.stdout.write(JSON.stringify({ ready: false, project: proj2.projectId, headline: r.rendered.headline, report: r.report }) + "\n");
|
|
12316
12314
|
process.exit(1);
|
|
@@ -12318,10 +12316,13 @@ function exitWithReport(r, proj2, platforms, json) {
|
|
|
12318
12316
|
printReport(r, false);
|
|
12319
12317
|
const want = platforms;
|
|
12320
12318
|
const blocking = r.report.results.filter((x) => !x.pass && x.severity === "block" && !x.unverified && x.platforms.some((p) => want.includes(p)));
|
|
12321
|
-
const
|
|
12319
|
+
const real = blocking.filter((x) => x.id !== SNAPSHOT_RULE);
|
|
12320
|
+
const first = real.find((x) => x.tier !== "review") ?? real[0] ?? blocking[0];
|
|
12322
12321
|
console.error(import_chalk30.default.red(`
|
|
12323
12322
|
Not ready: ${blocking.length} blocker${blocking.length === 1 ? "" : "s"} (${blocking.map((x) => x.id).join(", ")}).`));
|
|
12324
|
-
|
|
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}`);
|
|
12325
12326
|
console.error(import_chalk30.default.dim(` Report page: ${DASHBOARD_BASE6}/directory/${encodeURIComponent(proj2.projectId)}/${encodeURIComponent(proj2.apiVersion)}`));
|
|
12326
12327
|
process.exit(1);
|
|
12327
12328
|
}
|