@testsmith/api-spector 0.8.8 → 0.9.0
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/out/main/chunks/{broker-client-Bmt4seb8.js → broker-client-DqDgA2G6.js} +11 -7
- package/out/main/chunks/{perf-report-ChaO3K0w.js → perf-report-KXGZgCDY.js} +1 -1
- package/out/main/chunks/{perf-run-wfdvpJev.js → perf-run-Ww_weuqI.js} +1 -1
- package/out/main/chunks/{request-exec-s7k-oRi2.js → request-exec-CcF1Fzve.js} +13 -4
- package/out/main/contract.js +13 -4
- package/out/main/flow.js +17 -4
- package/out/main/index.js +5 -5
- package/out/main/lib.js +1 -1
- package/out/main/perf-worker.js +2 -2
- package/out/main/perf.js +4 -4
- package/out/main/register-handlers.js +54 -39
- package/out/main/runner.js +5 -5
- package/out/renderer/assets/{GraphQLEditor-TklsnkDw.js → GraphQLEditor-CmfodipY.js} +1 -1
- package/out/renderer/assets/{SoapEditor-CllZqWyv.js → SoapEditor-CVRCFvJy.js} +1 -1
- package/out/renderer/assets/{index-fV0So_bF.js → index-BV1FsSQR.js} +1013 -184
- package/out/renderer/assets/index-D9e_KYf1.css +627 -0
- package/out/renderer/index.html +2 -2
- package/package.json +1 -1
- package/out/renderer/assets/index-Dj6OhE3D.css +0 -627
|
@@ -3,7 +3,7 @@ const promises = require("node:fs/promises");
|
|
|
3
3
|
const path = require("node:path");
|
|
4
4
|
const crypto = require("node:crypto");
|
|
5
5
|
const undici = require("undici");
|
|
6
|
-
const requestExec = require("./request-exec-
|
|
6
|
+
const requestExec = require("./request-exec-CcF1Fzve.js");
|
|
7
7
|
const Ajv = require("ajv");
|
|
8
8
|
const jsYaml = require("js-yaml");
|
|
9
9
|
require("node:http");
|
|
@@ -2024,8 +2024,8 @@ h1 { font-size: 20px; margin: 0 0 4px; }
|
|
|
2024
2024
|
.card.pend { border-color: #92600a; }
|
|
2025
2025
|
.method { font: 700 12px ui-monospace,SFMono-Regular,Menlo,monospace; width: 56px; flex-shrink: 0; color: #6aa3c8; }
|
|
2026
2026
|
.name { flex: 1; color: #e4e3ea; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2027
|
-
.url { color: #
|
|
2028
|
-
.dur { color: #
|
|
2027
|
+
.url { color: #9d9aa8; font: 11px ui-monospace,monospace; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2028
|
+
.dur { color: #9d9aa8; font-size: 11px; }
|
|
2029
2029
|
.code { font: 700 12px ui-monospace,monospace; }
|
|
2030
2030
|
.code.s2 { color: #9fc93c; } .code.s3 { color: #fbbf24; } .code.s4, .code.s5 { color: #f87171; }
|
|
2031
2031
|
.viol { padding: 14px 16px; border-top: 1px solid #3d3b48; display: flex; flex-direction: column; gap: 10px; }
|
|
@@ -2034,7 +2034,7 @@ h1 { font-size: 20px; margin: 0 0 4px; }
|
|
|
2034
2034
|
.v .path { font: 10px ui-monospace,monospace; color: #9d9aa8; background: #272630; padding: 1px 6px; border-radius: 4px; margin-left: 8px; }
|
|
2035
2035
|
.v .m { color: #fecaca; font-size: 13px; margin: 4px 0 0; }
|
|
2036
2036
|
.v .ea { font: 11px ui-monospace,monospace; margin-top: 4px; display: flex; gap: 18px; }
|
|
2037
|
-
.v .ea .lab { color: #
|
|
2037
|
+
.v .ea .lab { color: #9d9aa8; }
|
|
2038
2038
|
.v .ea .exp { color: #9fc93c; } .v .ea .act { color: #f87171; }
|
|
2039
2039
|
.pass-note { color: #9fc93c; font-size: 13px; padding: 12px 16px; border-top: 1px solid #3d3b48; }
|
|
2040
2040
|
table { border-collapse: collapse; width: 100%; margin-top: 16px; font-size: 13px; }
|
|
@@ -2044,10 +2044,10 @@ td.cell { text-align: center; }
|
|
|
2044
2044
|
.b { display: inline-block; min-width: 56px; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 700; }
|
|
2045
2045
|
.b.ok { background: #2d3a12; color: #9fc93c; }
|
|
2046
2046
|
.b.bad { background: rgba(127,29,29,.55); color: #f87171; }
|
|
2047
|
-
.b.na { background: #272630; color: #
|
|
2047
|
+
.b.na { background: #272630; color: #9d9aa8; }
|
|
2048
2048
|
a.b { text-decoration: none; }
|
|
2049
2049
|
a.b.ok:hover { background: #4a5e1d; } a.b.bad:hover { background: rgba(127,29,29,.8); }
|
|
2050
|
-
.foot { color: #
|
|
2050
|
+
.foot { color: #9d9aa8; font-size: 11px; margin-top: 40px; text-align: center; }
|
|
2051
2051
|
summary { cursor: pointer; list-style: none; }
|
|
2052
2052
|
summary::-webkit-details-marker { display: none; }
|
|
2053
2053
|
`;
|
|
@@ -2400,7 +2400,11 @@ async function publishVerification(cfg, input) {
|
|
|
2400
2400
|
contractId: input.contractId,
|
|
2401
2401
|
providerVersion: input.providerVersion,
|
|
2402
2402
|
success: input.success,
|
|
2403
|
-
...input.buildUrl ? { buildUrl: input.buildUrl } : {}
|
|
2403
|
+
...input.buildUrl ? { buildUrl: input.buildUrl } : {},
|
|
2404
|
+
// Full per-interaction detail (a ContractReport) so the cloud can show WHY
|
|
2405
|
+
// a verification failed, not just pass/fail. Optional — omitted when no
|
|
2406
|
+
// report is supplied.
|
|
2407
|
+
...input.results !== void 0 ? { results: input.results } : {}
|
|
2404
2408
|
});
|
|
2405
2409
|
if (!r.ok) fail(r, "Publish verification failed");
|
|
2406
2410
|
}
|
|
@@ -79,7 +79,7 @@ function perfReportToHtml(result, meta = {}) {
|
|
|
79
79
|
.muted { color: #7f93ab; } .small { font-size: 11px; margin-top: 8px; }
|
|
80
80
|
code { background: #0d1a28; padding: 1px 5px; border-radius: 4px; color: #f9a8a8; font-size: 12px; }
|
|
81
81
|
.errs { margin: 0; padding-left: 18px; } .errs li { margin: 3px 0; }
|
|
82
|
-
footer { margin-top: 40px; color: #
|
|
82
|
+
footer { margin-top: 40px; color: #7f93ab; font-size: 11px; }
|
|
83
83
|
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
|
|
84
84
|
@media (max-width: 720px) { .kpis { grid-template-columns: repeat(2, 1fr); } .cols { grid-template-columns: 1fr; } }
|
|
85
85
|
</style></head>
|
|
@@ -791,7 +791,7 @@ async function buildDynamicVars() {
|
|
|
791
791
|
};
|
|
792
792
|
}
|
|
793
793
|
function interpolate(str, vars) {
|
|
794
|
-
return str.replaceAll(/\{\{([^}]
|
|
794
|
+
return str.replaceAll(/\{\{\s*((?:[^{}]|\{[^{}]*\})+?)\s*\}\}/g, (match, key) => {
|
|
795
795
|
const trimmed = key.trim();
|
|
796
796
|
if (trimmed in vars) return vars[trimmed];
|
|
797
797
|
if (_exprContext && (trimmed.includes(".") || trimmed.includes("("))) {
|
|
@@ -811,7 +811,7 @@ function resolveDataRow(row, scope) {
|
|
|
811
811
|
}
|
|
812
812
|
function buildUrl(baseUrl, params, vars) {
|
|
813
813
|
const templateTokens = /* @__PURE__ */ new Set();
|
|
814
|
-
baseUrl.replaceAll(/\{\{([^}]
|
|
814
|
+
baseUrl.replaceAll(/\{\{\s*((?:[^{}]|\{[^{}]*\})+?)\s*\}\}/g, (_m, name) => {
|
|
815
815
|
templateTokens.add(String(name).trim());
|
|
816
816
|
return "";
|
|
817
817
|
});
|
|
@@ -1130,10 +1130,11 @@ function buildAt(ctx, testResults, consoleOutput) {
|
|
|
1130
1130
|
fn();
|
|
1131
1131
|
testResults.push({ name, passed: true });
|
|
1132
1132
|
} catch (err) {
|
|
1133
|
+
const line = scriptLineOf(err);
|
|
1133
1134
|
testResults.push({
|
|
1134
1135
|
name,
|
|
1135
1136
|
passed: false,
|
|
1136
|
-
error: err instanceof Error ? err.message : String(err)
|
|
1137
|
+
error: (err instanceof Error ? err.message : String(err)) + (line ? ` (line ${line})` : "")
|
|
1137
1138
|
});
|
|
1138
1139
|
}
|
|
1139
1140
|
},
|
|
@@ -1254,6 +1255,13 @@ function buildSandbox(scriptCtx, testResults, consoleOutput, faker) {
|
|
|
1254
1255
|
setInterval: void 0
|
|
1255
1256
|
};
|
|
1256
1257
|
}
|
|
1258
|
+
function scriptLineOf(err) {
|
|
1259
|
+
if (err instanceof Error && err.stack) {
|
|
1260
|
+
const m = err.stack.match(/script\.js:(\d+):\d+/);
|
|
1261
|
+
if (m) return Number(m[1]);
|
|
1262
|
+
}
|
|
1263
|
+
return void 0;
|
|
1264
|
+
}
|
|
1257
1265
|
async function runScript(code, ctx, timeoutMs = 5e3) {
|
|
1258
1266
|
const faker = await getFaker();
|
|
1259
1267
|
const testResults = [];
|
|
@@ -1279,6 +1287,7 @@ async function runScript(code, ctx, timeoutMs = 5e3) {
|
|
|
1279
1287
|
try {
|
|
1280
1288
|
vm__namespace.runInNewContext(code, sandbox, { timeout: timeoutMs, filename: "script.js" });
|
|
1281
1289
|
} catch (err) {
|
|
1290
|
+
const line = scriptLineOf(err);
|
|
1282
1291
|
const message = err instanceof Error ? err.message : String(err);
|
|
1283
1292
|
return {
|
|
1284
1293
|
testResults,
|
|
@@ -1288,7 +1297,7 @@ async function runScript(code, ctx, timeoutMs = 5e3) {
|
|
|
1288
1297
|
updatedGlobals: globalsCopy,
|
|
1289
1298
|
updatedLocalVars: localVarsCopy,
|
|
1290
1299
|
updatedFolderVars: folderCopy,
|
|
1291
|
-
error: message
|
|
1300
|
+
error: (line ? `Line ${line}: ` : "") + message
|
|
1292
1301
|
};
|
|
1293
1302
|
}
|
|
1294
1303
|
return {
|
package/out/main/contract.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const promises = require("node:fs/promises");
|
|
4
4
|
const path = require("node:path");
|
|
5
|
-
const brokerClient = require("./chunks/broker-client-
|
|
5
|
+
const brokerClient = require("./chunks/broker-client-DqDgA2G6.js");
|
|
6
6
|
const escape = require("./chunks/escape-DDVAlOvZ.js");
|
|
7
7
|
const crypto = require("node:crypto");
|
|
8
8
|
const undici = require("undici");
|
|
@@ -11,7 +11,7 @@ const cliCommon = require("./chunks/cli-common-GnihVSjU.js");
|
|
|
11
11
|
const node_child_process = require("node:child_process");
|
|
12
12
|
const jsYaml = require("js-yaml");
|
|
13
13
|
const environments = require("./chunks/environments-iM3SUM-4.js");
|
|
14
|
-
require("./chunks/request-exec-
|
|
14
|
+
require("./chunks/request-exec-CcF1Fzve.js");
|
|
15
15
|
require("fs/promises");
|
|
16
16
|
require("tls");
|
|
17
17
|
require("./chunks/handle-_4XMUlwm.js");
|
|
@@ -803,12 +803,21 @@ async function cmdPublishVerification(args) {
|
|
|
803
803
|
const success = successArg === "true" || successArg === "1";
|
|
804
804
|
const buildUrl = str(args["build-url"]);
|
|
805
805
|
const consumerVersion = str(args["consumer-version"]);
|
|
806
|
+
let results;
|
|
807
|
+
const reportPath = str(args["report"]);
|
|
808
|
+
if (reportPath) {
|
|
809
|
+
try {
|
|
810
|
+
results = JSON.parse(await promises.readFile(path.resolve(reportPath), "utf8"));
|
|
811
|
+
} catch (e) {
|
|
812
|
+
die(`Could not read --report ${reportPath}: ${e instanceof Error ? e.message : String(e)}`);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
806
815
|
const cfg = brokerClient.brokerConfigFromEnv();
|
|
807
816
|
const contracts = await brokerClient.fetchContracts(cfg, { consumer, provider });
|
|
808
817
|
const match = consumerVersion ? contracts.find((c) => c.consumerVersion === consumerVersion) : contracts[contracts.length - 1];
|
|
809
818
|
if (!match) die(`No published contract for ${consumer} -> ${provider}${consumerVersion ? "@" + consumerVersion : ""}.`);
|
|
810
|
-
await brokerClient.publishVerification(cfg, { contractId: match.id, providerVersion, success, buildUrl });
|
|
811
|
-
console.log(` Published verification: ${provider}@${providerVersion.slice(0, 7)} -> ${consumer}@${match.consumerVersion} = ${success ? "passed" : "FAILED"}`);
|
|
819
|
+
await brokerClient.publishVerification(cfg, { contractId: match.id, providerVersion, success, buildUrl, results });
|
|
820
|
+
console.log(` Published verification: ${provider}@${providerVersion.slice(0, 7)} -> ${consumer}@${match.consumerVersion} = ${success ? "passed" : "FAILED"}${results ? " (+ report)" : ""}`);
|
|
812
821
|
}
|
|
813
822
|
async function main() {
|
|
814
823
|
const [, , sub, ...rest] = process.argv;
|
package/out/main/flow.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const promises = require("node:fs/promises");
|
|
4
4
|
const path = require("node:path");
|
|
5
|
-
const requestExec = require("./chunks/request-exec-
|
|
5
|
+
const requestExec = require("./chunks/request-exec-CcF1Fzve.js");
|
|
6
6
|
const requestCollection = require("./chunks/request-collection-zRRUfg0X.js");
|
|
7
7
|
const environments = require("./chunks/environments-iM3SUM-4.js");
|
|
8
8
|
const flowEngine = require("./chunks/flow-engine-BxwjEy37.js");
|
|
@@ -43,6 +43,9 @@ function pretty(v) {
|
|
|
43
43
|
return esc(String(v));
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
+
function headerLines(h) {
|
|
47
|
+
return Object.entries(h).map(([k, v]) => `${k}: ${v}`).join("\n");
|
|
48
|
+
}
|
|
46
49
|
const STATUS_CLS = {
|
|
47
50
|
passed: "badge-pass",
|
|
48
51
|
failed: "badge-fail",
|
|
@@ -60,8 +63,18 @@ function blockDetail(b) {
|
|
|
60
63
|
).join("");
|
|
61
64
|
parts.push(`<div class="section-label">Tests</div><div class="tests-wrap">${rows}</div>`);
|
|
62
65
|
}
|
|
63
|
-
if (b.type === "request" && b.resolvedUrl) {
|
|
64
|
-
|
|
66
|
+
if (b.type === "request" && (b.resolvedUrl || b.http)) {
|
|
67
|
+
const h = b.http;
|
|
68
|
+
parts.push('<div class="section-label">Request</div>');
|
|
69
|
+
if (b.resolvedUrl) parts.push(`<div class="mono url">${esc(b.method ?? "")} ${esc(b.resolvedUrl)}</div>`);
|
|
70
|
+
if (h?.reqHeaders && Object.keys(h.reqHeaders).length) parts.push(`<pre class="code-block">${esc(headerLines(h.reqHeaders))}</pre>`);
|
|
71
|
+
if (h?.reqBody) parts.push(`<pre class="code-block">${pretty(h.reqBody)}</pre>`);
|
|
72
|
+
parts.push('<div class="section-label">Response</div>');
|
|
73
|
+
const statusLine = b.httpStatus != null ? `${b.httpStatus}${h?.statusText ? " " + h.statusText : ""}${h?.bodySize != null ? ` · ${h.bodySize} bytes` : ""}` : "(no response received)";
|
|
74
|
+
parts.push(`<div class="mono url">${esc(statusLine)}</div>`);
|
|
75
|
+
if (h?.resHeaders && Object.keys(h.resHeaders).length) parts.push(`<pre class="code-block">${esc(headerLines(h.resHeaders))}</pre>`);
|
|
76
|
+
if (h?.resBody) parts.push(`<pre class="code-block">${pretty(h.resBody)}</pre>`);
|
|
77
|
+
if (h?.truncated) parts.push('<div class="muted" style="font-size:11px">Request/response body truncated for the report.</div>');
|
|
65
78
|
}
|
|
66
79
|
if (b.type === "log" && b.message) {
|
|
67
80
|
parts.push(`<div class="section-label">Message</div><pre class="code-block">${esc(b.message)}</pre>`);
|
|
@@ -268,7 +281,7 @@ async function main() {
|
|
|
268
281
|
const envName = args.environment ?? args.env;
|
|
269
282
|
const env = environments.selectEnvironment(workspace, environments$1, envName);
|
|
270
283
|
const verbose = Boolean(args.verbose);
|
|
271
|
-
const version = `v${"0.
|
|
284
|
+
const version = `v${"0.9.0"}`;
|
|
272
285
|
console.log("");
|
|
273
286
|
console.log(cliCommon.color(" API Flow Runner" + (version ? ` ${version}` : ""), cliCommon.C.bold, cliCommon.C.white));
|
|
274
287
|
console.log(cliCommon.color(` Flow: ${flow.name}`, cliCommon.C.gray));
|
package/out/main/index.js
CHANGED
|
@@ -4,12 +4,13 @@ const handle = require("./chunks/handle-_4XMUlwm.js");
|
|
|
4
4
|
const path = require("node:path");
|
|
5
5
|
const fs = require("node:fs");
|
|
6
6
|
const registerHandlers = require("./register-handlers.js");
|
|
7
|
-
const requestExec = require("./chunks/request-exec-
|
|
7
|
+
const requestExec = require("./chunks/request-exec-CcF1Fzve.js");
|
|
8
8
|
const electronUpdater = require("electron-updater");
|
|
9
9
|
const mockServer = require("./chunks/mock-server-C4kTFkod.js");
|
|
10
10
|
require("node:fs/promises");
|
|
11
11
|
require("node:crypto");
|
|
12
12
|
require("jszip");
|
|
13
|
+
require("simple-git");
|
|
13
14
|
require("./chunks/data-files-BYqhsoPe.js");
|
|
14
15
|
require("./chunks/request-collection-zRRUfg0X.js");
|
|
15
16
|
require("uuid");
|
|
@@ -26,13 +27,12 @@ require("./chunks/flow-engine-BxwjEy37.js");
|
|
|
26
27
|
require("ws");
|
|
27
28
|
require("socket.io-client");
|
|
28
29
|
require("mqtt");
|
|
29
|
-
require("./chunks/perf-report-
|
|
30
|
+
require("./chunks/perf-report-KXGZgCDY.js");
|
|
30
31
|
require("node:os");
|
|
31
32
|
require("@grpc/grpc-js");
|
|
32
33
|
require("@grpc/proto-loader");
|
|
33
34
|
require("./chunks/escape-DDVAlOvZ.js");
|
|
34
|
-
require("./chunks/broker-client-
|
|
35
|
-
require("simple-git");
|
|
35
|
+
require("./chunks/broker-client-DqDgA2G6.js");
|
|
36
36
|
require("./chunks/recorder-BkO8G_mB.js");
|
|
37
37
|
require("fs/promises");
|
|
38
38
|
require("tls");
|
|
@@ -50,7 +50,7 @@ function isNewer(a, b) {
|
|
|
50
50
|
return a2 > b2;
|
|
51
51
|
}
|
|
52
52
|
async function checkForUpdate() {
|
|
53
|
-
const current = "0.
|
|
53
|
+
const current = "0.9.0";
|
|
54
54
|
try {
|
|
55
55
|
const res = await fetch(REGISTRY_URL, { signal: AbortSignal.timeout(4e3) });
|
|
56
56
|
if (!res.ok) return null;
|
package/out/main/lib.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const mockServer = require("./chunks/mock-server-C4kTFkod.js");
|
|
4
|
-
const requestExec = require("./chunks/request-exec-
|
|
4
|
+
const requestExec = require("./chunks/request-exec-CcF1Fzve.js");
|
|
5
5
|
const flowEngine = require("./chunks/flow-engine-BxwjEy37.js");
|
|
6
6
|
require("node:http");
|
|
7
7
|
require("node:crypto");
|
package/out/main/perf-worker.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const perfRun = require("./chunks/perf-run-
|
|
3
|
-
const requestExec = require("./chunks/request-exec-
|
|
2
|
+
const perfRun = require("./chunks/perf-run-Ww_weuqI.js");
|
|
3
|
+
const requestExec = require("./chunks/request-exec-CcF1Fzve.js");
|
|
4
4
|
require("@grpc/grpc-js");
|
|
5
5
|
require("@grpc/proto-loader");
|
|
6
6
|
require("node:fs");
|
package/out/main/perf.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const promises = require("node:fs/promises");
|
|
4
4
|
const path = require("node:path");
|
|
5
|
-
const requestExec = require("./chunks/request-exec-
|
|
5
|
+
const requestExec = require("./chunks/request-exec-CcF1Fzve.js");
|
|
6
6
|
const requestCollection = require("./chunks/request-collection-zRRUfg0X.js");
|
|
7
7
|
const environments = require("./chunks/environments-iM3SUM-4.js");
|
|
8
8
|
const flowEngine = require("./chunks/flow-engine-BxwjEy37.js");
|
|
9
|
-
const perfRun = require("./chunks/perf-run-
|
|
10
|
-
const perfReport = require("./chunks/perf-report-
|
|
9
|
+
const perfRun = require("./chunks/perf-run-Ww_weuqI.js");
|
|
10
|
+
const perfReport = require("./chunks/perf-report-KXGZgCDY.js");
|
|
11
11
|
const cliCommon = require("./chunks/cli-common-GnihVSjU.js");
|
|
12
12
|
require("undici");
|
|
13
13
|
require("fs/promises");
|
|
@@ -191,7 +191,7 @@ async function main() {
|
|
|
191
191
|
targetLabel = `flow: ${flow.name}`;
|
|
192
192
|
}
|
|
193
193
|
const load = perfRun.deriveLoad(plan);
|
|
194
|
-
const version = `v${"0.
|
|
194
|
+
const version = `v${"0.9.0"}`;
|
|
195
195
|
console.log("");
|
|
196
196
|
console.log(cliCommon.color(" API Performance" + (version ? ` ${version}` : ""), cliCommon.C.bold, cliCommon.C.white));
|
|
197
197
|
console.log(cliCommon.color(` Plan: ${plan.name}`, cliCommon.C.gray));
|
|
@@ -28,9 +28,10 @@ const promises = require("node:fs/promises");
|
|
|
28
28
|
const path = require("node:path");
|
|
29
29
|
const crypto = require("node:crypto");
|
|
30
30
|
const JSZip = require("jszip");
|
|
31
|
+
const simpleGit = require("simple-git");
|
|
31
32
|
const dataFiles = require("./chunks/data-files-BYqhsoPe.js");
|
|
32
33
|
const requestCollection = require("./chunks/request-collection-zRRUfg0X.js");
|
|
33
|
-
const requestExec = require("./chunks/request-exec-
|
|
34
|
+
const requestExec = require("./chunks/request-exec-CcF1Fzve.js");
|
|
34
35
|
const ipcValidate = require("./chunks/ipc-validate-sqUFqRmE.js");
|
|
35
36
|
const uuid = require("uuid");
|
|
36
37
|
const jsYaml = require("js-yaml");
|
|
@@ -43,14 +44,13 @@ const http = require("node:http");
|
|
|
43
44
|
const WebSocket = require("ws");
|
|
44
45
|
const socket_ioClient = require("socket.io-client");
|
|
45
46
|
const mqtt = require("mqtt");
|
|
46
|
-
const perfReport = require("./chunks/perf-report-
|
|
47
|
+
const perfReport = require("./chunks/perf-report-KXGZgCDY.js");
|
|
47
48
|
const fs = require("node:fs");
|
|
48
49
|
const os = require("node:os");
|
|
49
50
|
const grpc = require("@grpc/grpc-js");
|
|
50
51
|
const protoLoader = require("@grpc/proto-loader");
|
|
51
52
|
const escape = require("./chunks/escape-DDVAlOvZ.js");
|
|
52
|
-
const brokerClient = require("./chunks/broker-client-
|
|
53
|
-
const simpleGit = require("simple-git");
|
|
53
|
+
const brokerClient = require("./chunks/broker-client-DqDgA2G6.js");
|
|
54
54
|
const recorder = require("./chunks/recorder-BkO8G_mB.js");
|
|
55
55
|
require("fs/promises");
|
|
56
56
|
require("tls");
|
|
@@ -481,10 +481,8 @@ Create a workspace in this folder and add "${path.basename(wsPath)}" to it? The
|
|
|
481
481
|
return { workspace: parsed, workspacePath: wsPath };
|
|
482
482
|
});
|
|
483
483
|
handle.handleIpc(ipc, handle.IPC.file.openFromGit, async (_e, repoUrl) => {
|
|
484
|
-
const
|
|
485
|
-
if (!
|
|
486
|
-
throw new Error("unsupported URL — use a public GitHub repo URL or a direct .zip link");
|
|
487
|
-
}
|
|
484
|
+
const url = repoUrl.trim();
|
|
485
|
+
if (!url) throw new Error("Enter a repository URL");
|
|
488
486
|
const pick = await electron.dialog.showOpenDialog({
|
|
489
487
|
title: "Choose a folder to clone the repository into",
|
|
490
488
|
properties: ["openDirectory", "createDirectory"],
|
|
@@ -492,7 +490,7 @@ Create a workspace in this folder and add "${path.basename(wsPath)}" to it? The
|
|
|
492
490
|
});
|
|
493
491
|
if (pick.canceled || pick.filePaths.length === 0) return null;
|
|
494
492
|
const parent = pick.filePaths[0];
|
|
495
|
-
const repoName = (/
|
|
493
|
+
const repoName = (/[/:]([^/:]+?)(?:\.git)?\/?$/.exec(url)?.[1] ?? "repository").replaceAll(/[^a-zA-Z0-9._-]+/g, "-") || "repository";
|
|
496
494
|
const destDir = path.join(parent, repoName);
|
|
497
495
|
try {
|
|
498
496
|
const existing = await promises.readdir(destDir);
|
|
@@ -502,9 +500,20 @@ Create a workspace in this folder and add "${path.basename(wsPath)}" to it? The
|
|
|
502
500
|
} catch (err) {
|
|
503
501
|
if (err instanceof Error && err.message.includes("already exists")) throw err;
|
|
504
502
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
503
|
+
try {
|
|
504
|
+
await simpleGit.simpleGit(parent).clone(url, destDir);
|
|
505
|
+
} catch (err) {
|
|
506
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
507
|
+
const gitMissing = /not found|ENOENT|not recognized|command not found|spawn git/i.test(msg);
|
|
508
|
+
const archiveUrl = gitMissing ? await resolveArchiveUrl(url).catch(() => null) : null;
|
|
509
|
+
if (gitMissing && archiveUrl) {
|
|
510
|
+
await promises.mkdir(destDir, { recursive: true });
|
|
511
|
+
const buf = await downloadArchive(archiveUrl);
|
|
512
|
+
await extractZip(buf, destDir);
|
|
513
|
+
} else {
|
|
514
|
+
throw new Error(`git clone failed: ${msg}`);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
508
517
|
const wsPath = await findWorkspaceSpector(destDir);
|
|
509
518
|
const parsed = JSON.parse(await promises.readFile(wsPath, "utf8"));
|
|
510
519
|
workspaceDir = path.dirname(wsPath);
|
|
@@ -5604,7 +5613,10 @@ function registerFlowHandler(ipc) {
|
|
|
5604
5613
|
testResults: result.testResults,
|
|
5605
5614
|
name: result.name,
|
|
5606
5615
|
method: result.method,
|
|
5607
|
-
resolvedUrl: result.resolvedUrl
|
|
5616
|
+
resolvedUrl: result.resolvedUrl,
|
|
5617
|
+
// The request actually sent (resolved headers/body), so the run log
|
|
5618
|
+
// and report can show it — especially on failures.
|
|
5619
|
+
sentRequest: result.sentRequest ? { method: result.method, url: result.resolvedUrl, headers: result.sentRequest.headers, body: result.sentRequest.body } : void 0
|
|
5608
5620
|
};
|
|
5609
5621
|
},
|
|
5610
5622
|
runScript: async (code, input) => {
|
|
@@ -7216,11 +7228,11 @@ function generateHtml(payload) {
|
|
|
7216
7228
|
.collection { margin-bottom: 3rem; }
|
|
7217
7229
|
.collection-desc, .folder-desc, .desc { color: #94a3b8; font-size: .9rem; margin: .25rem 0 1rem; }
|
|
7218
7230
|
.request { background: #1e2433; border: 1px solid #2d3748; border-radius: 8px; padding: 1rem 1.25rem; margin: 1rem 0; }
|
|
7219
|
-
.label { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #
|
|
7231
|
+
.label { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: #94a3b8; margin: .75rem 0 .3rem; }
|
|
7220
7232
|
pre { background: #131924; border: 1px solid #2d3748; border-radius: 6px; padding: .75rem 1rem; overflow-x: auto; margin: 0; }
|
|
7221
7233
|
code { font-family: 'JetBrains Mono', 'Fira Mono', monospace; font-size: .8rem; color: #a5f3fc; }
|
|
7222
7234
|
table { border-collapse: collapse; width: 100%; font-size: .85rem; margin: .25rem 0; }
|
|
7223
|
-
th { background: #131924; color: #
|
|
7235
|
+
th { background: #131924; color: #94a3b8; font-weight: 600; text-align: left; padding: .4rem .6rem; border: 1px solid #2d3748; }
|
|
7224
7236
|
td { padding: .35rem .6rem; border: 1px solid #2d3748; color: #cbd5e1; font-family: monospace; font-size: .8rem; }
|
|
7225
7237
|
.auth-type { background: #1e2433; border: 1px solid #2d3748; border-radius: 4px; display: inline-block; padding: .2rem .6rem; font-size: .8rem; color: #a5f3fc; margin: 0; }
|
|
7226
7238
|
.folder-heading { color: #94a3b8; font-size: 1.05rem; }
|
|
@@ -7415,6 +7427,31 @@ function registerContractHandlers(ipc) {
|
|
|
7415
7427
|
return { file };
|
|
7416
7428
|
});
|
|
7417
7429
|
}
|
|
7430
|
+
const BRANCH_REF_FORMAT = "%(refname)|%(refname:short)|%(HEAD)|%(upstream:short)|%(upstream:track)";
|
|
7431
|
+
function parseBranchRefs(raw, current) {
|
|
7432
|
+
const branches = [];
|
|
7433
|
+
for (const line of raw.split("\n")) {
|
|
7434
|
+
if (!line.trim()) continue;
|
|
7435
|
+
const [fullRef, shortName, head, upstream, track] = line.split("|");
|
|
7436
|
+
if (!shortName || shortName.endsWith("/HEAD")) continue;
|
|
7437
|
+
const isRemote = fullRef.startsWith("refs/remotes/");
|
|
7438
|
+
let ahead;
|
|
7439
|
+
let behind;
|
|
7440
|
+
const aheadM = /ahead (\d+)/.exec(track ?? "");
|
|
7441
|
+
const behindM = /behind (\d+)/.exec(track ?? "");
|
|
7442
|
+
if (aheadM) ahead = Number(aheadM[1]);
|
|
7443
|
+
if (behindM) behind = Number(behindM[1]);
|
|
7444
|
+
branches.push({
|
|
7445
|
+
name: shortName,
|
|
7446
|
+
current: !isRemote && (head === "*" || shortName === current),
|
|
7447
|
+
remote: isRemote,
|
|
7448
|
+
upstream: upstream || void 0,
|
|
7449
|
+
ahead,
|
|
7450
|
+
behind
|
|
7451
|
+
});
|
|
7452
|
+
}
|
|
7453
|
+
return branches;
|
|
7454
|
+
}
|
|
7418
7455
|
function git() {
|
|
7419
7456
|
const dir = getWorkspaceDir();
|
|
7420
7457
|
if (!dir) throw new Error("No workspace open");
|
|
@@ -7507,34 +7544,12 @@ function registerGitHandlers(ipc) {
|
|
|
7507
7544
|
handle.handleIpc(ipc, handle.IPC.git.branches, async () => {
|
|
7508
7545
|
const raw = await git().raw([
|
|
7509
7546
|
"for-each-ref",
|
|
7510
|
-
|
|
7547
|
+
`--format=${BRANCH_REF_FORMAT}`,
|
|
7511
7548
|
"refs/heads",
|
|
7512
7549
|
"refs/remotes"
|
|
7513
7550
|
]);
|
|
7514
7551
|
const current = (await git().branch()).current;
|
|
7515
|
-
|
|
7516
|
-
for (const line of raw.split("\n")) {
|
|
7517
|
-
if (!line.trim()) continue;
|
|
7518
|
-
const [shortName, head, upstream, track] = line.split("|");
|
|
7519
|
-
if (!shortName || shortName.endsWith("/HEAD")) continue;
|
|
7520
|
-
const isRemote = shortName.startsWith("origin/") || shortName.includes("/");
|
|
7521
|
-
const looksLocal = !isRemote;
|
|
7522
|
-
let ahead;
|
|
7523
|
-
let behind;
|
|
7524
|
-
const aheadM = /ahead (\d+)/.exec(track);
|
|
7525
|
-
const behindM = /behind (\d+)/.exec(track);
|
|
7526
|
-
if (aheadM) ahead = Number(aheadM[1]);
|
|
7527
|
-
if (behindM) behind = Number(behindM[1]);
|
|
7528
|
-
branches.push({
|
|
7529
|
-
name: shortName,
|
|
7530
|
-
current: looksLocal && (head === "*" || shortName === current),
|
|
7531
|
-
remote: isRemote,
|
|
7532
|
-
upstream: upstream || void 0,
|
|
7533
|
-
ahead,
|
|
7534
|
-
behind
|
|
7535
|
-
});
|
|
7536
|
-
}
|
|
7537
|
-
return branches;
|
|
7552
|
+
return parseBranchRefs(raw, current);
|
|
7538
7553
|
});
|
|
7539
7554
|
handle.handleIpc(ipc, handle.IPC.git.checkout, async (_e, branch, create) => {
|
|
7540
7555
|
if (create) {
|
package/out/main/runner.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
const promises = require("node:fs/promises");
|
|
4
4
|
const path = require("node:path");
|
|
5
|
-
const requestExec = require("./chunks/request-exec-
|
|
5
|
+
const requestExec = require("./chunks/request-exec-CcF1Fzve.js");
|
|
6
6
|
const requestCollection = require("./chunks/request-collection-zRRUfg0X.js");
|
|
7
7
|
const escape = require("./chunks/escape-DDVAlOvZ.js");
|
|
8
8
|
const runConcurrent = require("./chunks/run-concurrent-468tH0AX.js");
|
|
@@ -173,18 +173,18 @@ function buildHtmlReport(results, summary, meta = {}) {
|
|
|
173
173
|
:root {
|
|
174
174
|
--bg: #0f1117; --bg-surface: #161b22; --bg-panel: #0d1117;
|
|
175
175
|
--border: #21262d; --border-hover:#30363d;
|
|
176
|
-
--text: #c9d1d9; --text-bright: #e6edf3; --text-muted: #8b949e; --text-dim: #
|
|
176
|
+
--text: #c9d1d9; --text-bright: #e6edf3; --text-muted: #8b949e; --text-dim: #818992;
|
|
177
177
|
--green: #3fb950; --red: #f85149; --amber: #d29922; --blue: #79c0ff;
|
|
178
178
|
--badge-pass-bg: #0d3a1e; --badge-fail-bg: #3d1014; --badge-err-bg: #3d2a00; --badge-skip-bg: #21262d;
|
|
179
179
|
--hook-before-border: #7c3aed; --hook-after-border: #0e7490;
|
|
180
180
|
--hook-before-bg: #4c1d95; --hook-before-fg: #c4b5fd;
|
|
181
181
|
--hook-after-bg: #164e63; --hook-after-fg: #67e8f9;
|
|
182
|
-
--link: #
|
|
182
|
+
--link: #58a6ff;
|
|
183
183
|
}
|
|
184
184
|
html.light {
|
|
185
185
|
--bg: #ffffff; --bg-surface: #f6f8fa; --bg-panel: #ffffff;
|
|
186
186
|
--border: #d0d7de; --border-hover:#c4c9cf;
|
|
187
|
-
--text: #1f2328; --text-bright: #1f2328; --text-muted: #656d76; --text-dim: #
|
|
187
|
+
--text: #1f2328; --text-bright: #1f2328; --text-muted: #656d76; --text-dim: #6b7280;
|
|
188
188
|
--green: #1a7f37; --red: #cf222e; --amber: #9a6700; --blue: #0969da;
|
|
189
189
|
--badge-pass-bg: #dafbe1; --badge-fail-bg: #ffebe9; --badge-err-bg: #fff8c5; --badge-skip-bg: #f6f8fa;
|
|
190
190
|
--hook-before-border: #8b5cf6; --hook-after-border: #06b6d4;
|
|
@@ -551,7 +551,7 @@ async function main() {
|
|
|
551
551
|
} else if (!envName && workspace.settings?.defaultEnvironment && !env) {
|
|
552
552
|
console.warn(cliCommon.color(`Warning: default environment "${workspace.settings.defaultEnvironment}" not found. Running without environment.`, cliCommon.C.yellow));
|
|
553
553
|
}
|
|
554
|
-
const version = `v${"0.
|
|
554
|
+
const version = `v${"0.9.0"}`;
|
|
555
555
|
console.log("");
|
|
556
556
|
console.log(cliCommon.color(" API Test Runner" + (version ? ` ${version}` : ""), cliCommon.C.bold, cliCommon.C.white));
|
|
557
557
|
console.log(cliCommon.color(` Workspace: ${wsPath}`, cliCommon.C.gray));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { l as linter, E as EditorView, L as LanguageSupport, i as LRLanguage, s as styleTags, m as indentNodeProp, n as delimitedIndent, p as foldNodeProp, q as foldInside, S as StateField, u as LRParser, v as StateEffect, w as tags, a as reactExports, j as jsxRuntimeExports, e as ReactCodeMirror, o as oneDark, d as json } from "./codemirror-BKmwMUlV.js";
|
|
2
|
-
import { u as useT, a as useStore, b as useActiveEnvironment, i as isSubscriptionQuery } from "./index-
|
|
2
|
+
import { u as useT, a as useStore, b as useActiveEnvironment, i as isSubscriptionQuery } from "./index-BV1FsSQR.js";
|
|
3
3
|
import "./ajv-CJPwFjiP.js";
|
|
4
4
|
function devAssert(condition, message) {
|
|
5
5
|
const booleanCondition = Boolean(condition);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as reactExports, j as jsxRuntimeExports, e as ReactCodeMirror, o as oneDark, x as xml } from "./codemirror-BKmwMUlV.js";
|
|
2
|
-
import { u as useT, c as btnPrimaryCls, d as commentKeymap } from "./index-
|
|
2
|
+
import { u as useT, c as btnPrimaryCls, d as commentKeymap } from "./index-BV1FsSQR.js";
|
|
3
3
|
import "./ajv-CJPwFjiP.js";
|
|
4
4
|
const SOAP_11_CONTENT_TYPE = "text/xml; charset=utf-8";
|
|
5
5
|
const SOAP_12_CONTENT_TYPE = "application/soap+xml; charset=utf-8";
|