@schwabyio/gta 0.12.0 → 0.13.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/README.md +4 -0
- package/dist/FUNCTIONS.md +560 -0
- package/dist/SPEC.md +221 -49
- package/dist/chunks/{chunk-3NSHWS24.js → chunk-ABBBM5UZ.js} +627 -91
- package/dist/gta.js +18 -5
- package/dist/worker.js +1 -1
- package/package.json +1 -1
package/dist/gta.js
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
iterationName,
|
|
18
18
|
loadProjectCollections,
|
|
19
19
|
loadProjectTls,
|
|
20
|
+
parseEventStream,
|
|
20
21
|
parseMarkdown,
|
|
21
22
|
projectEnvironments,
|
|
22
23
|
readProject,
|
|
@@ -28,7 +29,7 @@ import {
|
|
|
28
29
|
samePath,
|
|
29
30
|
stepsForTags,
|
|
30
31
|
unattempted
|
|
31
|
-
} from "./chunks/chunk-
|
|
32
|
+
} from "./chunks/chunk-ABBBM5UZ.js";
|
|
32
33
|
|
|
33
34
|
// src/args.ts
|
|
34
35
|
var UsageError = class extends Error {
|
|
@@ -552,6 +553,16 @@ function requestCard(r) {
|
|
|
552
553
|
].filter(Boolean).join("\n")
|
|
553
554
|
);
|
|
554
555
|
}
|
|
556
|
+
var ENDED_BY = {
|
|
557
|
+
close: "closed by the server",
|
|
558
|
+
maxEvents: "stopped at maxEvents",
|
|
559
|
+
streamTimeout: "stopped at streamTimeout",
|
|
560
|
+
untilEvent: "stopped at untilEvent",
|
|
561
|
+
limit: "stopped at the safety limit",
|
|
562
|
+
stopped: "stopped by hand",
|
|
563
|
+
held: "took the events held"
|
|
564
|
+
};
|
|
565
|
+
var connectionNote = (stream) => stream.connection ? `, connection ${stream.connection.name} ${stream.connection.open ? "open" : "closed"}` : "";
|
|
555
566
|
function responseCard(r) {
|
|
556
567
|
const res = r.response;
|
|
557
568
|
if (!res) {
|
|
@@ -560,18 +571,20 @@ function responseCard(r) {
|
|
|
560
571
|
field2("Failure", '<span class="c-failed">No response was received.</span>', "wide")
|
|
561
572
|
);
|
|
562
573
|
}
|
|
563
|
-
const
|
|
574
|
+
const events = res.bodyKind === "events";
|
|
575
|
+
const body = res.bodyKind === "json" ? prettyJson(res.body) : events ? JSON.stringify(parseEventStream(res.body), null, 2) : res.body;
|
|
564
576
|
const extra = [
|
|
565
577
|
`first byte ${Math.round(res.timings.ttfbMs)}ms`,
|
|
566
578
|
bytes(res.sizeBytes),
|
|
567
|
-
res.redirectCount > 0 ? `${res.redirectCount} redirect${res.redirectCount === 1 ? "" : "s"}` : ""
|
|
579
|
+
res.redirectCount > 0 ? `${res.redirectCount} redirect${res.redirectCount === 1 ? "" : "s"}` : "",
|
|
580
|
+
res.stream ? `${res.stream.at.length} event${res.stream.at.length === 1 ? "" : "s"}, ${ENDED_BY[res.stream.endedBy]}${connectionNote(res.stream)}` : ""
|
|
568
581
|
].filter(Boolean);
|
|
569
582
|
return card(
|
|
570
583
|
"Response",
|
|
571
584
|
[
|
|
572
585
|
field2("Response Code", escape(`${res.status} ${res.statusText}`.trim())),
|
|
573
586
|
res.headers.length > 0 ? field2("Response Headers", scrollPre(headerText(res.headers)), "wide") : "",
|
|
574
|
-
body ? field2("Response Body", scrollPre(clip2(body)), "wide") : "",
|
|
587
|
+
body ? field2(events ? "Response Events" : "Response Body", scrollPre(clip2(body)), "wide") : "",
|
|
575
588
|
field2(
|
|
576
589
|
"Response Time",
|
|
577
590
|
`${Math.round(res.timings.totalMs)}ms <span class="dim">\xB7 ${extra.join(" \xB7 ")}</span>`
|
|
@@ -1269,7 +1282,7 @@ function coerce(key, value, where) {
|
|
|
1269
1282
|
}
|
|
1270
1283
|
|
|
1271
1284
|
// src/main.ts
|
|
1272
|
-
var VERSION = true ? "0.
|
|
1285
|
+
var VERSION = true ? "0.13.0" : "0.0.0-dev";
|
|
1273
1286
|
var JUNIT_DIR = "junit";
|
|
1274
1287
|
var JUNIT_FILE = "junit.xml";
|
|
1275
1288
|
var HTML_DIR = "html";
|
package/dist/worker.js
CHANGED
|
@@ -3,7 +3,7 @@ import { createRequire as __gtaCreateRequire } from 'node:module';
|
|
|
3
3
|
const require = __gtaCreateRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
runJob
|
|
6
|
-
} from "./chunks/chunk-
|
|
6
|
+
} from "./chunks/chunk-ABBBM5UZ.js";
|
|
7
7
|
|
|
8
8
|
// src/worker.ts
|
|
9
9
|
import { parentPort, workerData } from "node:worker_threads";
|
package/package.json
CHANGED