postboy-tui 1.3.6 → 1.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.
- package/dist/cli.js +1174 -271
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -32071,13 +32071,13 @@ var require_figures = __commonJS((exports, module) => {
|
|
|
32071
32071
|
|
|
32072
32072
|
// node_modules/inquirer/lib/objects/separator.js
|
|
32073
32073
|
var require_separator = __commonJS((exports, module) => {
|
|
32074
|
-
var
|
|
32074
|
+
var chalk5 = require_source();
|
|
32075
32075
|
var figures = require_figures();
|
|
32076
32076
|
|
|
32077
32077
|
class Separator {
|
|
32078
32078
|
constructor(line) {
|
|
32079
32079
|
this.type = "separator";
|
|
32080
|
-
this.line =
|
|
32080
|
+
this.line = chalk5.dim(line || new Array(15).join(figures.line));
|
|
32081
32081
|
}
|
|
32082
32082
|
toString() {
|
|
32083
32083
|
return this.line;
|
|
@@ -32668,11 +32668,11 @@ var require_isPlainObject = __commonJS((exports, module) => {
|
|
|
32668
32668
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
32669
32669
|
return false;
|
|
32670
32670
|
}
|
|
32671
|
-
var
|
|
32672
|
-
if (
|
|
32671
|
+
var proto3 = getPrototype(value);
|
|
32672
|
+
if (proto3 === null) {
|
|
32673
32673
|
return true;
|
|
32674
32674
|
}
|
|
32675
|
-
var Ctor = hasOwnProperty.call(
|
|
32675
|
+
var Ctor = hasOwnProperty.call(proto3, "constructor") && proto3.constructor;
|
|
32676
32676
|
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
32677
32677
|
}
|
|
32678
32678
|
module.exports = isPlainObject;
|
|
@@ -36378,7 +36378,7 @@ var require_innerFrom = __commonJS((exports) => {
|
|
|
36378
36378
|
exports.fromIterable = fromIterable;
|
|
36379
36379
|
function fromAsyncIterable(asyncIterable) {
|
|
36380
36380
|
return new Observable_1.Observable(function(subscriber) {
|
|
36381
|
-
|
|
36381
|
+
process14(asyncIterable, subscriber).catch(function(err) {
|
|
36382
36382
|
return subscriber.error(err);
|
|
36383
36383
|
});
|
|
36384
36384
|
});
|
|
@@ -36388,7 +36388,7 @@ var require_innerFrom = __commonJS((exports) => {
|
|
|
36388
36388
|
return fromAsyncIterable(isReadableStreamLike_1.readableStreamLikeToAsyncGenerator(readableStream));
|
|
36389
36389
|
}
|
|
36390
36390
|
exports.fromReadableStreamLike = fromReadableStreamLike;
|
|
36391
|
-
function
|
|
36391
|
+
function process14(asyncIterable, subscriber) {
|
|
36392
36392
|
var asyncIterable_1, asyncIterable_1_1;
|
|
36393
36393
|
var e_2, _a;
|
|
36394
36394
|
return __awaiter(this, undefined, undefined, function() {
|
|
@@ -43378,8 +43378,8 @@ var require__arrayLikeKeys = __commonJS((exports, module) => {
|
|
|
43378
43378
|
var require__isPrototype = __commonJS((exports, module) => {
|
|
43379
43379
|
var objectProto = Object.prototype;
|
|
43380
43380
|
function isPrototype(value) {
|
|
43381
|
-
var Ctor = value && value.constructor,
|
|
43382
|
-
return value ===
|
|
43381
|
+
var Ctor = value && value.constructor, proto3 = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
43382
|
+
return value === proto3;
|
|
43383
43383
|
}
|
|
43384
43384
|
module.exports = isPrototype;
|
|
43385
43385
|
});
|
|
@@ -44019,14 +44019,14 @@ var require__baseCreate = __commonJS((exports, module) => {
|
|
|
44019
44019
|
var objectCreate = Object.create;
|
|
44020
44020
|
var baseCreate = function() {
|
|
44021
44021
|
function object() {}
|
|
44022
|
-
return function(
|
|
44023
|
-
if (!isObject(
|
|
44022
|
+
return function(proto3) {
|
|
44023
|
+
if (!isObject(proto3)) {
|
|
44024
44024
|
return {};
|
|
44025
44025
|
}
|
|
44026
44026
|
if (objectCreate) {
|
|
44027
|
-
return objectCreate(
|
|
44027
|
+
return objectCreate(proto3);
|
|
44028
44028
|
}
|
|
44029
|
-
object.prototype =
|
|
44029
|
+
object.prototype = proto3;
|
|
44030
44030
|
var result = new object;
|
|
44031
44031
|
object.prototype = undefined;
|
|
44032
44032
|
return result;
|
|
@@ -45097,7 +45097,7 @@ var require_string_width = __commonJS((exports, module) => {
|
|
|
45097
45097
|
var require_wrap_ansi = __commonJS((exports, module) => {
|
|
45098
45098
|
var stringWidth2 = require_string_width();
|
|
45099
45099
|
var stripAnsi2 = require_strip_ansi();
|
|
45100
|
-
var
|
|
45100
|
+
var ansiStyles7 = require_ansi_styles();
|
|
45101
45101
|
var ESCAPES5 = new Set([
|
|
45102
45102
|
"\x1B",
|
|
45103
45103
|
""
|
|
@@ -45226,7 +45226,7 @@ var require_wrap_ansi = __commonJS((exports, module) => {
|
|
|
45226
45226
|
escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
|
|
45227
45227
|
}
|
|
45228
45228
|
}
|
|
45229
|
-
const code =
|
|
45229
|
+
const code = ansiStyles7.codes.get(Number(escapeCode));
|
|
45230
45230
|
if (pre[index + 1] === `
|
|
45231
45231
|
`) {
|
|
45232
45232
|
if (escapeUrl) {
|
|
@@ -46949,19 +46949,19 @@ var require_is_unicode_supported = __commonJS((exports, module) => {
|
|
|
46949
46949
|
|
|
46950
46950
|
// node_modules/log-symbols/index.js
|
|
46951
46951
|
var require_log_symbols = __commonJS((exports, module) => {
|
|
46952
|
-
var
|
|
46952
|
+
var chalk5 = require_source();
|
|
46953
46953
|
var isUnicodeSupported = require_is_unicode_supported();
|
|
46954
46954
|
var main = {
|
|
46955
|
-
info:
|
|
46956
|
-
success:
|
|
46957
|
-
warning:
|
|
46958
|
-
error:
|
|
46955
|
+
info: chalk5.blue("ℹ"),
|
|
46956
|
+
success: chalk5.green("✔"),
|
|
46957
|
+
warning: chalk5.yellow("⚠"),
|
|
46958
|
+
error: chalk5.red("✖")
|
|
46959
46959
|
};
|
|
46960
46960
|
var fallback = {
|
|
46961
|
-
info:
|
|
46962
|
-
success:
|
|
46963
|
-
warning:
|
|
46964
|
-
error:
|
|
46961
|
+
info: chalk5.blue("i"),
|
|
46962
|
+
success: chalk5.green("√"),
|
|
46963
|
+
warning: chalk5.yellow("‼"),
|
|
46964
|
+
error: chalk5.red("×")
|
|
46965
46965
|
};
|
|
46966
46966
|
module.exports = isUnicodeSupported() ? main : fallback;
|
|
46967
46967
|
});
|
|
@@ -47007,7 +47007,7 @@ var require_clone2 = __commonJS((exports, module) => {
|
|
|
47007
47007
|
if (depth2 == 0)
|
|
47008
47008
|
return parent2;
|
|
47009
47009
|
var child;
|
|
47010
|
-
var
|
|
47010
|
+
var proto3;
|
|
47011
47011
|
if (typeof parent2 != "object") {
|
|
47012
47012
|
return parent2;
|
|
47013
47013
|
}
|
|
@@ -47029,11 +47029,11 @@ var require_clone2 = __commonJS((exports, module) => {
|
|
|
47029
47029
|
return child;
|
|
47030
47030
|
} else {
|
|
47031
47031
|
if (typeof prototype == "undefined") {
|
|
47032
|
-
|
|
47033
|
-
child = Object.create(
|
|
47032
|
+
proto3 = Object.getPrototypeOf(parent2);
|
|
47033
|
+
child = Object.create(proto3);
|
|
47034
47034
|
} else {
|
|
47035
47035
|
child = Object.create(prototype);
|
|
47036
|
-
|
|
47036
|
+
proto3 = prototype;
|
|
47037
47037
|
}
|
|
47038
47038
|
}
|
|
47039
47039
|
if (circular) {
|
|
@@ -47046,8 +47046,8 @@ var require_clone2 = __commonJS((exports, module) => {
|
|
|
47046
47046
|
}
|
|
47047
47047
|
for (var i in parent2) {
|
|
47048
47048
|
var attrs;
|
|
47049
|
-
if (
|
|
47050
|
-
attrs = Object.getOwnPropertyDescriptor(
|
|
47049
|
+
if (proto3) {
|
|
47050
|
+
attrs = Object.getOwnPropertyDescriptor(proto3, i);
|
|
47051
47051
|
}
|
|
47052
47052
|
if (attrs && attrs.set == null) {
|
|
47053
47053
|
continue;
|
|
@@ -50510,7 +50510,7 @@ var require_bl = __commonJS((exports, module) => {
|
|
|
50510
50510
|
// node_modules/ora/index.js
|
|
50511
50511
|
var require_ora = __commonJS((exports, module) => {
|
|
50512
50512
|
var readline = __require("readline");
|
|
50513
|
-
var
|
|
50513
|
+
var chalk5 = require_source();
|
|
50514
50514
|
var cliCursor2 = require_cli_cursor2();
|
|
50515
50515
|
var cliSpinners = require_cli_spinners();
|
|
50516
50516
|
var logSymbols = require_log_symbols();
|
|
@@ -50710,7 +50710,7 @@ var require_ora = __commonJS((exports, module) => {
|
|
|
50710
50710
|
const { frames } = this.spinner;
|
|
50711
50711
|
let frame = frames[this.frameIndex];
|
|
50712
50712
|
if (this.color) {
|
|
50713
|
-
frame =
|
|
50713
|
+
frame = chalk5[this.color](frame);
|
|
50714
50714
|
}
|
|
50715
50715
|
this.frameIndex = ++this.frameIndex % frames.length;
|
|
50716
50716
|
const fullPrefixText = typeof this.prefixText === "string" && this.prefixText !== "" ? this.prefixText + " " : "";
|
|
@@ -50955,7 +50955,7 @@ var require_base = __commonJS((exports, module) => {
|
|
|
50955
50955
|
defaults: require_defaults(),
|
|
50956
50956
|
clone: require_clone()
|
|
50957
50957
|
};
|
|
50958
|
-
var
|
|
50958
|
+
var chalk5 = require_source();
|
|
50959
50959
|
var runAsync = require_run_async();
|
|
50960
50960
|
var { filter, flatMap, share, take, takeUntil } = require_operators();
|
|
50961
50961
|
var Choices = require_choices();
|
|
@@ -50974,7 +50974,7 @@ var require_base = __commonJS((exports, module) => {
|
|
|
50974
50974
|
filteringText: "",
|
|
50975
50975
|
when: () => true,
|
|
50976
50976
|
suffix: "",
|
|
50977
|
-
prefix:
|
|
50977
|
+
prefix: chalk5.green("?")
|
|
50978
50978
|
});
|
|
50979
50979
|
if (!this.opt.name) {
|
|
50980
50980
|
this.throwParamError("name");
|
|
@@ -51029,12 +51029,12 @@ var require_base = __commonJS((exports, module) => {
|
|
|
51029
51029
|
return value;
|
|
51030
51030
|
}
|
|
51031
51031
|
getQuestion() {
|
|
51032
|
-
let message = (this.opt.prefix ? this.opt.prefix + " " : "") +
|
|
51032
|
+
let message = (this.opt.prefix ? this.opt.prefix + " " : "") + chalk5.bold(this.opt.message) + this.opt.suffix + chalk5.reset(" ");
|
|
51033
51033
|
if (this.opt.default != null && this.status !== "touched" && this.status !== "answered") {
|
|
51034
51034
|
if (this.opt.type === "password") {
|
|
51035
|
-
message +=
|
|
51035
|
+
message += chalk5.italic.dim("[hidden] ");
|
|
51036
51036
|
} else {
|
|
51037
|
-
message +=
|
|
51037
|
+
message += chalk5.dim("(" + this.opt.default + ") ");
|
|
51038
51038
|
}
|
|
51039
51039
|
}
|
|
51040
51040
|
return message;
|
|
@@ -51067,7 +51067,7 @@ var require_events = __commonJS((exports, module) => {
|
|
|
51067
51067
|
|
|
51068
51068
|
// node_modules/inquirer/lib/utils/paginator.js
|
|
51069
51069
|
var require_paginator = __commonJS((exports, module) => {
|
|
51070
|
-
var
|
|
51070
|
+
var chalk5 = require_source();
|
|
51071
51071
|
|
|
51072
51072
|
class Paginator {
|
|
51073
51073
|
constructor(screen, options = {}) {
|
|
@@ -51092,7 +51092,7 @@ var require_paginator = __commonJS((exports, module) => {
|
|
|
51092
51092
|
this.lastIndex = active;
|
|
51093
51093
|
return visibleLines.join(`
|
|
51094
51094
|
`) + `
|
|
51095
|
-
` +
|
|
51095
|
+
` + chalk5.dim("(Move up and down to reveal more choices)");
|
|
51096
51096
|
}
|
|
51097
51097
|
getInfiniteLines(lines, active, pageSize) {
|
|
51098
51098
|
if (this.pointer === undefined) {
|
|
@@ -51143,7 +51143,7 @@ var require_incrementListIndex = __commonJS((exports, module) => {
|
|
|
51143
51143
|
|
|
51144
51144
|
// node_modules/inquirer/lib/prompts/list.js
|
|
51145
51145
|
var require_list = __commonJS((exports, module) => {
|
|
51146
|
-
var
|
|
51146
|
+
var chalk5 = require_source();
|
|
51147
51147
|
var figures = require_figures();
|
|
51148
51148
|
var cliCursor2 = require_cli_cursor();
|
|
51149
51149
|
var runAsync = require_run_async();
|
|
@@ -51187,10 +51187,10 @@ var require_list = __commonJS((exports, module) => {
|
|
|
51187
51187
|
render() {
|
|
51188
51188
|
let message = this.getQuestion();
|
|
51189
51189
|
if (this.firstRender) {
|
|
51190
|
-
message +=
|
|
51190
|
+
message += chalk5.dim("(Use arrow keys)");
|
|
51191
51191
|
}
|
|
51192
51192
|
if (this.status === "answered") {
|
|
51193
|
-
message +=
|
|
51193
|
+
message += chalk5.cyan(this.opt.choices.getChoice(this.selected).short);
|
|
51194
51194
|
} else {
|
|
51195
51195
|
const choicesStr = listRender(this.opt.choices, this.selected);
|
|
51196
51196
|
const indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.selected));
|
|
@@ -51261,7 +51261,7 @@ var require_list = __commonJS((exports, module) => {
|
|
|
51261
51261
|
const isSelected = i - separatorOffset === pointer;
|
|
51262
51262
|
let line = (isSelected ? figures.pointer + " " : " ") + choice.name;
|
|
51263
51263
|
if (isSelected) {
|
|
51264
|
-
line =
|
|
51264
|
+
line = chalk5.cyan(line);
|
|
51265
51265
|
}
|
|
51266
51266
|
output += line + `
|
|
51267
51267
|
`;
|
|
@@ -51273,7 +51273,7 @@ var require_list = __commonJS((exports, module) => {
|
|
|
51273
51273
|
|
|
51274
51274
|
// node_modules/inquirer/lib/prompts/input.js
|
|
51275
51275
|
var require_input = __commonJS((exports, module) => {
|
|
51276
|
-
var
|
|
51276
|
+
var chalk5 = require_source();
|
|
51277
51277
|
var { map, takeUntil } = require_operators();
|
|
51278
51278
|
var Base = require_base();
|
|
51279
51279
|
var observe = require_events();
|
|
@@ -51304,10 +51304,10 @@ var require_input = __commonJS((exports, module) => {
|
|
|
51304
51304
|
if (transformer) {
|
|
51305
51305
|
message += transformer(appendContent, this.answers, { isFinal });
|
|
51306
51306
|
} else {
|
|
51307
|
-
message += isFinal ?
|
|
51307
|
+
message += isFinal ? chalk5.cyan(appendContent) : appendContent;
|
|
51308
51308
|
}
|
|
51309
51309
|
if (error) {
|
|
51310
|
-
bottomContent =
|
|
51310
|
+
bottomContent = chalk5.red(">> ") + error;
|
|
51311
51311
|
}
|
|
51312
51312
|
this.screen.render(message, bottomContent);
|
|
51313
51313
|
}
|
|
@@ -51358,7 +51358,7 @@ var require_number = __commonJS((exports, module) => {
|
|
|
51358
51358
|
|
|
51359
51359
|
// node_modules/inquirer/lib/prompts/confirm.js
|
|
51360
51360
|
var require_confirm = __commonJS((exports, module) => {
|
|
51361
|
-
var
|
|
51361
|
+
var chalk5 = require_source();
|
|
51362
51362
|
var { take, takeUntil } = require_operators();
|
|
51363
51363
|
var Base = require_base();
|
|
51364
51364
|
var observe = require_events();
|
|
@@ -51392,7 +51392,7 @@ var require_confirm = __commonJS((exports, module) => {
|
|
|
51392
51392
|
render(answer) {
|
|
51393
51393
|
let message = this.getQuestion();
|
|
51394
51394
|
if (typeof answer === "boolean") {
|
|
51395
|
-
message +=
|
|
51395
|
+
message += chalk5.cyan(answer ? "Yes" : "No");
|
|
51396
51396
|
} else {
|
|
51397
51397
|
message += this.rl.line;
|
|
51398
51398
|
}
|
|
@@ -51415,7 +51415,7 @@ var require_confirm = __commonJS((exports, module) => {
|
|
|
51415
51415
|
|
|
51416
51416
|
// node_modules/inquirer/lib/prompts/rawlist.js
|
|
51417
51417
|
var require_rawlist = __commonJS((exports, module) => {
|
|
51418
|
-
var
|
|
51418
|
+
var chalk5 = require_source();
|
|
51419
51419
|
var { map, takeUntil } = require_operators();
|
|
51420
51420
|
var Base = require_base();
|
|
51421
51421
|
var Separator = require_separator();
|
|
@@ -51470,7 +51470,7 @@ var require_rawlist = __commonJS((exports, module) => {
|
|
|
51470
51470
|
let message = this.getQuestion();
|
|
51471
51471
|
let bottomContent = "";
|
|
51472
51472
|
if (this.status === "answered") {
|
|
51473
|
-
message +=
|
|
51473
|
+
message += chalk5.cyan(this.opt.choices.getChoice(this.selected).short);
|
|
51474
51474
|
} else {
|
|
51475
51475
|
const choicesStr = renderChoices(this.opt.choices, this.selected);
|
|
51476
51476
|
message += `
|
|
@@ -51481,7 +51481,7 @@ var require_rawlist = __commonJS((exports, module) => {
|
|
|
51481
51481
|
message += this.rl.line;
|
|
51482
51482
|
if (error) {
|
|
51483
51483
|
bottomContent = `
|
|
51484
|
-
` +
|
|
51484
|
+
` + chalk5.red(">> ") + error;
|
|
51485
51485
|
}
|
|
51486
51486
|
this.screen.render(message, bottomContent);
|
|
51487
51487
|
}
|
|
@@ -51549,7 +51549,7 @@ var require_rawlist = __commonJS((exports, module) => {
|
|
|
51549
51549
|
const index = i - separatorOffset;
|
|
51550
51550
|
let display = index + 1 + ") " + choice.name;
|
|
51551
51551
|
if (index === pointer) {
|
|
51552
|
-
display =
|
|
51552
|
+
display = chalk5.cyan(display);
|
|
51553
51553
|
}
|
|
51554
51554
|
output += display;
|
|
51555
51555
|
});
|
|
@@ -51560,7 +51560,7 @@ var require_rawlist = __commonJS((exports, module) => {
|
|
|
51560
51560
|
|
|
51561
51561
|
// node_modules/inquirer/lib/prompts/expand.js
|
|
51562
51562
|
var require_expand2 = __commonJS((exports, module) => {
|
|
51563
|
-
var
|
|
51563
|
+
var chalk5 = require_source();
|
|
51564
51564
|
var { map, takeUntil } = require_operators();
|
|
51565
51565
|
var Base = require_base();
|
|
51566
51566
|
var Separator = require_separator();
|
|
@@ -51602,7 +51602,7 @@ var require_expand2 = __commonJS((exports, module) => {
|
|
|
51602
51602
|
let message = this.getQuestion();
|
|
51603
51603
|
let bottomContent = "";
|
|
51604
51604
|
if (this.status === "answered") {
|
|
51605
|
-
message +=
|
|
51605
|
+
message += chalk5.cyan(this.answer);
|
|
51606
51606
|
} else if (this.status === "expanded") {
|
|
51607
51607
|
const choicesStr = renderChoices(this.opt.choices, this.selectedKey);
|
|
51608
51608
|
message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize);
|
|
@@ -51611,10 +51611,10 @@ var require_expand2 = __commonJS((exports, module) => {
|
|
|
51611
51611
|
}
|
|
51612
51612
|
message += this.rl.line;
|
|
51613
51613
|
if (error) {
|
|
51614
|
-
bottomContent =
|
|
51614
|
+
bottomContent = chalk5.red(">> ") + error;
|
|
51615
51615
|
}
|
|
51616
51616
|
if (hint) {
|
|
51617
|
-
bottomContent =
|
|
51617
|
+
bottomContent = chalk5.cyan(">> ") + hint;
|
|
51618
51618
|
}
|
|
51619
51619
|
this.screen.render(message, bottomContent);
|
|
51620
51620
|
}
|
|
@@ -51639,7 +51639,7 @@ var require_expand2 = __commonJS((exports, module) => {
|
|
|
51639
51639
|
}
|
|
51640
51640
|
let choiceStr = choice.key + ") " + choice.name;
|
|
51641
51641
|
if (this.selectedKey === choice.key) {
|
|
51642
|
-
choiceStr =
|
|
51642
|
+
choiceStr = chalk5.cyan(choiceStr);
|
|
51643
51643
|
}
|
|
51644
51644
|
output += choiceStr;
|
|
51645
51645
|
});
|
|
@@ -51720,7 +51720,7 @@ var require_expand2 = __commonJS((exports, module) => {
|
|
|
51720
51720
|
}
|
|
51721
51721
|
let choiceStr = choice.key + ") " + choice.name;
|
|
51722
51722
|
if (pointer === choice.key) {
|
|
51723
|
-
choiceStr =
|
|
51723
|
+
choiceStr = chalk5.cyan(choiceStr);
|
|
51724
51724
|
}
|
|
51725
51725
|
output += choiceStr;
|
|
51726
51726
|
});
|
|
@@ -51731,7 +51731,7 @@ var require_expand2 = __commonJS((exports, module) => {
|
|
|
51731
51731
|
|
|
51732
51732
|
// node_modules/inquirer/lib/prompts/checkbox.js
|
|
51733
51733
|
var require_checkbox = __commonJS((exports, module) => {
|
|
51734
|
-
var
|
|
51734
|
+
var chalk5 = require_source();
|
|
51735
51735
|
var cliCursor2 = require_cli_cursor();
|
|
51736
51736
|
var figures = require_figures();
|
|
51737
51737
|
var { map, takeUntil } = require_operators();
|
|
@@ -51779,10 +51779,10 @@ var require_checkbox = __commonJS((exports, module) => {
|
|
|
51779
51779
|
let message = this.getQuestion();
|
|
51780
51780
|
let bottomContent = "";
|
|
51781
51781
|
if (!this.dontShowHints) {
|
|
51782
|
-
message += "(Press " +
|
|
51782
|
+
message += "(Press " + chalk5.cyan.bold("<space>") + " to select, " + chalk5.cyan.bold("<a>") + " to toggle all, " + chalk5.cyan.bold("<i>") + " to invert selection, and " + chalk5.cyan.bold("<enter>") + " to proceed)";
|
|
51783
51783
|
}
|
|
51784
51784
|
if (this.status === "answered") {
|
|
51785
|
-
message +=
|
|
51785
|
+
message += chalk5.cyan(this.selection.join(", "));
|
|
51786
51786
|
} else {
|
|
51787
51787
|
const choicesStr = renderChoices(this.opt.choices, this.pointer);
|
|
51788
51788
|
const indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.pointer));
|
|
@@ -51805,7 +51805,7 @@ var require_checkbox = __commonJS((exports, module) => {
|
|
|
51805
51805
|
` + this.paginator.paginate(choicesStr, realIndexPosition, this.opt.pageSize);
|
|
51806
51806
|
}
|
|
51807
51807
|
if (error) {
|
|
51808
|
-
bottomContent =
|
|
51808
|
+
bottomContent = chalk5.red(">> ") + error;
|
|
51809
51809
|
}
|
|
51810
51810
|
this.screen.render(message, bottomContent);
|
|
51811
51811
|
}
|
|
@@ -51885,7 +51885,7 @@ var require_checkbox = __commonJS((exports, module) => {
|
|
|
51885
51885
|
} else {
|
|
51886
51886
|
const line = getCheckbox(choice.checked) + " " + choice.name;
|
|
51887
51887
|
if (i - separatorOffset === pointer) {
|
|
51888
|
-
output +=
|
|
51888
|
+
output += chalk5.cyan(figures.pointer + line);
|
|
51889
51889
|
} else {
|
|
51890
51890
|
output += " " + line;
|
|
51891
51891
|
}
|
|
@@ -51896,14 +51896,14 @@ var require_checkbox = __commonJS((exports, module) => {
|
|
|
51896
51896
|
return output.replace(/\n$/, "");
|
|
51897
51897
|
}
|
|
51898
51898
|
function getCheckbox(checked) {
|
|
51899
|
-
return checked ?
|
|
51899
|
+
return checked ? chalk5.green(figures.radioOn) : figures.radioOff;
|
|
51900
51900
|
}
|
|
51901
51901
|
module.exports = CheckboxPrompt;
|
|
51902
51902
|
});
|
|
51903
51903
|
|
|
51904
51904
|
// node_modules/inquirer/lib/prompts/password.js
|
|
51905
51905
|
var require_password = __commonJS((exports, module) => {
|
|
51906
|
-
var
|
|
51906
|
+
var chalk5 = require_source();
|
|
51907
51907
|
var { map, takeUntil } = require_operators();
|
|
51908
51908
|
var Base = require_base();
|
|
51909
51909
|
var observe = require_events();
|
|
@@ -51938,15 +51938,15 @@ var require_password = __commonJS((exports, module) => {
|
|
|
51938
51938
|
}
|
|
51939
51939
|
if (error) {
|
|
51940
51940
|
bottomContent = `
|
|
51941
|
-
` +
|
|
51941
|
+
` + chalk5.red(">> ") + error;
|
|
51942
51942
|
}
|
|
51943
51943
|
this.screen.render(message, bottomContent);
|
|
51944
51944
|
}
|
|
51945
51945
|
getMaskedValue(value) {
|
|
51946
51946
|
if (this.status === "answered") {
|
|
51947
|
-
return this.opt.mask ?
|
|
51947
|
+
return this.opt.mask ? chalk5.cyan(mask(value, this.opt.mask)) : chalk5.italic.dim("[hidden]");
|
|
51948
51948
|
}
|
|
51949
|
-
return this.opt.mask ? mask(value, this.opt.mask) :
|
|
51949
|
+
return this.opt.mask ? mask(value, this.opt.mask) : chalk5.italic.dim("[input is hidden] ");
|
|
51950
51950
|
}
|
|
51951
51951
|
getSpinningValue(value) {
|
|
51952
51952
|
return this.getMaskedValue(value);
|
|
@@ -61023,9 +61023,9 @@ var require_CreateFileError = __commonJS((exports) => {
|
|
|
61023
61023
|
var _newTarget = this.constructor;
|
|
61024
61024
|
var _this = _super.call(this, "Failed to create temporary file for editor") || this;
|
|
61025
61025
|
_this.originalError = originalError;
|
|
61026
|
-
var
|
|
61026
|
+
var proto3 = _newTarget.prototype;
|
|
61027
61027
|
if (Object.setPrototypeOf) {
|
|
61028
|
-
Object.setPrototypeOf(_this,
|
|
61028
|
+
Object.setPrototypeOf(_this, proto3);
|
|
61029
61029
|
} else {
|
|
61030
61030
|
_this.__proto__ = _newTarget.prototype;
|
|
61031
61031
|
}
|
|
@@ -61064,9 +61064,9 @@ var require_LaunchEditorError = __commonJS((exports) => {
|
|
|
61064
61064
|
var _newTarget = this.constructor;
|
|
61065
61065
|
var _this = _super.call(this, "Failed launch editor") || this;
|
|
61066
61066
|
_this.originalError = originalError;
|
|
61067
|
-
var
|
|
61067
|
+
var proto3 = _newTarget.prototype;
|
|
61068
61068
|
if (Object.setPrototypeOf) {
|
|
61069
|
-
Object.setPrototypeOf(_this,
|
|
61069
|
+
Object.setPrototypeOf(_this, proto3);
|
|
61070
61070
|
} else {
|
|
61071
61071
|
_this.__proto__ = _newTarget.prototype;
|
|
61072
61072
|
}
|
|
@@ -61105,9 +61105,9 @@ var require_ReadFileError = __commonJS((exports) => {
|
|
|
61105
61105
|
var _newTarget = this.constructor;
|
|
61106
61106
|
var _this = _super.call(this, "Failed to read temporary file") || this;
|
|
61107
61107
|
_this.originalError = originalError;
|
|
61108
|
-
var
|
|
61108
|
+
var proto3 = _newTarget.prototype;
|
|
61109
61109
|
if (Object.setPrototypeOf) {
|
|
61110
|
-
Object.setPrototypeOf(_this,
|
|
61110
|
+
Object.setPrototypeOf(_this, proto3);
|
|
61111
61111
|
} else {
|
|
61112
61112
|
_this.__proto__ = _newTarget.prototype;
|
|
61113
61113
|
}
|
|
@@ -61146,9 +61146,9 @@ var require_RemoveFileError = __commonJS((exports) => {
|
|
|
61146
61146
|
var _newTarget = this.constructor;
|
|
61147
61147
|
var _this = _super.call(this, "Failed to cleanup temporary file") || this;
|
|
61148
61148
|
_this.originalError = originalError;
|
|
61149
|
-
var
|
|
61149
|
+
var proto3 = _newTarget.prototype;
|
|
61150
61150
|
if (Object.setPrototypeOf) {
|
|
61151
|
-
Object.setPrototypeOf(_this,
|
|
61151
|
+
Object.setPrototypeOf(_this, proto3);
|
|
61152
61152
|
} else {
|
|
61153
61153
|
_this.__proto__ = _newTarget.prototype;
|
|
61154
61154
|
}
|
|
@@ -61344,7 +61344,7 @@ var require_main = __commonJS((exports) => {
|
|
|
61344
61344
|
|
|
61345
61345
|
// node_modules/inquirer/lib/prompts/editor.js
|
|
61346
61346
|
var require_editor = __commonJS((exports, module) => {
|
|
61347
|
-
var
|
|
61347
|
+
var chalk5 = require_source();
|
|
61348
61348
|
var { editAsync } = require_main();
|
|
61349
61349
|
var Base = require_base();
|
|
61350
61350
|
var observe = require_events();
|
|
@@ -61368,12 +61368,12 @@ var require_editor = __commonJS((exports, module) => {
|
|
|
61368
61368
|
let bottomContent = "";
|
|
61369
61369
|
let message = this.getQuestion();
|
|
61370
61370
|
if (this.status === "answered") {
|
|
61371
|
-
message +=
|
|
61371
|
+
message += chalk5.dim("Received");
|
|
61372
61372
|
} else {
|
|
61373
|
-
message +=
|
|
61373
|
+
message += chalk5.dim("Press <enter> to launch your preferred editor.");
|
|
61374
61374
|
}
|
|
61375
61375
|
if (error) {
|
|
61376
|
-
bottomContent =
|
|
61376
|
+
bottomContent = chalk5.red(">> ") + error;
|
|
61377
61377
|
}
|
|
61378
61378
|
this.screen.render(message, bottomContent);
|
|
61379
61379
|
}
|
|
@@ -61471,7 +61471,7 @@ var {
|
|
|
61471
61471
|
} = import__.default;
|
|
61472
61472
|
|
|
61473
61473
|
// src/index.ts
|
|
61474
|
-
var
|
|
61474
|
+
var import_chalk9 = __toESM(require_source(), 1);
|
|
61475
61475
|
|
|
61476
61476
|
// src/utils/logger.ts
|
|
61477
61477
|
var import_chalk = __toESM(require_source(), 1);
|
|
@@ -67534,7 +67534,7 @@ var useFocusManager = () => {
|
|
|
67534
67534
|
};
|
|
67535
67535
|
var use_focus_manager_default = useFocusManager;
|
|
67536
67536
|
// src/ui/app/ui.tsx
|
|
67537
|
-
var
|
|
67537
|
+
var import_react34 = __toESM(require_react(), 1);
|
|
67538
67538
|
|
|
67539
67539
|
// src/utils/history.ts
|
|
67540
67540
|
import { promises as fs2 } from "fs";
|
|
@@ -67630,6 +67630,14 @@ function sendRequest({ method, url, headers = {}, body }) {
|
|
|
67630
67630
|
return new Promise((resolve, reject) => {
|
|
67631
67631
|
const urlObj = new URL2(url);
|
|
67632
67632
|
const isHttps = urlObj.protocol === "https:";
|
|
67633
|
+
const timings = {
|
|
67634
|
+
start: performance.now(),
|
|
67635
|
+
dnsLookup: 0,
|
|
67636
|
+
tcpConnection: 0,
|
|
67637
|
+
tlsHandshake: 0,
|
|
67638
|
+
ttfb: 0,
|
|
67639
|
+
end: 0
|
|
67640
|
+
};
|
|
67633
67641
|
const options = {
|
|
67634
67642
|
method,
|
|
67635
67643
|
hostname: urlObj.hostname,
|
|
@@ -67639,21 +67647,41 @@ function sendRequest({ method, url, headers = {}, body }) {
|
|
|
67639
67647
|
};
|
|
67640
67648
|
const reqModule = isHttps ? https : http;
|
|
67641
67649
|
const req = reqModule.request(options, (res) => {
|
|
67650
|
+
timings.ttfb = performance.now();
|
|
67642
67651
|
let data = "";
|
|
67643
67652
|
res.on("data", (chunk) => {
|
|
67644
67653
|
data += chunk;
|
|
67645
67654
|
});
|
|
67646
67655
|
res.on("end", () => {
|
|
67647
|
-
|
|
67648
|
-
|
|
67649
|
-
|
|
67650
|
-
|
|
67651
|
-
|
|
67652
|
-
|
|
67653
|
-
|
|
67654
|
-
|
|
67655
|
-
|
|
67656
|
-
|
|
67656
|
+
timings.end = performance.now();
|
|
67657
|
+
const contentLength = parseInt(res.headers["content-length"] || "0", 10) || Buffer.byteLength(data, "utf8");
|
|
67658
|
+
const metrics = {
|
|
67659
|
+
dnsLookup: timings.dnsLookup - timings.start,
|
|
67660
|
+
tcpConnection: timings.tcpConnection - timings.dnsLookup,
|
|
67661
|
+
tlsHandshake: isHttps ? timings.tlsHandshake - timings.tcpConnection : 0,
|
|
67662
|
+
ttfb: timings.ttfb - timings.start,
|
|
67663
|
+
contentDownload: timings.end - timings.ttfb,
|
|
67664
|
+
total: timings.end - timings.start,
|
|
67665
|
+
contentLength
|
|
67666
|
+
};
|
|
67667
|
+
resolve({
|
|
67668
|
+
status: res.statusCode || 0,
|
|
67669
|
+
statusText: res.statusMessage || "",
|
|
67670
|
+
headers: Object.fromEntries(Object.entries(res.headers).map(([k, v]) => [k, Array.isArray(v) ? v.join(", ") : v || ""])),
|
|
67671
|
+
body: data,
|
|
67672
|
+
metrics
|
|
67673
|
+
});
|
|
67674
|
+
});
|
|
67675
|
+
});
|
|
67676
|
+
req.on("socket", (socket) => {
|
|
67677
|
+
socket.on("lookup", () => {
|
|
67678
|
+
timings.dnsLookup = performance.now();
|
|
67679
|
+
});
|
|
67680
|
+
socket.on("connect", () => {
|
|
67681
|
+
timings.tcpConnection = performance.now();
|
|
67682
|
+
});
|
|
67683
|
+
socket.on("secureConnect", () => {
|
|
67684
|
+
timings.tlsHandshake = performance.now();
|
|
67657
67685
|
});
|
|
67658
67686
|
});
|
|
67659
67687
|
req.on("error", reject);
|
|
@@ -68280,9 +68308,584 @@ var Tabs = ({ tabs, activeTab, onChange, theme }) => /* @__PURE__ */ jsx_dev_run
|
|
|
68280
68308
|
}, tab2.name, false, undefined, this))
|
|
68281
68309
|
}, undefined, false, undefined, this);
|
|
68282
68310
|
|
|
68283
|
-
//
|
|
68311
|
+
// node_modules/ink-text-input/build/index.js
|
|
68284
68312
|
var import_react26 = __toESM(require_react(), 1);
|
|
68285
68313
|
|
|
68314
|
+
// node_modules/ink-text-input/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
68315
|
+
var ANSI_BACKGROUND_OFFSET6 = 10;
|
|
68316
|
+
var wrapAnsi166 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
68317
|
+
var wrapAnsi2566 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
68318
|
+
var wrapAnsi16m6 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
68319
|
+
var styles8 = {
|
|
68320
|
+
modifier: {
|
|
68321
|
+
reset: [0, 0],
|
|
68322
|
+
bold: [1, 22],
|
|
68323
|
+
dim: [2, 22],
|
|
68324
|
+
italic: [3, 23],
|
|
68325
|
+
underline: [4, 24],
|
|
68326
|
+
overline: [53, 55],
|
|
68327
|
+
inverse: [7, 27],
|
|
68328
|
+
hidden: [8, 28],
|
|
68329
|
+
strikethrough: [9, 29]
|
|
68330
|
+
},
|
|
68331
|
+
color: {
|
|
68332
|
+
black: [30, 39],
|
|
68333
|
+
red: [31, 39],
|
|
68334
|
+
green: [32, 39],
|
|
68335
|
+
yellow: [33, 39],
|
|
68336
|
+
blue: [34, 39],
|
|
68337
|
+
magenta: [35, 39],
|
|
68338
|
+
cyan: [36, 39],
|
|
68339
|
+
white: [37, 39],
|
|
68340
|
+
blackBright: [90, 39],
|
|
68341
|
+
gray: [90, 39],
|
|
68342
|
+
grey: [90, 39],
|
|
68343
|
+
redBright: [91, 39],
|
|
68344
|
+
greenBright: [92, 39],
|
|
68345
|
+
yellowBright: [93, 39],
|
|
68346
|
+
blueBright: [94, 39],
|
|
68347
|
+
magentaBright: [95, 39],
|
|
68348
|
+
cyanBright: [96, 39],
|
|
68349
|
+
whiteBright: [97, 39]
|
|
68350
|
+
},
|
|
68351
|
+
bgColor: {
|
|
68352
|
+
bgBlack: [40, 49],
|
|
68353
|
+
bgRed: [41, 49],
|
|
68354
|
+
bgGreen: [42, 49],
|
|
68355
|
+
bgYellow: [43, 49],
|
|
68356
|
+
bgBlue: [44, 49],
|
|
68357
|
+
bgMagenta: [45, 49],
|
|
68358
|
+
bgCyan: [46, 49],
|
|
68359
|
+
bgWhite: [47, 49],
|
|
68360
|
+
bgBlackBright: [100, 49],
|
|
68361
|
+
bgGray: [100, 49],
|
|
68362
|
+
bgGrey: [100, 49],
|
|
68363
|
+
bgRedBright: [101, 49],
|
|
68364
|
+
bgGreenBright: [102, 49],
|
|
68365
|
+
bgYellowBright: [103, 49],
|
|
68366
|
+
bgBlueBright: [104, 49],
|
|
68367
|
+
bgMagentaBright: [105, 49],
|
|
68368
|
+
bgCyanBright: [106, 49],
|
|
68369
|
+
bgWhiteBright: [107, 49]
|
|
68370
|
+
}
|
|
68371
|
+
};
|
|
68372
|
+
var modifierNames6 = Object.keys(styles8.modifier);
|
|
68373
|
+
var foregroundColorNames6 = Object.keys(styles8.color);
|
|
68374
|
+
var backgroundColorNames6 = Object.keys(styles8.bgColor);
|
|
68375
|
+
var colorNames6 = [...foregroundColorNames6, ...backgroundColorNames6];
|
|
68376
|
+
function assembleStyles6() {
|
|
68377
|
+
const codes = new Map;
|
|
68378
|
+
for (const [groupName, group] of Object.entries(styles8)) {
|
|
68379
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
68380
|
+
styles8[styleName] = {
|
|
68381
|
+
open: `\x1B[${style[0]}m`,
|
|
68382
|
+
close: `\x1B[${style[1]}m`
|
|
68383
|
+
};
|
|
68384
|
+
group[styleName] = styles8[styleName];
|
|
68385
|
+
codes.set(style[0], style[1]);
|
|
68386
|
+
}
|
|
68387
|
+
Object.defineProperty(styles8, groupName, {
|
|
68388
|
+
value: group,
|
|
68389
|
+
enumerable: false
|
|
68390
|
+
});
|
|
68391
|
+
}
|
|
68392
|
+
Object.defineProperty(styles8, "codes", {
|
|
68393
|
+
value: codes,
|
|
68394
|
+
enumerable: false
|
|
68395
|
+
});
|
|
68396
|
+
styles8.color.close = "\x1B[39m";
|
|
68397
|
+
styles8.bgColor.close = "\x1B[49m";
|
|
68398
|
+
styles8.color.ansi = wrapAnsi166();
|
|
68399
|
+
styles8.color.ansi256 = wrapAnsi2566();
|
|
68400
|
+
styles8.color.ansi16m = wrapAnsi16m6();
|
|
68401
|
+
styles8.bgColor.ansi = wrapAnsi166(ANSI_BACKGROUND_OFFSET6);
|
|
68402
|
+
styles8.bgColor.ansi256 = wrapAnsi2566(ANSI_BACKGROUND_OFFSET6);
|
|
68403
|
+
styles8.bgColor.ansi16m = wrapAnsi16m6(ANSI_BACKGROUND_OFFSET6);
|
|
68404
|
+
Object.defineProperties(styles8, {
|
|
68405
|
+
rgbToAnsi256: {
|
|
68406
|
+
value(red, green, blue) {
|
|
68407
|
+
if (red === green && green === blue) {
|
|
68408
|
+
if (red < 8) {
|
|
68409
|
+
return 16;
|
|
68410
|
+
}
|
|
68411
|
+
if (red > 248) {
|
|
68412
|
+
return 231;
|
|
68413
|
+
}
|
|
68414
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
68415
|
+
}
|
|
68416
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
68417
|
+
},
|
|
68418
|
+
enumerable: false
|
|
68419
|
+
},
|
|
68420
|
+
hexToRgb: {
|
|
68421
|
+
value(hex) {
|
|
68422
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
68423
|
+
if (!matches) {
|
|
68424
|
+
return [0, 0, 0];
|
|
68425
|
+
}
|
|
68426
|
+
let [colorString] = matches;
|
|
68427
|
+
if (colorString.length === 3) {
|
|
68428
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
68429
|
+
}
|
|
68430
|
+
const integer = Number.parseInt(colorString, 16);
|
|
68431
|
+
return [
|
|
68432
|
+
integer >> 16 & 255,
|
|
68433
|
+
integer >> 8 & 255,
|
|
68434
|
+
integer & 255
|
|
68435
|
+
];
|
|
68436
|
+
},
|
|
68437
|
+
enumerable: false
|
|
68438
|
+
},
|
|
68439
|
+
hexToAnsi256: {
|
|
68440
|
+
value: (hex) => styles8.rgbToAnsi256(...styles8.hexToRgb(hex)),
|
|
68441
|
+
enumerable: false
|
|
68442
|
+
},
|
|
68443
|
+
ansi256ToAnsi: {
|
|
68444
|
+
value(code) {
|
|
68445
|
+
if (code < 8) {
|
|
68446
|
+
return 30 + code;
|
|
68447
|
+
}
|
|
68448
|
+
if (code < 16) {
|
|
68449
|
+
return 90 + (code - 8);
|
|
68450
|
+
}
|
|
68451
|
+
let red;
|
|
68452
|
+
let green;
|
|
68453
|
+
let blue;
|
|
68454
|
+
if (code >= 232) {
|
|
68455
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
68456
|
+
green = red;
|
|
68457
|
+
blue = red;
|
|
68458
|
+
} else {
|
|
68459
|
+
code -= 16;
|
|
68460
|
+
const remainder = code % 36;
|
|
68461
|
+
red = Math.floor(code / 36) / 5;
|
|
68462
|
+
green = Math.floor(remainder / 6) / 5;
|
|
68463
|
+
blue = remainder % 6 / 5;
|
|
68464
|
+
}
|
|
68465
|
+
const value = Math.max(red, green, blue) * 2;
|
|
68466
|
+
if (value === 0) {
|
|
68467
|
+
return 30;
|
|
68468
|
+
}
|
|
68469
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
68470
|
+
if (value === 2) {
|
|
68471
|
+
result += 60;
|
|
68472
|
+
}
|
|
68473
|
+
return result;
|
|
68474
|
+
},
|
|
68475
|
+
enumerable: false
|
|
68476
|
+
},
|
|
68477
|
+
rgbToAnsi: {
|
|
68478
|
+
value: (red, green, blue) => styles8.ansi256ToAnsi(styles8.rgbToAnsi256(red, green, blue)),
|
|
68479
|
+
enumerable: false
|
|
68480
|
+
},
|
|
68481
|
+
hexToAnsi: {
|
|
68482
|
+
value: (hex) => styles8.ansi256ToAnsi(styles8.hexToAnsi256(hex)),
|
|
68483
|
+
enumerable: false
|
|
68484
|
+
}
|
|
68485
|
+
});
|
|
68486
|
+
return styles8;
|
|
68487
|
+
}
|
|
68488
|
+
var ansiStyles6 = assembleStyles6();
|
|
68489
|
+
var ansi_styles_default6 = ansiStyles6;
|
|
68490
|
+
|
|
68491
|
+
// node_modules/ink-text-input/node_modules/chalk/source/vendor/supports-color/index.js
|
|
68492
|
+
import process13 from "node:process";
|
|
68493
|
+
import os3 from "node:os";
|
|
68494
|
+
import tty2 from "node:tty";
|
|
68495
|
+
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process13.argv) {
|
|
68496
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
68497
|
+
const position = argv.indexOf(prefix + flag);
|
|
68498
|
+
const terminatorPosition = argv.indexOf("--");
|
|
68499
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
68500
|
+
}
|
|
68501
|
+
var { env: env3 } = process13;
|
|
68502
|
+
var flagForceColor2;
|
|
68503
|
+
if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
|
|
68504
|
+
flagForceColor2 = 0;
|
|
68505
|
+
} else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
|
|
68506
|
+
flagForceColor2 = 1;
|
|
68507
|
+
}
|
|
68508
|
+
function envForceColor2() {
|
|
68509
|
+
if ("FORCE_COLOR" in env3) {
|
|
68510
|
+
if (env3.FORCE_COLOR === "true") {
|
|
68511
|
+
return 1;
|
|
68512
|
+
}
|
|
68513
|
+
if (env3.FORCE_COLOR === "false") {
|
|
68514
|
+
return 0;
|
|
68515
|
+
}
|
|
68516
|
+
return env3.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env3.FORCE_COLOR, 10), 3);
|
|
68517
|
+
}
|
|
68518
|
+
}
|
|
68519
|
+
function translateLevel2(level) {
|
|
68520
|
+
if (level === 0) {
|
|
68521
|
+
return false;
|
|
68522
|
+
}
|
|
68523
|
+
return {
|
|
68524
|
+
level,
|
|
68525
|
+
hasBasic: true,
|
|
68526
|
+
has256: level >= 2,
|
|
68527
|
+
has16m: level >= 3
|
|
68528
|
+
};
|
|
68529
|
+
}
|
|
68530
|
+
function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
68531
|
+
const noFlagForceColor = envForceColor2();
|
|
68532
|
+
if (noFlagForceColor !== undefined) {
|
|
68533
|
+
flagForceColor2 = noFlagForceColor;
|
|
68534
|
+
}
|
|
68535
|
+
const forceColor = sniffFlags ? flagForceColor2 : noFlagForceColor;
|
|
68536
|
+
if (forceColor === 0) {
|
|
68537
|
+
return 0;
|
|
68538
|
+
}
|
|
68539
|
+
if (sniffFlags) {
|
|
68540
|
+
if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
|
|
68541
|
+
return 3;
|
|
68542
|
+
}
|
|
68543
|
+
if (hasFlag2("color=256")) {
|
|
68544
|
+
return 2;
|
|
68545
|
+
}
|
|
68546
|
+
}
|
|
68547
|
+
if ("TF_BUILD" in env3 && "AGENT_NAME" in env3) {
|
|
68548
|
+
return 1;
|
|
68549
|
+
}
|
|
68550
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
68551
|
+
return 0;
|
|
68552
|
+
}
|
|
68553
|
+
const min = forceColor || 0;
|
|
68554
|
+
if (env3.TERM === "dumb") {
|
|
68555
|
+
return min;
|
|
68556
|
+
}
|
|
68557
|
+
if (process13.platform === "win32") {
|
|
68558
|
+
const osRelease = os3.release().split(".");
|
|
68559
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
68560
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
68561
|
+
}
|
|
68562
|
+
return 1;
|
|
68563
|
+
}
|
|
68564
|
+
if ("CI" in env3) {
|
|
68565
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env3))) {
|
|
68566
|
+
return 3;
|
|
68567
|
+
}
|
|
68568
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env3)) || env3.CI_NAME === "codeship") {
|
|
68569
|
+
return 1;
|
|
68570
|
+
}
|
|
68571
|
+
return min;
|
|
68572
|
+
}
|
|
68573
|
+
if ("TEAMCITY_VERSION" in env3) {
|
|
68574
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0;
|
|
68575
|
+
}
|
|
68576
|
+
if (env3.COLORTERM === "truecolor") {
|
|
68577
|
+
return 3;
|
|
68578
|
+
}
|
|
68579
|
+
if (env3.TERM === "xterm-kitty") {
|
|
68580
|
+
return 3;
|
|
68581
|
+
}
|
|
68582
|
+
if ("TERM_PROGRAM" in env3) {
|
|
68583
|
+
const version = Number.parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
68584
|
+
switch (env3.TERM_PROGRAM) {
|
|
68585
|
+
case "iTerm.app": {
|
|
68586
|
+
return version >= 3 ? 3 : 2;
|
|
68587
|
+
}
|
|
68588
|
+
case "Apple_Terminal": {
|
|
68589
|
+
return 2;
|
|
68590
|
+
}
|
|
68591
|
+
}
|
|
68592
|
+
}
|
|
68593
|
+
if (/-256(color)?$/i.test(env3.TERM)) {
|
|
68594
|
+
return 2;
|
|
68595
|
+
}
|
|
68596
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) {
|
|
68597
|
+
return 1;
|
|
68598
|
+
}
|
|
68599
|
+
if ("COLORTERM" in env3) {
|
|
68600
|
+
return 1;
|
|
68601
|
+
}
|
|
68602
|
+
return min;
|
|
68603
|
+
}
|
|
68604
|
+
function createSupportsColor2(stream, options = {}) {
|
|
68605
|
+
const level = _supportsColor2(stream, {
|
|
68606
|
+
streamIsTTY: stream && stream.isTTY,
|
|
68607
|
+
...options
|
|
68608
|
+
});
|
|
68609
|
+
return translateLevel2(level);
|
|
68610
|
+
}
|
|
68611
|
+
var supportsColor2 = {
|
|
68612
|
+
stdout: createSupportsColor2({ isTTY: tty2.isatty(1) }),
|
|
68613
|
+
stderr: createSupportsColor2({ isTTY: tty2.isatty(2) })
|
|
68614
|
+
};
|
|
68615
|
+
var supports_color_default2 = supportsColor2;
|
|
68616
|
+
|
|
68617
|
+
// node_modules/ink-text-input/node_modules/chalk/source/utilities.js
|
|
68618
|
+
function stringReplaceAll2(string, substring, replacer) {
|
|
68619
|
+
let index = string.indexOf(substring);
|
|
68620
|
+
if (index === -1) {
|
|
68621
|
+
return string;
|
|
68622
|
+
}
|
|
68623
|
+
const substringLength = substring.length;
|
|
68624
|
+
let endIndex = 0;
|
|
68625
|
+
let returnValue = "";
|
|
68626
|
+
do {
|
|
68627
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
68628
|
+
endIndex = index + substringLength;
|
|
68629
|
+
index = string.indexOf(substring, endIndex);
|
|
68630
|
+
} while (index !== -1);
|
|
68631
|
+
returnValue += string.slice(endIndex);
|
|
68632
|
+
return returnValue;
|
|
68633
|
+
}
|
|
68634
|
+
function stringEncaseCRLFWithFirstIndex2(string, prefix, postfix, index) {
|
|
68635
|
+
let endIndex = 0;
|
|
68636
|
+
let returnValue = "";
|
|
68637
|
+
do {
|
|
68638
|
+
const gotCR = string[index - 1] === "\r";
|
|
68639
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
|
|
68640
|
+
` : `
|
|
68641
|
+
`) + postfix;
|
|
68642
|
+
endIndex = index + 1;
|
|
68643
|
+
index = string.indexOf(`
|
|
68644
|
+
`, endIndex);
|
|
68645
|
+
} while (index !== -1);
|
|
68646
|
+
returnValue += string.slice(endIndex);
|
|
68647
|
+
return returnValue;
|
|
68648
|
+
}
|
|
68649
|
+
|
|
68650
|
+
// node_modules/ink-text-input/node_modules/chalk/source/index.js
|
|
68651
|
+
var { stdout: stdoutColor2, stderr: stderrColor2 } = supports_color_default2;
|
|
68652
|
+
var GENERATOR2 = Symbol("GENERATOR");
|
|
68653
|
+
var STYLER2 = Symbol("STYLER");
|
|
68654
|
+
var IS_EMPTY2 = Symbol("IS_EMPTY");
|
|
68655
|
+
var levelMapping2 = [
|
|
68656
|
+
"ansi",
|
|
68657
|
+
"ansi",
|
|
68658
|
+
"ansi256",
|
|
68659
|
+
"ansi16m"
|
|
68660
|
+
];
|
|
68661
|
+
var styles9 = Object.create(null);
|
|
68662
|
+
var applyOptions2 = (object, options = {}) => {
|
|
68663
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
68664
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
68665
|
+
}
|
|
68666
|
+
const colorLevel = stdoutColor2 ? stdoutColor2.level : 0;
|
|
68667
|
+
object.level = options.level === undefined ? colorLevel : options.level;
|
|
68668
|
+
};
|
|
68669
|
+
var chalkFactory2 = (options) => {
|
|
68670
|
+
const chalk3 = (...strings) => strings.join(" ");
|
|
68671
|
+
applyOptions2(chalk3, options);
|
|
68672
|
+
Object.setPrototypeOf(chalk3, createChalk2.prototype);
|
|
68673
|
+
return chalk3;
|
|
68674
|
+
};
|
|
68675
|
+
function createChalk2(options) {
|
|
68676
|
+
return chalkFactory2(options);
|
|
68677
|
+
}
|
|
68678
|
+
Object.setPrototypeOf(createChalk2.prototype, Function.prototype);
|
|
68679
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default6)) {
|
|
68680
|
+
styles9[styleName] = {
|
|
68681
|
+
get() {
|
|
68682
|
+
const builder = createBuilder2(this, createStyler2(style.open, style.close, this[STYLER2]), this[IS_EMPTY2]);
|
|
68683
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
68684
|
+
return builder;
|
|
68685
|
+
}
|
|
68686
|
+
};
|
|
68687
|
+
}
|
|
68688
|
+
styles9.visible = {
|
|
68689
|
+
get() {
|
|
68690
|
+
const builder = createBuilder2(this, this[STYLER2], true);
|
|
68691
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
68692
|
+
return builder;
|
|
68693
|
+
}
|
|
68694
|
+
};
|
|
68695
|
+
var getModelAnsi2 = (model, level, type, ...arguments_) => {
|
|
68696
|
+
if (model === "rgb") {
|
|
68697
|
+
if (level === "ansi16m") {
|
|
68698
|
+
return ansi_styles_default6[type].ansi16m(...arguments_);
|
|
68699
|
+
}
|
|
68700
|
+
if (level === "ansi256") {
|
|
68701
|
+
return ansi_styles_default6[type].ansi256(ansi_styles_default6.rgbToAnsi256(...arguments_));
|
|
68702
|
+
}
|
|
68703
|
+
return ansi_styles_default6[type].ansi(ansi_styles_default6.rgbToAnsi(...arguments_));
|
|
68704
|
+
}
|
|
68705
|
+
if (model === "hex") {
|
|
68706
|
+
return getModelAnsi2("rgb", level, type, ...ansi_styles_default6.hexToRgb(...arguments_));
|
|
68707
|
+
}
|
|
68708
|
+
return ansi_styles_default6[type][model](...arguments_);
|
|
68709
|
+
};
|
|
68710
|
+
var usedModels2 = ["rgb", "hex", "ansi256"];
|
|
68711
|
+
for (const model of usedModels2) {
|
|
68712
|
+
styles9[model] = {
|
|
68713
|
+
get() {
|
|
68714
|
+
const { level } = this;
|
|
68715
|
+
return function(...arguments_) {
|
|
68716
|
+
const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "color", ...arguments_), ansi_styles_default6.color.close, this[STYLER2]);
|
|
68717
|
+
return createBuilder2(this, styler, this[IS_EMPTY2]);
|
|
68718
|
+
};
|
|
68719
|
+
}
|
|
68720
|
+
};
|
|
68721
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
68722
|
+
styles9[bgModel] = {
|
|
68723
|
+
get() {
|
|
68724
|
+
const { level } = this;
|
|
68725
|
+
return function(...arguments_) {
|
|
68726
|
+
const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "bgColor", ...arguments_), ansi_styles_default6.bgColor.close, this[STYLER2]);
|
|
68727
|
+
return createBuilder2(this, styler, this[IS_EMPTY2]);
|
|
68728
|
+
};
|
|
68729
|
+
}
|
|
68730
|
+
};
|
|
68731
|
+
}
|
|
68732
|
+
var proto2 = Object.defineProperties(() => {}, {
|
|
68733
|
+
...styles9,
|
|
68734
|
+
level: {
|
|
68735
|
+
enumerable: true,
|
|
68736
|
+
get() {
|
|
68737
|
+
return this[GENERATOR2].level;
|
|
68738
|
+
},
|
|
68739
|
+
set(level) {
|
|
68740
|
+
this[GENERATOR2].level = level;
|
|
68741
|
+
}
|
|
68742
|
+
}
|
|
68743
|
+
});
|
|
68744
|
+
var createStyler2 = (open, close, parent) => {
|
|
68745
|
+
let openAll;
|
|
68746
|
+
let closeAll;
|
|
68747
|
+
if (parent === undefined) {
|
|
68748
|
+
openAll = open;
|
|
68749
|
+
closeAll = close;
|
|
68750
|
+
} else {
|
|
68751
|
+
openAll = parent.openAll + open;
|
|
68752
|
+
closeAll = close + parent.closeAll;
|
|
68753
|
+
}
|
|
68754
|
+
return {
|
|
68755
|
+
open,
|
|
68756
|
+
close,
|
|
68757
|
+
openAll,
|
|
68758
|
+
closeAll,
|
|
68759
|
+
parent
|
|
68760
|
+
};
|
|
68761
|
+
};
|
|
68762
|
+
var createBuilder2 = (self2, _styler, _isEmpty) => {
|
|
68763
|
+
const builder = (...arguments_) => applyStyle2(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
68764
|
+
Object.setPrototypeOf(builder, proto2);
|
|
68765
|
+
builder[GENERATOR2] = self2;
|
|
68766
|
+
builder[STYLER2] = _styler;
|
|
68767
|
+
builder[IS_EMPTY2] = _isEmpty;
|
|
68768
|
+
return builder;
|
|
68769
|
+
};
|
|
68770
|
+
var applyStyle2 = (self2, string) => {
|
|
68771
|
+
if (self2.level <= 0 || !string) {
|
|
68772
|
+
return self2[IS_EMPTY2] ? "" : string;
|
|
68773
|
+
}
|
|
68774
|
+
let styler = self2[STYLER2];
|
|
68775
|
+
if (styler === undefined) {
|
|
68776
|
+
return string;
|
|
68777
|
+
}
|
|
68778
|
+
const { openAll, closeAll } = styler;
|
|
68779
|
+
if (string.includes("\x1B")) {
|
|
68780
|
+
while (styler !== undefined) {
|
|
68781
|
+
string = stringReplaceAll2(string, styler.close, styler.open);
|
|
68782
|
+
styler = styler.parent;
|
|
68783
|
+
}
|
|
68784
|
+
}
|
|
68785
|
+
const lfIndex = string.indexOf(`
|
|
68786
|
+
`);
|
|
68787
|
+
if (lfIndex !== -1) {
|
|
68788
|
+
string = stringEncaseCRLFWithFirstIndex2(string, closeAll, openAll, lfIndex);
|
|
68789
|
+
}
|
|
68790
|
+
return openAll + string + closeAll;
|
|
68791
|
+
};
|
|
68792
|
+
Object.defineProperties(createChalk2.prototype, styles9);
|
|
68793
|
+
var chalk3 = createChalk2();
|
|
68794
|
+
var chalkStderr2 = createChalk2({ level: stderrColor2 ? stderrColor2.level : 0 });
|
|
68795
|
+
var source_default2 = chalk3;
|
|
68796
|
+
|
|
68797
|
+
// node_modules/ink-text-input/build/index.js
|
|
68798
|
+
function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
|
|
68799
|
+
const [state, setState] = import_react26.useState({
|
|
68800
|
+
cursorOffset: (originalValue || "").length,
|
|
68801
|
+
cursorWidth: 0
|
|
68802
|
+
});
|
|
68803
|
+
const { cursorOffset, cursorWidth } = state;
|
|
68804
|
+
import_react26.useEffect(() => {
|
|
68805
|
+
setState((previousState) => {
|
|
68806
|
+
if (!focus || !showCursor) {
|
|
68807
|
+
return previousState;
|
|
68808
|
+
}
|
|
68809
|
+
const newValue = originalValue || "";
|
|
68810
|
+
if (previousState.cursorOffset > newValue.length - 1) {
|
|
68811
|
+
return {
|
|
68812
|
+
cursorOffset: newValue.length,
|
|
68813
|
+
cursorWidth: 0
|
|
68814
|
+
};
|
|
68815
|
+
}
|
|
68816
|
+
return previousState;
|
|
68817
|
+
});
|
|
68818
|
+
}, [originalValue, focus, showCursor]);
|
|
68819
|
+
const cursorActualWidth = highlightPastedText ? cursorWidth : 0;
|
|
68820
|
+
const value = mask ? mask.repeat(originalValue.length) : originalValue;
|
|
68821
|
+
let renderedValue = value;
|
|
68822
|
+
let renderedPlaceholder = placeholder ? source_default2.grey(placeholder) : undefined;
|
|
68823
|
+
if (showCursor && focus) {
|
|
68824
|
+
renderedPlaceholder = placeholder.length > 0 ? source_default2.inverse(placeholder[0]) + source_default2.grey(placeholder.slice(1)) : source_default2.inverse(" ");
|
|
68825
|
+
renderedValue = value.length > 0 ? "" : source_default2.inverse(" ");
|
|
68826
|
+
let i = 0;
|
|
68827
|
+
for (const char of value) {
|
|
68828
|
+
renderedValue += i >= cursorOffset - cursorActualWidth && i <= cursorOffset ? source_default2.inverse(char) : char;
|
|
68829
|
+
i++;
|
|
68830
|
+
}
|
|
68831
|
+
if (value.length > 0 && cursorOffset === value.length) {
|
|
68832
|
+
renderedValue += source_default2.inverse(" ");
|
|
68833
|
+
}
|
|
68834
|
+
}
|
|
68835
|
+
use_input_default((input, key) => {
|
|
68836
|
+
if (key.upArrow || key.downArrow || key.ctrl && input === "c" || key.tab || key.shift && key.tab) {
|
|
68837
|
+
return;
|
|
68838
|
+
}
|
|
68839
|
+
if (key.return) {
|
|
68840
|
+
if (onSubmit) {
|
|
68841
|
+
onSubmit(originalValue);
|
|
68842
|
+
}
|
|
68843
|
+
return;
|
|
68844
|
+
}
|
|
68845
|
+
let nextCursorOffset = cursorOffset;
|
|
68846
|
+
let nextValue = originalValue;
|
|
68847
|
+
let nextCursorWidth = 0;
|
|
68848
|
+
if (key.leftArrow) {
|
|
68849
|
+
if (showCursor) {
|
|
68850
|
+
nextCursorOffset--;
|
|
68851
|
+
}
|
|
68852
|
+
} else if (key.rightArrow) {
|
|
68853
|
+
if (showCursor) {
|
|
68854
|
+
nextCursorOffset++;
|
|
68855
|
+
}
|
|
68856
|
+
} else if (key.backspace || key.delete) {
|
|
68857
|
+
if (cursorOffset > 0) {
|
|
68858
|
+
nextValue = originalValue.slice(0, cursorOffset - 1) + originalValue.slice(cursorOffset, originalValue.length);
|
|
68859
|
+
nextCursorOffset--;
|
|
68860
|
+
}
|
|
68861
|
+
} else {
|
|
68862
|
+
nextValue = originalValue.slice(0, cursorOffset) + input + originalValue.slice(cursorOffset, originalValue.length);
|
|
68863
|
+
nextCursorOffset += input.length;
|
|
68864
|
+
if (input.length > 1) {
|
|
68865
|
+
nextCursorWidth = input.length;
|
|
68866
|
+
}
|
|
68867
|
+
}
|
|
68868
|
+
if (cursorOffset < 0) {
|
|
68869
|
+
nextCursorOffset = 0;
|
|
68870
|
+
}
|
|
68871
|
+
if (cursorOffset > originalValue.length) {
|
|
68872
|
+
nextCursorOffset = originalValue.length;
|
|
68873
|
+
}
|
|
68874
|
+
setState({
|
|
68875
|
+
cursorOffset: nextCursorOffset,
|
|
68876
|
+
cursorWidth: nextCursorWidth
|
|
68877
|
+
});
|
|
68878
|
+
if (nextValue !== originalValue) {
|
|
68879
|
+
onChange(nextValue);
|
|
68880
|
+
}
|
|
68881
|
+
}, { isActive: focus });
|
|
68882
|
+
return import_react26.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
|
|
68883
|
+
}
|
|
68884
|
+
var build_default = TextInput;
|
|
68885
|
+
|
|
68886
|
+
// src/ui/app/components/historylist.tsx
|
|
68887
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
68888
|
+
|
|
68286
68889
|
// src/utils/colors.ts
|
|
68287
68890
|
var getStatusColor = (status, theme) => {
|
|
68288
68891
|
if (status.startsWith("2"))
|
|
@@ -68294,6 +68897,30 @@ var getStatusColor = (status, theme) => {
|
|
|
68294
68897
|
return theme.colors.accent;
|
|
68295
68898
|
};
|
|
68296
68899
|
|
|
68900
|
+
// src/utils/fuzzy.ts
|
|
68901
|
+
function fuzzyMatch(pattern, str) {
|
|
68902
|
+
if (!pattern)
|
|
68903
|
+
return { matched: true, score: 0, indices: [] };
|
|
68904
|
+
pattern = pattern.toLowerCase();
|
|
68905
|
+
str = str.toLowerCase();
|
|
68906
|
+
let patternIdx = 0;
|
|
68907
|
+
let score = 0;
|
|
68908
|
+
const indices = [];
|
|
68909
|
+
for (let i = 0;i < str.length && patternIdx < pattern.length; i++) {
|
|
68910
|
+
if (str[i] === pattern[patternIdx]) {
|
|
68911
|
+
score += 1;
|
|
68912
|
+
indices.push(i);
|
|
68913
|
+
patternIdx++;
|
|
68914
|
+
}
|
|
68915
|
+
}
|
|
68916
|
+
return { matched: patternIdx === pattern.length, score, indices };
|
|
68917
|
+
}
|
|
68918
|
+
function fuzzyFilter(items, pattern, getText) {
|
|
68919
|
+
if (!pattern)
|
|
68920
|
+
return items;
|
|
68921
|
+
return items.map((item) => ({ item, ...fuzzyMatch(pattern, getText(item)) })).filter((r) => r.matched).sort((a, b) => b.score - a.score).map((r) => r.item);
|
|
68922
|
+
}
|
|
68923
|
+
|
|
68297
68924
|
// src/ui/app/components/historylist.tsx
|
|
68298
68925
|
var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68299
68926
|
var HistoryListItem = ({ item, isSelected, theme }) => {
|
|
@@ -68360,19 +68987,33 @@ var HistoryList = ({ history, onItemClick, theme }) => {
|
|
|
68360
68987
|
const { stdout } = use_stdout_default();
|
|
68361
68988
|
const { isFocused } = use_focus_default();
|
|
68362
68989
|
const { focusNext } = use_focus_manager_default();
|
|
68363
|
-
const [selectedIndex, setSelectedIndex] =
|
|
68364
|
-
const [scrollPosition, setScrollPosition] =
|
|
68365
|
-
const
|
|
68366
|
-
const
|
|
68367
|
-
|
|
68990
|
+
const [selectedIndex, setSelectedIndex] = import_react27.useState(0);
|
|
68991
|
+
const [scrollPosition, setScrollPosition] = import_react27.useState(0);
|
|
68992
|
+
const [searchQuery, setSearchQuery] = import_react27.useState("");
|
|
68993
|
+
const [isSearching, setIsSearching] = import_react27.useState(false);
|
|
68994
|
+
const listRef = import_react27.useRef(null);
|
|
68995
|
+
const filteredHistory = fuzzyFilter(history, searchQuery, (item) => `${item.method} ${item.url}`);
|
|
68996
|
+
const maxHeight = stdout.rows - 10;
|
|
68997
|
+
use_input_default((input, key) => {
|
|
68998
|
+
if (input === "/" && !isSearching) {
|
|
68999
|
+
setIsSearching(true);
|
|
69000
|
+
return;
|
|
69001
|
+
}
|
|
69002
|
+
if (key.escape && isSearching) {
|
|
69003
|
+
setIsSearching(false);
|
|
69004
|
+
setSearchQuery("");
|
|
69005
|
+
return;
|
|
69006
|
+
}
|
|
69007
|
+
if (isSearching)
|
|
69008
|
+
return;
|
|
68368
69009
|
if (key.upArrow) {
|
|
68369
69010
|
setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
68370
69011
|
}
|
|
68371
69012
|
if (key.downArrow) {
|
|
68372
|
-
setSelectedIndex((prev) => Math.min(
|
|
69013
|
+
setSelectedIndex((prev) => Math.min(filteredHistory.length - 1, prev + 1));
|
|
68373
69014
|
}
|
|
68374
|
-
if (key.return &&
|
|
68375
|
-
onItemClick(
|
|
69015
|
+
if (key.return && filteredHistory[selectedIndex]) {
|
|
69016
|
+
onItemClick(filteredHistory[selectedIndex]);
|
|
68376
69017
|
}
|
|
68377
69018
|
if (key.tab) {
|
|
68378
69019
|
focusNext();
|
|
@@ -68381,10 +69022,14 @@ var HistoryList = ({ history, onItemClick, theme }) => {
|
|
|
68381
69022
|
setScrollPosition((prev) => Math.max(0, prev - maxHeight));
|
|
68382
69023
|
}
|
|
68383
69024
|
if (key.pageDown) {
|
|
68384
|
-
setScrollPosition((prev) => Math.min(
|
|
69025
|
+
setScrollPosition((prev) => Math.min(filteredHistory.length - maxHeight, prev + maxHeight));
|
|
68385
69026
|
}
|
|
68386
69027
|
}, { isActive: isFocused });
|
|
68387
|
-
|
|
69028
|
+
import_react27.useEffect(() => {
|
|
69029
|
+
setSelectedIndex(0);
|
|
69030
|
+
setScrollPosition(0);
|
|
69031
|
+
}, [searchQuery]);
|
|
69032
|
+
import_react27.useEffect(() => {
|
|
68388
69033
|
if (selectedIndex < scrollPosition) {
|
|
68389
69034
|
setScrollPosition(selectedIndex);
|
|
68390
69035
|
} else if (selectedIndex >= scrollPosition + maxHeight) {
|
|
@@ -68394,22 +69039,55 @@ var HistoryList = ({ history, onItemClick, theme }) => {
|
|
|
68394
69039
|
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
68395
69040
|
flexDirection: "column",
|
|
68396
69041
|
flexGrow: 1,
|
|
68397
|
-
children:
|
|
68398
|
-
|
|
68399
|
-
|
|
68400
|
-
|
|
68401
|
-
|
|
68402
|
-
|
|
68403
|
-
|
|
68404
|
-
|
|
68405
|
-
|
|
68406
|
-
|
|
69042
|
+
children: [
|
|
69043
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
69044
|
+
paddingX: 1,
|
|
69045
|
+
marginBottom: 1,
|
|
69046
|
+
children: isSearching ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
69047
|
+
children: [
|
|
69048
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
|
|
69049
|
+
color: theme.colors.accent,
|
|
69050
|
+
children: "\uD83D\uDD0D "
|
|
69051
|
+
}, undefined, false, undefined, this),
|
|
69052
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(build_default, {
|
|
69053
|
+
value: searchQuery,
|
|
69054
|
+
onChange: setSearchQuery,
|
|
69055
|
+
placeholder: "Type to search...",
|
|
69056
|
+
focus: isSearching
|
|
69057
|
+
}, undefined, false, undefined, this)
|
|
69058
|
+
]
|
|
69059
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
|
|
69060
|
+
color: theme.colors.muted,
|
|
69061
|
+
dimColor: true,
|
|
69062
|
+
children: [
|
|
69063
|
+
"Press / to search",
|
|
69064
|
+
searchQuery && ` (filtered: "${searchQuery}")`
|
|
69065
|
+
]
|
|
69066
|
+
}, undefined, true, undefined, this)
|
|
69067
|
+
}, undefined, false, undefined, this),
|
|
69068
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
69069
|
+
flexDirection: "column",
|
|
69070
|
+
ref: listRef,
|
|
69071
|
+
children: filteredHistory.length === 0 ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
69072
|
+
paddingX: 1,
|
|
69073
|
+
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
|
|
69074
|
+
color: theme.colors.muted,
|
|
69075
|
+
children: "No matches found"
|
|
69076
|
+
}, undefined, false, undefined, this)
|
|
69077
|
+
}, undefined, false, undefined, this) : filteredHistory.slice(scrollPosition, scrollPosition + maxHeight).map((item, index) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(HistoryListItem, {
|
|
69078
|
+
item,
|
|
69079
|
+
isSelected: isFocused && selectedIndex === scrollPosition + index,
|
|
69080
|
+
theme
|
|
69081
|
+
}, item.timestamp, false, undefined, this))
|
|
69082
|
+
}, undefined, false, undefined, this)
|
|
69083
|
+
]
|
|
69084
|
+
}, undefined, true, undefined, this);
|
|
68407
69085
|
};
|
|
68408
69086
|
|
|
68409
69087
|
// src/ui/app/components/footer.tsx
|
|
68410
|
-
var
|
|
69088
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
68411
69089
|
var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68412
|
-
var Footer =
|
|
69090
|
+
var Footer = import_react28.default.memo(({ theme }) => {
|
|
68413
69091
|
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
|
|
68414
69092
|
borderStyle: "round",
|
|
68415
69093
|
borderTopColor: theme.muted,
|
|
@@ -68430,7 +69108,7 @@ var Footer = import_react27.default.memo(({ theme }) => {
|
|
|
68430
69108
|
});
|
|
68431
69109
|
|
|
68432
69110
|
// src/ui/app/components/themeselector.tsx
|
|
68433
|
-
var
|
|
69111
|
+
var import_react29 = __toESM(require_react(), 1);
|
|
68434
69112
|
var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68435
69113
|
var getIndex = (theme) => {
|
|
68436
69114
|
let index = 0;
|
|
@@ -68471,9 +69149,9 @@ var getIndex = (theme) => {
|
|
|
68471
69149
|
return index;
|
|
68472
69150
|
};
|
|
68473
69151
|
var ThemeSelector = ({ onThemeChange, theme }) => {
|
|
68474
|
-
const [selectedIndex, setSelectedIndex] =
|
|
69152
|
+
const [selectedIndex, setSelectedIndex] = import_react29.useState(getIndex(theme.name));
|
|
68475
69153
|
const themeNames = Object.keys(themes);
|
|
68476
|
-
|
|
69154
|
+
import_react29.useEffect(() => {
|
|
68477
69155
|
const currentThemeIndex = themeNames.findIndex((name) => {
|
|
68478
69156
|
const themeColors = themes[name].colors;
|
|
68479
69157
|
return Object.entries(themeColors).every(([key, value]) => theme[key] === value);
|
|
@@ -68529,20 +69207,20 @@ var ThemeSelector = ({ onThemeChange, theme }) => {
|
|
|
68529
69207
|
};
|
|
68530
69208
|
|
|
68531
69209
|
// src/ui/app/components/scrollablebox.tsx
|
|
68532
|
-
var
|
|
69210
|
+
var import_react30 = __toESM(require_react(), 1);
|
|
68533
69211
|
var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68534
69212
|
var ScrollableBox = ({ children }) => {
|
|
68535
69213
|
const { stdout } = use_stdout_default();
|
|
68536
|
-
const [scrollPosition, setScrollPosition] =
|
|
69214
|
+
const [scrollPosition, setScrollPosition] = import_react30.useState(0);
|
|
68537
69215
|
const maxHeight = stdout.rows - 10;
|
|
68538
|
-
const [contentHeight, setContentHeight] =
|
|
69216
|
+
const [contentHeight, setContentHeight] = import_react30.useState(0);
|
|
68539
69217
|
use_input_default((_, key) => {
|
|
68540
69218
|
if (key.pageUp)
|
|
68541
69219
|
setScrollPosition((prev) => Math.max(0, prev - maxHeight));
|
|
68542
69220
|
if (key.pageDown)
|
|
68543
69221
|
setScrollPosition((prev) => Math.min(contentHeight - maxHeight, prev + maxHeight));
|
|
68544
69222
|
});
|
|
68545
|
-
|
|
69223
|
+
import_react30.useEffect(() => {
|
|
68546
69224
|
const estimateHeight = (node) => {
|
|
68547
69225
|
if (!node)
|
|
68548
69226
|
return 0;
|
|
@@ -68551,7 +69229,7 @@ var ScrollableBox = ({ children }) => {
|
|
|
68551
69229
|
`).length;
|
|
68552
69230
|
if (Array.isArray(node))
|
|
68553
69231
|
return node.reduce((acc, child) => acc + estimateHeight(child), 0);
|
|
68554
|
-
if (
|
|
69232
|
+
if (import_react30.default.isValidElement(node))
|
|
68555
69233
|
return estimateHeight(node.props.children);
|
|
68556
69234
|
return 1;
|
|
68557
69235
|
};
|
|
@@ -68568,7 +69246,7 @@ var ScrollableBox = ({ children }) => {
|
|
|
68568
69246
|
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
68569
69247
|
marginTop: -scrollPosition,
|
|
68570
69248
|
flexDirection: "column",
|
|
68571
|
-
children:
|
|
69249
|
+
children: import_react30.default.Children.map(children, (child) => import_react30.default.isValidElement(child) ? import_react30.default.cloneElement(child) : child)
|
|
68572
69250
|
}, undefined, false, undefined, this)
|
|
68573
69251
|
}, undefined, false, undefined, this),
|
|
68574
69252
|
contentHeight > maxHeight && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
@@ -68583,9 +69261,9 @@ var ScrollableBox = ({ children }) => {
|
|
|
68583
69261
|
};
|
|
68584
69262
|
|
|
68585
69263
|
// src/ui/app/components/syntaxhighlighter.tsx
|
|
68586
|
-
var
|
|
69264
|
+
var import_react31 = __toESM(require_react(), 1);
|
|
68587
69265
|
var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68588
|
-
var JsonSyntaxHighlight =
|
|
69266
|
+
var JsonSyntaxHighlight = import_react31.default.memo(({ jsonString, theme }) => {
|
|
68589
69267
|
try {
|
|
68590
69268
|
const json = JSON.parse(jsonString);
|
|
68591
69269
|
const prettyJson = JSON.stringify(json, null, 2);
|
|
@@ -68688,26 +69366,242 @@ var JsonSyntaxHighlight = import_react30.default.memo(({ jsonString, theme }) =>
|
|
|
68688
69366
|
});
|
|
68689
69367
|
|
|
68690
69368
|
// src/ui/app/components/responsepanel.tsx
|
|
68691
|
-
var
|
|
69369
|
+
var import_react32 = __toESM(require_react(), 1);
|
|
69370
|
+
|
|
69371
|
+
// src/ui/app/components/metricspanel.tsx
|
|
68692
69372
|
var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68693
|
-
var
|
|
68694
|
-
const
|
|
68695
|
-
const
|
|
69373
|
+
var MetricBar = ({ label, value, maxValue, color, theme }) => {
|
|
69374
|
+
const barWidth = 40;
|
|
69375
|
+
const safeValue = Math.max(0, value);
|
|
69376
|
+
const filledWidth = Math.max(0, Math.min(barWidth, maxValue > 0 ? Math.round(safeValue / maxValue * barWidth) : 0));
|
|
69377
|
+
const emptyWidth = barWidth - filledWidth;
|
|
69378
|
+
const bar = "█".repeat(filledWidth) + "░".repeat(emptyWidth);
|
|
69379
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69380
|
+
marginY: 0,
|
|
69381
|
+
children: [
|
|
69382
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69383
|
+
width: 18,
|
|
69384
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69385
|
+
color: theme.colors.muted,
|
|
69386
|
+
children: label
|
|
69387
|
+
}, undefined, false, undefined, this)
|
|
69388
|
+
}, undefined, false, undefined, this),
|
|
69389
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69390
|
+
width: barWidth + 2,
|
|
69391
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69392
|
+
color,
|
|
69393
|
+
children: bar
|
|
69394
|
+
}, undefined, false, undefined, this)
|
|
69395
|
+
}, undefined, false, undefined, this),
|
|
69396
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69397
|
+
width: 12,
|
|
69398
|
+
justifyContent: "flex-end",
|
|
69399
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69400
|
+
color: theme.colors.white,
|
|
69401
|
+
bold: true,
|
|
69402
|
+
children: [
|
|
69403
|
+
safeValue.toFixed(1),
|
|
69404
|
+
"ms"
|
|
69405
|
+
]
|
|
69406
|
+
}, undefined, true, undefined, this)
|
|
69407
|
+
}, undefined, false, undefined, this)
|
|
69408
|
+
]
|
|
69409
|
+
}, undefined, true, undefined, this);
|
|
69410
|
+
};
|
|
69411
|
+
var formatBytes = (bytes) => {
|
|
69412
|
+
if (bytes === 0)
|
|
69413
|
+
return "0 B";
|
|
69414
|
+
const k = 1024;
|
|
69415
|
+
const sizes = ["B", "KB", "MB", "GB"];
|
|
69416
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
69417
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
|
|
69418
|
+
};
|
|
69419
|
+
var MetricsPanel = ({ metrics, theme }) => {
|
|
69420
|
+
if (!metrics) {
|
|
69421
|
+
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69422
|
+
flexDirection: "column",
|
|
69423
|
+
padding: 1,
|
|
69424
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69425
|
+
color: theme.colors.muted,
|
|
69426
|
+
children: "No metrics available. Send a request first."
|
|
69427
|
+
}, undefined, false, undefined, this)
|
|
69428
|
+
}, undefined, false, undefined, this);
|
|
69429
|
+
}
|
|
69430
|
+
const maxTime = Math.max(Math.max(0, metrics.dnsLookup), Math.max(0, metrics.tcpConnection), Math.max(0, metrics.tlsHandshake), Math.max(0, metrics.ttfb), Math.max(0, metrics.contentDownload), 1);
|
|
68696
69431
|
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
68697
69432
|
flexDirection: "column",
|
|
68698
|
-
|
|
69433
|
+
paddingX: 1,
|
|
68699
69434
|
children: [
|
|
68700
69435
|
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
68701
69436
|
marginBottom: 1,
|
|
69437
|
+
flexDirection: "column",
|
|
69438
|
+
children: [
|
|
69439
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69440
|
+
color: theme.colors.accent,
|
|
69441
|
+
bold: true,
|
|
69442
|
+
children: "⚡ Performance Breakdown"
|
|
69443
|
+
}, undefined, false, undefined, this),
|
|
69444
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69445
|
+
color: theme.colors.muted,
|
|
69446
|
+
children: "────────────────────────────────────────────────────────────"
|
|
69447
|
+
}, undefined, false, undefined, this)
|
|
69448
|
+
]
|
|
69449
|
+
}, undefined, true, undefined, this),
|
|
69450
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69451
|
+
flexDirection: "column",
|
|
69452
|
+
gap: 0,
|
|
69453
|
+
children: [
|
|
69454
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(MetricBar, {
|
|
69455
|
+
label: "\uD83D\uDD0D DNS Lookup",
|
|
69456
|
+
value: metrics.dnsLookup,
|
|
69457
|
+
maxValue: maxTime,
|
|
69458
|
+
color: theme.colors.cool,
|
|
69459
|
+
theme
|
|
69460
|
+
}, undefined, false, undefined, this),
|
|
69461
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(MetricBar, {
|
|
69462
|
+
label: "\uD83D\uDD0C TCP Connect",
|
|
69463
|
+
value: metrics.tcpConnection,
|
|
69464
|
+
maxValue: maxTime,
|
|
69465
|
+
color: theme.colors.success,
|
|
69466
|
+
theme
|
|
69467
|
+
}, undefined, false, undefined, this),
|
|
69468
|
+
metrics.tlsHandshake > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(MetricBar, {
|
|
69469
|
+
label: "\uD83D\uDD10 TLS Handshake",
|
|
69470
|
+
value: metrics.tlsHandshake,
|
|
69471
|
+
maxValue: maxTime,
|
|
69472
|
+
color: theme.colors.secondary,
|
|
69473
|
+
theme
|
|
69474
|
+
}, undefined, false, undefined, this),
|
|
69475
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(MetricBar, {
|
|
69476
|
+
label: "⏱️ TTFB",
|
|
69477
|
+
value: metrics.ttfb,
|
|
69478
|
+
maxValue: maxTime,
|
|
69479
|
+
color: theme.colors.accent,
|
|
69480
|
+
theme
|
|
69481
|
+
}, undefined, false, undefined, this),
|
|
69482
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(MetricBar, {
|
|
69483
|
+
label: "\uD83D\uDCE5 Download",
|
|
69484
|
+
value: metrics.contentDownload,
|
|
69485
|
+
maxValue: maxTime,
|
|
69486
|
+
color: theme.colors.primary,
|
|
69487
|
+
theme
|
|
69488
|
+
}, undefined, false, undefined, this)
|
|
69489
|
+
]
|
|
69490
|
+
}, undefined, true, undefined, this),
|
|
69491
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69492
|
+
marginTop: 1,
|
|
69493
|
+
flexDirection: "column",
|
|
69494
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69495
|
+
color: theme.colors.muted,
|
|
69496
|
+
children: "────────────────────────────────────────────────────────────"
|
|
69497
|
+
}, undefined, false, undefined, this)
|
|
69498
|
+
}, undefined, false, undefined, this),
|
|
69499
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69500
|
+
marginTop: 1,
|
|
69501
|
+
flexDirection: "column",
|
|
69502
|
+
gap: 0,
|
|
68702
69503
|
children: [
|
|
68703
69504
|
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
68704
|
-
|
|
69505
|
+
children: [
|
|
69506
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69507
|
+
width: 18,
|
|
69508
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69509
|
+
color: theme.colors.accent,
|
|
69510
|
+
bold: true,
|
|
69511
|
+
children: "\uD83D\uDCCA Total Time"
|
|
69512
|
+
}, undefined, false, undefined, this)
|
|
69513
|
+
}, undefined, false, undefined, this),
|
|
69514
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69515
|
+
color: theme.colors.white,
|
|
69516
|
+
bold: true,
|
|
69517
|
+
children: [
|
|
69518
|
+
metrics.total.toFixed(2),
|
|
69519
|
+
" ms"
|
|
69520
|
+
]
|
|
69521
|
+
}, undefined, true, undefined, this)
|
|
69522
|
+
]
|
|
69523
|
+
}, undefined, true, undefined, this),
|
|
69524
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69525
|
+
children: [
|
|
69526
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69527
|
+
width: 18,
|
|
69528
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69529
|
+
color: theme.colors.accent,
|
|
69530
|
+
bold: true,
|
|
69531
|
+
children: "\uD83D\uDCE6 Size"
|
|
69532
|
+
}, undefined, false, undefined, this)
|
|
69533
|
+
}, undefined, false, undefined, this),
|
|
69534
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69535
|
+
color: theme.colors.white,
|
|
69536
|
+
bold: true,
|
|
69537
|
+
children: formatBytes(metrics.contentLength)
|
|
69538
|
+
}, undefined, false, undefined, this)
|
|
69539
|
+
]
|
|
69540
|
+
}, undefined, true, undefined, this),
|
|
69541
|
+
metrics.contentLength > 0 && metrics.contentDownload > 0 && /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69542
|
+
children: [
|
|
69543
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69544
|
+
width: 18,
|
|
69545
|
+
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69546
|
+
color: theme.colors.accent,
|
|
69547
|
+
bold: true,
|
|
69548
|
+
children: "\uD83D\uDE80 Speed"
|
|
69549
|
+
}, undefined, false, undefined, this)
|
|
69550
|
+
}, undefined, false, undefined, this),
|
|
69551
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69552
|
+
color: theme.colors.success,
|
|
69553
|
+
bold: true,
|
|
69554
|
+
children: [
|
|
69555
|
+
formatBytes(metrics.contentLength / (metrics.contentDownload / 1000)),
|
|
69556
|
+
"/s"
|
|
69557
|
+
]
|
|
69558
|
+
}, undefined, true, undefined, this)
|
|
69559
|
+
]
|
|
69560
|
+
}, undefined, true, undefined, this)
|
|
69561
|
+
]
|
|
69562
|
+
}, undefined, true, undefined, this),
|
|
69563
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69564
|
+
marginTop: 1,
|
|
69565
|
+
flexDirection: "column",
|
|
69566
|
+
children: [
|
|
69567
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69568
|
+
color: theme.colors.muted,
|
|
69569
|
+
children: "────────────────────────────────────────────────────────────"
|
|
69570
|
+
}, undefined, false, undefined, this),
|
|
69571
|
+
/* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
69572
|
+
marginTop: 1,
|
|
68705
69573
|
children: /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Text, {
|
|
69574
|
+
color: theme.colors.muted,
|
|
69575
|
+
dimColor: true,
|
|
69576
|
+
children: "TTFB = Time To First Byte (DNS + TCP + TLS + Server Processing)"
|
|
69577
|
+
}, undefined, false, undefined, this)
|
|
69578
|
+
}, undefined, false, undefined, this)
|
|
69579
|
+
]
|
|
69580
|
+
}, undefined, true, undefined, this)
|
|
69581
|
+
]
|
|
69582
|
+
}, undefined, true, undefined, this);
|
|
69583
|
+
};
|
|
69584
|
+
|
|
69585
|
+
// src/ui/app/components/responsepanel.tsx
|
|
69586
|
+
var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69587
|
+
var ResponsePanel = import_react32.default.memo(({ response, theme, metrics = null }) => {
|
|
69588
|
+
const [activeTab, setActiveTab] = import_react32.useState("body");
|
|
69589
|
+
const tabs = [{ name: "body", label: "Body" }, { name: "headers", label: "Headers" }, { name: "metrics", label: "⚡ Metrics" }];
|
|
69590
|
+
return /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
69591
|
+
flexDirection: "column",
|
|
69592
|
+
flexGrow: 1,
|
|
69593
|
+
children: [
|
|
69594
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
69595
|
+
marginBottom: 1,
|
|
69596
|
+
children: [
|
|
69597
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
69598
|
+
width: 8,
|
|
69599
|
+
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
68706
69600
|
color: theme.colors.primary,
|
|
68707
69601
|
children: "STATUS:"
|
|
68708
69602
|
}, undefined, false, undefined, this)
|
|
68709
69603
|
}, undefined, false, undefined, this),
|
|
68710
|
-
/* @__PURE__ */
|
|
69604
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
68711
69605
|
color: getStatusColor(response.status, theme),
|
|
68712
69606
|
bold: true,
|
|
68713
69607
|
children: [
|
|
@@ -68718,30 +69612,30 @@ var ResponsePanel = import_react31.default.memo(({ response, theme }) => {
|
|
|
68718
69612
|
}, undefined, true, undefined, this)
|
|
68719
69613
|
]
|
|
68720
69614
|
}, undefined, true, undefined, this),
|
|
68721
|
-
/* @__PURE__ */
|
|
69615
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Tabs, {
|
|
68722
69616
|
tabs,
|
|
68723
69617
|
activeTab,
|
|
68724
69618
|
onChange: setActiveTab,
|
|
68725
69619
|
theme
|
|
68726
69620
|
}, undefined, false, undefined, this),
|
|
68727
|
-
/* @__PURE__ */
|
|
69621
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
68728
69622
|
marginTop: 1,
|
|
68729
69623
|
flexGrow: 1,
|
|
68730
69624
|
children: [
|
|
68731
|
-
activeTab === "headers" && /* @__PURE__ */
|
|
68732
|
-
children: /* @__PURE__ */
|
|
69625
|
+
activeTab === "headers" && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ScrollableBox, {
|
|
69626
|
+
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
68733
69627
|
flexDirection: "column",
|
|
68734
|
-
children: Object.entries(JSON.parse(response.headers || "{}")).map(([key, value]) => /* @__PURE__ */
|
|
69628
|
+
children: Object.entries(JSON.parse(response.headers || "{}")).map(([key, value]) => /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
68735
69629
|
children: [
|
|
68736
|
-
/* @__PURE__ */
|
|
69630
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
68737
69631
|
color: theme.colors.accent,
|
|
68738
69632
|
children: key
|
|
68739
69633
|
}, undefined, false, undefined, this),
|
|
68740
|
-
/* @__PURE__ */
|
|
69634
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
68741
69635
|
color: theme.colors.muted,
|
|
68742
69636
|
children: ": "
|
|
68743
69637
|
}, undefined, false, undefined, this),
|
|
68744
|
-
/* @__PURE__ */
|
|
69638
|
+
/* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Text, {
|
|
68745
69639
|
color: theme.colors.success,
|
|
68746
69640
|
children: String(value)
|
|
68747
69641
|
}, undefined, false, undefined, this)
|
|
@@ -68749,15 +69643,21 @@ var ResponsePanel = import_react31.default.memo(({ response, theme }) => {
|
|
|
68749
69643
|
}, key, true, undefined, this))
|
|
68750
69644
|
}, undefined, false, undefined, this)
|
|
68751
69645
|
}, undefined, false, undefined, this),
|
|
68752
|
-
activeTab === "body" && /* @__PURE__ */
|
|
68753
|
-
children: /* @__PURE__ */
|
|
69646
|
+
activeTab === "body" && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ScrollableBox, {
|
|
69647
|
+
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(Box_default, {
|
|
68754
69648
|
flexDirection: "column",
|
|
68755
69649
|
flexGrow: 1,
|
|
68756
|
-
children: /* @__PURE__ */
|
|
69650
|
+
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(JsonSyntaxHighlight, {
|
|
68757
69651
|
jsonString: response.body,
|
|
68758
69652
|
theme
|
|
68759
69653
|
}, undefined, false, undefined, this)
|
|
68760
69654
|
}, undefined, false, undefined, this)
|
|
69655
|
+
}, undefined, false, undefined, this),
|
|
69656
|
+
activeTab === "metrics" && /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(ScrollableBox, {
|
|
69657
|
+
children: /* @__PURE__ */ jsx_dev_runtime11.jsxDEV(MetricsPanel, {
|
|
69658
|
+
metrics,
|
|
69659
|
+
theme
|
|
69660
|
+
}, undefined, false, undefined, this)
|
|
68761
69661
|
}, undefined, false, undefined, this)
|
|
68762
69662
|
]
|
|
68763
69663
|
}, undefined, true, undefined, this)
|
|
@@ -68766,7 +69666,7 @@ var ResponsePanel = import_react31.default.memo(({ response, theme }) => {
|
|
|
68766
69666
|
});
|
|
68767
69667
|
|
|
68768
69668
|
// src/ui/app/components/exportdialog.tsx
|
|
68769
|
-
var
|
|
69669
|
+
var import_react33 = __toESM(require_react(), 1);
|
|
68770
69670
|
|
|
68771
69671
|
// src/utils/export.ts
|
|
68772
69672
|
import { writeFile, mkdir } from "fs";
|
|
@@ -68854,15 +69754,15 @@ var saveToFile = async (content, filePath) => {
|
|
|
68854
69754
|
};
|
|
68855
69755
|
|
|
68856
69756
|
// src/ui/app/components/exportdialog.tsx
|
|
68857
|
-
var
|
|
69757
|
+
var jsx_dev_runtime12 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68858
69758
|
var EXPORT_DIR = `${process.env.HOME}/.postboy/exports`;
|
|
68859
69759
|
var ExportDialog = ({ request, onClose, theme }) => {
|
|
68860
|
-
const [format, setFormat] =
|
|
68861
|
-
const [action, setAction] =
|
|
68862
|
-
const [showSavePrompt, setShowSavePrompt] =
|
|
68863
|
-
const [filePath, setFilePath] =
|
|
68864
|
-
const [message, setMessage] =
|
|
68865
|
-
const [activeField, setActiveField] =
|
|
69760
|
+
const [format, setFormat] = import_react33.useState("curl");
|
|
69761
|
+
const [action, setAction] = import_react33.useState("copy");
|
|
69762
|
+
const [showSavePrompt, setShowSavePrompt] = import_react33.useState(false);
|
|
69763
|
+
const [filePath, setFilePath] = import_react33.useState("");
|
|
69764
|
+
const [message, setMessage] = import_react33.useState("");
|
|
69765
|
+
const [activeField, setActiveField] = import_react33.useState("format");
|
|
68866
69766
|
const getExportContent = () => {
|
|
68867
69767
|
return format === "curl" ? toCurl(request) : toFetch(request);
|
|
68868
69768
|
};
|
|
@@ -68934,58 +69834,58 @@ ${finalPath}` : "Failed to save file");
|
|
|
68934
69834
|
}
|
|
68935
69835
|
});
|
|
68936
69836
|
const preview = getExportContent();
|
|
68937
|
-
return /* @__PURE__ */
|
|
69837
|
+
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68938
69838
|
flexDirection: "column",
|
|
68939
69839
|
borderStyle: "double",
|
|
68940
69840
|
borderColor: theme.accent,
|
|
68941
69841
|
padding: 1,
|
|
68942
69842
|
children: [
|
|
68943
|
-
/* @__PURE__ */
|
|
69843
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68944
69844
|
marginBottom: 1,
|
|
68945
69845
|
children: [
|
|
68946
|
-
/* @__PURE__ */
|
|
69846
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
68947
69847
|
color: theme.accent,
|
|
68948
69848
|
bold: true,
|
|
68949
69849
|
children: "Export Request"
|
|
68950
69850
|
}, undefined, false, undefined, this),
|
|
68951
|
-
/* @__PURE__ */
|
|
69851
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
68952
69852
|
color: theme.muted,
|
|
68953
69853
|
children: " (Tab: switch, ←→: select, Enter: confirm, Esc: cancel)"
|
|
68954
69854
|
}, undefined, false, undefined, this)
|
|
68955
69855
|
]
|
|
68956
69856
|
}, undefined, true, undefined, this),
|
|
68957
|
-
message ? /* @__PURE__ */
|
|
69857
|
+
message ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68958
69858
|
padding: 1,
|
|
68959
69859
|
flexDirection: "column",
|
|
68960
69860
|
borderStyle: "round",
|
|
68961
69861
|
borderColor: theme.success,
|
|
68962
69862
|
children: message.split(`
|
|
68963
|
-
`).map((line, i) => /* @__PURE__ */
|
|
69863
|
+
`).map((line, i) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
68964
69864
|
color: theme.success,
|
|
68965
69865
|
bold: true,
|
|
68966
69866
|
children: line
|
|
68967
69867
|
}, i, false, undefined, this))
|
|
68968
|
-
}, undefined, false, undefined, this) : showSavePrompt ? /* @__PURE__ */
|
|
69868
|
+
}, undefined, false, undefined, this) : showSavePrompt ? /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68969
69869
|
flexDirection: "column",
|
|
68970
69870
|
gap: 1,
|
|
68971
69871
|
children: [
|
|
68972
|
-
/* @__PURE__ */
|
|
69872
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68973
69873
|
children: [
|
|
68974
|
-
/* @__PURE__ */
|
|
69874
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
68975
69875
|
color: theme.primary,
|
|
68976
69876
|
children: "File path: "
|
|
68977
69877
|
}, undefined, false, undefined, this),
|
|
68978
|
-
/* @__PURE__ */
|
|
69878
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
68979
69879
|
borderStyle: "round",
|
|
68980
69880
|
borderColor: theme.accent,
|
|
68981
69881
|
paddingX: 1,
|
|
68982
69882
|
flexGrow: 1,
|
|
68983
69883
|
children: [
|
|
68984
|
-
/* @__PURE__ */
|
|
69884
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
68985
69885
|
color: theme.white,
|
|
68986
69886
|
children: filePath
|
|
68987
69887
|
}, undefined, false, undefined, this),
|
|
68988
|
-
/* @__PURE__ */
|
|
69888
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
68989
69889
|
color: theme.accent,
|
|
68990
69890
|
children: "▌"
|
|
68991
69891
|
}, undefined, false, undefined, this)
|
|
@@ -68993,7 +69893,7 @@ ${finalPath}` : "Failed to save file");
|
|
|
68993
69893
|
}, undefined, true, undefined, this)
|
|
68994
69894
|
]
|
|
68995
69895
|
}, undefined, true, undefined, this),
|
|
68996
|
-
/* @__PURE__ */
|
|
69896
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
68997
69897
|
color: theme.muted,
|
|
68998
69898
|
children: [
|
|
68999
69899
|
"Extension .",
|
|
@@ -69002,32 +69902,32 @@ ${finalPath}` : "Failed to save file");
|
|
|
69002
69902
|
]
|
|
69003
69903
|
}, undefined, true, undefined, this)
|
|
69004
69904
|
]
|
|
69005
|
-
}, undefined, true, undefined, this) : /* @__PURE__ */
|
|
69905
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69006
69906
|
flexDirection: "column",
|
|
69007
69907
|
gap: 1,
|
|
69008
69908
|
children: [
|
|
69009
|
-
/* @__PURE__ */
|
|
69909
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69010
69910
|
gap: 2,
|
|
69011
69911
|
children: [
|
|
69012
|
-
/* @__PURE__ */
|
|
69912
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
69013
69913
|
color: theme.primary,
|
|
69014
69914
|
children: "Format: "
|
|
69015
69915
|
}, undefined, false, undefined, this),
|
|
69016
|
-
/* @__PURE__ */
|
|
69916
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69017
69917
|
borderStyle: "round",
|
|
69018
69918
|
borderColor: activeField === "format" && format === "curl" ? theme.accent : theme.muted,
|
|
69019
69919
|
paddingX: 1,
|
|
69020
|
-
children: /* @__PURE__ */
|
|
69920
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
69021
69921
|
color: format === "curl" ? theme.accent : theme.muted,
|
|
69022
69922
|
bold: format === "curl",
|
|
69023
69923
|
children: "cURL"
|
|
69024
69924
|
}, undefined, false, undefined, this)
|
|
69025
69925
|
}, undefined, false, undefined, this),
|
|
69026
|
-
/* @__PURE__ */
|
|
69926
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69027
69927
|
borderStyle: "round",
|
|
69028
69928
|
borderColor: activeField === "format" && format === "fetch" ? theme.accent : theme.muted,
|
|
69029
69929
|
paddingX: 1,
|
|
69030
|
-
children: /* @__PURE__ */
|
|
69930
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
69031
69931
|
color: format === "fetch" ? theme.accent : theme.muted,
|
|
69032
69932
|
bold: format === "fetch",
|
|
69033
69933
|
children: "Fetch"
|
|
@@ -69035,28 +69935,28 @@ ${finalPath}` : "Failed to save file");
|
|
|
69035
69935
|
}, undefined, false, undefined, this)
|
|
69036
69936
|
]
|
|
69037
69937
|
}, undefined, true, undefined, this),
|
|
69038
|
-
/* @__PURE__ */
|
|
69938
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69039
69939
|
gap: 2,
|
|
69040
69940
|
children: [
|
|
69041
|
-
/* @__PURE__ */
|
|
69941
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
69042
69942
|
color: theme.primary,
|
|
69043
69943
|
children: "Action: "
|
|
69044
69944
|
}, undefined, false, undefined, this),
|
|
69045
|
-
/* @__PURE__ */
|
|
69945
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69046
69946
|
borderStyle: "round",
|
|
69047
69947
|
borderColor: activeField === "action" && action === "copy" ? theme.accent : theme.muted,
|
|
69048
69948
|
paddingX: 1,
|
|
69049
|
-
children: /* @__PURE__ */
|
|
69949
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
69050
69950
|
color: action === "copy" ? theme.accent : theme.muted,
|
|
69051
69951
|
bold: action === "copy",
|
|
69052
69952
|
children: "Copy to Clipboard"
|
|
69053
69953
|
}, undefined, false, undefined, this)
|
|
69054
69954
|
}, undefined, false, undefined, this),
|
|
69055
|
-
/* @__PURE__ */
|
|
69955
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69056
69956
|
borderStyle: "round",
|
|
69057
69957
|
borderColor: activeField === "action" && action === "save" ? theme.accent : theme.muted,
|
|
69058
69958
|
paddingX: 1,
|
|
69059
|
-
children: /* @__PURE__ */
|
|
69959
|
+
children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
69060
69960
|
color: action === "save" ? theme.accent : theme.muted,
|
|
69061
69961
|
bold: action === "save",
|
|
69062
69962
|
children: "Save to File"
|
|
@@ -69064,21 +69964,21 @@ ${finalPath}` : "Failed to save file");
|
|
|
69064
69964
|
}, undefined, false, undefined, this)
|
|
69065
69965
|
]
|
|
69066
69966
|
}, undefined, true, undefined, this),
|
|
69067
|
-
/* @__PURE__ */
|
|
69967
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69068
69968
|
flexDirection: "column",
|
|
69069
69969
|
marginTop: 1,
|
|
69070
69970
|
children: [
|
|
69071
|
-
/* @__PURE__ */
|
|
69971
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
69072
69972
|
color: theme.primary,
|
|
69073
69973
|
children: "Preview:"
|
|
69074
69974
|
}, undefined, false, undefined, this),
|
|
69075
|
-
/* @__PURE__ */
|
|
69975
|
+
/* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69076
69976
|
borderStyle: "round",
|
|
69077
69977
|
borderColor: theme.muted,
|
|
69078
69978
|
padding: 1,
|
|
69079
69979
|
flexDirection: "column",
|
|
69080
69980
|
children: preview.split(`
|
|
69081
|
-
`).map((line, i) => /* @__PURE__ */
|
|
69981
|
+
`).map((line, i) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
|
|
69082
69982
|
color: theme.white,
|
|
69083
69983
|
children: line
|
|
69084
69984
|
}, i, false, undefined, this))
|
|
@@ -69094,12 +69994,12 @@ ${finalPath}` : "Failed to save file");
|
|
|
69094
69994
|
// src/utils/themeManager.ts
|
|
69095
69995
|
import { promises as fs3 } from "fs";
|
|
69096
69996
|
import path2 from "path";
|
|
69097
|
-
import
|
|
69997
|
+
import os4 from "os";
|
|
69098
69998
|
|
|
69099
69999
|
class ThemeManager {
|
|
69100
70000
|
themeFile;
|
|
69101
70001
|
constructor() {
|
|
69102
|
-
const homeDir =
|
|
70002
|
+
const homeDir = os4.homedir();
|
|
69103
70003
|
const configDir = path2.join(homeDir, ".postboy");
|
|
69104
70004
|
this.themeFile = path2.join(configDir, "theme.json");
|
|
69105
70005
|
}
|
|
@@ -69194,21 +70094,21 @@ class ThemeManager {
|
|
|
69194
70094
|
var themeManager = new ThemeManager;
|
|
69195
70095
|
|
|
69196
70096
|
// src/ui/app/ui.tsx
|
|
69197
|
-
var
|
|
70097
|
+
var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69198
70098
|
var SendButton = ({ onPress, loading, theme }) => {
|
|
69199
70099
|
const { isFocused } = use_focus_default();
|
|
69200
70100
|
use_input_default((_, key) => {
|
|
69201
70101
|
if (isFocused && key.return)
|
|
69202
70102
|
onPress();
|
|
69203
70103
|
});
|
|
69204
|
-
return /* @__PURE__ */
|
|
70104
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69205
70105
|
borderStyle: "round",
|
|
69206
70106
|
paddingX: 2,
|
|
69207
70107
|
borderTopDimColor: true,
|
|
69208
70108
|
borderColor: isFocused ? theme.accent : theme.primary,
|
|
69209
|
-
children: loading ? /* @__PURE__ */
|
|
70109
|
+
children: loading ? /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Spinner, {
|
|
69210
70110
|
theme
|
|
69211
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
70111
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
69212
70112
|
bold: true,
|
|
69213
70113
|
color: isFocused ? theme.accent : theme.white,
|
|
69214
70114
|
children: "\uD83D\uDE80 Send"
|
|
@@ -69216,12 +70116,12 @@ var SendButton = ({ onPress, loading, theme }) => {
|
|
|
69216
70116
|
}, undefined, false, undefined, this);
|
|
69217
70117
|
};
|
|
69218
70118
|
var HTTP_METHODS = ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"];
|
|
69219
|
-
var RequestPanel =
|
|
70119
|
+
var RequestPanel = import_react34.default.memo(({ request, onMethodChange, onUrlChange, onHeadersChange, onBodyChange, onSend, loading, theme, historyUrls = [], onInputFocus }) => /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69220
70120
|
flexDirection: "column",
|
|
69221
70121
|
gap: 1,
|
|
69222
70122
|
flexGrow: 1,
|
|
69223
70123
|
children: [
|
|
69224
|
-
/* @__PURE__ */
|
|
70124
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FormField, {
|
|
69225
70125
|
label: "Method",
|
|
69226
70126
|
value: request.method,
|
|
69227
70127
|
onChange: onMethodChange,
|
|
@@ -69230,7 +70130,7 @@ var RequestPanel = import_react33.default.memo(({ request, onMethodChange, onUrl
|
|
|
69230
70130
|
suggestions: HTTP_METHODS,
|
|
69231
70131
|
onFocusChange: onInputFocus
|
|
69232
70132
|
}, undefined, false, undefined, this),
|
|
69233
|
-
/* @__PURE__ */
|
|
70133
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(FormField, {
|
|
69234
70134
|
label: "URL",
|
|
69235
70135
|
value: request.url,
|
|
69236
70136
|
onChange: onUrlChange,
|
|
@@ -69239,7 +70139,7 @@ var RequestPanel = import_react33.default.memo(({ request, onMethodChange, onUrl
|
|
|
69239
70139
|
suggestions: historyUrls,
|
|
69240
70140
|
onFocusChange: onInputFocus
|
|
69241
70141
|
}, undefined, false, undefined, this),
|
|
69242
|
-
/* @__PURE__ */
|
|
70142
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(KeyValueField, {
|
|
69243
70143
|
label: "Headers",
|
|
69244
70144
|
value: request.headers,
|
|
69245
70145
|
onChange: onHeadersChange,
|
|
@@ -69247,7 +70147,7 @@ var RequestPanel = import_react33.default.memo(({ request, onMethodChange, onUrl
|
|
|
69247
70147
|
theme,
|
|
69248
70148
|
onFocusChange: onInputFocus
|
|
69249
70149
|
}, undefined, false, undefined, this),
|
|
69250
|
-
/* @__PURE__ */
|
|
70150
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(KeyValueField, {
|
|
69251
70151
|
label: "Body",
|
|
69252
70152
|
value: request.body,
|
|
69253
70153
|
onChange: onBodyChange,
|
|
@@ -69255,10 +70155,10 @@ var RequestPanel = import_react33.default.memo(({ request, onMethodChange, onUrl
|
|
|
69255
70155
|
theme,
|
|
69256
70156
|
onFocusChange: onInputFocus
|
|
69257
70157
|
}, undefined, false, undefined, this),
|
|
69258
|
-
/* @__PURE__ */
|
|
70158
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69259
70159
|
marginTop: 1,
|
|
69260
70160
|
justifyContent: "center",
|
|
69261
|
-
children: /* @__PURE__ */
|
|
70161
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(SendButton, {
|
|
69262
70162
|
onPress: onSend,
|
|
69263
70163
|
loading,
|
|
69264
70164
|
theme
|
|
@@ -69267,27 +70167,28 @@ var RequestPanel = import_react33.default.memo(({ request, onMethodChange, onUrl
|
|
|
69267
70167
|
]
|
|
69268
70168
|
}, undefined, true, undefined, this));
|
|
69269
70169
|
var UI = () => {
|
|
69270
|
-
const [theme, setTheme] =
|
|
70170
|
+
const [theme, setTheme] = import_react34.useState(themes.catppuccin);
|
|
69271
70171
|
const { exit } = use_app_default();
|
|
69272
|
-
const [activeTab, setActiveTab] =
|
|
69273
|
-
const [request, setRequest] =
|
|
69274
|
-
const [response, setResponse] =
|
|
69275
|
-
const [
|
|
69276
|
-
const [
|
|
69277
|
-
const
|
|
70172
|
+
const [activeTab, setActiveTab] = import_react34.useState("request");
|
|
70173
|
+
const [request, setRequest] = import_react34.useState({ method: "GET", url: "", headers: "", body: "" });
|
|
70174
|
+
const [response, setResponse] = import_react34.useState({ statustext: "", status: "", headers: "", body: "", error: "" });
|
|
70175
|
+
const [metrics, setMetrics] = import_react34.useState(null);
|
|
70176
|
+
const [history, setHistory] = import_react34.useState([]);
|
|
70177
|
+
const [loading, setLoading] = import_react34.useState(false);
|
|
70178
|
+
const requestRef = import_react34.useRef(request);
|
|
69278
70179
|
requestRef.current = request;
|
|
69279
|
-
|
|
70180
|
+
import_react34.useEffect(() => {
|
|
69280
70181
|
const loadHistory = async () => setHistory((await historyManager.loadHistory()).entries);
|
|
69281
70182
|
loadHistory();
|
|
69282
70183
|
}, []);
|
|
69283
|
-
|
|
70184
|
+
import_react34.useEffect(() => {
|
|
69284
70185
|
const loadTheme = async () => {
|
|
69285
70186
|
const loadedTheme = await themeManager.loadCurrTheme();
|
|
69286
70187
|
setTheme(loadedTheme);
|
|
69287
70188
|
};
|
|
69288
70189
|
loadTheme();
|
|
69289
70190
|
}, []);
|
|
69290
|
-
const handleSend =
|
|
70191
|
+
const handleSend = import_react34.useCallback(async () => {
|
|
69291
70192
|
setLoading(true);
|
|
69292
70193
|
const startTime = Date.now();
|
|
69293
70194
|
const currentRequest = requestRef.current;
|
|
@@ -69315,6 +70216,7 @@ var UI = () => {
|
|
|
69315
70216
|
const responseTime = Date.now() - startTime;
|
|
69316
70217
|
await historyManager.addEntry({ ...currentRequest }, res.status, responseTime);
|
|
69317
70218
|
setHistory((await historyManager.loadHistory()).entries);
|
|
70219
|
+
setMetrics(res.metrics);
|
|
69318
70220
|
setResponse({ statustext: res.statusText, status: res.status.toString(), headers: JSON.stringify(res.headers), body: res.body, error: res.status >= 200 && res.status < 400 ? "" : `Error: ${res.statusText}` });
|
|
69319
70221
|
setActiveTab("response");
|
|
69320
70222
|
} catch (error) {
|
|
@@ -69328,7 +70230,7 @@ var UI = () => {
|
|
|
69328
70230
|
themeManager.ChangeTheme(theme2);
|
|
69329
70231
|
setTheme(theme2);
|
|
69330
70232
|
};
|
|
69331
|
-
const handleHistoryClick =
|
|
70233
|
+
const handleHistoryClick = import_react34.useCallback((item) => {
|
|
69332
70234
|
setRequest({
|
|
69333
70235
|
method: item.method,
|
|
69334
70236
|
url: item.url,
|
|
@@ -69339,9 +70241,9 @@ var UI = () => {
|
|
|
69339
70241
|
}, []);
|
|
69340
70242
|
const tabs = [{ name: "request", label: "Request" }, { name: "response", label: "Response" }];
|
|
69341
70243
|
const activeIndex = tabs.findIndex((t) => t.name === activeTab);
|
|
69342
|
-
const [showThemeSelector, setShowThemeSelector] =
|
|
69343
|
-
const [showExportDialog, setShowExportDialog] =
|
|
69344
|
-
const [inputFocused, setInputFocused] =
|
|
70244
|
+
const [showThemeSelector, setShowThemeSelector] = import_react34.useState(false);
|
|
70245
|
+
const [showExportDialog, setShowExportDialog] = import_react34.useState(false);
|
|
70246
|
+
const [inputFocused, setInputFocused] = import_react34.useState(false);
|
|
69345
70247
|
use_input_default((input, key) => {
|
|
69346
70248
|
if (input === "q" && !showExportDialog)
|
|
69347
70249
|
exit();
|
|
@@ -69360,94 +70262,94 @@ var UI = () => {
|
|
|
69360
70262
|
if ((input === "e" || input === "E") && !key.ctrl && !key.meta && !inputFocused && !showThemeSelector)
|
|
69361
70263
|
setShowExportDialog((prev) => !prev);
|
|
69362
70264
|
}, { isActive: !showExportDialog });
|
|
69363
|
-
const onMethodChange =
|
|
69364
|
-
const onUrlChange =
|
|
69365
|
-
const onHeadersChange =
|
|
69366
|
-
const onBodyChange =
|
|
70265
|
+
const onMethodChange = import_react34.useCallback((method) => setRequest((r) => ({ ...r, method })), []);
|
|
70266
|
+
const onUrlChange = import_react34.useCallback((url) => setRequest((r) => ({ ...r, url })), []);
|
|
70267
|
+
const onHeadersChange = import_react34.useCallback((headers) => setRequest((r) => ({ ...r, headers })), []);
|
|
70268
|
+
const onBodyChange = import_react34.useCallback((body) => setRequest((r) => ({ ...r, body })), []);
|
|
69367
70269
|
const historyUrls = Array.from(new Set(history.map((h) => h.url))).filter(Boolean);
|
|
69368
|
-
return /* @__PURE__ */
|
|
70270
|
+
return /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69369
70271
|
padding: 1,
|
|
69370
70272
|
flexDirection: "column",
|
|
69371
70273
|
flexGrow: 1,
|
|
69372
70274
|
children: [
|
|
69373
|
-
showThemeSelector && /* @__PURE__ */
|
|
70275
|
+
showThemeSelector && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69374
70276
|
flexDirection: "row",
|
|
69375
70277
|
justifyContent: "center",
|
|
69376
70278
|
marginBottom: 1,
|
|
69377
|
-
children: /* @__PURE__ */
|
|
70279
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ThemeSelector, {
|
|
69378
70280
|
theme,
|
|
69379
70281
|
onThemeChange: (themeName) => {
|
|
69380
70282
|
handleThemeChange(themes[themeName]);
|
|
69381
70283
|
}
|
|
69382
70284
|
}, undefined, false, undefined, this)
|
|
69383
70285
|
}, undefined, false, undefined, this),
|
|
69384
|
-
showExportDialog && /* @__PURE__ */
|
|
70286
|
+
showExportDialog && /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69385
70287
|
flexDirection: "row",
|
|
69386
70288
|
justifyContent: "center",
|
|
69387
70289
|
marginBottom: 1,
|
|
69388
|
-
children: /* @__PURE__ */
|
|
70290
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ExportDialog, {
|
|
69389
70291
|
request,
|
|
69390
70292
|
onClose: () => setShowExportDialog(false),
|
|
69391
70293
|
theme: theme.colors
|
|
69392
70294
|
}, undefined, false, undefined, this)
|
|
69393
70295
|
}, undefined, false, undefined, this),
|
|
69394
|
-
/* @__PURE__ */
|
|
70296
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69395
70297
|
alignSelf: "center",
|
|
69396
70298
|
marginBottom: 1,
|
|
69397
|
-
children: /* @__PURE__ */
|
|
70299
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
69398
70300
|
color: theme.colors.accent,
|
|
69399
70301
|
bold: true,
|
|
69400
70302
|
children: `┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`
|
|
69401
70303
|
}, undefined, false, undefined, this)
|
|
69402
70304
|
}, undefined, false, undefined, this),
|
|
69403
|
-
/* @__PURE__ */
|
|
70305
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69404
70306
|
alignSelf: "center",
|
|
69405
70307
|
marginBottom: 1,
|
|
69406
|
-
children: /* @__PURE__ */
|
|
70308
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
69407
70309
|
color: theme.colors.primary,
|
|
69408
70310
|
bold: true,
|
|
69409
70311
|
children: `┃ \uD83D\uDEF0️ Welcome to PostBoy — The Modern Terminal API Client ┃`
|
|
69410
70312
|
}, undefined, false, undefined, this)
|
|
69411
70313
|
}, undefined, false, undefined, this),
|
|
69412
|
-
/* @__PURE__ */
|
|
70314
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69413
70315
|
alignSelf: "center",
|
|
69414
70316
|
marginBottom: 1,
|
|
69415
|
-
children: /* @__PURE__ */
|
|
70317
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
69416
70318
|
color: theme.colors.accent,
|
|
69417
70319
|
bold: true,
|
|
69418
70320
|
children: `┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`
|
|
69419
70321
|
}, undefined, false, undefined, this)
|
|
69420
70322
|
}, undefined, false, undefined, this),
|
|
69421
|
-
/* @__PURE__ */
|
|
70323
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69422
70324
|
flexGrow: 1,
|
|
69423
70325
|
children: [
|
|
69424
|
-
/* @__PURE__ */
|
|
70326
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69425
70327
|
width: "40%",
|
|
69426
70328
|
borderColor: theme.colors.muted,
|
|
69427
70329
|
flexDirection: "column",
|
|
69428
70330
|
marginRight: 1,
|
|
69429
70331
|
children: [
|
|
69430
|
-
/* @__PURE__ */
|
|
70332
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69431
70333
|
alignSelf: "center",
|
|
69432
70334
|
marginBottom: 1,
|
|
69433
|
-
children: /* @__PURE__ */
|
|
70335
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
69434
70336
|
color: theme.colors.accent,
|
|
69435
70337
|
bold: true,
|
|
69436
70338
|
children: `┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`
|
|
69437
70339
|
}, undefined, false, undefined, this)
|
|
69438
70340
|
}, undefined, false, undefined, this),
|
|
69439
|
-
/* @__PURE__ */
|
|
70341
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69440
70342
|
borderTopColor: "grey",
|
|
69441
70343
|
borderColor: theme.colors.secondary,
|
|
69442
70344
|
paddingX: 1,
|
|
69443
70345
|
alignSelf: "center",
|
|
69444
|
-
children: /* @__PURE__ */
|
|
70346
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
69445
70347
|
color: theme.colors.accent,
|
|
69446
70348
|
bold: true,
|
|
69447
70349
|
children: "\uD83D\uDCDC History"
|
|
69448
70350
|
}, undefined, false, undefined, this)
|
|
69449
70351
|
}, undefined, false, undefined, this),
|
|
69450
|
-
/* @__PURE__ */
|
|
70352
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69451
70353
|
flexDirection: "column",
|
|
69452
70354
|
flexGrow: 1,
|
|
69453
70355
|
borderRightColor: "grey",
|
|
@@ -69456,22 +70358,22 @@ var UI = () => {
|
|
|
69456
70358
|
borderLeft: false,
|
|
69457
70359
|
borderBottom: false,
|
|
69458
70360
|
paddingY: 1,
|
|
69459
|
-
children: history.length === 0 ? /* @__PURE__ */
|
|
70361
|
+
children: history.length === 0 ? /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69460
70362
|
padding: 1,
|
|
69461
|
-
children: /* @__PURE__ */
|
|
70363
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
69462
70364
|
color: theme.colors.muted,
|
|
69463
70365
|
children: "No requests yet..."
|
|
69464
70366
|
}, undefined, false, undefined, this)
|
|
69465
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
70367
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(HistoryList, {
|
|
69466
70368
|
history,
|
|
69467
70369
|
onItemClick: handleHistoryClick,
|
|
69468
70370
|
theme
|
|
69469
70371
|
}, undefined, false, undefined, this)
|
|
69470
70372
|
}, undefined, false, undefined, this),
|
|
69471
|
-
/* @__PURE__ */
|
|
70373
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69472
70374
|
alignSelf: "center",
|
|
69473
70375
|
marginBottom: 1,
|
|
69474
|
-
children: /* @__PURE__ */
|
|
70376
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
69475
70377
|
color: theme.colors.accent,
|
|
69476
70378
|
bold: true,
|
|
69477
70379
|
children: `┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`
|
|
@@ -69479,36 +70381,36 @@ var UI = () => {
|
|
|
69479
70381
|
}, undefined, false, undefined, this)
|
|
69480
70382
|
]
|
|
69481
70383
|
}, undefined, true, undefined, this),
|
|
69482
|
-
/* @__PURE__ */
|
|
70384
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69483
70385
|
width: "60%",
|
|
69484
70386
|
borderColor: theme.colors.muted,
|
|
69485
70387
|
padding: 1,
|
|
69486
70388
|
flexDirection: "column",
|
|
69487
70389
|
children: [
|
|
69488
|
-
/* @__PURE__ */
|
|
70390
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69489
70391
|
alignSelf: "center",
|
|
69490
70392
|
marginBottom: 1,
|
|
69491
|
-
children: /* @__PURE__ */
|
|
70393
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
69492
70394
|
color: theme.colors.accent,
|
|
69493
70395
|
bold: true,
|
|
69494
70396
|
children: `┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`
|
|
69495
70397
|
}, undefined, false, undefined, this)
|
|
69496
70398
|
}, undefined, false, undefined, this),
|
|
69497
|
-
/* @__PURE__ */
|
|
70399
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Tabs, {
|
|
69498
70400
|
tabs,
|
|
69499
70401
|
activeTab,
|
|
69500
70402
|
onChange: setActiveTab,
|
|
69501
70403
|
theme
|
|
69502
70404
|
}, undefined, false, undefined, this),
|
|
69503
|
-
/* @__PURE__ */
|
|
70405
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69504
70406
|
marginTop: 1,
|
|
69505
70407
|
flexDirection: "column",
|
|
69506
70408
|
flexGrow: 1,
|
|
69507
70409
|
children: [
|
|
69508
|
-
/* @__PURE__ */
|
|
70410
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69509
70411
|
display: activeTab === "request" ? "flex" : "none",
|
|
69510
70412
|
flexGrow: 1,
|
|
69511
|
-
children: /* @__PURE__ */
|
|
70413
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(RequestPanel, {
|
|
69512
70414
|
request,
|
|
69513
70415
|
onMethodChange,
|
|
69514
70416
|
onUrlChange,
|
|
@@ -69521,20 +70423,21 @@ var UI = () => {
|
|
|
69521
70423
|
onInputFocus: setInputFocused
|
|
69522
70424
|
}, undefined, false, undefined, this)
|
|
69523
70425
|
}, undefined, false, undefined, this),
|
|
69524
|
-
/* @__PURE__ */
|
|
70426
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69525
70427
|
display: activeTab === "response" ? "flex" : "none",
|
|
69526
70428
|
flexGrow: 1,
|
|
69527
|
-
children: /* @__PURE__ */
|
|
70429
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(ResponsePanel, {
|
|
69528
70430
|
response,
|
|
69529
|
-
theme
|
|
70431
|
+
theme,
|
|
70432
|
+
metrics
|
|
69530
70433
|
}, undefined, false, undefined, this)
|
|
69531
70434
|
}, undefined, false, undefined, this)
|
|
69532
70435
|
]
|
|
69533
70436
|
}, undefined, true, undefined, this),
|
|
69534
|
-
/* @__PURE__ */
|
|
70437
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Box_default, {
|
|
69535
70438
|
alignSelf: "center",
|
|
69536
70439
|
marginBottom: 1,
|
|
69537
|
-
children: /* @__PURE__ */
|
|
70440
|
+
children: /* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Text, {
|
|
69538
70441
|
color: theme.colors.accent,
|
|
69539
70442
|
bold: true,
|
|
69540
70443
|
children: `┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`
|
|
@@ -69544,7 +70447,7 @@ var UI = () => {
|
|
|
69544
70447
|
}, undefined, true, undefined, this)
|
|
69545
70448
|
]
|
|
69546
70449
|
}, undefined, true, undefined, this),
|
|
69547
|
-
/* @__PURE__ */
|
|
70450
|
+
/* @__PURE__ */ jsx_dev_runtime13.jsxDEV(Footer, {
|
|
69548
70451
|
theme: theme.colors
|
|
69549
70452
|
}, undefined, false, undefined, this)
|
|
69550
70453
|
]
|
|
@@ -69553,14 +70456,14 @@ var UI = () => {
|
|
|
69553
70456
|
var ui_default = UI;
|
|
69554
70457
|
|
|
69555
70458
|
// src/ui/app/app.tsx
|
|
69556
|
-
var
|
|
70459
|
+
var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69557
70460
|
function App2() {
|
|
69558
|
-
return /* @__PURE__ */
|
|
70461
|
+
return /* @__PURE__ */ jsx_dev_runtime14.jsxDEV(ui_default, {}, undefined, false, undefined, this);
|
|
69559
70462
|
}
|
|
69560
70463
|
|
|
69561
70464
|
// src/commands/ui.tsx
|
|
69562
|
-
var
|
|
69563
|
-
var
|
|
70465
|
+
var import_chalk6 = __toESM(require_source(), 1);
|
|
70466
|
+
var jsx_dev_runtime15 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69564
70467
|
var UIWrapper = () => {
|
|
69565
70468
|
const { exit } = use_app_default();
|
|
69566
70469
|
use_input_default((input) => {
|
|
@@ -69568,23 +70471,23 @@ var UIWrapper = () => {
|
|
|
69568
70471
|
exit();
|
|
69569
70472
|
}
|
|
69570
70473
|
});
|
|
69571
|
-
return /* @__PURE__ */
|
|
70474
|
+
return /* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Box_default, {
|
|
69572
70475
|
flexDirection: "column",
|
|
69573
70476
|
children: [
|
|
69574
|
-
/* @__PURE__ */
|
|
69575
|
-
children:
|
|
70477
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(Text, {
|
|
70478
|
+
children: import_chalk6.default.cyanBright(`PostBoy \uD83D\uDC8C`)
|
|
69576
70479
|
}, undefined, false, undefined, this),
|
|
69577
|
-
/* @__PURE__ */
|
|
70480
|
+
/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(App2, {}, undefined, false, undefined, this)
|
|
69578
70481
|
]
|
|
69579
70482
|
}, undefined, true, undefined, this);
|
|
69580
70483
|
};
|
|
69581
70484
|
var uiCommand = () => {
|
|
69582
|
-
render_default(/* @__PURE__ */
|
|
70485
|
+
render_default(/* @__PURE__ */ jsx_dev_runtime15.jsxDEV(UIWrapper, {}, undefined, false, undefined, this));
|
|
69583
70486
|
};
|
|
69584
70487
|
|
|
69585
70488
|
// src/commands/test.ts
|
|
69586
70489
|
var import_inquirer = __toESM(require_inquirer(), 1);
|
|
69587
|
-
var
|
|
70490
|
+
var import_chalk7 = __toESM(require_source(), 1);
|
|
69588
70491
|
async function testCommand() {
|
|
69589
70492
|
logger.title(WELCOME_MESSAGE);
|
|
69590
70493
|
logger.info(SUBTITLE);
|
|
@@ -69592,13 +70495,13 @@ async function testCommand() {
|
|
|
69592
70495
|
{
|
|
69593
70496
|
type: "input",
|
|
69594
70497
|
name: "url",
|
|
69595
|
-
message:
|
|
70498
|
+
message: import_chalk7.default.green("Enter the API URL:"),
|
|
69596
70499
|
default: "leave this empty for selecting mock URL"
|
|
69597
70500
|
},
|
|
69598
70501
|
{
|
|
69599
70502
|
type: "list",
|
|
69600
70503
|
name: "MOCK_URL",
|
|
69601
|
-
message:
|
|
70504
|
+
message: import_chalk7.default.green("Select a mock URL:"),
|
|
69602
70505
|
choices: [
|
|
69603
70506
|
"https://jsonplaceholder.typicode.com/posts",
|
|
69604
70507
|
"https://jsonplaceholder.typicode.com/comments",
|
|
@@ -69609,19 +70512,19 @@ async function testCommand() {
|
|
|
69609
70512
|
{
|
|
69610
70513
|
type: "list",
|
|
69611
70514
|
name: "method",
|
|
69612
|
-
message:
|
|
70515
|
+
message: import_chalk7.default.green("Select HTTP method:"),
|
|
69613
70516
|
choices: ["GET", "POST", "PUT", "DELETE"]
|
|
69614
70517
|
},
|
|
69615
70518
|
{
|
|
69616
70519
|
type: "input",
|
|
69617
70520
|
name: "headers",
|
|
69618
|
-
message:
|
|
70521
|
+
message: import_chalk7.default.green("Enter headers (JSON format):"),
|
|
69619
70522
|
default: "{}"
|
|
69620
70523
|
},
|
|
69621
70524
|
{
|
|
69622
70525
|
type: "input",
|
|
69623
70526
|
name: "body",
|
|
69624
|
-
message:
|
|
70527
|
+
message: import_chalk7.default.green("Enter request body (JSON format):"),
|
|
69625
70528
|
default: "{}"
|
|
69626
70529
|
}
|
|
69627
70530
|
]);
|
|
@@ -69635,20 +70538,20 @@ Your request configuration:`);
|
|
|
69635
70538
|
Response received! ✨`);
|
|
69636
70539
|
logger.info(`Status: ${response.status}`);
|
|
69637
70540
|
logger.info(`Status Text: ${response.statusText}`);
|
|
69638
|
-
console.log(
|
|
70541
|
+
console.log(import_chalk7.default.green("Response Body :"));
|
|
69639
70542
|
+logger.info(await response.text());
|
|
69640
|
-
console.log(
|
|
70543
|
+
console.log(import_chalk7.default.green("Response Headers:"));
|
|
69641
70544
|
logger.info(JSON.stringify(response.headers, null, 2));
|
|
69642
70545
|
} catch (err) {
|
|
69643
70546
|
logger.error(`
|
|
69644
70547
|
Error occurred! ❌`);
|
|
69645
|
-
console.error(
|
|
70548
|
+
console.error(import_chalk7.default.magentaBright(err));
|
|
69646
70549
|
}
|
|
69647
70550
|
}
|
|
69648
70551
|
|
|
69649
70552
|
// src/commands/mock.ts
|
|
69650
70553
|
var import_inquirer2 = __toESM(require_inquirer(), 1);
|
|
69651
|
-
var
|
|
70554
|
+
var import_chalk8 = __toESM(require_source(), 1);
|
|
69652
70555
|
async function mockApis() {
|
|
69653
70556
|
logger.title(WELCOME_MESSAGE);
|
|
69654
70557
|
logger.info(SUBTITLE);
|
|
@@ -69687,7 +70590,7 @@ async function mockApis() {
|
|
|
69687
70590
|
{
|
|
69688
70591
|
type: "list",
|
|
69689
70592
|
name: "category",
|
|
69690
|
-
message:
|
|
70593
|
+
message: import_chalk8.default.green("Select categories :"),
|
|
69691
70594
|
choices: [
|
|
69692
70595
|
"posts",
|
|
69693
70596
|
"ecommerce/store",
|
|
@@ -69702,7 +70605,7 @@ async function mockApis() {
|
|
|
69702
70605
|
{
|
|
69703
70606
|
type: "list",
|
|
69704
70607
|
name: "method",
|
|
69705
|
-
message:
|
|
70608
|
+
message: import_chalk8.default.green("Select HTTP method:"),
|
|
69706
70609
|
choices: ["GET", "POST", "PUT", "DELETE"]
|
|
69707
70610
|
}
|
|
69708
70611
|
]);
|
|
@@ -69748,7 +70651,7 @@ async function mockApis() {
|
|
|
69748
70651
|
|
|
69749
70652
|
// src/index.ts
|
|
69750
70653
|
var program2 = new Command;
|
|
69751
|
-
program2.version("1.3.
|
|
70654
|
+
program2.version("1.3.8").description(import_chalk9.default.yellow("PostBoy CLI - Test your APIs with ease"));
|
|
69752
70655
|
program2.command("run").description("Run a test API request").action(testCommand);
|
|
69753
70656
|
program2.command("mock-list").description("List the mock API servers").action(mockApis);
|
|
69754
70657
|
program2.command("ui").description("UI for PostBoy").action(uiCommand);
|