clisbot 0.1.54-beta.1 → 0.1.54-beta.2
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/main.js +248 -117
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -13037,10 +13037,10 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
13037
13037
|
if (++this._redirectCount > this._options.maxRedirects) {
|
|
13038
13038
|
throw new TooManyRedirectsError;
|
|
13039
13039
|
}
|
|
13040
|
-
var
|
|
13040
|
+
var requestHeaders2;
|
|
13041
13041
|
var beforeRedirect = this._options.beforeRedirect;
|
|
13042
13042
|
if (beforeRedirect) {
|
|
13043
|
-
|
|
13043
|
+
requestHeaders2 = Object.assign({
|
|
13044
13044
|
Host: response.req.getHeader("host")
|
|
13045
13045
|
}, this._options.headers);
|
|
13046
13046
|
}
|
|
@@ -13069,7 +13069,7 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
13069
13069
|
var requestDetails = {
|
|
13070
13070
|
url: currentUrl,
|
|
13071
13071
|
method,
|
|
13072
|
-
headers:
|
|
13072
|
+
headers: requestHeaders2
|
|
13073
13073
|
};
|
|
13074
13074
|
beforeRedirect(this._options, responseDetails, requestDetails);
|
|
13075
13075
|
this._sanitizeOptions(this._options);
|
|
@@ -15747,7 +15747,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
15747
15747
|
return new Promise(function dispatchXhrRequest(resolve, reject) {
|
|
15748
15748
|
const _config = resolveConfig(config);
|
|
15749
15749
|
let requestData = _config.data;
|
|
15750
|
-
const
|
|
15750
|
+
const requestHeaders2 = AxiosHeaders.from(_config.headers).normalize();
|
|
15751
15751
|
let {
|
|
15752
15752
|
responseType,
|
|
15753
15753
|
onUploadProgress,
|
|
@@ -15824,9 +15824,9 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
15824
15824
|
reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request));
|
|
15825
15825
|
request = null;
|
|
15826
15826
|
};
|
|
15827
|
-
requestData === undefined &&
|
|
15827
|
+
requestData === undefined && requestHeaders2.setContentType(null);
|
|
15828
15828
|
if ("setRequestHeader" in request) {
|
|
15829
|
-
utils$1.forEach(
|
|
15829
|
+
utils$1.forEach(requestHeaders2.toJSON(), function setRequestHeader(val, key) {
|
|
15830
15830
|
request.setRequestHeader(key, val);
|
|
15831
15831
|
});
|
|
15832
15832
|
}
|
|
@@ -15990,10 +15990,10 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
15990
15990
|
isFunction
|
|
15991
15991
|
} = utils$1;
|
|
15992
15992
|
var globalFetchAPI = (({
|
|
15993
|
-
Request,
|
|
15993
|
+
Request: Request2,
|
|
15994
15994
|
Response: Response2
|
|
15995
15995
|
}) => ({
|
|
15996
|
-
Request,
|
|
15996
|
+
Request: Request2,
|
|
15997
15997
|
Response: Response2
|
|
15998
15998
|
}))(utils$1.global);
|
|
15999
15999
|
var {
|
|
@@ -16013,21 +16013,21 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
16013
16013
|
}, globalFetchAPI, env);
|
|
16014
16014
|
const {
|
|
16015
16015
|
fetch: envFetch,
|
|
16016
|
-
Request,
|
|
16016
|
+
Request: Request2,
|
|
16017
16017
|
Response: Response2
|
|
16018
16018
|
} = env;
|
|
16019
16019
|
const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function";
|
|
16020
|
-
const isRequestSupported = isFunction(
|
|
16020
|
+
const isRequestSupported = isFunction(Request2);
|
|
16021
16021
|
const isResponseSupported = isFunction(Response2);
|
|
16022
16022
|
if (!isFetchSupported) {
|
|
16023
16023
|
return false;
|
|
16024
16024
|
}
|
|
16025
16025
|
const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
|
|
16026
|
-
const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1) : async (str) => new Uint8Array(await new
|
|
16026
|
+
const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1) : async (str) => new Uint8Array(await new Request2(str).arrayBuffer()));
|
|
16027
16027
|
const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
|
|
16028
16028
|
let duplexAccessed = false;
|
|
16029
16029
|
const body = new ReadableStream$1;
|
|
16030
|
-
const hasContentType = new
|
|
16030
|
+
const hasContentType = new Request2(platform.origin, {
|
|
16031
16031
|
body,
|
|
16032
16032
|
method: "POST",
|
|
16033
16033
|
get duplex() {
|
|
@@ -16061,7 +16061,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
16061
16061
|
return body.size;
|
|
16062
16062
|
}
|
|
16063
16063
|
if (utils$1.isSpecCompliantForm(body)) {
|
|
16064
|
-
const _request = new
|
|
16064
|
+
const _request = new Request2(platform.origin, {
|
|
16065
16065
|
method: "POST",
|
|
16066
16066
|
body
|
|
16067
16067
|
});
|
|
@@ -16106,7 +16106,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
16106
16106
|
let requestContentLength;
|
|
16107
16107
|
try {
|
|
16108
16108
|
if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = await resolveBodyLength(headers, data)) !== 0) {
|
|
16109
|
-
let _request = new
|
|
16109
|
+
let _request = new Request2(url2, {
|
|
16110
16110
|
method: "POST",
|
|
16111
16111
|
body: data,
|
|
16112
16112
|
duplex: "half"
|
|
@@ -16123,7 +16123,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
16123
16123
|
if (!utils$1.isString(withCredentials)) {
|
|
16124
16124
|
withCredentials = withCredentials ? "include" : "omit";
|
|
16125
16125
|
}
|
|
16126
|
-
const isCredentialsSupported = isRequestSupported && "credentials" in
|
|
16126
|
+
const isCredentialsSupported = isRequestSupported && "credentials" in Request2.prototype;
|
|
16127
16127
|
const resolvedOptions = {
|
|
16128
16128
|
...fetchOptions,
|
|
16129
16129
|
signal: composedSignal,
|
|
@@ -16133,7 +16133,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
16133
16133
|
duplex: "half",
|
|
16134
16134
|
credentials: isCredentialsSupported ? withCredentials : undefined
|
|
16135
16135
|
};
|
|
16136
|
-
request = isRequestSupported && new
|
|
16136
|
+
request = isRequestSupported && new Request2(url2, resolvedOptions);
|
|
16137
16137
|
let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url2, resolvedOptions));
|
|
16138
16138
|
const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response");
|
|
16139
16139
|
if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) {
|
|
@@ -16177,10 +16177,10 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
16177
16177
|
let env = config && config.env || {};
|
|
16178
16178
|
const {
|
|
16179
16179
|
fetch: fetch2,
|
|
16180
|
-
Request,
|
|
16180
|
+
Request: Request2,
|
|
16181
16181
|
Response: Response2
|
|
16182
16182
|
} = env;
|
|
16183
|
-
const seeds = [
|
|
16183
|
+
const seeds = [Request2, Response2, fetch2];
|
|
16184
16184
|
let len = seeds.length, i = len, seed, target, map = seedCache;
|
|
16185
16185
|
while (i--) {
|
|
16186
16186
|
seed = seeds[i];
|
|
@@ -20591,34 +20591,34 @@ var require_logger2 = __commonJS((exports) => {
|
|
|
20591
20591
|
var require_safe_buffer = __commonJS((exports, module) => {
|
|
20592
20592
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
20593
20593
|
var buffer = __require("buffer");
|
|
20594
|
-
var
|
|
20594
|
+
var Buffer3 = buffer.Buffer;
|
|
20595
20595
|
function copyProps(src, dst) {
|
|
20596
20596
|
for (var key in src) {
|
|
20597
20597
|
dst[key] = src[key];
|
|
20598
20598
|
}
|
|
20599
20599
|
}
|
|
20600
|
-
if (
|
|
20600
|
+
if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) {
|
|
20601
20601
|
module.exports = buffer;
|
|
20602
20602
|
} else {
|
|
20603
20603
|
copyProps(buffer, exports);
|
|
20604
20604
|
exports.Buffer = SafeBuffer;
|
|
20605
20605
|
}
|
|
20606
20606
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
20607
|
-
return
|
|
20607
|
+
return Buffer3(arg, encodingOrOffset, length);
|
|
20608
20608
|
}
|
|
20609
|
-
SafeBuffer.prototype = Object.create(
|
|
20610
|
-
copyProps(
|
|
20609
|
+
SafeBuffer.prototype = Object.create(Buffer3.prototype);
|
|
20610
|
+
copyProps(Buffer3, SafeBuffer);
|
|
20611
20611
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
20612
20612
|
if (typeof arg === "number") {
|
|
20613
20613
|
throw new TypeError("Argument must not be a number");
|
|
20614
20614
|
}
|
|
20615
|
-
return
|
|
20615
|
+
return Buffer3(arg, encodingOrOffset, length);
|
|
20616
20616
|
};
|
|
20617
20617
|
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
20618
20618
|
if (typeof size !== "number") {
|
|
20619
20619
|
throw new TypeError("Argument must be a number");
|
|
20620
20620
|
}
|
|
20621
|
-
var buf =
|
|
20621
|
+
var buf = Buffer3(size);
|
|
20622
20622
|
if (fill !== undefined) {
|
|
20623
20623
|
if (typeof encoding === "string") {
|
|
20624
20624
|
buf.fill(fill, encoding);
|
|
@@ -20634,7 +20634,7 @@ var require_safe_buffer = __commonJS((exports, module) => {
|
|
|
20634
20634
|
if (typeof size !== "number") {
|
|
20635
20635
|
throw new TypeError("Argument must be a number");
|
|
20636
20636
|
}
|
|
20637
|
-
return
|
|
20637
|
+
return Buffer3(size);
|
|
20638
20638
|
};
|
|
20639
20639
|
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
20640
20640
|
if (typeof size !== "number") {
|
|
@@ -20646,7 +20646,7 @@ var require_safe_buffer = __commonJS((exports, module) => {
|
|
|
20646
20646
|
|
|
20647
20647
|
// node_modules/jws/lib/data-stream.js
|
|
20648
20648
|
var require_data_stream = __commonJS((exports, module) => {
|
|
20649
|
-
var
|
|
20649
|
+
var Buffer3 = require_safe_buffer().Buffer;
|
|
20650
20650
|
var Stream = __require("stream");
|
|
20651
20651
|
var util3 = __require("util");
|
|
20652
20652
|
function DataStream(data) {
|
|
@@ -20654,11 +20654,11 @@ var require_data_stream = __commonJS((exports, module) => {
|
|
|
20654
20654
|
this.writable = true;
|
|
20655
20655
|
this.readable = true;
|
|
20656
20656
|
if (!data) {
|
|
20657
|
-
this.buffer =
|
|
20657
|
+
this.buffer = Buffer3.alloc(0);
|
|
20658
20658
|
return this;
|
|
20659
20659
|
}
|
|
20660
20660
|
if (typeof data.pipe === "function") {
|
|
20661
|
-
this.buffer =
|
|
20661
|
+
this.buffer = Buffer3.alloc(0);
|
|
20662
20662
|
data.pipe(this);
|
|
20663
20663
|
return this;
|
|
20664
20664
|
}
|
|
@@ -20676,7 +20676,7 @@ var require_data_stream = __commonJS((exports, module) => {
|
|
|
20676
20676
|
}
|
|
20677
20677
|
util3.inherits(DataStream, Stream);
|
|
20678
20678
|
DataStream.prototype.write = function write(data) {
|
|
20679
|
-
this.buffer =
|
|
20679
|
+
this.buffer = Buffer3.concat([this.buffer, Buffer3.from(data)]);
|
|
20680
20680
|
this.emit("data", data);
|
|
20681
20681
|
};
|
|
20682
20682
|
DataStream.prototype.end = function end(data) {
|
|
@@ -20713,7 +20713,7 @@ var require_param_bytes_for_alg = __commonJS((exports, module) => {
|
|
|
20713
20713
|
|
|
20714
20714
|
// node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js
|
|
20715
20715
|
var require_ecdsa_sig_formatter = __commonJS((exports, module) => {
|
|
20716
|
-
var
|
|
20716
|
+
var Buffer3 = require_safe_buffer().Buffer;
|
|
20717
20717
|
var getParamBytesForAlg = require_param_bytes_for_alg();
|
|
20718
20718
|
var MAX_OCTET = 128;
|
|
20719
20719
|
var CLASS_UNIVERSAL = 0;
|
|
@@ -20726,10 +20726,10 @@ var require_ecdsa_sig_formatter = __commonJS((exports, module) => {
|
|
|
20726
20726
|
return base64.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
20727
20727
|
}
|
|
20728
20728
|
function signatureAsBuffer(signature) {
|
|
20729
|
-
if (
|
|
20729
|
+
if (Buffer3.isBuffer(signature)) {
|
|
20730
20730
|
return signature;
|
|
20731
20731
|
} else if (typeof signature === "string") {
|
|
20732
|
-
return
|
|
20732
|
+
return Buffer3.from(signature, "base64");
|
|
20733
20733
|
}
|
|
20734
20734
|
throw new TypeError("ECDSA signature must be a Base64 string or a Buffer");
|
|
20735
20735
|
}
|
|
@@ -20777,7 +20777,7 @@ var require_ecdsa_sig_formatter = __commonJS((exports, module) => {
|
|
|
20777
20777
|
throw new Error('Expected to consume entire buffer, but "' + (inputLength - offset) + '" bytes remain');
|
|
20778
20778
|
}
|
|
20779
20779
|
var rPadding = paramBytes - rLength, sPadding = paramBytes - sLength;
|
|
20780
|
-
var dst =
|
|
20780
|
+
var dst = Buffer3.allocUnsafe(rPadding + rLength + sPadding + sLength);
|
|
20781
20781
|
for (offset = 0;offset < rPadding; ++offset) {
|
|
20782
20782
|
dst[offset] = 0;
|
|
20783
20783
|
}
|
|
@@ -20815,7 +20815,7 @@ var require_ecdsa_sig_formatter = __commonJS((exports, module) => {
|
|
|
20815
20815
|
var sLength = paramBytes - sPadding;
|
|
20816
20816
|
var rsBytes = 1 + 1 + rLength + 1 + 1 + sLength;
|
|
20817
20817
|
var shortLength = rsBytes < MAX_OCTET;
|
|
20818
|
-
var dst =
|
|
20818
|
+
var dst = Buffer3.allocUnsafe((shortLength ? 2 : 3) + rsBytes);
|
|
20819
20819
|
var offset = 0;
|
|
20820
20820
|
dst[offset++] = ENCODED_TAG_SEQ;
|
|
20821
20821
|
if (shortLength) {
|
|
@@ -20850,11 +20850,11 @@ var require_ecdsa_sig_formatter = __commonJS((exports, module) => {
|
|
|
20850
20850
|
|
|
20851
20851
|
// node_modules/buffer-equal-constant-time/index.js
|
|
20852
20852
|
var require_buffer_equal_constant_time = __commonJS((exports, module) => {
|
|
20853
|
-
var
|
|
20853
|
+
var Buffer3 = __require("buffer").Buffer;
|
|
20854
20854
|
var SlowBuffer = __require("buffer").SlowBuffer;
|
|
20855
20855
|
module.exports = bufferEq;
|
|
20856
20856
|
function bufferEq(a, b) {
|
|
20857
|
-
if (!
|
|
20857
|
+
if (!Buffer3.isBuffer(a) || !Buffer3.isBuffer(b)) {
|
|
20858
20858
|
return false;
|
|
20859
20859
|
}
|
|
20860
20860
|
if (a.length !== b.length) {
|
|
@@ -20867,21 +20867,21 @@ var require_buffer_equal_constant_time = __commonJS((exports, module) => {
|
|
|
20867
20867
|
return c === 0;
|
|
20868
20868
|
}
|
|
20869
20869
|
bufferEq.install = function() {
|
|
20870
|
-
|
|
20870
|
+
Buffer3.prototype.equal = SlowBuffer.prototype.equal = function equal(that) {
|
|
20871
20871
|
return bufferEq(this, that);
|
|
20872
20872
|
};
|
|
20873
20873
|
};
|
|
20874
|
-
var origBufEqual =
|
|
20874
|
+
var origBufEqual = Buffer3.prototype.equal;
|
|
20875
20875
|
var origSlowBufEqual = SlowBuffer.prototype.equal;
|
|
20876
20876
|
bufferEq.restore = function() {
|
|
20877
|
-
|
|
20877
|
+
Buffer3.prototype.equal = origBufEqual;
|
|
20878
20878
|
SlowBuffer.prototype.equal = origSlowBufEqual;
|
|
20879
20879
|
};
|
|
20880
20880
|
});
|
|
20881
20881
|
|
|
20882
20882
|
// node_modules/jwa/index.js
|
|
20883
20883
|
var require_jwa = __commonJS((exports, module) => {
|
|
20884
|
-
var
|
|
20884
|
+
var Buffer3 = require_safe_buffer().Buffer;
|
|
20885
20885
|
var crypto3 = __require("crypto");
|
|
20886
20886
|
var formatEcdsa = require_ecdsa_sig_formatter();
|
|
20887
20887
|
var util3 = __require("util");
|
|
@@ -20897,7 +20897,7 @@ var require_jwa = __commonJS((exports, module) => {
|
|
|
20897
20897
|
MSG_INVALID_SECRET += "or a KeyObject";
|
|
20898
20898
|
}
|
|
20899
20899
|
function checkIsPublicKey(key) {
|
|
20900
|
-
if (
|
|
20900
|
+
if (Buffer3.isBuffer(key)) {
|
|
20901
20901
|
return;
|
|
20902
20902
|
}
|
|
20903
20903
|
if (typeof key === "string") {
|
|
@@ -20920,7 +20920,7 @@ var require_jwa = __commonJS((exports, module) => {
|
|
|
20920
20920
|
}
|
|
20921
20921
|
}
|
|
20922
20922
|
function checkIsPrivateKey(key) {
|
|
20923
|
-
if (
|
|
20923
|
+
if (Buffer3.isBuffer(key)) {
|
|
20924
20924
|
return;
|
|
20925
20925
|
}
|
|
20926
20926
|
if (typeof key === "string") {
|
|
@@ -20932,7 +20932,7 @@ var require_jwa = __commonJS((exports, module) => {
|
|
|
20932
20932
|
throw typeError(MSG_INVALID_SIGNER_KEY);
|
|
20933
20933
|
}
|
|
20934
20934
|
function checkIsSecretKey(key) {
|
|
20935
|
-
if (
|
|
20935
|
+
if (Buffer3.isBuffer(key)) {
|
|
20936
20936
|
return;
|
|
20937
20937
|
}
|
|
20938
20938
|
if (typeof key === "string") {
|
|
@@ -20970,7 +20970,7 @@ var require_jwa = __commonJS((exports, module) => {
|
|
|
20970
20970
|
return new TypeError(errMsg);
|
|
20971
20971
|
}
|
|
20972
20972
|
function bufferOrString(obj) {
|
|
20973
|
-
return
|
|
20973
|
+
return Buffer3.isBuffer(obj) || typeof obj === "string";
|
|
20974
20974
|
}
|
|
20975
20975
|
function normalizeInput(thing) {
|
|
20976
20976
|
if (!bufferOrString(thing))
|
|
@@ -21001,7 +21001,7 @@ var require_jwa = __commonJS((exports, module) => {
|
|
|
21001
21001
|
function createHmacVerifier(bits) {
|
|
21002
21002
|
return function verify(thing, signature, secret) {
|
|
21003
21003
|
var computedSig = createHmacSigner(bits)(thing, secret);
|
|
21004
|
-
return timingSafeEqual2(
|
|
21004
|
+
return timingSafeEqual2(Buffer3.from(signature), Buffer3.from(computedSig));
|
|
21005
21005
|
};
|
|
21006
21006
|
}
|
|
21007
21007
|
function createKeySigner(bits) {
|
|
@@ -21105,11 +21105,11 @@ var require_jwa = __commonJS((exports, module) => {
|
|
|
21105
21105
|
|
|
21106
21106
|
// node_modules/jws/lib/tostring.js
|
|
21107
21107
|
var require_tostring = __commonJS((exports, module) => {
|
|
21108
|
-
var
|
|
21108
|
+
var Buffer3 = __require("buffer").Buffer;
|
|
21109
21109
|
module.exports = function toString(obj) {
|
|
21110
21110
|
if (typeof obj === "string")
|
|
21111
21111
|
return obj;
|
|
21112
|
-
if (typeof obj === "number" ||
|
|
21112
|
+
if (typeof obj === "number" || Buffer3.isBuffer(obj))
|
|
21113
21113
|
return obj.toString();
|
|
21114
21114
|
return JSON.stringify(obj);
|
|
21115
21115
|
};
|
|
@@ -21117,14 +21117,14 @@ var require_tostring = __commonJS((exports, module) => {
|
|
|
21117
21117
|
|
|
21118
21118
|
// node_modules/jws/lib/sign-stream.js
|
|
21119
21119
|
var require_sign_stream = __commonJS((exports, module) => {
|
|
21120
|
-
var
|
|
21120
|
+
var Buffer3 = require_safe_buffer().Buffer;
|
|
21121
21121
|
var DataStream = require_data_stream();
|
|
21122
21122
|
var jwa = require_jwa();
|
|
21123
21123
|
var Stream = __require("stream");
|
|
21124
21124
|
var toString = require_tostring();
|
|
21125
21125
|
var util3 = __require("util");
|
|
21126
21126
|
function base64url(string, encoding) {
|
|
21127
|
-
return
|
|
21127
|
+
return Buffer3.from(string, encoding).toString("base64").replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
21128
21128
|
}
|
|
21129
21129
|
function jwsSecuredInput(header, payload, encoding) {
|
|
21130
21130
|
encoding = encoding || "utf8";
|
|
@@ -21190,7 +21190,7 @@ var require_sign_stream = __commonJS((exports, module) => {
|
|
|
21190
21190
|
|
|
21191
21191
|
// node_modules/jws/lib/verify-stream.js
|
|
21192
21192
|
var require_verify_stream = __commonJS((exports, module) => {
|
|
21193
|
-
var
|
|
21193
|
+
var Buffer3 = require_safe_buffer().Buffer;
|
|
21194
21194
|
var DataStream = require_data_stream();
|
|
21195
21195
|
var jwa = require_jwa();
|
|
21196
21196
|
var Stream = __require("stream");
|
|
@@ -21211,7 +21211,7 @@ var require_verify_stream = __commonJS((exports, module) => {
|
|
|
21211
21211
|
}
|
|
21212
21212
|
function headerFromJWS(jwsSig) {
|
|
21213
21213
|
var encodedHeader = jwsSig.split(".", 1)[0];
|
|
21214
|
-
return safeJsonParse(
|
|
21214
|
+
return safeJsonParse(Buffer3.from(encodedHeader, "base64").toString("binary"));
|
|
21215
21215
|
}
|
|
21216
21216
|
function securedInputFromJWS(jwsSig) {
|
|
21217
21217
|
return jwsSig.split(".", 2).join(".");
|
|
@@ -21222,7 +21222,7 @@ var require_verify_stream = __commonJS((exports, module) => {
|
|
|
21222
21222
|
function payloadFromJWS(jwsSig, encoding) {
|
|
21223
21223
|
encoding = encoding || "utf8";
|
|
21224
21224
|
var payload = jwsSig.split(".")[1];
|
|
21225
|
-
return
|
|
21225
|
+
return Buffer3.from(payload, "base64").toString(encoding);
|
|
21226
21226
|
}
|
|
21227
21227
|
function isValidJws(string) {
|
|
21228
21228
|
return JWS_REGEX.test(string) && !!headerFromJWS(string);
|
|
@@ -26005,7 +26005,7 @@ var require_http_errors = __commonJS((exports, module) => {
|
|
|
26005
26005
|
// node_modules/safer-buffer/safer.js
|
|
26006
26006
|
var require_safer = __commonJS((exports, module) => {
|
|
26007
26007
|
var buffer = __require("buffer");
|
|
26008
|
-
var
|
|
26008
|
+
var Buffer3 = buffer.Buffer;
|
|
26009
26009
|
var safer = {};
|
|
26010
26010
|
var key;
|
|
26011
26011
|
for (key in buffer) {
|
|
@@ -26016,14 +26016,14 @@ var require_safer = __commonJS((exports, module) => {
|
|
|
26016
26016
|
safer[key] = buffer[key];
|
|
26017
26017
|
}
|
|
26018
26018
|
var Safer = safer.Buffer = {};
|
|
26019
|
-
for (key in
|
|
26020
|
-
if (!
|
|
26019
|
+
for (key in Buffer3) {
|
|
26020
|
+
if (!Buffer3.hasOwnProperty(key))
|
|
26021
26021
|
continue;
|
|
26022
26022
|
if (key === "allocUnsafe" || key === "allocUnsafeSlow")
|
|
26023
26023
|
continue;
|
|
26024
|
-
Safer[key] =
|
|
26024
|
+
Safer[key] = Buffer3[key];
|
|
26025
26025
|
}
|
|
26026
|
-
safer.Buffer.prototype =
|
|
26026
|
+
safer.Buffer.prototype = Buffer3.prototype;
|
|
26027
26027
|
if (!Safer.from || Safer.from === Uint8Array.from) {
|
|
26028
26028
|
Safer.from = function(value, encodingOrOffset, length) {
|
|
26029
26029
|
if (typeof value === "number") {
|
|
@@ -26032,7 +26032,7 @@ var require_safer = __commonJS((exports, module) => {
|
|
|
26032
26032
|
if (value && typeof value.length === "undefined") {
|
|
26033
26033
|
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
|
|
26034
26034
|
}
|
|
26035
|
-
return
|
|
26035
|
+
return Buffer3(value, encodingOrOffset, length);
|
|
26036
26036
|
};
|
|
26037
26037
|
}
|
|
26038
26038
|
if (!Safer.alloc) {
|
|
@@ -26043,7 +26043,7 @@ var require_safer = __commonJS((exports, module) => {
|
|
|
26043
26043
|
if (size < 0 || size >= 2 * (1 << 30)) {
|
|
26044
26044
|
throw new RangeError('The value "' + size + '" is invalid for option "size"');
|
|
26045
26045
|
}
|
|
26046
|
-
var buf =
|
|
26046
|
+
var buf = Buffer3(size);
|
|
26047
26047
|
if (!fill || fill.length === 0) {
|
|
26048
26048
|
buf.fill(0);
|
|
26049
26049
|
} else if (typeof encoding === "string") {
|
|
@@ -26128,7 +26128,7 @@ var require_merge_exports = __commonJS((exports, module) => {
|
|
|
26128
26128
|
|
|
26129
26129
|
// node_modules/iconv-lite/encodings/internal.js
|
|
26130
26130
|
var require_internal = __commonJS((exports, module) => {
|
|
26131
|
-
var
|
|
26131
|
+
var Buffer3 = require_safer().Buffer;
|
|
26132
26132
|
module.exports = {
|
|
26133
26133
|
utf8: { type: "_internal", bomAware: true },
|
|
26134
26134
|
cesu8: { type: "_internal", bomAware: true },
|
|
@@ -26150,7 +26150,7 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
26150
26150
|
} else if (this.enc === "cesu8") {
|
|
26151
26151
|
this.enc = "utf8";
|
|
26152
26152
|
this.encoder = InternalEncoderCesu8;
|
|
26153
|
-
if (
|
|
26153
|
+
if (Buffer3.from("eda0bdedb2a9", "hex").toString() !== "\uD83D\uDCA9") {
|
|
26154
26154
|
this.decoder = InternalDecoderCesu8;
|
|
26155
26155
|
this.defaultCharUnicode = iconv.defaultCharUnicode;
|
|
26156
26156
|
}
|
|
@@ -26163,8 +26163,8 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
26163
26163
|
this.decoder = new StringDecoder(codec.enc);
|
|
26164
26164
|
}
|
|
26165
26165
|
InternalDecoder.prototype.write = function(buf) {
|
|
26166
|
-
if (!
|
|
26167
|
-
buf =
|
|
26166
|
+
if (!Buffer3.isBuffer(buf)) {
|
|
26167
|
+
buf = Buffer3.from(buf);
|
|
26168
26168
|
}
|
|
26169
26169
|
return this.decoder.write(buf);
|
|
26170
26170
|
};
|
|
@@ -26175,7 +26175,7 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
26175
26175
|
this.enc = codec.enc;
|
|
26176
26176
|
}
|
|
26177
26177
|
InternalEncoder.prototype.write = function(str) {
|
|
26178
|
-
return
|
|
26178
|
+
return Buffer3.from(str, this.enc);
|
|
26179
26179
|
};
|
|
26180
26180
|
InternalEncoder.prototype.end = function() {};
|
|
26181
26181
|
function InternalEncoderBase64(options, codec) {
|
|
@@ -26186,14 +26186,14 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
26186
26186
|
var completeQuads = str.length - str.length % 4;
|
|
26187
26187
|
this.prevStr = str.slice(completeQuads);
|
|
26188
26188
|
str = str.slice(0, completeQuads);
|
|
26189
|
-
return
|
|
26189
|
+
return Buffer3.from(str, "base64");
|
|
26190
26190
|
};
|
|
26191
26191
|
InternalEncoderBase64.prototype.end = function() {
|
|
26192
|
-
return
|
|
26192
|
+
return Buffer3.from(this.prevStr, "base64");
|
|
26193
26193
|
};
|
|
26194
26194
|
function InternalEncoderCesu8(options, codec) {}
|
|
26195
26195
|
InternalEncoderCesu8.prototype.write = function(str) {
|
|
26196
|
-
var buf =
|
|
26196
|
+
var buf = Buffer3.alloc(str.length * 3);
|
|
26197
26197
|
var bufIdx = 0;
|
|
26198
26198
|
for (var i = 0;i < str.length; i++) {
|
|
26199
26199
|
var charCode = str.charCodeAt(i);
|
|
@@ -26288,20 +26288,20 @@ var require_internal = __commonJS((exports, module) => {
|
|
|
26288
26288
|
str = str.slice(0, str.length - 1);
|
|
26289
26289
|
}
|
|
26290
26290
|
}
|
|
26291
|
-
return
|
|
26291
|
+
return Buffer3.from(str, this.enc);
|
|
26292
26292
|
};
|
|
26293
26293
|
InternalEncoderUtf8.prototype.end = function() {
|
|
26294
26294
|
if (this.highSurrogate) {
|
|
26295
26295
|
var str = this.highSurrogate;
|
|
26296
26296
|
this.highSurrogate = "";
|
|
26297
|
-
return
|
|
26297
|
+
return Buffer3.from(str, this.enc);
|
|
26298
26298
|
}
|
|
26299
26299
|
};
|
|
26300
26300
|
});
|
|
26301
26301
|
|
|
26302
26302
|
// node_modules/iconv-lite/encodings/utf32.js
|
|
26303
26303
|
var require_utf32 = __commonJS((exports) => {
|
|
26304
|
-
var
|
|
26304
|
+
var Buffer3 = require_safer().Buffer;
|
|
26305
26305
|
exports._utf32 = Utf32Codec;
|
|
26306
26306
|
function Utf32Codec(codecOptions, iconv) {
|
|
26307
26307
|
this.iconv = iconv;
|
|
@@ -26319,8 +26319,8 @@ var require_utf32 = __commonJS((exports) => {
|
|
|
26319
26319
|
this.highSurrogate = 0;
|
|
26320
26320
|
}
|
|
26321
26321
|
Utf32Encoder.prototype.write = function(str) {
|
|
26322
|
-
var src =
|
|
26323
|
-
var dst =
|
|
26322
|
+
var src = Buffer3.from(str, "ucs2");
|
|
26323
|
+
var dst = Buffer3.alloc(src.length * 2);
|
|
26324
26324
|
var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE;
|
|
26325
26325
|
var offset = 0;
|
|
26326
26326
|
for (var i = 0;i < src.length; i += 2) {
|
|
@@ -26356,7 +26356,7 @@ var require_utf32 = __commonJS((exports) => {
|
|
|
26356
26356
|
if (!this.highSurrogate) {
|
|
26357
26357
|
return;
|
|
26358
26358
|
}
|
|
26359
|
-
var buf =
|
|
26359
|
+
var buf = Buffer3.alloc(4);
|
|
26360
26360
|
if (this.isLE) {
|
|
26361
26361
|
buf.writeUInt32LE(this.highSurrogate, 0);
|
|
26362
26362
|
} else {
|
|
@@ -26376,7 +26376,7 @@ var require_utf32 = __commonJS((exports) => {
|
|
|
26376
26376
|
}
|
|
26377
26377
|
var i = 0;
|
|
26378
26378
|
var codepoint = 0;
|
|
26379
|
-
var dst =
|
|
26379
|
+
var dst = Buffer3.alloc(src.length + 4);
|
|
26380
26380
|
var offset = 0;
|
|
26381
26381
|
var isLE = this.isLE;
|
|
26382
26382
|
var overflow = this.overflow;
|
|
@@ -26535,7 +26535,7 @@ var require_utf32 = __commonJS((exports) => {
|
|
|
26535
26535
|
|
|
26536
26536
|
// node_modules/iconv-lite/encodings/utf16.js
|
|
26537
26537
|
var require_utf16 = __commonJS((exports) => {
|
|
26538
|
-
var
|
|
26538
|
+
var Buffer3 = require_safer().Buffer;
|
|
26539
26539
|
exports.utf16be = Utf16BECodec;
|
|
26540
26540
|
function Utf16BECodec() {}
|
|
26541
26541
|
Utf16BECodec.prototype.encoder = Utf16BEEncoder;
|
|
@@ -26543,7 +26543,7 @@ var require_utf16 = __commonJS((exports) => {
|
|
|
26543
26543
|
Utf16BECodec.prototype.bomAware = true;
|
|
26544
26544
|
function Utf16BEEncoder() {}
|
|
26545
26545
|
Utf16BEEncoder.prototype.write = function(str) {
|
|
26546
|
-
var buf =
|
|
26546
|
+
var buf = Buffer3.from(str, "ucs2");
|
|
26547
26547
|
for (var i = 0;i < buf.length; i += 2) {
|
|
26548
26548
|
var tmp = buf[i];
|
|
26549
26549
|
buf[i] = buf[i + 1];
|
|
@@ -26559,7 +26559,7 @@ var require_utf16 = __commonJS((exports) => {
|
|
|
26559
26559
|
if (buf.length == 0) {
|
|
26560
26560
|
return "";
|
|
26561
26561
|
}
|
|
26562
|
-
var buf2 =
|
|
26562
|
+
var buf2 = Buffer3.alloc(buf.length + 1);
|
|
26563
26563
|
var i = 0;
|
|
26564
26564
|
var j = 0;
|
|
26565
26565
|
if (this.overflowByte !== -1) {
|
|
@@ -26678,7 +26678,7 @@ var require_utf16 = __commonJS((exports) => {
|
|
|
26678
26678
|
|
|
26679
26679
|
// node_modules/iconv-lite/encodings/utf7.js
|
|
26680
26680
|
var require_utf7 = __commonJS((exports) => {
|
|
26681
|
-
var
|
|
26681
|
+
var Buffer3 = require_safer().Buffer;
|
|
26682
26682
|
exports.utf7 = Utf7Codec;
|
|
26683
26683
|
exports.unicode11utf7 = "utf7";
|
|
26684
26684
|
function Utf7Codec(codecOptions, iconv) {
|
|
@@ -26692,7 +26692,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
26692
26692
|
this.iconv = codec.iconv;
|
|
26693
26693
|
}
|
|
26694
26694
|
Utf7Encoder.prototype.write = function(str) {
|
|
26695
|
-
return
|
|
26695
|
+
return Buffer3.from(str.replace(nonDirectChars, function(chunk) {
|
|
26696
26696
|
return "+" + (chunk === "+" ? "" : this.iconv.encode(chunk, "utf16-be").toString("base64").replace(/=+$/, "")) + "-";
|
|
26697
26697
|
}.bind(this)));
|
|
26698
26698
|
};
|
|
@@ -26729,7 +26729,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
26729
26729
|
res += "+";
|
|
26730
26730
|
} else {
|
|
26731
26731
|
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i2), "ascii");
|
|
26732
|
-
res += this.iconv.decode(
|
|
26732
|
+
res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
|
|
26733
26733
|
}
|
|
26734
26734
|
if (buf[i2] != minusChar) {
|
|
26735
26735
|
i2--;
|
|
@@ -26747,7 +26747,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
26747
26747
|
var canBeDecoded = b64str.length - b64str.length % 8;
|
|
26748
26748
|
base64Accum = b64str.slice(canBeDecoded);
|
|
26749
26749
|
b64str = b64str.slice(0, canBeDecoded);
|
|
26750
|
-
res += this.iconv.decode(
|
|
26750
|
+
res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
|
|
26751
26751
|
}
|
|
26752
26752
|
this.inBase64 = inBase64;
|
|
26753
26753
|
this.base64Accum = base64Accum;
|
|
@@ -26756,7 +26756,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
26756
26756
|
Utf7Decoder.prototype.end = function() {
|
|
26757
26757
|
var res = "";
|
|
26758
26758
|
if (this.inBase64 && this.base64Accum.length > 0) {
|
|
26759
|
-
res = this.iconv.decode(
|
|
26759
|
+
res = this.iconv.decode(Buffer3.from(this.base64Accum, "base64"), "utf16-be");
|
|
26760
26760
|
}
|
|
26761
26761
|
this.inBase64 = false;
|
|
26762
26762
|
this.base64Accum = "";
|
|
@@ -26772,14 +26772,14 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
26772
26772
|
function Utf7IMAPEncoder(options, codec) {
|
|
26773
26773
|
this.iconv = codec.iconv;
|
|
26774
26774
|
this.inBase64 = false;
|
|
26775
|
-
this.base64Accum =
|
|
26775
|
+
this.base64Accum = Buffer3.alloc(6);
|
|
26776
26776
|
this.base64AccumIdx = 0;
|
|
26777
26777
|
}
|
|
26778
26778
|
Utf7IMAPEncoder.prototype.write = function(str) {
|
|
26779
26779
|
var inBase64 = this.inBase64;
|
|
26780
26780
|
var base64Accum = this.base64Accum;
|
|
26781
26781
|
var base64AccumIdx = this.base64AccumIdx;
|
|
26782
|
-
var buf =
|
|
26782
|
+
var buf = Buffer3.alloc(str.length * 5 + 10);
|
|
26783
26783
|
var bufIdx = 0;
|
|
26784
26784
|
for (var i2 = 0;i2 < str.length; i2++) {
|
|
26785
26785
|
var uChar = str.charCodeAt(i2);
|
|
@@ -26818,7 +26818,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
26818
26818
|
return buf.slice(0, bufIdx);
|
|
26819
26819
|
};
|
|
26820
26820
|
Utf7IMAPEncoder.prototype.end = function() {
|
|
26821
|
-
var buf =
|
|
26821
|
+
var buf = Buffer3.alloc(10);
|
|
26822
26822
|
var bufIdx = 0;
|
|
26823
26823
|
if (this.inBase64) {
|
|
26824
26824
|
if (this.base64AccumIdx > 0) {
|
|
@@ -26855,7 +26855,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
26855
26855
|
res += "&";
|
|
26856
26856
|
} else {
|
|
26857
26857
|
var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i2), "ascii").replace(/,/g, "/");
|
|
26858
|
-
res += this.iconv.decode(
|
|
26858
|
+
res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
|
|
26859
26859
|
}
|
|
26860
26860
|
if (buf[i2] != minusChar) {
|
|
26861
26861
|
i2--;
|
|
@@ -26873,7 +26873,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
26873
26873
|
var canBeDecoded = b64str.length - b64str.length % 8;
|
|
26874
26874
|
base64Accum = b64str.slice(canBeDecoded);
|
|
26875
26875
|
b64str = b64str.slice(0, canBeDecoded);
|
|
26876
|
-
res += this.iconv.decode(
|
|
26876
|
+
res += this.iconv.decode(Buffer3.from(b64str, "base64"), "utf16-be");
|
|
26877
26877
|
}
|
|
26878
26878
|
this.inBase64 = inBase64;
|
|
26879
26879
|
this.base64Accum = base64Accum;
|
|
@@ -26882,7 +26882,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
26882
26882
|
Utf7IMAPDecoder.prototype.end = function() {
|
|
26883
26883
|
var res = "";
|
|
26884
26884
|
if (this.inBase64 && this.base64Accum.length > 0) {
|
|
26885
|
-
res = this.iconv.decode(
|
|
26885
|
+
res = this.iconv.decode(Buffer3.from(this.base64Accum, "base64"), "utf16-be");
|
|
26886
26886
|
}
|
|
26887
26887
|
this.inBase64 = false;
|
|
26888
26888
|
this.base64Accum = "";
|
|
@@ -26892,7 +26892,7 @@ var require_utf7 = __commonJS((exports) => {
|
|
|
26892
26892
|
|
|
26893
26893
|
// node_modules/iconv-lite/encodings/sbcs-codec.js
|
|
26894
26894
|
var require_sbcs_codec = __commonJS((exports) => {
|
|
26895
|
-
var
|
|
26895
|
+
var Buffer3 = require_safer().Buffer;
|
|
26896
26896
|
exports._sbcs = SBCSCodec;
|
|
26897
26897
|
function SBCSCodec(codecOptions, iconv) {
|
|
26898
26898
|
if (!codecOptions) {
|
|
@@ -26908,8 +26908,8 @@ var require_sbcs_codec = __commonJS((exports) => {
|
|
|
26908
26908
|
}
|
|
26909
26909
|
codecOptions.chars = asciiString + codecOptions.chars;
|
|
26910
26910
|
}
|
|
26911
|
-
this.decodeBuf =
|
|
26912
|
-
var encodeBuf =
|
|
26911
|
+
this.decodeBuf = Buffer3.from(codecOptions.chars, "ucs2");
|
|
26912
|
+
var encodeBuf = Buffer3.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
|
|
26913
26913
|
for (var i = 0;i < codecOptions.chars.length; i++) {
|
|
26914
26914
|
encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
|
|
26915
26915
|
}
|
|
@@ -26921,7 +26921,7 @@ var require_sbcs_codec = __commonJS((exports) => {
|
|
|
26921
26921
|
this.encodeBuf = codec.encodeBuf;
|
|
26922
26922
|
}
|
|
26923
26923
|
SBCSEncoder.prototype.write = function(str) {
|
|
26924
|
-
var buf =
|
|
26924
|
+
var buf = Buffer3.alloc(str.length);
|
|
26925
26925
|
for (var i = 0;i < str.length; i++) {
|
|
26926
26926
|
buf[i] = this.encodeBuf[str.charCodeAt(i)];
|
|
26927
26927
|
}
|
|
@@ -26933,7 +26933,7 @@ var require_sbcs_codec = __commonJS((exports) => {
|
|
|
26933
26933
|
}
|
|
26934
26934
|
SBCSDecoder.prototype.write = function(buf) {
|
|
26935
26935
|
var decodeBuf = this.decodeBuf;
|
|
26936
|
-
var newBuf =
|
|
26936
|
+
var newBuf = Buffer3.alloc(buf.length * 2);
|
|
26937
26937
|
var idx1 = 0;
|
|
26938
26938
|
var idx2 = 0;
|
|
26939
26939
|
for (var i = 0;i < buf.length; i++) {
|
|
@@ -27554,7 +27554,7 @@ var require_sbcs_data_generated = __commonJS((exports, module) => {
|
|
|
27554
27554
|
|
|
27555
27555
|
// node_modules/iconv-lite/encodings/dbcs-codec.js
|
|
27556
27556
|
var require_dbcs_codec = __commonJS((exports) => {
|
|
27557
|
-
var
|
|
27557
|
+
var Buffer3 = require_safer().Buffer;
|
|
27558
27558
|
exports._dbcs = DBCSCodec;
|
|
27559
27559
|
var UNASSIGNED = -1;
|
|
27560
27560
|
var GB18030_CODE = -2;
|
|
@@ -27793,7 +27793,7 @@ var require_dbcs_codec = __commonJS((exports) => {
|
|
|
27793
27793
|
this.gb18030 = codec.gb18030;
|
|
27794
27794
|
}
|
|
27795
27795
|
DBCSEncoder.prototype.write = function(str) {
|
|
27796
|
-
var newBuf =
|
|
27796
|
+
var newBuf = Buffer3.alloc(str.length * (this.gb18030 ? 4 : 3));
|
|
27797
27797
|
var leadSurrogate = this.leadSurrogate;
|
|
27798
27798
|
var seqObj = this.seqObj;
|
|
27799
27799
|
var nextChar = -1;
|
|
@@ -27897,7 +27897,7 @@ var require_dbcs_codec = __commonJS((exports) => {
|
|
|
27897
27897
|
if (this.leadSurrogate === -1 && this.seqObj === undefined) {
|
|
27898
27898
|
return;
|
|
27899
27899
|
}
|
|
27900
|
-
var newBuf =
|
|
27900
|
+
var newBuf = Buffer3.alloc(10);
|
|
27901
27901
|
var j = 0;
|
|
27902
27902
|
if (this.seqObj) {
|
|
27903
27903
|
var dbcsCode = this.seqObj[DEF_CHAR];
|
|
@@ -27927,7 +27927,7 @@ var require_dbcs_codec = __commonJS((exports) => {
|
|
|
27927
27927
|
this.gb18030 = codec.gb18030;
|
|
27928
27928
|
}
|
|
27929
27929
|
DBCSDecoder.prototype.write = function(buf) {
|
|
27930
|
-
var newBuf =
|
|
27930
|
+
var newBuf = Buffer3.alloc(buf.length * 2);
|
|
27931
27931
|
var nodeIdx = this.nodeIdx;
|
|
27932
27932
|
var prevBytes = this.prevBytes;
|
|
27933
27933
|
var prevOffset = this.prevBytes.length;
|
|
@@ -29437,7 +29437,7 @@ var require_encodings = __commonJS((exports, module) => {
|
|
|
29437
29437
|
|
|
29438
29438
|
// node_modules/iconv-lite/lib/streams.js
|
|
29439
29439
|
var require_streams = __commonJS((exports, module) => {
|
|
29440
|
-
var
|
|
29440
|
+
var Buffer3 = require_safer().Buffer;
|
|
29441
29441
|
module.exports = function(streamModule) {
|
|
29442
29442
|
var Transform = streamModule.Transform;
|
|
29443
29443
|
function IconvLiteEncoderStream(conv, options) {
|
|
@@ -29479,7 +29479,7 @@ var require_streams = __commonJS((exports, module) => {
|
|
|
29479
29479
|
chunks.push(chunk);
|
|
29480
29480
|
});
|
|
29481
29481
|
this.on("end", function() {
|
|
29482
|
-
cb(null,
|
|
29482
|
+
cb(null, Buffer3.concat(chunks));
|
|
29483
29483
|
});
|
|
29484
29484
|
return this;
|
|
29485
29485
|
};
|
|
@@ -29493,7 +29493,7 @@ var require_streams = __commonJS((exports, module) => {
|
|
|
29493
29493
|
constructor: { value: IconvLiteDecoderStream }
|
|
29494
29494
|
});
|
|
29495
29495
|
IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
|
|
29496
|
-
if (!
|
|
29496
|
+
if (!Buffer3.isBuffer(chunk) && !(chunk instanceof Uint8Array)) {
|
|
29497
29497
|
return done(new Error("Iconv decoding stream needs buffers as its input."));
|
|
29498
29498
|
}
|
|
29499
29499
|
try {
|
|
@@ -29535,7 +29535,7 @@ var require_streams = __commonJS((exports, module) => {
|
|
|
29535
29535
|
|
|
29536
29536
|
// node_modules/iconv-lite/lib/index.js
|
|
29537
29537
|
var require_lib = __commonJS((exports, module) => {
|
|
29538
|
-
var
|
|
29538
|
+
var Buffer3 = require_safer().Buffer;
|
|
29539
29539
|
var bomHandling = require_bom_handling();
|
|
29540
29540
|
var mergeModules = require_merge_exports();
|
|
29541
29541
|
exports.encodings = null;
|
|
@@ -29546,7 +29546,7 @@ var require_lib = __commonJS((exports, module) => {
|
|
|
29546
29546
|
var encoder = exports.getEncoder(encoding, options);
|
|
29547
29547
|
var res = encoder.write(str);
|
|
29548
29548
|
var trail = encoder.end();
|
|
29549
|
-
return trail && trail.length > 0 ?
|
|
29549
|
+
return trail && trail.length > 0 ? Buffer3.concat([res, trail]) : res;
|
|
29550
29550
|
};
|
|
29551
29551
|
exports.decode = function decode(buf, encoding, options) {
|
|
29552
29552
|
if (typeof buf === "string") {
|
|
@@ -29554,7 +29554,7 @@ var require_lib = __commonJS((exports, module) => {
|
|
|
29554
29554
|
console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding");
|
|
29555
29555
|
exports.skipDecodeWarning = true;
|
|
29556
29556
|
}
|
|
29557
|
-
buf =
|
|
29557
|
+
buf = Buffer3.from("" + (buf || ""), "binary");
|
|
29558
29558
|
}
|
|
29559
29559
|
var decoder = exports.getDecoder(encoding, options);
|
|
29560
29560
|
var res = decoder.write(buf);
|
|
@@ -48737,7 +48737,7 @@ var require_utils3 = __commonJS((exports) => {
|
|
|
48737
48737
|
var proxyaddr = require_proxy_addr();
|
|
48738
48738
|
var qs = require_lib3();
|
|
48739
48739
|
var querystring = __require("node:querystring");
|
|
48740
|
-
var { Buffer:
|
|
48740
|
+
var { Buffer: Buffer3 } = __require("node:buffer");
|
|
48741
48741
|
exports.methods = METHODS.map((method) => method.toLowerCase());
|
|
48742
48742
|
exports.etag = createETagGenerator({ weak: false });
|
|
48743
48743
|
exports.wetag = createETagGenerator({ weak: true });
|
|
@@ -48843,7 +48843,7 @@ var require_utils3 = __commonJS((exports) => {
|
|
|
48843
48843
|
};
|
|
48844
48844
|
function createETagGenerator(options) {
|
|
48845
48845
|
return function generateETag(body, encoding) {
|
|
48846
|
-
var buf = !
|
|
48846
|
+
var buf = !Buffer3.isBuffer(body) ? Buffer3.from(body, encoding) : body;
|
|
48847
48847
|
return etag(buf, options);
|
|
48848
48848
|
};
|
|
48849
48849
|
}
|
|
@@ -51757,7 +51757,7 @@ var require_response2 = __commonJS((exports, module) => {
|
|
|
51757
51757
|
var extname = path2.extname;
|
|
51758
51758
|
var resolve = path2.resolve;
|
|
51759
51759
|
var vary = require_vary();
|
|
51760
|
-
var { Buffer:
|
|
51760
|
+
var { Buffer: Buffer3 } = __require("node:buffer");
|
|
51761
51761
|
var res = Object.create(http.ServerResponse.prototype);
|
|
51762
51762
|
module.exports = res;
|
|
51763
51763
|
res.status = function status(code) {
|
|
@@ -51821,12 +51821,12 @@ var require_response2 = __commonJS((exports, module) => {
|
|
|
51821
51821
|
var generateETag = !this.get("ETag") && typeof etagFn === "function";
|
|
51822
51822
|
var len;
|
|
51823
51823
|
if (chunk !== undefined) {
|
|
51824
|
-
if (
|
|
51824
|
+
if (Buffer3.isBuffer(chunk)) {
|
|
51825
51825
|
len = chunk.length;
|
|
51826
51826
|
} else if (!generateETag && chunk.length < 1000) {
|
|
51827
|
-
len =
|
|
51827
|
+
len = Buffer3.byteLength(chunk, encoding);
|
|
51828
51828
|
} else {
|
|
51829
|
-
chunk =
|
|
51829
|
+
chunk = Buffer3.from(chunk, encoding);
|
|
51830
51830
|
encoding = undefined;
|
|
51831
51831
|
len = chunk.length;
|
|
51832
51832
|
}
|
|
@@ -52091,7 +52091,7 @@ var require_response2 = __commonJS((exports, module) => {
|
|
|
52091
52091
|
}
|
|
52092
52092
|
});
|
|
52093
52093
|
this.status(status);
|
|
52094
|
-
this.set("Content-Length",
|
|
52094
|
+
this.set("Content-Length", Buffer3.byteLength(body));
|
|
52095
52095
|
if (this.req.method === "HEAD") {
|
|
52096
52096
|
this.end();
|
|
52097
52097
|
} else {
|
|
@@ -83338,7 +83338,7 @@ import { chmod, open, readFile as readFile2, rename, unlink, writeFile as writeF
|
|
|
83338
83338
|
import { basename, dirname as dirname2, join as join3 } from "node:path";
|
|
83339
83339
|
var DEFAULT_JSON_FILE_LOCK_OPTIONS = {
|
|
83340
83340
|
retries: {
|
|
83341
|
-
retries:
|
|
83341
|
+
retries: 20,
|
|
83342
83342
|
factor: 2,
|
|
83343
83343
|
minTimeout: 50,
|
|
83344
83344
|
maxTimeout: 2000,
|
|
@@ -89194,7 +89194,15 @@ class SessionStore {
|
|
|
89194
89194
|
if (!await fileExists(this.storePath)) {
|
|
89195
89195
|
return {};
|
|
89196
89196
|
}
|
|
89197
|
-
|
|
89197
|
+
let text;
|
|
89198
|
+
try {
|
|
89199
|
+
text = await readTextFile(this.storePath);
|
|
89200
|
+
} catch (error) {
|
|
89201
|
+
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") {
|
|
89202
|
+
return {};
|
|
89203
|
+
}
|
|
89204
|
+
throw error;
|
|
89205
|
+
}
|
|
89198
89206
|
if (!text.trim()) {
|
|
89199
89207
|
return {};
|
|
89200
89208
|
}
|
|
@@ -97828,6 +97836,129 @@ function isTerminalResultStatus(status) {
|
|
|
97828
97836
|
return ["completed", "failed", "filtered", "expired", "stopped"].includes(status);
|
|
97829
97837
|
}
|
|
97830
97838
|
|
|
97839
|
+
// src/channels/api/http-listener.ts
|
|
97840
|
+
import { Buffer as Buffer2 } from "node:buffer";
|
|
97841
|
+
import { createServer } from "node:http";
|
|
97842
|
+
var FORCE_CLOSE_TIMEOUT_MS = 1000;
|
|
97843
|
+
function requestHeaders(request) {
|
|
97844
|
+
const headers = new Headers;
|
|
97845
|
+
for (const [key, value] of Object.entries(request.headers)) {
|
|
97846
|
+
if (Array.isArray(value)) {
|
|
97847
|
+
for (const item of value) {
|
|
97848
|
+
headers.append(key, item);
|
|
97849
|
+
}
|
|
97850
|
+
} else if (value != null) {
|
|
97851
|
+
headers.set(key, value);
|
|
97852
|
+
}
|
|
97853
|
+
}
|
|
97854
|
+
return headers;
|
|
97855
|
+
}
|
|
97856
|
+
async function readRequestBody(request) {
|
|
97857
|
+
const chunks = [];
|
|
97858
|
+
for await (const chunk of request) {
|
|
97859
|
+
chunks.push(Buffer2.isBuffer(chunk) ? chunk : Buffer2.from(chunk));
|
|
97860
|
+
}
|
|
97861
|
+
return Buffer2.concat(chunks);
|
|
97862
|
+
}
|
|
97863
|
+
function requestUrl(request, host) {
|
|
97864
|
+
const protocol = request.headers["x-forwarded-proto"] ?? "http";
|
|
97865
|
+
const requestHost = request.headers.host ?? host;
|
|
97866
|
+
return `${Array.isArray(protocol) ? protocol[0] : protocol}://${requestHost}${request.url ?? "/"}`;
|
|
97867
|
+
}
|
|
97868
|
+
async function toWebRequest(request, host) {
|
|
97869
|
+
const method = request.method ?? "GET";
|
|
97870
|
+
const bodyAllowed = method !== "GET" && method !== "HEAD";
|
|
97871
|
+
return new Request(requestUrl(request, host), {
|
|
97872
|
+
method,
|
|
97873
|
+
headers: requestHeaders(request),
|
|
97874
|
+
body: bodyAllowed ? await readRequestBody(request) : undefined
|
|
97875
|
+
});
|
|
97876
|
+
}
|
|
97877
|
+
async function writeWebResponse(response, target) {
|
|
97878
|
+
target.statusCode = response.status;
|
|
97879
|
+
response.headers.forEach((value, key) => {
|
|
97880
|
+
target.setHeader(key, value);
|
|
97881
|
+
});
|
|
97882
|
+
if (!response.body) {
|
|
97883
|
+
target.end();
|
|
97884
|
+
return;
|
|
97885
|
+
}
|
|
97886
|
+
target.end(Buffer2.from(await response.arrayBuffer()));
|
|
97887
|
+
}
|
|
97888
|
+
function closeServer(server, force) {
|
|
97889
|
+
return new Promise((resolve, reject) => {
|
|
97890
|
+
let settled = false;
|
|
97891
|
+
let timeout;
|
|
97892
|
+
const finish = (error) => {
|
|
97893
|
+
if (settled) {
|
|
97894
|
+
return;
|
|
97895
|
+
}
|
|
97896
|
+
settled = true;
|
|
97897
|
+
if (timeout) {
|
|
97898
|
+
clearTimeout(timeout);
|
|
97899
|
+
}
|
|
97900
|
+
if (error) {
|
|
97901
|
+
reject(error);
|
|
97902
|
+
} else {
|
|
97903
|
+
resolve();
|
|
97904
|
+
}
|
|
97905
|
+
};
|
|
97906
|
+
if (!server.listening) {
|
|
97907
|
+
if (force) {
|
|
97908
|
+
server.closeAllConnections?.();
|
|
97909
|
+
}
|
|
97910
|
+
finish();
|
|
97911
|
+
return;
|
|
97912
|
+
}
|
|
97913
|
+
server.close((error) => {
|
|
97914
|
+
if (error?.code === "ERR_SERVER_NOT_RUNNING") {
|
|
97915
|
+
finish();
|
|
97916
|
+
return;
|
|
97917
|
+
}
|
|
97918
|
+
if (error) {
|
|
97919
|
+
finish(error);
|
|
97920
|
+
} else {
|
|
97921
|
+
finish();
|
|
97922
|
+
}
|
|
97923
|
+
});
|
|
97924
|
+
if (force) {
|
|
97925
|
+
server.closeAllConnections?.();
|
|
97926
|
+
server.closeIdleConnections?.();
|
|
97927
|
+
timeout = setTimeout(() => finish(), FORCE_CLOSE_TIMEOUT_MS);
|
|
97928
|
+
timeout.unref?.();
|
|
97929
|
+
}
|
|
97930
|
+
});
|
|
97931
|
+
}
|
|
97932
|
+
async function startApiHttpListener(params) {
|
|
97933
|
+
const server = createServer(async (request, response) => {
|
|
97934
|
+
try {
|
|
97935
|
+
await writeWebResponse(await params.handle(await toWebRequest(request, params.host), request.socket.remoteAddress), response);
|
|
97936
|
+
} catch (error) {
|
|
97937
|
+
response.statusCode = 500;
|
|
97938
|
+
response.setHeader("content-type", "application/json");
|
|
97939
|
+
response.end(JSON.stringify({
|
|
97940
|
+
error: "api_listener_failed",
|
|
97941
|
+
detail: error instanceof Error ? error.message : String(error)
|
|
97942
|
+
}, null, 2));
|
|
97943
|
+
}
|
|
97944
|
+
});
|
|
97945
|
+
await new Promise((resolve, reject) => {
|
|
97946
|
+
server.once("error", reject);
|
|
97947
|
+
server.listen(params.port, params.host, () => {
|
|
97948
|
+
server.off("error", reject);
|
|
97949
|
+
resolve();
|
|
97950
|
+
});
|
|
97951
|
+
});
|
|
97952
|
+
const address = server.address();
|
|
97953
|
+
return {
|
|
97954
|
+
host: params.host,
|
|
97955
|
+
port: typeof address === "object" && address ? address.port : params.port,
|
|
97956
|
+
stop: async (force = false) => {
|
|
97957
|
+
await closeServer(server, force);
|
|
97958
|
+
}
|
|
97959
|
+
};
|
|
97960
|
+
}
|
|
97961
|
+
|
|
97831
97962
|
// src/channels/api/stop.ts
|
|
97832
97963
|
async function authorizeStopRequest(params) {
|
|
97833
97964
|
const rawBody = await params.request.text();
|
|
@@ -97993,14 +98124,14 @@ class ApiChannelService {
|
|
|
97993
98124
|
}
|
|
97994
98125
|
async start() {
|
|
97995
98126
|
const providerConfig = resolveApiProviderConfig(this.dependencies.loadedConfig.raw.bots.api);
|
|
97996
|
-
this.server =
|
|
97997
|
-
|
|
98127
|
+
this.server = await startApiHttpListener({
|
|
98128
|
+
host: providerConfig.defaults.listener.host,
|
|
97998
98129
|
port: providerConfig.defaults.listener.port,
|
|
97999
|
-
|
|
98130
|
+
handle: (request, remoteAddress) => this.handleRequest(request, remoteAddress)
|
|
98000
98131
|
});
|
|
98001
98132
|
}
|
|
98002
98133
|
async stop() {
|
|
98003
|
-
this.server?.stop(true);
|
|
98134
|
+
await this.server?.stop(true);
|
|
98004
98135
|
this.server = undefined;
|
|
98005
98136
|
}
|
|
98006
98137
|
async handleRequest(request, remoteAddress) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clisbot",
|
|
3
|
-
"version": "0.1.54-beta.
|
|
3
|
+
"version": "0.1.54-beta.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Chat surfaces for durable AI coding agents running in tmux",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"typecheck": "bunx tsc --noEmit",
|
|
41
41
|
"test": "env -u SLACK_APP_TOKEN -u SLACK_BOT_TOKEN -u TELEGRAM_BOT_TOKEN -u TELEGRAM_CONTROL_BOT_TOKEN -u TELEGRAM_DEV_BOT_TOKEN bun test --preload ./test/preload-env.ts",
|
|
42
42
|
"prepack": "bun run build",
|
|
43
|
-
"check": "bun run typecheck && bun test"
|
|
43
|
+
"check": "bun run typecheck && bun test --timeout 30000"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@slack/bolt": "^4.6.0",
|