postboy-tui 1.3.6 → 1.3.7
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 +812 -162
- 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";
|
|
@@ -68280,9 +68280,584 @@ var Tabs = ({ tabs, activeTab, onChange, theme }) => /* @__PURE__ */ jsx_dev_run
|
|
|
68280
68280
|
}, tab2.name, false, undefined, this))
|
|
68281
68281
|
}, undefined, false, undefined, this);
|
|
68282
68282
|
|
|
68283
|
-
//
|
|
68283
|
+
// node_modules/ink-text-input/build/index.js
|
|
68284
68284
|
var import_react26 = __toESM(require_react(), 1);
|
|
68285
68285
|
|
|
68286
|
+
// node_modules/ink-text-input/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
68287
|
+
var ANSI_BACKGROUND_OFFSET6 = 10;
|
|
68288
|
+
var wrapAnsi166 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
68289
|
+
var wrapAnsi2566 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
68290
|
+
var wrapAnsi16m6 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
68291
|
+
var styles8 = {
|
|
68292
|
+
modifier: {
|
|
68293
|
+
reset: [0, 0],
|
|
68294
|
+
bold: [1, 22],
|
|
68295
|
+
dim: [2, 22],
|
|
68296
|
+
italic: [3, 23],
|
|
68297
|
+
underline: [4, 24],
|
|
68298
|
+
overline: [53, 55],
|
|
68299
|
+
inverse: [7, 27],
|
|
68300
|
+
hidden: [8, 28],
|
|
68301
|
+
strikethrough: [9, 29]
|
|
68302
|
+
},
|
|
68303
|
+
color: {
|
|
68304
|
+
black: [30, 39],
|
|
68305
|
+
red: [31, 39],
|
|
68306
|
+
green: [32, 39],
|
|
68307
|
+
yellow: [33, 39],
|
|
68308
|
+
blue: [34, 39],
|
|
68309
|
+
magenta: [35, 39],
|
|
68310
|
+
cyan: [36, 39],
|
|
68311
|
+
white: [37, 39],
|
|
68312
|
+
blackBright: [90, 39],
|
|
68313
|
+
gray: [90, 39],
|
|
68314
|
+
grey: [90, 39],
|
|
68315
|
+
redBright: [91, 39],
|
|
68316
|
+
greenBright: [92, 39],
|
|
68317
|
+
yellowBright: [93, 39],
|
|
68318
|
+
blueBright: [94, 39],
|
|
68319
|
+
magentaBright: [95, 39],
|
|
68320
|
+
cyanBright: [96, 39],
|
|
68321
|
+
whiteBright: [97, 39]
|
|
68322
|
+
},
|
|
68323
|
+
bgColor: {
|
|
68324
|
+
bgBlack: [40, 49],
|
|
68325
|
+
bgRed: [41, 49],
|
|
68326
|
+
bgGreen: [42, 49],
|
|
68327
|
+
bgYellow: [43, 49],
|
|
68328
|
+
bgBlue: [44, 49],
|
|
68329
|
+
bgMagenta: [45, 49],
|
|
68330
|
+
bgCyan: [46, 49],
|
|
68331
|
+
bgWhite: [47, 49],
|
|
68332
|
+
bgBlackBright: [100, 49],
|
|
68333
|
+
bgGray: [100, 49],
|
|
68334
|
+
bgGrey: [100, 49],
|
|
68335
|
+
bgRedBright: [101, 49],
|
|
68336
|
+
bgGreenBright: [102, 49],
|
|
68337
|
+
bgYellowBright: [103, 49],
|
|
68338
|
+
bgBlueBright: [104, 49],
|
|
68339
|
+
bgMagentaBright: [105, 49],
|
|
68340
|
+
bgCyanBright: [106, 49],
|
|
68341
|
+
bgWhiteBright: [107, 49]
|
|
68342
|
+
}
|
|
68343
|
+
};
|
|
68344
|
+
var modifierNames6 = Object.keys(styles8.modifier);
|
|
68345
|
+
var foregroundColorNames6 = Object.keys(styles8.color);
|
|
68346
|
+
var backgroundColorNames6 = Object.keys(styles8.bgColor);
|
|
68347
|
+
var colorNames6 = [...foregroundColorNames6, ...backgroundColorNames6];
|
|
68348
|
+
function assembleStyles6() {
|
|
68349
|
+
const codes = new Map;
|
|
68350
|
+
for (const [groupName, group] of Object.entries(styles8)) {
|
|
68351
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
68352
|
+
styles8[styleName] = {
|
|
68353
|
+
open: `\x1B[${style[0]}m`,
|
|
68354
|
+
close: `\x1B[${style[1]}m`
|
|
68355
|
+
};
|
|
68356
|
+
group[styleName] = styles8[styleName];
|
|
68357
|
+
codes.set(style[0], style[1]);
|
|
68358
|
+
}
|
|
68359
|
+
Object.defineProperty(styles8, groupName, {
|
|
68360
|
+
value: group,
|
|
68361
|
+
enumerable: false
|
|
68362
|
+
});
|
|
68363
|
+
}
|
|
68364
|
+
Object.defineProperty(styles8, "codes", {
|
|
68365
|
+
value: codes,
|
|
68366
|
+
enumerable: false
|
|
68367
|
+
});
|
|
68368
|
+
styles8.color.close = "\x1B[39m";
|
|
68369
|
+
styles8.bgColor.close = "\x1B[49m";
|
|
68370
|
+
styles8.color.ansi = wrapAnsi166();
|
|
68371
|
+
styles8.color.ansi256 = wrapAnsi2566();
|
|
68372
|
+
styles8.color.ansi16m = wrapAnsi16m6();
|
|
68373
|
+
styles8.bgColor.ansi = wrapAnsi166(ANSI_BACKGROUND_OFFSET6);
|
|
68374
|
+
styles8.bgColor.ansi256 = wrapAnsi2566(ANSI_BACKGROUND_OFFSET6);
|
|
68375
|
+
styles8.bgColor.ansi16m = wrapAnsi16m6(ANSI_BACKGROUND_OFFSET6);
|
|
68376
|
+
Object.defineProperties(styles8, {
|
|
68377
|
+
rgbToAnsi256: {
|
|
68378
|
+
value(red, green, blue) {
|
|
68379
|
+
if (red === green && green === blue) {
|
|
68380
|
+
if (red < 8) {
|
|
68381
|
+
return 16;
|
|
68382
|
+
}
|
|
68383
|
+
if (red > 248) {
|
|
68384
|
+
return 231;
|
|
68385
|
+
}
|
|
68386
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
68387
|
+
}
|
|
68388
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
68389
|
+
},
|
|
68390
|
+
enumerable: false
|
|
68391
|
+
},
|
|
68392
|
+
hexToRgb: {
|
|
68393
|
+
value(hex) {
|
|
68394
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
68395
|
+
if (!matches) {
|
|
68396
|
+
return [0, 0, 0];
|
|
68397
|
+
}
|
|
68398
|
+
let [colorString] = matches;
|
|
68399
|
+
if (colorString.length === 3) {
|
|
68400
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
68401
|
+
}
|
|
68402
|
+
const integer = Number.parseInt(colorString, 16);
|
|
68403
|
+
return [
|
|
68404
|
+
integer >> 16 & 255,
|
|
68405
|
+
integer >> 8 & 255,
|
|
68406
|
+
integer & 255
|
|
68407
|
+
];
|
|
68408
|
+
},
|
|
68409
|
+
enumerable: false
|
|
68410
|
+
},
|
|
68411
|
+
hexToAnsi256: {
|
|
68412
|
+
value: (hex) => styles8.rgbToAnsi256(...styles8.hexToRgb(hex)),
|
|
68413
|
+
enumerable: false
|
|
68414
|
+
},
|
|
68415
|
+
ansi256ToAnsi: {
|
|
68416
|
+
value(code) {
|
|
68417
|
+
if (code < 8) {
|
|
68418
|
+
return 30 + code;
|
|
68419
|
+
}
|
|
68420
|
+
if (code < 16) {
|
|
68421
|
+
return 90 + (code - 8);
|
|
68422
|
+
}
|
|
68423
|
+
let red;
|
|
68424
|
+
let green;
|
|
68425
|
+
let blue;
|
|
68426
|
+
if (code >= 232) {
|
|
68427
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
68428
|
+
green = red;
|
|
68429
|
+
blue = red;
|
|
68430
|
+
} else {
|
|
68431
|
+
code -= 16;
|
|
68432
|
+
const remainder = code % 36;
|
|
68433
|
+
red = Math.floor(code / 36) / 5;
|
|
68434
|
+
green = Math.floor(remainder / 6) / 5;
|
|
68435
|
+
blue = remainder % 6 / 5;
|
|
68436
|
+
}
|
|
68437
|
+
const value = Math.max(red, green, blue) * 2;
|
|
68438
|
+
if (value === 0) {
|
|
68439
|
+
return 30;
|
|
68440
|
+
}
|
|
68441
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
68442
|
+
if (value === 2) {
|
|
68443
|
+
result += 60;
|
|
68444
|
+
}
|
|
68445
|
+
return result;
|
|
68446
|
+
},
|
|
68447
|
+
enumerable: false
|
|
68448
|
+
},
|
|
68449
|
+
rgbToAnsi: {
|
|
68450
|
+
value: (red, green, blue) => styles8.ansi256ToAnsi(styles8.rgbToAnsi256(red, green, blue)),
|
|
68451
|
+
enumerable: false
|
|
68452
|
+
},
|
|
68453
|
+
hexToAnsi: {
|
|
68454
|
+
value: (hex) => styles8.ansi256ToAnsi(styles8.hexToAnsi256(hex)),
|
|
68455
|
+
enumerable: false
|
|
68456
|
+
}
|
|
68457
|
+
});
|
|
68458
|
+
return styles8;
|
|
68459
|
+
}
|
|
68460
|
+
var ansiStyles6 = assembleStyles6();
|
|
68461
|
+
var ansi_styles_default6 = ansiStyles6;
|
|
68462
|
+
|
|
68463
|
+
// node_modules/ink-text-input/node_modules/chalk/source/vendor/supports-color/index.js
|
|
68464
|
+
import process13 from "node:process";
|
|
68465
|
+
import os3 from "node:os";
|
|
68466
|
+
import tty2 from "node:tty";
|
|
68467
|
+
function hasFlag2(flag, argv = globalThis.Deno ? globalThis.Deno.args : process13.argv) {
|
|
68468
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
68469
|
+
const position = argv.indexOf(prefix + flag);
|
|
68470
|
+
const terminatorPosition = argv.indexOf("--");
|
|
68471
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
68472
|
+
}
|
|
68473
|
+
var { env: env3 } = process13;
|
|
68474
|
+
var flagForceColor2;
|
|
68475
|
+
if (hasFlag2("no-color") || hasFlag2("no-colors") || hasFlag2("color=false") || hasFlag2("color=never")) {
|
|
68476
|
+
flagForceColor2 = 0;
|
|
68477
|
+
} else if (hasFlag2("color") || hasFlag2("colors") || hasFlag2("color=true") || hasFlag2("color=always")) {
|
|
68478
|
+
flagForceColor2 = 1;
|
|
68479
|
+
}
|
|
68480
|
+
function envForceColor2() {
|
|
68481
|
+
if ("FORCE_COLOR" in env3) {
|
|
68482
|
+
if (env3.FORCE_COLOR === "true") {
|
|
68483
|
+
return 1;
|
|
68484
|
+
}
|
|
68485
|
+
if (env3.FORCE_COLOR === "false") {
|
|
68486
|
+
return 0;
|
|
68487
|
+
}
|
|
68488
|
+
return env3.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env3.FORCE_COLOR, 10), 3);
|
|
68489
|
+
}
|
|
68490
|
+
}
|
|
68491
|
+
function translateLevel2(level) {
|
|
68492
|
+
if (level === 0) {
|
|
68493
|
+
return false;
|
|
68494
|
+
}
|
|
68495
|
+
return {
|
|
68496
|
+
level,
|
|
68497
|
+
hasBasic: true,
|
|
68498
|
+
has256: level >= 2,
|
|
68499
|
+
has16m: level >= 3
|
|
68500
|
+
};
|
|
68501
|
+
}
|
|
68502
|
+
function _supportsColor2(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
68503
|
+
const noFlagForceColor = envForceColor2();
|
|
68504
|
+
if (noFlagForceColor !== undefined) {
|
|
68505
|
+
flagForceColor2 = noFlagForceColor;
|
|
68506
|
+
}
|
|
68507
|
+
const forceColor = sniffFlags ? flagForceColor2 : noFlagForceColor;
|
|
68508
|
+
if (forceColor === 0) {
|
|
68509
|
+
return 0;
|
|
68510
|
+
}
|
|
68511
|
+
if (sniffFlags) {
|
|
68512
|
+
if (hasFlag2("color=16m") || hasFlag2("color=full") || hasFlag2("color=truecolor")) {
|
|
68513
|
+
return 3;
|
|
68514
|
+
}
|
|
68515
|
+
if (hasFlag2("color=256")) {
|
|
68516
|
+
return 2;
|
|
68517
|
+
}
|
|
68518
|
+
}
|
|
68519
|
+
if ("TF_BUILD" in env3 && "AGENT_NAME" in env3) {
|
|
68520
|
+
return 1;
|
|
68521
|
+
}
|
|
68522
|
+
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
68523
|
+
return 0;
|
|
68524
|
+
}
|
|
68525
|
+
const min = forceColor || 0;
|
|
68526
|
+
if (env3.TERM === "dumb") {
|
|
68527
|
+
return min;
|
|
68528
|
+
}
|
|
68529
|
+
if (process13.platform === "win32") {
|
|
68530
|
+
const osRelease = os3.release().split(".");
|
|
68531
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
68532
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
68533
|
+
}
|
|
68534
|
+
return 1;
|
|
68535
|
+
}
|
|
68536
|
+
if ("CI" in env3) {
|
|
68537
|
+
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => (key in env3))) {
|
|
68538
|
+
return 3;
|
|
68539
|
+
}
|
|
68540
|
+
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env3)) || env3.CI_NAME === "codeship") {
|
|
68541
|
+
return 1;
|
|
68542
|
+
}
|
|
68543
|
+
return min;
|
|
68544
|
+
}
|
|
68545
|
+
if ("TEAMCITY_VERSION" in env3) {
|
|
68546
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env3.TEAMCITY_VERSION) ? 1 : 0;
|
|
68547
|
+
}
|
|
68548
|
+
if (env3.COLORTERM === "truecolor") {
|
|
68549
|
+
return 3;
|
|
68550
|
+
}
|
|
68551
|
+
if (env3.TERM === "xterm-kitty") {
|
|
68552
|
+
return 3;
|
|
68553
|
+
}
|
|
68554
|
+
if ("TERM_PROGRAM" in env3) {
|
|
68555
|
+
const version = Number.parseInt((env3.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
68556
|
+
switch (env3.TERM_PROGRAM) {
|
|
68557
|
+
case "iTerm.app": {
|
|
68558
|
+
return version >= 3 ? 3 : 2;
|
|
68559
|
+
}
|
|
68560
|
+
case "Apple_Terminal": {
|
|
68561
|
+
return 2;
|
|
68562
|
+
}
|
|
68563
|
+
}
|
|
68564
|
+
}
|
|
68565
|
+
if (/-256(color)?$/i.test(env3.TERM)) {
|
|
68566
|
+
return 2;
|
|
68567
|
+
}
|
|
68568
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env3.TERM)) {
|
|
68569
|
+
return 1;
|
|
68570
|
+
}
|
|
68571
|
+
if ("COLORTERM" in env3) {
|
|
68572
|
+
return 1;
|
|
68573
|
+
}
|
|
68574
|
+
return min;
|
|
68575
|
+
}
|
|
68576
|
+
function createSupportsColor2(stream, options = {}) {
|
|
68577
|
+
const level = _supportsColor2(stream, {
|
|
68578
|
+
streamIsTTY: stream && stream.isTTY,
|
|
68579
|
+
...options
|
|
68580
|
+
});
|
|
68581
|
+
return translateLevel2(level);
|
|
68582
|
+
}
|
|
68583
|
+
var supportsColor2 = {
|
|
68584
|
+
stdout: createSupportsColor2({ isTTY: tty2.isatty(1) }),
|
|
68585
|
+
stderr: createSupportsColor2({ isTTY: tty2.isatty(2) })
|
|
68586
|
+
};
|
|
68587
|
+
var supports_color_default2 = supportsColor2;
|
|
68588
|
+
|
|
68589
|
+
// node_modules/ink-text-input/node_modules/chalk/source/utilities.js
|
|
68590
|
+
function stringReplaceAll2(string, substring, replacer) {
|
|
68591
|
+
let index = string.indexOf(substring);
|
|
68592
|
+
if (index === -1) {
|
|
68593
|
+
return string;
|
|
68594
|
+
}
|
|
68595
|
+
const substringLength = substring.length;
|
|
68596
|
+
let endIndex = 0;
|
|
68597
|
+
let returnValue = "";
|
|
68598
|
+
do {
|
|
68599
|
+
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
68600
|
+
endIndex = index + substringLength;
|
|
68601
|
+
index = string.indexOf(substring, endIndex);
|
|
68602
|
+
} while (index !== -1);
|
|
68603
|
+
returnValue += string.slice(endIndex);
|
|
68604
|
+
return returnValue;
|
|
68605
|
+
}
|
|
68606
|
+
function stringEncaseCRLFWithFirstIndex2(string, prefix, postfix, index) {
|
|
68607
|
+
let endIndex = 0;
|
|
68608
|
+
let returnValue = "";
|
|
68609
|
+
do {
|
|
68610
|
+
const gotCR = string[index - 1] === "\r";
|
|
68611
|
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
|
|
68612
|
+
` : `
|
|
68613
|
+
`) + postfix;
|
|
68614
|
+
endIndex = index + 1;
|
|
68615
|
+
index = string.indexOf(`
|
|
68616
|
+
`, endIndex);
|
|
68617
|
+
} while (index !== -1);
|
|
68618
|
+
returnValue += string.slice(endIndex);
|
|
68619
|
+
return returnValue;
|
|
68620
|
+
}
|
|
68621
|
+
|
|
68622
|
+
// node_modules/ink-text-input/node_modules/chalk/source/index.js
|
|
68623
|
+
var { stdout: stdoutColor2, stderr: stderrColor2 } = supports_color_default2;
|
|
68624
|
+
var GENERATOR2 = Symbol("GENERATOR");
|
|
68625
|
+
var STYLER2 = Symbol("STYLER");
|
|
68626
|
+
var IS_EMPTY2 = Symbol("IS_EMPTY");
|
|
68627
|
+
var levelMapping2 = [
|
|
68628
|
+
"ansi",
|
|
68629
|
+
"ansi",
|
|
68630
|
+
"ansi256",
|
|
68631
|
+
"ansi16m"
|
|
68632
|
+
];
|
|
68633
|
+
var styles9 = Object.create(null);
|
|
68634
|
+
var applyOptions2 = (object, options = {}) => {
|
|
68635
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
68636
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
68637
|
+
}
|
|
68638
|
+
const colorLevel = stdoutColor2 ? stdoutColor2.level : 0;
|
|
68639
|
+
object.level = options.level === undefined ? colorLevel : options.level;
|
|
68640
|
+
};
|
|
68641
|
+
var chalkFactory2 = (options) => {
|
|
68642
|
+
const chalk3 = (...strings) => strings.join(" ");
|
|
68643
|
+
applyOptions2(chalk3, options);
|
|
68644
|
+
Object.setPrototypeOf(chalk3, createChalk2.prototype);
|
|
68645
|
+
return chalk3;
|
|
68646
|
+
};
|
|
68647
|
+
function createChalk2(options) {
|
|
68648
|
+
return chalkFactory2(options);
|
|
68649
|
+
}
|
|
68650
|
+
Object.setPrototypeOf(createChalk2.prototype, Function.prototype);
|
|
68651
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default6)) {
|
|
68652
|
+
styles9[styleName] = {
|
|
68653
|
+
get() {
|
|
68654
|
+
const builder = createBuilder2(this, createStyler2(style.open, style.close, this[STYLER2]), this[IS_EMPTY2]);
|
|
68655
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
68656
|
+
return builder;
|
|
68657
|
+
}
|
|
68658
|
+
};
|
|
68659
|
+
}
|
|
68660
|
+
styles9.visible = {
|
|
68661
|
+
get() {
|
|
68662
|
+
const builder = createBuilder2(this, this[STYLER2], true);
|
|
68663
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
68664
|
+
return builder;
|
|
68665
|
+
}
|
|
68666
|
+
};
|
|
68667
|
+
var getModelAnsi2 = (model, level, type, ...arguments_) => {
|
|
68668
|
+
if (model === "rgb") {
|
|
68669
|
+
if (level === "ansi16m") {
|
|
68670
|
+
return ansi_styles_default6[type].ansi16m(...arguments_);
|
|
68671
|
+
}
|
|
68672
|
+
if (level === "ansi256") {
|
|
68673
|
+
return ansi_styles_default6[type].ansi256(ansi_styles_default6.rgbToAnsi256(...arguments_));
|
|
68674
|
+
}
|
|
68675
|
+
return ansi_styles_default6[type].ansi(ansi_styles_default6.rgbToAnsi(...arguments_));
|
|
68676
|
+
}
|
|
68677
|
+
if (model === "hex") {
|
|
68678
|
+
return getModelAnsi2("rgb", level, type, ...ansi_styles_default6.hexToRgb(...arguments_));
|
|
68679
|
+
}
|
|
68680
|
+
return ansi_styles_default6[type][model](...arguments_);
|
|
68681
|
+
};
|
|
68682
|
+
var usedModels2 = ["rgb", "hex", "ansi256"];
|
|
68683
|
+
for (const model of usedModels2) {
|
|
68684
|
+
styles9[model] = {
|
|
68685
|
+
get() {
|
|
68686
|
+
const { level } = this;
|
|
68687
|
+
return function(...arguments_) {
|
|
68688
|
+
const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "color", ...arguments_), ansi_styles_default6.color.close, this[STYLER2]);
|
|
68689
|
+
return createBuilder2(this, styler, this[IS_EMPTY2]);
|
|
68690
|
+
};
|
|
68691
|
+
}
|
|
68692
|
+
};
|
|
68693
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
68694
|
+
styles9[bgModel] = {
|
|
68695
|
+
get() {
|
|
68696
|
+
const { level } = this;
|
|
68697
|
+
return function(...arguments_) {
|
|
68698
|
+
const styler = createStyler2(getModelAnsi2(model, levelMapping2[level], "bgColor", ...arguments_), ansi_styles_default6.bgColor.close, this[STYLER2]);
|
|
68699
|
+
return createBuilder2(this, styler, this[IS_EMPTY2]);
|
|
68700
|
+
};
|
|
68701
|
+
}
|
|
68702
|
+
};
|
|
68703
|
+
}
|
|
68704
|
+
var proto2 = Object.defineProperties(() => {}, {
|
|
68705
|
+
...styles9,
|
|
68706
|
+
level: {
|
|
68707
|
+
enumerable: true,
|
|
68708
|
+
get() {
|
|
68709
|
+
return this[GENERATOR2].level;
|
|
68710
|
+
},
|
|
68711
|
+
set(level) {
|
|
68712
|
+
this[GENERATOR2].level = level;
|
|
68713
|
+
}
|
|
68714
|
+
}
|
|
68715
|
+
});
|
|
68716
|
+
var createStyler2 = (open, close, parent) => {
|
|
68717
|
+
let openAll;
|
|
68718
|
+
let closeAll;
|
|
68719
|
+
if (parent === undefined) {
|
|
68720
|
+
openAll = open;
|
|
68721
|
+
closeAll = close;
|
|
68722
|
+
} else {
|
|
68723
|
+
openAll = parent.openAll + open;
|
|
68724
|
+
closeAll = close + parent.closeAll;
|
|
68725
|
+
}
|
|
68726
|
+
return {
|
|
68727
|
+
open,
|
|
68728
|
+
close,
|
|
68729
|
+
openAll,
|
|
68730
|
+
closeAll,
|
|
68731
|
+
parent
|
|
68732
|
+
};
|
|
68733
|
+
};
|
|
68734
|
+
var createBuilder2 = (self2, _styler, _isEmpty) => {
|
|
68735
|
+
const builder = (...arguments_) => applyStyle2(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
68736
|
+
Object.setPrototypeOf(builder, proto2);
|
|
68737
|
+
builder[GENERATOR2] = self2;
|
|
68738
|
+
builder[STYLER2] = _styler;
|
|
68739
|
+
builder[IS_EMPTY2] = _isEmpty;
|
|
68740
|
+
return builder;
|
|
68741
|
+
};
|
|
68742
|
+
var applyStyle2 = (self2, string) => {
|
|
68743
|
+
if (self2.level <= 0 || !string) {
|
|
68744
|
+
return self2[IS_EMPTY2] ? "" : string;
|
|
68745
|
+
}
|
|
68746
|
+
let styler = self2[STYLER2];
|
|
68747
|
+
if (styler === undefined) {
|
|
68748
|
+
return string;
|
|
68749
|
+
}
|
|
68750
|
+
const { openAll, closeAll } = styler;
|
|
68751
|
+
if (string.includes("\x1B")) {
|
|
68752
|
+
while (styler !== undefined) {
|
|
68753
|
+
string = stringReplaceAll2(string, styler.close, styler.open);
|
|
68754
|
+
styler = styler.parent;
|
|
68755
|
+
}
|
|
68756
|
+
}
|
|
68757
|
+
const lfIndex = string.indexOf(`
|
|
68758
|
+
`);
|
|
68759
|
+
if (lfIndex !== -1) {
|
|
68760
|
+
string = stringEncaseCRLFWithFirstIndex2(string, closeAll, openAll, lfIndex);
|
|
68761
|
+
}
|
|
68762
|
+
return openAll + string + closeAll;
|
|
68763
|
+
};
|
|
68764
|
+
Object.defineProperties(createChalk2.prototype, styles9);
|
|
68765
|
+
var chalk3 = createChalk2();
|
|
68766
|
+
var chalkStderr2 = createChalk2({ level: stderrColor2 ? stderrColor2.level : 0 });
|
|
68767
|
+
var source_default2 = chalk3;
|
|
68768
|
+
|
|
68769
|
+
// node_modules/ink-text-input/build/index.js
|
|
68770
|
+
function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
|
|
68771
|
+
const [state, setState] = import_react26.useState({
|
|
68772
|
+
cursorOffset: (originalValue || "").length,
|
|
68773
|
+
cursorWidth: 0
|
|
68774
|
+
});
|
|
68775
|
+
const { cursorOffset, cursorWidth } = state;
|
|
68776
|
+
import_react26.useEffect(() => {
|
|
68777
|
+
setState((previousState) => {
|
|
68778
|
+
if (!focus || !showCursor) {
|
|
68779
|
+
return previousState;
|
|
68780
|
+
}
|
|
68781
|
+
const newValue = originalValue || "";
|
|
68782
|
+
if (previousState.cursorOffset > newValue.length - 1) {
|
|
68783
|
+
return {
|
|
68784
|
+
cursorOffset: newValue.length,
|
|
68785
|
+
cursorWidth: 0
|
|
68786
|
+
};
|
|
68787
|
+
}
|
|
68788
|
+
return previousState;
|
|
68789
|
+
});
|
|
68790
|
+
}, [originalValue, focus, showCursor]);
|
|
68791
|
+
const cursorActualWidth = highlightPastedText ? cursorWidth : 0;
|
|
68792
|
+
const value = mask ? mask.repeat(originalValue.length) : originalValue;
|
|
68793
|
+
let renderedValue = value;
|
|
68794
|
+
let renderedPlaceholder = placeholder ? source_default2.grey(placeholder) : undefined;
|
|
68795
|
+
if (showCursor && focus) {
|
|
68796
|
+
renderedPlaceholder = placeholder.length > 0 ? source_default2.inverse(placeholder[0]) + source_default2.grey(placeholder.slice(1)) : source_default2.inverse(" ");
|
|
68797
|
+
renderedValue = value.length > 0 ? "" : source_default2.inverse(" ");
|
|
68798
|
+
let i = 0;
|
|
68799
|
+
for (const char of value) {
|
|
68800
|
+
renderedValue += i >= cursorOffset - cursorActualWidth && i <= cursorOffset ? source_default2.inverse(char) : char;
|
|
68801
|
+
i++;
|
|
68802
|
+
}
|
|
68803
|
+
if (value.length > 0 && cursorOffset === value.length) {
|
|
68804
|
+
renderedValue += source_default2.inverse(" ");
|
|
68805
|
+
}
|
|
68806
|
+
}
|
|
68807
|
+
use_input_default((input, key) => {
|
|
68808
|
+
if (key.upArrow || key.downArrow || key.ctrl && input === "c" || key.tab || key.shift && key.tab) {
|
|
68809
|
+
return;
|
|
68810
|
+
}
|
|
68811
|
+
if (key.return) {
|
|
68812
|
+
if (onSubmit) {
|
|
68813
|
+
onSubmit(originalValue);
|
|
68814
|
+
}
|
|
68815
|
+
return;
|
|
68816
|
+
}
|
|
68817
|
+
let nextCursorOffset = cursorOffset;
|
|
68818
|
+
let nextValue = originalValue;
|
|
68819
|
+
let nextCursorWidth = 0;
|
|
68820
|
+
if (key.leftArrow) {
|
|
68821
|
+
if (showCursor) {
|
|
68822
|
+
nextCursorOffset--;
|
|
68823
|
+
}
|
|
68824
|
+
} else if (key.rightArrow) {
|
|
68825
|
+
if (showCursor) {
|
|
68826
|
+
nextCursorOffset++;
|
|
68827
|
+
}
|
|
68828
|
+
} else if (key.backspace || key.delete) {
|
|
68829
|
+
if (cursorOffset > 0) {
|
|
68830
|
+
nextValue = originalValue.slice(0, cursorOffset - 1) + originalValue.slice(cursorOffset, originalValue.length);
|
|
68831
|
+
nextCursorOffset--;
|
|
68832
|
+
}
|
|
68833
|
+
} else {
|
|
68834
|
+
nextValue = originalValue.slice(0, cursorOffset) + input + originalValue.slice(cursorOffset, originalValue.length);
|
|
68835
|
+
nextCursorOffset += input.length;
|
|
68836
|
+
if (input.length > 1) {
|
|
68837
|
+
nextCursorWidth = input.length;
|
|
68838
|
+
}
|
|
68839
|
+
}
|
|
68840
|
+
if (cursorOffset < 0) {
|
|
68841
|
+
nextCursorOffset = 0;
|
|
68842
|
+
}
|
|
68843
|
+
if (cursorOffset > originalValue.length) {
|
|
68844
|
+
nextCursorOffset = originalValue.length;
|
|
68845
|
+
}
|
|
68846
|
+
setState({
|
|
68847
|
+
cursorOffset: nextCursorOffset,
|
|
68848
|
+
cursorWidth: nextCursorWidth
|
|
68849
|
+
});
|
|
68850
|
+
if (nextValue !== originalValue) {
|
|
68851
|
+
onChange(nextValue);
|
|
68852
|
+
}
|
|
68853
|
+
}, { isActive: focus });
|
|
68854
|
+
return import_react26.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
|
|
68855
|
+
}
|
|
68856
|
+
var build_default = TextInput;
|
|
68857
|
+
|
|
68858
|
+
// src/ui/app/components/historylist.tsx
|
|
68859
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
68860
|
+
|
|
68286
68861
|
// src/utils/colors.ts
|
|
68287
68862
|
var getStatusColor = (status, theme) => {
|
|
68288
68863
|
if (status.startsWith("2"))
|
|
@@ -68294,6 +68869,30 @@ var getStatusColor = (status, theme) => {
|
|
|
68294
68869
|
return theme.colors.accent;
|
|
68295
68870
|
};
|
|
68296
68871
|
|
|
68872
|
+
// src/utils/fuzzy.ts
|
|
68873
|
+
function fuzzyMatch(pattern, str) {
|
|
68874
|
+
if (!pattern)
|
|
68875
|
+
return { matched: true, score: 0, indices: [] };
|
|
68876
|
+
pattern = pattern.toLowerCase();
|
|
68877
|
+
str = str.toLowerCase();
|
|
68878
|
+
let patternIdx = 0;
|
|
68879
|
+
let score = 0;
|
|
68880
|
+
const indices = [];
|
|
68881
|
+
for (let i = 0;i < str.length && patternIdx < pattern.length; i++) {
|
|
68882
|
+
if (str[i] === pattern[patternIdx]) {
|
|
68883
|
+
score += 1;
|
|
68884
|
+
indices.push(i);
|
|
68885
|
+
patternIdx++;
|
|
68886
|
+
}
|
|
68887
|
+
}
|
|
68888
|
+
return { matched: patternIdx === pattern.length, score, indices };
|
|
68889
|
+
}
|
|
68890
|
+
function fuzzyFilter(items, pattern, getText) {
|
|
68891
|
+
if (!pattern)
|
|
68892
|
+
return items;
|
|
68893
|
+
return items.map((item) => ({ item, ...fuzzyMatch(pattern, getText(item)) })).filter((r) => r.matched).sort((a, b) => b.score - a.score).map((r) => r.item);
|
|
68894
|
+
}
|
|
68895
|
+
|
|
68297
68896
|
// src/ui/app/components/historylist.tsx
|
|
68298
68897
|
var jsx_dev_runtime5 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68299
68898
|
var HistoryListItem = ({ item, isSelected, theme }) => {
|
|
@@ -68360,19 +68959,33 @@ var HistoryList = ({ history, onItemClick, theme }) => {
|
|
|
68360
68959
|
const { stdout } = use_stdout_default();
|
|
68361
68960
|
const { isFocused } = use_focus_default();
|
|
68362
68961
|
const { focusNext } = use_focus_manager_default();
|
|
68363
|
-
const [selectedIndex, setSelectedIndex] =
|
|
68364
|
-
const [scrollPosition, setScrollPosition] =
|
|
68365
|
-
const
|
|
68366
|
-
const
|
|
68367
|
-
|
|
68962
|
+
const [selectedIndex, setSelectedIndex] = import_react27.useState(0);
|
|
68963
|
+
const [scrollPosition, setScrollPosition] = import_react27.useState(0);
|
|
68964
|
+
const [searchQuery, setSearchQuery] = import_react27.useState("");
|
|
68965
|
+
const [isSearching, setIsSearching] = import_react27.useState(false);
|
|
68966
|
+
const listRef = import_react27.useRef(null);
|
|
68967
|
+
const filteredHistory = fuzzyFilter(history, searchQuery, (item) => `${item.method} ${item.url}`);
|
|
68968
|
+
const maxHeight = stdout.rows - 10;
|
|
68969
|
+
use_input_default((input, key) => {
|
|
68970
|
+
if (input === "/" && !isSearching) {
|
|
68971
|
+
setIsSearching(true);
|
|
68972
|
+
return;
|
|
68973
|
+
}
|
|
68974
|
+
if (key.escape && isSearching) {
|
|
68975
|
+
setIsSearching(false);
|
|
68976
|
+
setSearchQuery("");
|
|
68977
|
+
return;
|
|
68978
|
+
}
|
|
68979
|
+
if (isSearching)
|
|
68980
|
+
return;
|
|
68368
68981
|
if (key.upArrow) {
|
|
68369
68982
|
setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
68370
68983
|
}
|
|
68371
68984
|
if (key.downArrow) {
|
|
68372
|
-
setSelectedIndex((prev) => Math.min(
|
|
68985
|
+
setSelectedIndex((prev) => Math.min(filteredHistory.length - 1, prev + 1));
|
|
68373
68986
|
}
|
|
68374
|
-
if (key.return &&
|
|
68375
|
-
onItemClick(
|
|
68987
|
+
if (key.return && filteredHistory[selectedIndex]) {
|
|
68988
|
+
onItemClick(filteredHistory[selectedIndex]);
|
|
68376
68989
|
}
|
|
68377
68990
|
if (key.tab) {
|
|
68378
68991
|
focusNext();
|
|
@@ -68381,10 +68994,14 @@ var HistoryList = ({ history, onItemClick, theme }) => {
|
|
|
68381
68994
|
setScrollPosition((prev) => Math.max(0, prev - maxHeight));
|
|
68382
68995
|
}
|
|
68383
68996
|
if (key.pageDown) {
|
|
68384
|
-
setScrollPosition((prev) => Math.min(
|
|
68997
|
+
setScrollPosition((prev) => Math.min(filteredHistory.length - maxHeight, prev + maxHeight));
|
|
68385
68998
|
}
|
|
68386
68999
|
}, { isActive: isFocused });
|
|
68387
|
-
|
|
69000
|
+
import_react27.useEffect(() => {
|
|
69001
|
+
setSelectedIndex(0);
|
|
69002
|
+
setScrollPosition(0);
|
|
69003
|
+
}, [searchQuery]);
|
|
69004
|
+
import_react27.useEffect(() => {
|
|
68388
69005
|
if (selectedIndex < scrollPosition) {
|
|
68389
69006
|
setScrollPosition(selectedIndex);
|
|
68390
69007
|
} else if (selectedIndex >= scrollPosition + maxHeight) {
|
|
@@ -68394,22 +69011,55 @@ var HistoryList = ({ history, onItemClick, theme }) => {
|
|
|
68394
69011
|
return /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
68395
69012
|
flexDirection: "column",
|
|
68396
69013
|
flexGrow: 1,
|
|
68397
|
-
children:
|
|
68398
|
-
|
|
68399
|
-
|
|
68400
|
-
|
|
68401
|
-
|
|
68402
|
-
|
|
68403
|
-
|
|
68404
|
-
|
|
68405
|
-
|
|
68406
|
-
|
|
69014
|
+
children: [
|
|
69015
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
69016
|
+
paddingX: 1,
|
|
69017
|
+
marginBottom: 1,
|
|
69018
|
+
children: isSearching ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
69019
|
+
children: [
|
|
69020
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
|
|
69021
|
+
color: theme.colors.accent,
|
|
69022
|
+
children: "\uD83D\uDD0D "
|
|
69023
|
+
}, undefined, false, undefined, this),
|
|
69024
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(build_default, {
|
|
69025
|
+
value: searchQuery,
|
|
69026
|
+
onChange: setSearchQuery,
|
|
69027
|
+
placeholder: "Type to search...",
|
|
69028
|
+
focus: isSearching
|
|
69029
|
+
}, undefined, false, undefined, this)
|
|
69030
|
+
]
|
|
69031
|
+
}, undefined, true, undefined, this) : /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
|
|
69032
|
+
color: theme.colors.muted,
|
|
69033
|
+
dimColor: true,
|
|
69034
|
+
children: [
|
|
69035
|
+
"Press / to search",
|
|
69036
|
+
searchQuery && ` (filtered: "${searchQuery}")`
|
|
69037
|
+
]
|
|
69038
|
+
}, undefined, true, undefined, this)
|
|
69039
|
+
}, undefined, false, undefined, this),
|
|
69040
|
+
/* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
69041
|
+
flexDirection: "column",
|
|
69042
|
+
ref: listRef,
|
|
69043
|
+
children: filteredHistory.length === 0 ? /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Box_default, {
|
|
69044
|
+
paddingX: 1,
|
|
69045
|
+
children: /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(Text, {
|
|
69046
|
+
color: theme.colors.muted,
|
|
69047
|
+
children: "No matches found"
|
|
69048
|
+
}, undefined, false, undefined, this)
|
|
69049
|
+
}, undefined, false, undefined, this) : filteredHistory.slice(scrollPosition, scrollPosition + maxHeight).map((item, index) => /* @__PURE__ */ jsx_dev_runtime5.jsxDEV(HistoryListItem, {
|
|
69050
|
+
item,
|
|
69051
|
+
isSelected: isFocused && selectedIndex === scrollPosition + index,
|
|
69052
|
+
theme
|
|
69053
|
+
}, item.timestamp, false, undefined, this))
|
|
69054
|
+
}, undefined, false, undefined, this)
|
|
69055
|
+
]
|
|
69056
|
+
}, undefined, true, undefined, this);
|
|
68407
69057
|
};
|
|
68408
69058
|
|
|
68409
69059
|
// src/ui/app/components/footer.tsx
|
|
68410
|
-
var
|
|
69060
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
68411
69061
|
var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68412
|
-
var Footer =
|
|
69062
|
+
var Footer = import_react28.default.memo(({ theme }) => {
|
|
68413
69063
|
return /* @__PURE__ */ jsx_dev_runtime6.jsxDEV(Box_default, {
|
|
68414
69064
|
borderStyle: "round",
|
|
68415
69065
|
borderTopColor: theme.muted,
|
|
@@ -68430,7 +69080,7 @@ var Footer = import_react27.default.memo(({ theme }) => {
|
|
|
68430
69080
|
});
|
|
68431
69081
|
|
|
68432
69082
|
// src/ui/app/components/themeselector.tsx
|
|
68433
|
-
var
|
|
69083
|
+
var import_react29 = __toESM(require_react(), 1);
|
|
68434
69084
|
var jsx_dev_runtime7 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68435
69085
|
var getIndex = (theme) => {
|
|
68436
69086
|
let index = 0;
|
|
@@ -68471,9 +69121,9 @@ var getIndex = (theme) => {
|
|
|
68471
69121
|
return index;
|
|
68472
69122
|
};
|
|
68473
69123
|
var ThemeSelector = ({ onThemeChange, theme }) => {
|
|
68474
|
-
const [selectedIndex, setSelectedIndex] =
|
|
69124
|
+
const [selectedIndex, setSelectedIndex] = import_react29.useState(getIndex(theme.name));
|
|
68475
69125
|
const themeNames = Object.keys(themes);
|
|
68476
|
-
|
|
69126
|
+
import_react29.useEffect(() => {
|
|
68477
69127
|
const currentThemeIndex = themeNames.findIndex((name) => {
|
|
68478
69128
|
const themeColors = themes[name].colors;
|
|
68479
69129
|
return Object.entries(themeColors).every(([key, value]) => theme[key] === value);
|
|
@@ -68529,20 +69179,20 @@ var ThemeSelector = ({ onThemeChange, theme }) => {
|
|
|
68529
69179
|
};
|
|
68530
69180
|
|
|
68531
69181
|
// src/ui/app/components/scrollablebox.tsx
|
|
68532
|
-
var
|
|
69182
|
+
var import_react30 = __toESM(require_react(), 1);
|
|
68533
69183
|
var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68534
69184
|
var ScrollableBox = ({ children }) => {
|
|
68535
69185
|
const { stdout } = use_stdout_default();
|
|
68536
|
-
const [scrollPosition, setScrollPosition] =
|
|
69186
|
+
const [scrollPosition, setScrollPosition] = import_react30.useState(0);
|
|
68537
69187
|
const maxHeight = stdout.rows - 10;
|
|
68538
|
-
const [contentHeight, setContentHeight] =
|
|
69188
|
+
const [contentHeight, setContentHeight] = import_react30.useState(0);
|
|
68539
69189
|
use_input_default((_, key) => {
|
|
68540
69190
|
if (key.pageUp)
|
|
68541
69191
|
setScrollPosition((prev) => Math.max(0, prev - maxHeight));
|
|
68542
69192
|
if (key.pageDown)
|
|
68543
69193
|
setScrollPosition((prev) => Math.min(contentHeight - maxHeight, prev + maxHeight));
|
|
68544
69194
|
});
|
|
68545
|
-
|
|
69195
|
+
import_react30.useEffect(() => {
|
|
68546
69196
|
const estimateHeight = (node) => {
|
|
68547
69197
|
if (!node)
|
|
68548
69198
|
return 0;
|
|
@@ -68551,7 +69201,7 @@ var ScrollableBox = ({ children }) => {
|
|
|
68551
69201
|
`).length;
|
|
68552
69202
|
if (Array.isArray(node))
|
|
68553
69203
|
return node.reduce((acc, child) => acc + estimateHeight(child), 0);
|
|
68554
|
-
if (
|
|
69204
|
+
if (import_react30.default.isValidElement(node))
|
|
68555
69205
|
return estimateHeight(node.props.children);
|
|
68556
69206
|
return 1;
|
|
68557
69207
|
};
|
|
@@ -68568,7 +69218,7 @@ var ScrollableBox = ({ children }) => {
|
|
|
68568
69218
|
children: /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
68569
69219
|
marginTop: -scrollPosition,
|
|
68570
69220
|
flexDirection: "column",
|
|
68571
|
-
children:
|
|
69221
|
+
children: import_react30.default.Children.map(children, (child) => import_react30.default.isValidElement(child) ? import_react30.default.cloneElement(child) : child)
|
|
68572
69222
|
}, undefined, false, undefined, this)
|
|
68573
69223
|
}, undefined, false, undefined, this),
|
|
68574
69224
|
contentHeight > maxHeight && /* @__PURE__ */ jsx_dev_runtime8.jsxDEV(Box_default, {
|
|
@@ -68583,9 +69233,9 @@ var ScrollableBox = ({ children }) => {
|
|
|
68583
69233
|
};
|
|
68584
69234
|
|
|
68585
69235
|
// src/ui/app/components/syntaxhighlighter.tsx
|
|
68586
|
-
var
|
|
69236
|
+
var import_react31 = __toESM(require_react(), 1);
|
|
68587
69237
|
var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68588
|
-
var JsonSyntaxHighlight =
|
|
69238
|
+
var JsonSyntaxHighlight = import_react31.default.memo(({ jsonString, theme }) => {
|
|
68589
69239
|
try {
|
|
68590
69240
|
const json = JSON.parse(jsonString);
|
|
68591
69241
|
const prettyJson = JSON.stringify(json, null, 2);
|
|
@@ -68688,10 +69338,10 @@ var JsonSyntaxHighlight = import_react30.default.memo(({ jsonString, theme }) =>
|
|
|
68688
69338
|
});
|
|
68689
69339
|
|
|
68690
69340
|
// src/ui/app/components/responsepanel.tsx
|
|
68691
|
-
var
|
|
69341
|
+
var import_react32 = __toESM(require_react(), 1);
|
|
68692
69342
|
var jsx_dev_runtime10 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68693
|
-
var ResponsePanel =
|
|
68694
|
-
const [activeTab, setActiveTab] =
|
|
69343
|
+
var ResponsePanel = import_react32.default.memo(({ response, theme }) => {
|
|
69344
|
+
const [activeTab, setActiveTab] = import_react32.useState("body");
|
|
68695
69345
|
const tabs = [{ name: "headers", label: "Headers" }, { name: "body", label: "Body" }];
|
|
68696
69346
|
return /* @__PURE__ */ jsx_dev_runtime10.jsxDEV(Box_default, {
|
|
68697
69347
|
flexDirection: "column",
|
|
@@ -68766,7 +69416,7 @@ var ResponsePanel = import_react31.default.memo(({ response, theme }) => {
|
|
|
68766
69416
|
});
|
|
68767
69417
|
|
|
68768
69418
|
// src/ui/app/components/exportdialog.tsx
|
|
68769
|
-
var
|
|
69419
|
+
var import_react33 = __toESM(require_react(), 1);
|
|
68770
69420
|
|
|
68771
69421
|
// src/utils/export.ts
|
|
68772
69422
|
import { writeFile, mkdir } from "fs";
|
|
@@ -68857,12 +69507,12 @@ var saveToFile = async (content, filePath) => {
|
|
|
68857
69507
|
var jsx_dev_runtime11 = __toESM(require_jsx_dev_runtime(), 1);
|
|
68858
69508
|
var EXPORT_DIR = `${process.env.HOME}/.postboy/exports`;
|
|
68859
69509
|
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] =
|
|
69510
|
+
const [format, setFormat] = import_react33.useState("curl");
|
|
69511
|
+
const [action, setAction] = import_react33.useState("copy");
|
|
69512
|
+
const [showSavePrompt, setShowSavePrompt] = import_react33.useState(false);
|
|
69513
|
+
const [filePath, setFilePath] = import_react33.useState("");
|
|
69514
|
+
const [message, setMessage] = import_react33.useState("");
|
|
69515
|
+
const [activeField, setActiveField] = import_react33.useState("format");
|
|
68866
69516
|
const getExportContent = () => {
|
|
68867
69517
|
return format === "curl" ? toCurl(request) : toFetch(request);
|
|
68868
69518
|
};
|
|
@@ -69094,12 +69744,12 @@ ${finalPath}` : "Failed to save file");
|
|
|
69094
69744
|
// src/utils/themeManager.ts
|
|
69095
69745
|
import { promises as fs3 } from "fs";
|
|
69096
69746
|
import path2 from "path";
|
|
69097
|
-
import
|
|
69747
|
+
import os4 from "os";
|
|
69098
69748
|
|
|
69099
69749
|
class ThemeManager {
|
|
69100
69750
|
themeFile;
|
|
69101
69751
|
constructor() {
|
|
69102
|
-
const homeDir =
|
|
69752
|
+
const homeDir = os4.homedir();
|
|
69103
69753
|
const configDir = path2.join(homeDir, ".postboy");
|
|
69104
69754
|
this.themeFile = path2.join(configDir, "theme.json");
|
|
69105
69755
|
}
|
|
@@ -69216,7 +69866,7 @@ var SendButton = ({ onPress, loading, theme }) => {
|
|
|
69216
69866
|
}, undefined, false, undefined, this);
|
|
69217
69867
|
};
|
|
69218
69868
|
var HTTP_METHODS = ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"];
|
|
69219
|
-
var RequestPanel =
|
|
69869
|
+
var RequestPanel = import_react34.default.memo(({ request, onMethodChange, onUrlChange, onHeadersChange, onBodyChange, onSend, loading, theme, historyUrls = [], onInputFocus }) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69220
69870
|
flexDirection: "column",
|
|
69221
69871
|
gap: 1,
|
|
69222
69872
|
flexGrow: 1,
|
|
@@ -69267,27 +69917,27 @@ var RequestPanel = import_react33.default.memo(({ request, onMethodChange, onUrl
|
|
|
69267
69917
|
]
|
|
69268
69918
|
}, undefined, true, undefined, this));
|
|
69269
69919
|
var UI = () => {
|
|
69270
|
-
const [theme, setTheme] =
|
|
69920
|
+
const [theme, setTheme] = import_react34.useState(themes.catppuccin);
|
|
69271
69921
|
const { exit } = use_app_default();
|
|
69272
|
-
const [activeTab, setActiveTab] =
|
|
69273
|
-
const [request, setRequest] =
|
|
69274
|
-
const [response, setResponse] =
|
|
69275
|
-
const [history, setHistory] =
|
|
69276
|
-
const [loading, setLoading] =
|
|
69277
|
-
const requestRef =
|
|
69922
|
+
const [activeTab, setActiveTab] = import_react34.useState("request");
|
|
69923
|
+
const [request, setRequest] = import_react34.useState({ method: "GET", url: "", headers: "", body: "" });
|
|
69924
|
+
const [response, setResponse] = import_react34.useState({ statustext: "", status: "", headers: "", body: "", error: "" });
|
|
69925
|
+
const [history, setHistory] = import_react34.useState([]);
|
|
69926
|
+
const [loading, setLoading] = import_react34.useState(false);
|
|
69927
|
+
const requestRef = import_react34.useRef(request);
|
|
69278
69928
|
requestRef.current = request;
|
|
69279
|
-
|
|
69929
|
+
import_react34.useEffect(() => {
|
|
69280
69930
|
const loadHistory = async () => setHistory((await historyManager.loadHistory()).entries);
|
|
69281
69931
|
loadHistory();
|
|
69282
69932
|
}, []);
|
|
69283
|
-
|
|
69933
|
+
import_react34.useEffect(() => {
|
|
69284
69934
|
const loadTheme = async () => {
|
|
69285
69935
|
const loadedTheme = await themeManager.loadCurrTheme();
|
|
69286
69936
|
setTheme(loadedTheme);
|
|
69287
69937
|
};
|
|
69288
69938
|
loadTheme();
|
|
69289
69939
|
}, []);
|
|
69290
|
-
const handleSend =
|
|
69940
|
+
const handleSend = import_react34.useCallback(async () => {
|
|
69291
69941
|
setLoading(true);
|
|
69292
69942
|
const startTime = Date.now();
|
|
69293
69943
|
const currentRequest = requestRef.current;
|
|
@@ -69328,7 +69978,7 @@ var UI = () => {
|
|
|
69328
69978
|
themeManager.ChangeTheme(theme2);
|
|
69329
69979
|
setTheme(theme2);
|
|
69330
69980
|
};
|
|
69331
|
-
const handleHistoryClick =
|
|
69981
|
+
const handleHistoryClick = import_react34.useCallback((item) => {
|
|
69332
69982
|
setRequest({
|
|
69333
69983
|
method: item.method,
|
|
69334
69984
|
url: item.url,
|
|
@@ -69339,9 +69989,9 @@ var UI = () => {
|
|
|
69339
69989
|
}, []);
|
|
69340
69990
|
const tabs = [{ name: "request", label: "Request" }, { name: "response", label: "Response" }];
|
|
69341
69991
|
const activeIndex = tabs.findIndex((t) => t.name === activeTab);
|
|
69342
|
-
const [showThemeSelector, setShowThemeSelector] =
|
|
69343
|
-
const [showExportDialog, setShowExportDialog] =
|
|
69344
|
-
const [inputFocused, setInputFocused] =
|
|
69992
|
+
const [showThemeSelector, setShowThemeSelector] = import_react34.useState(false);
|
|
69993
|
+
const [showExportDialog, setShowExportDialog] = import_react34.useState(false);
|
|
69994
|
+
const [inputFocused, setInputFocused] = import_react34.useState(false);
|
|
69345
69995
|
use_input_default((input, key) => {
|
|
69346
69996
|
if (input === "q" && !showExportDialog)
|
|
69347
69997
|
exit();
|
|
@@ -69360,10 +70010,10 @@ var UI = () => {
|
|
|
69360
70010
|
if ((input === "e" || input === "E") && !key.ctrl && !key.meta && !inputFocused && !showThemeSelector)
|
|
69361
70011
|
setShowExportDialog((prev) => !prev);
|
|
69362
70012
|
}, { isActive: !showExportDialog });
|
|
69363
|
-
const onMethodChange =
|
|
69364
|
-
const onUrlChange =
|
|
69365
|
-
const onHeadersChange =
|
|
69366
|
-
const onBodyChange =
|
|
70013
|
+
const onMethodChange = import_react34.useCallback((method) => setRequest((r) => ({ ...r, method })), []);
|
|
70014
|
+
const onUrlChange = import_react34.useCallback((url) => setRequest((r) => ({ ...r, url })), []);
|
|
70015
|
+
const onHeadersChange = import_react34.useCallback((headers) => setRequest((r) => ({ ...r, headers })), []);
|
|
70016
|
+
const onBodyChange = import_react34.useCallback((body) => setRequest((r) => ({ ...r, body })), []);
|
|
69367
70017
|
const historyUrls = Array.from(new Set(history.map((h) => h.url))).filter(Boolean);
|
|
69368
70018
|
return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
|
|
69369
70019
|
padding: 1,
|
|
@@ -69559,7 +70209,7 @@ function App2() {
|
|
|
69559
70209
|
}
|
|
69560
70210
|
|
|
69561
70211
|
// src/commands/ui.tsx
|
|
69562
|
-
var
|
|
70212
|
+
var import_chalk6 = __toESM(require_source(), 1);
|
|
69563
70213
|
var jsx_dev_runtime14 = __toESM(require_jsx_dev_runtime(), 1);
|
|
69564
70214
|
var UIWrapper = () => {
|
|
69565
70215
|
const { exit } = use_app_default();
|
|
@@ -69572,7 +70222,7 @@ var UIWrapper = () => {
|
|
|
69572
70222
|
flexDirection: "column",
|
|
69573
70223
|
children: [
|
|
69574
70224
|
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(Text, {
|
|
69575
|
-
children:
|
|
70225
|
+
children: import_chalk6.default.cyanBright(`PostBoy \uD83D\uDC8C`)
|
|
69576
70226
|
}, undefined, false, undefined, this),
|
|
69577
70227
|
/* @__PURE__ */ jsx_dev_runtime14.jsxDEV(App2, {}, undefined, false, undefined, this)
|
|
69578
70228
|
]
|
|
@@ -69584,7 +70234,7 @@ var uiCommand = () => {
|
|
|
69584
70234
|
|
|
69585
70235
|
// src/commands/test.ts
|
|
69586
70236
|
var import_inquirer = __toESM(require_inquirer(), 1);
|
|
69587
|
-
var
|
|
70237
|
+
var import_chalk7 = __toESM(require_source(), 1);
|
|
69588
70238
|
async function testCommand() {
|
|
69589
70239
|
logger.title(WELCOME_MESSAGE);
|
|
69590
70240
|
logger.info(SUBTITLE);
|
|
@@ -69592,13 +70242,13 @@ async function testCommand() {
|
|
|
69592
70242
|
{
|
|
69593
70243
|
type: "input",
|
|
69594
70244
|
name: "url",
|
|
69595
|
-
message:
|
|
70245
|
+
message: import_chalk7.default.green("Enter the API URL:"),
|
|
69596
70246
|
default: "leave this empty for selecting mock URL"
|
|
69597
70247
|
},
|
|
69598
70248
|
{
|
|
69599
70249
|
type: "list",
|
|
69600
70250
|
name: "MOCK_URL",
|
|
69601
|
-
message:
|
|
70251
|
+
message: import_chalk7.default.green("Select a mock URL:"),
|
|
69602
70252
|
choices: [
|
|
69603
70253
|
"https://jsonplaceholder.typicode.com/posts",
|
|
69604
70254
|
"https://jsonplaceholder.typicode.com/comments",
|
|
@@ -69609,19 +70259,19 @@ async function testCommand() {
|
|
|
69609
70259
|
{
|
|
69610
70260
|
type: "list",
|
|
69611
70261
|
name: "method",
|
|
69612
|
-
message:
|
|
70262
|
+
message: import_chalk7.default.green("Select HTTP method:"),
|
|
69613
70263
|
choices: ["GET", "POST", "PUT", "DELETE"]
|
|
69614
70264
|
},
|
|
69615
70265
|
{
|
|
69616
70266
|
type: "input",
|
|
69617
70267
|
name: "headers",
|
|
69618
|
-
message:
|
|
70268
|
+
message: import_chalk7.default.green("Enter headers (JSON format):"),
|
|
69619
70269
|
default: "{}"
|
|
69620
70270
|
},
|
|
69621
70271
|
{
|
|
69622
70272
|
type: "input",
|
|
69623
70273
|
name: "body",
|
|
69624
|
-
message:
|
|
70274
|
+
message: import_chalk7.default.green("Enter request body (JSON format):"),
|
|
69625
70275
|
default: "{}"
|
|
69626
70276
|
}
|
|
69627
70277
|
]);
|
|
@@ -69635,20 +70285,20 @@ Your request configuration:`);
|
|
|
69635
70285
|
Response received! ✨`);
|
|
69636
70286
|
logger.info(`Status: ${response.status}`);
|
|
69637
70287
|
logger.info(`Status Text: ${response.statusText}`);
|
|
69638
|
-
console.log(
|
|
70288
|
+
console.log(import_chalk7.default.green("Response Body :"));
|
|
69639
70289
|
+logger.info(await response.text());
|
|
69640
|
-
console.log(
|
|
70290
|
+
console.log(import_chalk7.default.green("Response Headers:"));
|
|
69641
70291
|
logger.info(JSON.stringify(response.headers, null, 2));
|
|
69642
70292
|
} catch (err) {
|
|
69643
70293
|
logger.error(`
|
|
69644
70294
|
Error occurred! ❌`);
|
|
69645
|
-
console.error(
|
|
70295
|
+
console.error(import_chalk7.default.magentaBright(err));
|
|
69646
70296
|
}
|
|
69647
70297
|
}
|
|
69648
70298
|
|
|
69649
70299
|
// src/commands/mock.ts
|
|
69650
70300
|
var import_inquirer2 = __toESM(require_inquirer(), 1);
|
|
69651
|
-
var
|
|
70301
|
+
var import_chalk8 = __toESM(require_source(), 1);
|
|
69652
70302
|
async function mockApis() {
|
|
69653
70303
|
logger.title(WELCOME_MESSAGE);
|
|
69654
70304
|
logger.info(SUBTITLE);
|
|
@@ -69687,7 +70337,7 @@ async function mockApis() {
|
|
|
69687
70337
|
{
|
|
69688
70338
|
type: "list",
|
|
69689
70339
|
name: "category",
|
|
69690
|
-
message:
|
|
70340
|
+
message: import_chalk8.default.green("Select categories :"),
|
|
69691
70341
|
choices: [
|
|
69692
70342
|
"posts",
|
|
69693
70343
|
"ecommerce/store",
|
|
@@ -69702,7 +70352,7 @@ async function mockApis() {
|
|
|
69702
70352
|
{
|
|
69703
70353
|
type: "list",
|
|
69704
70354
|
name: "method",
|
|
69705
|
-
message:
|
|
70355
|
+
message: import_chalk8.default.green("Select HTTP method:"),
|
|
69706
70356
|
choices: ["GET", "POST", "PUT", "DELETE"]
|
|
69707
70357
|
}
|
|
69708
70358
|
]);
|
|
@@ -69748,7 +70398,7 @@ async function mockApis() {
|
|
|
69748
70398
|
|
|
69749
70399
|
// src/index.ts
|
|
69750
70400
|
var program2 = new Command;
|
|
69751
|
-
program2.version("1.3.
|
|
70401
|
+
program2.version("1.3.7").description(import_chalk9.default.yellow("PostBoy CLI - Test your APIs with ease"));
|
|
69752
70402
|
program2.command("run").description("Run a test API request").action(testCommand);
|
|
69753
70403
|
program2.command("mock-list").description("List the mock API servers").action(mockApis);
|
|
69754
70404
|
program2.command("ui").description("UI for PostBoy").action(uiCommand);
|