@base44-preview/cli 0.0.47-pr.437.84c5dd7 → 0.0.47-pr.439.4472b1f
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/index.js +3948 -307
- package/dist/cli/index.js.map +85 -10
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -179494,19 +179494,19 @@ var require_base64id = __commonJS((exports, module) => {
|
|
|
179494
179494
|
/*!
|
|
179495
179495
|
* base64id v0.1.0
|
|
179496
179496
|
*/
|
|
179497
|
-
var
|
|
179497
|
+
var crypto2 = __require("crypto");
|
|
179498
179498
|
var Base64Id = function() {};
|
|
179499
179499
|
Base64Id.prototype.getRandomBytes = function(bytes) {
|
|
179500
179500
|
var BUFFER_SIZE = 4096;
|
|
179501
179501
|
var self2 = this;
|
|
179502
179502
|
bytes = bytes || 12;
|
|
179503
179503
|
if (bytes > BUFFER_SIZE) {
|
|
179504
|
-
return
|
|
179504
|
+
return crypto2.randomBytes(bytes);
|
|
179505
179505
|
}
|
|
179506
179506
|
var bytesInBuffer = parseInt(BUFFER_SIZE / bytes);
|
|
179507
179507
|
var threshold = parseInt(bytesInBuffer * 0.85);
|
|
179508
179508
|
if (!threshold) {
|
|
179509
|
-
return
|
|
179509
|
+
return crypto2.randomBytes(bytes);
|
|
179510
179510
|
}
|
|
179511
179511
|
if (this.bytesBufferIndex == null) {
|
|
179512
179512
|
this.bytesBufferIndex = -1;
|
|
@@ -179518,14 +179518,14 @@ var require_base64id = __commonJS((exports, module) => {
|
|
|
179518
179518
|
if (this.bytesBufferIndex == -1 || this.bytesBufferIndex > threshold) {
|
|
179519
179519
|
if (!this.isGeneratingBytes) {
|
|
179520
179520
|
this.isGeneratingBytes = true;
|
|
179521
|
-
|
|
179521
|
+
crypto2.randomBytes(BUFFER_SIZE, function(err, bytes2) {
|
|
179522
179522
|
self2.bytesBuffer = bytes2;
|
|
179523
179523
|
self2.bytesBufferIndex = 0;
|
|
179524
179524
|
self2.isGeneratingBytes = false;
|
|
179525
179525
|
});
|
|
179526
179526
|
}
|
|
179527
179527
|
if (this.bytesBufferIndex == -1) {
|
|
179528
|
-
return
|
|
179528
|
+
return crypto2.randomBytes(bytes);
|
|
179529
179529
|
}
|
|
179530
179530
|
}
|
|
179531
179531
|
var result = this.bytesBuffer.slice(bytes * this.bytesBufferIndex, bytes * (this.bytesBufferIndex + 1));
|
|
@@ -179539,7 +179539,7 @@ var require_base64id = __commonJS((exports, module) => {
|
|
|
179539
179539
|
}
|
|
179540
179540
|
this.sequenceNumber = this.sequenceNumber + 1 | 0;
|
|
179541
179541
|
rand.writeInt32BE(this.sequenceNumber, 11);
|
|
179542
|
-
if (
|
|
179542
|
+
if (crypto2.randomBytes) {
|
|
179543
179543
|
this.getRandomBytes(12).copy(rand);
|
|
179544
179544
|
} else {
|
|
179545
179545
|
[0, 4, 8].forEach(function(i5) {
|
|
@@ -197595,193 +197595,3738 @@ var require_dist4 = __commonJS((exports, module) => {
|
|
|
197595
197595
|
}
|
|
197596
197596
|
});
|
|
197597
197597
|
}
|
|
197598
|
-
serve(req, res) {
|
|
197599
|
-
const filename = req.url.replace(this._path, "").replace(/\?.*$/, "");
|
|
197600
|
-
const isMap = dotMapRegex.test(filename);
|
|
197601
|
-
const type = isMap ? "map" : "source";
|
|
197602
|
-
const expectedEtag = '"' + clientVersion + '"';
|
|
197603
|
-
const weakEtag = "W/" + expectedEtag;
|
|
197604
|
-
const etag = req.headers["if-none-match"];
|
|
197605
|
-
if (etag) {
|
|
197606
|
-
if (expectedEtag === etag || weakEtag === etag) {
|
|
197607
|
-
debug("serve client %s 304", type);
|
|
197608
|
-
res.writeHead(304);
|
|
197609
|
-
res.end();
|
|
197610
|
-
return;
|
|
197611
|
-
}
|
|
197612
|
-
}
|
|
197613
|
-
debug("serve client %s", type);
|
|
197614
|
-
res.setHeader("Cache-Control", "public, max-age=0");
|
|
197615
|
-
res.setHeader("Content-Type", "application/" + (isMap ? "json" : "javascript") + "; charset=utf-8");
|
|
197616
|
-
res.setHeader("ETag", expectedEtag);
|
|
197617
|
-
Server.sendFile(filename, req, res);
|
|
197598
|
+
serve(req, res) {
|
|
197599
|
+
const filename = req.url.replace(this._path, "").replace(/\?.*$/, "");
|
|
197600
|
+
const isMap = dotMapRegex.test(filename);
|
|
197601
|
+
const type = isMap ? "map" : "source";
|
|
197602
|
+
const expectedEtag = '"' + clientVersion + '"';
|
|
197603
|
+
const weakEtag = "W/" + expectedEtag;
|
|
197604
|
+
const etag = req.headers["if-none-match"];
|
|
197605
|
+
if (etag) {
|
|
197606
|
+
if (expectedEtag === etag || weakEtag === etag) {
|
|
197607
|
+
debug("serve client %s 304", type);
|
|
197608
|
+
res.writeHead(304);
|
|
197609
|
+
res.end();
|
|
197610
|
+
return;
|
|
197611
|
+
}
|
|
197612
|
+
}
|
|
197613
|
+
debug("serve client %s", type);
|
|
197614
|
+
res.setHeader("Cache-Control", "public, max-age=0");
|
|
197615
|
+
res.setHeader("Content-Type", "application/" + (isMap ? "json" : "javascript") + "; charset=utf-8");
|
|
197616
|
+
res.setHeader("ETag", expectedEtag);
|
|
197617
|
+
Server.sendFile(filename, req, res);
|
|
197618
|
+
}
|
|
197619
|
+
static sendFile(filename, req, res) {
|
|
197620
|
+
const readStream = (0, fs_1.createReadStream)(path18.join(__dirname, "../client-dist/", filename));
|
|
197621
|
+
const encoding = accepts(req).encodings(["br", "gzip", "deflate"]);
|
|
197622
|
+
const onError = (err) => {
|
|
197623
|
+
if (err) {
|
|
197624
|
+
res.end();
|
|
197625
|
+
}
|
|
197626
|
+
};
|
|
197627
|
+
switch (encoding) {
|
|
197628
|
+
case "br":
|
|
197629
|
+
res.writeHead(200, { "content-encoding": "br" });
|
|
197630
|
+
(0, stream_1.pipeline)(readStream, (0, zlib_1.createBrotliCompress)(), res, onError);
|
|
197631
|
+
break;
|
|
197632
|
+
case "gzip":
|
|
197633
|
+
res.writeHead(200, { "content-encoding": "gzip" });
|
|
197634
|
+
(0, stream_1.pipeline)(readStream, (0, zlib_1.createGzip)(), res, onError);
|
|
197635
|
+
break;
|
|
197636
|
+
case "deflate":
|
|
197637
|
+
res.writeHead(200, { "content-encoding": "deflate" });
|
|
197638
|
+
(0, stream_1.pipeline)(readStream, (0, zlib_1.createDeflate)(), res, onError);
|
|
197639
|
+
break;
|
|
197640
|
+
default:
|
|
197641
|
+
res.writeHead(200);
|
|
197642
|
+
(0, stream_1.pipeline)(readStream, res, onError);
|
|
197643
|
+
}
|
|
197644
|
+
}
|
|
197645
|
+
bind(engine) {
|
|
197646
|
+
this.engine = engine;
|
|
197647
|
+
this.engine.on("connection", this.onconnection.bind(this));
|
|
197648
|
+
return this;
|
|
197649
|
+
}
|
|
197650
|
+
onconnection(conn) {
|
|
197651
|
+
debug("incoming connection with id %s", conn.id);
|
|
197652
|
+
const client = new client_1.Client(this, conn);
|
|
197653
|
+
if (conn.protocol === 3) {
|
|
197654
|
+
client.connect("/");
|
|
197655
|
+
}
|
|
197656
|
+
return this;
|
|
197657
|
+
}
|
|
197658
|
+
of(name2, fn9) {
|
|
197659
|
+
if (typeof name2 === "function" || name2 instanceof RegExp) {
|
|
197660
|
+
const parentNsp = new parent_namespace_1.ParentNamespace(this);
|
|
197661
|
+
debug("initializing parent namespace %s", parentNsp.name);
|
|
197662
|
+
if (typeof name2 === "function") {
|
|
197663
|
+
this.parentNsps.set(name2, parentNsp);
|
|
197664
|
+
} else {
|
|
197665
|
+
this.parentNsps.set((nsp2, conn, next) => next(null, name2.test(nsp2)), parentNsp);
|
|
197666
|
+
this.parentNamespacesFromRegExp.set(name2, parentNsp);
|
|
197667
|
+
}
|
|
197668
|
+
if (fn9) {
|
|
197669
|
+
parentNsp.on("connect", fn9);
|
|
197670
|
+
}
|
|
197671
|
+
return parentNsp;
|
|
197672
|
+
}
|
|
197673
|
+
if (String(name2)[0] !== "/")
|
|
197674
|
+
name2 = "/" + name2;
|
|
197675
|
+
let nsp = this._nsps.get(name2);
|
|
197676
|
+
if (!nsp) {
|
|
197677
|
+
for (const [regex, parentNamespace] of this.parentNamespacesFromRegExp) {
|
|
197678
|
+
if (regex.test(name2)) {
|
|
197679
|
+
debug("attaching namespace %s to parent namespace %s", name2, regex);
|
|
197680
|
+
return parentNamespace.createChild(name2);
|
|
197681
|
+
}
|
|
197682
|
+
}
|
|
197683
|
+
debug("initializing namespace %s", name2);
|
|
197684
|
+
nsp = new namespace_1.Namespace(this, name2);
|
|
197685
|
+
this._nsps.set(name2, nsp);
|
|
197686
|
+
if (name2 !== "/") {
|
|
197687
|
+
this.sockets.emitReserved("new_namespace", nsp);
|
|
197688
|
+
}
|
|
197689
|
+
}
|
|
197690
|
+
if (fn9)
|
|
197691
|
+
nsp.on("connect", fn9);
|
|
197692
|
+
return nsp;
|
|
197693
|
+
}
|
|
197694
|
+
async close(fn9) {
|
|
197695
|
+
await Promise.allSettled([...this._nsps.values()].map(async (nsp) => {
|
|
197696
|
+
nsp.sockets.forEach((socket) => {
|
|
197697
|
+
socket._onclose("server shutting down");
|
|
197698
|
+
});
|
|
197699
|
+
await nsp.adapter.close();
|
|
197700
|
+
}));
|
|
197701
|
+
this.engine.close();
|
|
197702
|
+
(0, uws_1.restoreAdapter)();
|
|
197703
|
+
if (this.httpServer) {
|
|
197704
|
+
return new Promise((resolve6) => {
|
|
197705
|
+
this.httpServer.close((err) => {
|
|
197706
|
+
fn9 && fn9(err);
|
|
197707
|
+
if (err) {
|
|
197708
|
+
debug("server was not running");
|
|
197709
|
+
}
|
|
197710
|
+
resolve6();
|
|
197711
|
+
});
|
|
197712
|
+
});
|
|
197713
|
+
} else {
|
|
197714
|
+
fn9 && fn9();
|
|
197715
|
+
}
|
|
197716
|
+
}
|
|
197717
|
+
use(fn9) {
|
|
197718
|
+
this.sockets.use(fn9);
|
|
197719
|
+
return this;
|
|
197720
|
+
}
|
|
197721
|
+
to(room) {
|
|
197722
|
+
return this.sockets.to(room);
|
|
197723
|
+
}
|
|
197724
|
+
in(room) {
|
|
197725
|
+
return this.sockets.in(room);
|
|
197726
|
+
}
|
|
197727
|
+
except(room) {
|
|
197728
|
+
return this.sockets.except(room);
|
|
197729
|
+
}
|
|
197730
|
+
send(...args) {
|
|
197731
|
+
this.sockets.emit("message", ...args);
|
|
197732
|
+
return this;
|
|
197733
|
+
}
|
|
197734
|
+
write(...args) {
|
|
197735
|
+
this.sockets.emit("message", ...args);
|
|
197736
|
+
return this;
|
|
197737
|
+
}
|
|
197738
|
+
serverSideEmit(ev2, ...args) {
|
|
197739
|
+
return this.sockets.serverSideEmit(ev2, ...args);
|
|
197740
|
+
}
|
|
197741
|
+
serverSideEmitWithAck(ev2, ...args) {
|
|
197742
|
+
return this.sockets.serverSideEmitWithAck(ev2, ...args);
|
|
197743
|
+
}
|
|
197744
|
+
allSockets() {
|
|
197745
|
+
return this.sockets.allSockets();
|
|
197746
|
+
}
|
|
197747
|
+
compress(compress) {
|
|
197748
|
+
return this.sockets.compress(compress);
|
|
197749
|
+
}
|
|
197750
|
+
get volatile() {
|
|
197751
|
+
return this.sockets.volatile;
|
|
197752
|
+
}
|
|
197753
|
+
get local() {
|
|
197754
|
+
return this.sockets.local;
|
|
197755
|
+
}
|
|
197756
|
+
timeout(timeout3) {
|
|
197757
|
+
return this.sockets.timeout(timeout3);
|
|
197758
|
+
}
|
|
197759
|
+
fetchSockets() {
|
|
197760
|
+
return this.sockets.fetchSockets();
|
|
197761
|
+
}
|
|
197762
|
+
socketsJoin(room) {
|
|
197763
|
+
return this.sockets.socketsJoin(room);
|
|
197764
|
+
}
|
|
197765
|
+
socketsLeave(room) {
|
|
197766
|
+
return this.sockets.socketsLeave(room);
|
|
197767
|
+
}
|
|
197768
|
+
disconnectSockets(close = false) {
|
|
197769
|
+
return this.sockets.disconnectSockets(close);
|
|
197770
|
+
}
|
|
197771
|
+
}
|
|
197772
|
+
exports.Server = Server;
|
|
197773
|
+
var emitterMethods = Object.keys(events_1.EventEmitter.prototype).filter(function(key2) {
|
|
197774
|
+
return typeof events_1.EventEmitter.prototype[key2] === "function";
|
|
197775
|
+
});
|
|
197776
|
+
emitterMethods.forEach(function(fn9) {
|
|
197777
|
+
Server.prototype[fn9] = function() {
|
|
197778
|
+
return this.sockets[fn9].apply(this.sockets, arguments);
|
|
197779
|
+
};
|
|
197780
|
+
});
|
|
197781
|
+
module.exports = (srv, opts) => new Server(srv, opts);
|
|
197782
|
+
module.exports.Server = Server;
|
|
197783
|
+
module.exports.Namespace = namespace_1.Namespace;
|
|
197784
|
+
module.exports.Socket = socket_1.Socket;
|
|
197785
|
+
});
|
|
197786
|
+
|
|
197787
|
+
// ../../node_modules/safe-buffer/index.js
|
|
197788
|
+
var require_safe_buffer = __commonJS((exports, module) => {
|
|
197789
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
197790
|
+
var buffer2 = __require("buffer");
|
|
197791
|
+
var Buffer7 = buffer2.Buffer;
|
|
197792
|
+
function copyProps(src, dst) {
|
|
197793
|
+
for (var key2 in src) {
|
|
197794
|
+
dst[key2] = src[key2];
|
|
197795
|
+
}
|
|
197796
|
+
}
|
|
197797
|
+
if (Buffer7.from && Buffer7.alloc && Buffer7.allocUnsafe && Buffer7.allocUnsafeSlow) {
|
|
197798
|
+
module.exports = buffer2;
|
|
197799
|
+
} else {
|
|
197800
|
+
copyProps(buffer2, exports);
|
|
197801
|
+
exports.Buffer = SafeBuffer;
|
|
197802
|
+
}
|
|
197803
|
+
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
197804
|
+
return Buffer7(arg, encodingOrOffset, length);
|
|
197805
|
+
}
|
|
197806
|
+
SafeBuffer.prototype = Object.create(Buffer7.prototype);
|
|
197807
|
+
copyProps(Buffer7, SafeBuffer);
|
|
197808
|
+
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
197809
|
+
if (typeof arg === "number") {
|
|
197810
|
+
throw new TypeError("Argument must not be a number");
|
|
197811
|
+
}
|
|
197812
|
+
return Buffer7(arg, encodingOrOffset, length);
|
|
197813
|
+
};
|
|
197814
|
+
SafeBuffer.alloc = function(size, fill2, encoding) {
|
|
197815
|
+
if (typeof size !== "number") {
|
|
197816
|
+
throw new TypeError("Argument must be a number");
|
|
197817
|
+
}
|
|
197818
|
+
var buf = Buffer7(size);
|
|
197819
|
+
if (fill2 !== undefined) {
|
|
197820
|
+
if (typeof encoding === "string") {
|
|
197821
|
+
buf.fill(fill2, encoding);
|
|
197822
|
+
} else {
|
|
197823
|
+
buf.fill(fill2);
|
|
197824
|
+
}
|
|
197825
|
+
} else {
|
|
197826
|
+
buf.fill(0);
|
|
197827
|
+
}
|
|
197828
|
+
return buf;
|
|
197829
|
+
};
|
|
197830
|
+
SafeBuffer.allocUnsafe = function(size) {
|
|
197831
|
+
if (typeof size !== "number") {
|
|
197832
|
+
throw new TypeError("Argument must be a number");
|
|
197833
|
+
}
|
|
197834
|
+
return Buffer7(size);
|
|
197835
|
+
};
|
|
197836
|
+
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
197837
|
+
if (typeof size !== "number") {
|
|
197838
|
+
throw new TypeError("Argument must be a number");
|
|
197839
|
+
}
|
|
197840
|
+
return buffer2.SlowBuffer(size);
|
|
197841
|
+
};
|
|
197842
|
+
});
|
|
197843
|
+
|
|
197844
|
+
// ../../node_modules/jws/lib/data-stream.js
|
|
197845
|
+
var require_data_stream = __commonJS((exports, module) => {
|
|
197846
|
+
var Buffer7 = require_safe_buffer().Buffer;
|
|
197847
|
+
var Stream2 = __require("stream");
|
|
197848
|
+
var util2 = __require("util");
|
|
197849
|
+
function DataStream(data) {
|
|
197850
|
+
this.buffer = null;
|
|
197851
|
+
this.writable = true;
|
|
197852
|
+
this.readable = true;
|
|
197853
|
+
if (!data) {
|
|
197854
|
+
this.buffer = Buffer7.alloc(0);
|
|
197855
|
+
return this;
|
|
197856
|
+
}
|
|
197857
|
+
if (typeof data.pipe === "function") {
|
|
197858
|
+
this.buffer = Buffer7.alloc(0);
|
|
197859
|
+
data.pipe(this);
|
|
197860
|
+
return this;
|
|
197861
|
+
}
|
|
197862
|
+
if (data.length || typeof data === "object") {
|
|
197863
|
+
this.buffer = data;
|
|
197864
|
+
this.writable = false;
|
|
197865
|
+
process.nextTick(function() {
|
|
197866
|
+
this.emit("end", data);
|
|
197867
|
+
this.readable = false;
|
|
197868
|
+
this.emit("close");
|
|
197869
|
+
}.bind(this));
|
|
197870
|
+
return this;
|
|
197871
|
+
}
|
|
197872
|
+
throw new TypeError("Unexpected data type (" + typeof data + ")");
|
|
197873
|
+
}
|
|
197874
|
+
util2.inherits(DataStream, Stream2);
|
|
197875
|
+
DataStream.prototype.write = function write(data) {
|
|
197876
|
+
this.buffer = Buffer7.concat([this.buffer, Buffer7.from(data)]);
|
|
197877
|
+
this.emit("data", data);
|
|
197878
|
+
};
|
|
197879
|
+
DataStream.prototype.end = function end(data) {
|
|
197880
|
+
if (data)
|
|
197881
|
+
this.write(data);
|
|
197882
|
+
this.emit("end", data);
|
|
197883
|
+
this.emit("close");
|
|
197884
|
+
this.writable = false;
|
|
197885
|
+
this.readable = false;
|
|
197886
|
+
};
|
|
197887
|
+
module.exports = DataStream;
|
|
197888
|
+
});
|
|
197889
|
+
|
|
197890
|
+
// ../../node_modules/ecdsa-sig-formatter/src/param-bytes-for-alg.js
|
|
197891
|
+
var require_param_bytes_for_alg = __commonJS((exports, module) => {
|
|
197892
|
+
function getParamSize(keySize) {
|
|
197893
|
+
var result = (keySize / 8 | 0) + (keySize % 8 === 0 ? 0 : 1);
|
|
197894
|
+
return result;
|
|
197895
|
+
}
|
|
197896
|
+
var paramBytesForAlg = {
|
|
197897
|
+
ES256: getParamSize(256),
|
|
197898
|
+
ES384: getParamSize(384),
|
|
197899
|
+
ES512: getParamSize(521)
|
|
197900
|
+
};
|
|
197901
|
+
function getParamBytesForAlg(alg) {
|
|
197902
|
+
var paramBytes = paramBytesForAlg[alg];
|
|
197903
|
+
if (paramBytes) {
|
|
197904
|
+
return paramBytes;
|
|
197905
|
+
}
|
|
197906
|
+
throw new Error('Unknown algorithm "' + alg + '"');
|
|
197907
|
+
}
|
|
197908
|
+
module.exports = getParamBytesForAlg;
|
|
197909
|
+
});
|
|
197910
|
+
|
|
197911
|
+
// ../../node_modules/ecdsa-sig-formatter/src/ecdsa-sig-formatter.js
|
|
197912
|
+
var require_ecdsa_sig_formatter = __commonJS((exports, module) => {
|
|
197913
|
+
var Buffer7 = require_safe_buffer().Buffer;
|
|
197914
|
+
var getParamBytesForAlg = require_param_bytes_for_alg();
|
|
197915
|
+
var MAX_OCTET = 128;
|
|
197916
|
+
var CLASS_UNIVERSAL = 0;
|
|
197917
|
+
var PRIMITIVE_BIT = 32;
|
|
197918
|
+
var TAG_SEQ = 16;
|
|
197919
|
+
var TAG_INT = 2;
|
|
197920
|
+
var ENCODED_TAG_SEQ = TAG_SEQ | PRIMITIVE_BIT | CLASS_UNIVERSAL << 6;
|
|
197921
|
+
var ENCODED_TAG_INT = TAG_INT | CLASS_UNIVERSAL << 6;
|
|
197922
|
+
function base64Url(base643) {
|
|
197923
|
+
return base643.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
197924
|
+
}
|
|
197925
|
+
function signatureAsBuffer(signature) {
|
|
197926
|
+
if (Buffer7.isBuffer(signature)) {
|
|
197927
|
+
return signature;
|
|
197928
|
+
} else if (typeof signature === "string") {
|
|
197929
|
+
return Buffer7.from(signature, "base64");
|
|
197930
|
+
}
|
|
197931
|
+
throw new TypeError("ECDSA signature must be a Base64 string or a Buffer");
|
|
197932
|
+
}
|
|
197933
|
+
function derToJose(signature, alg) {
|
|
197934
|
+
signature = signatureAsBuffer(signature);
|
|
197935
|
+
var paramBytes = getParamBytesForAlg(alg);
|
|
197936
|
+
var maxEncodedParamLength = paramBytes + 1;
|
|
197937
|
+
var inputLength = signature.length;
|
|
197938
|
+
var offset = 0;
|
|
197939
|
+
if (signature[offset++] !== ENCODED_TAG_SEQ) {
|
|
197940
|
+
throw new Error('Could not find expected "seq"');
|
|
197941
|
+
}
|
|
197942
|
+
var seqLength = signature[offset++];
|
|
197943
|
+
if (seqLength === (MAX_OCTET | 1)) {
|
|
197944
|
+
seqLength = signature[offset++];
|
|
197945
|
+
}
|
|
197946
|
+
if (inputLength - offset < seqLength) {
|
|
197947
|
+
throw new Error('"seq" specified length of "' + seqLength + '", only "' + (inputLength - offset) + '" remaining');
|
|
197948
|
+
}
|
|
197949
|
+
if (signature[offset++] !== ENCODED_TAG_INT) {
|
|
197950
|
+
throw new Error('Could not find expected "int" for "r"');
|
|
197951
|
+
}
|
|
197952
|
+
var rLength = signature[offset++];
|
|
197953
|
+
if (inputLength - offset - 2 < rLength) {
|
|
197954
|
+
throw new Error('"r" specified length of "' + rLength + '", only "' + (inputLength - offset - 2) + '" available');
|
|
197955
|
+
}
|
|
197956
|
+
if (maxEncodedParamLength < rLength) {
|
|
197957
|
+
throw new Error('"r" specified length of "' + rLength + '", max of "' + maxEncodedParamLength + '" is acceptable');
|
|
197958
|
+
}
|
|
197959
|
+
var rOffset = offset;
|
|
197960
|
+
offset += rLength;
|
|
197961
|
+
if (signature[offset++] !== ENCODED_TAG_INT) {
|
|
197962
|
+
throw new Error('Could not find expected "int" for "s"');
|
|
197963
|
+
}
|
|
197964
|
+
var sLength = signature[offset++];
|
|
197965
|
+
if (inputLength - offset !== sLength) {
|
|
197966
|
+
throw new Error('"s" specified length of "' + sLength + '", expected "' + (inputLength - offset) + '"');
|
|
197967
|
+
}
|
|
197968
|
+
if (maxEncodedParamLength < sLength) {
|
|
197969
|
+
throw new Error('"s" specified length of "' + sLength + '", max of "' + maxEncodedParamLength + '" is acceptable');
|
|
197970
|
+
}
|
|
197971
|
+
var sOffset = offset;
|
|
197972
|
+
offset += sLength;
|
|
197973
|
+
if (offset !== inputLength) {
|
|
197974
|
+
throw new Error('Expected to consume entire buffer, but "' + (inputLength - offset) + '" bytes remain');
|
|
197975
|
+
}
|
|
197976
|
+
var rPadding = paramBytes - rLength, sPadding = paramBytes - sLength;
|
|
197977
|
+
var dst = Buffer7.allocUnsafe(rPadding + rLength + sPadding + sLength);
|
|
197978
|
+
for (offset = 0;offset < rPadding; ++offset) {
|
|
197979
|
+
dst[offset] = 0;
|
|
197980
|
+
}
|
|
197981
|
+
signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength);
|
|
197982
|
+
offset = paramBytes;
|
|
197983
|
+
for (var o5 = offset;offset < o5 + sPadding; ++offset) {
|
|
197984
|
+
dst[offset] = 0;
|
|
197985
|
+
}
|
|
197986
|
+
signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength);
|
|
197987
|
+
dst = dst.toString("base64");
|
|
197988
|
+
dst = base64Url(dst);
|
|
197989
|
+
return dst;
|
|
197990
|
+
}
|
|
197991
|
+
function countPadding(buf, start, stop2) {
|
|
197992
|
+
var padding = 0;
|
|
197993
|
+
while (start + padding < stop2 && buf[start + padding] === 0) {
|
|
197994
|
+
++padding;
|
|
197995
|
+
}
|
|
197996
|
+
var needsSign = buf[start + padding] >= MAX_OCTET;
|
|
197997
|
+
if (needsSign) {
|
|
197998
|
+
--padding;
|
|
197999
|
+
}
|
|
198000
|
+
return padding;
|
|
198001
|
+
}
|
|
198002
|
+
function joseToDer(signature, alg) {
|
|
198003
|
+
signature = signatureAsBuffer(signature);
|
|
198004
|
+
var paramBytes = getParamBytesForAlg(alg);
|
|
198005
|
+
var signatureBytes = signature.length;
|
|
198006
|
+
if (signatureBytes !== paramBytes * 2) {
|
|
198007
|
+
throw new TypeError('"' + alg + '" signatures must be "' + paramBytes * 2 + '" bytes, saw "' + signatureBytes + '"');
|
|
198008
|
+
}
|
|
198009
|
+
var rPadding = countPadding(signature, 0, paramBytes);
|
|
198010
|
+
var sPadding = countPadding(signature, paramBytes, signature.length);
|
|
198011
|
+
var rLength = paramBytes - rPadding;
|
|
198012
|
+
var sLength = paramBytes - sPadding;
|
|
198013
|
+
var rsBytes = 1 + 1 + rLength + 1 + 1 + sLength;
|
|
198014
|
+
var shortLength = rsBytes < MAX_OCTET;
|
|
198015
|
+
var dst = Buffer7.allocUnsafe((shortLength ? 2 : 3) + rsBytes);
|
|
198016
|
+
var offset = 0;
|
|
198017
|
+
dst[offset++] = ENCODED_TAG_SEQ;
|
|
198018
|
+
if (shortLength) {
|
|
198019
|
+
dst[offset++] = rsBytes;
|
|
198020
|
+
} else {
|
|
198021
|
+
dst[offset++] = MAX_OCTET | 1;
|
|
198022
|
+
dst[offset++] = rsBytes & 255;
|
|
198023
|
+
}
|
|
198024
|
+
dst[offset++] = ENCODED_TAG_INT;
|
|
198025
|
+
dst[offset++] = rLength;
|
|
198026
|
+
if (rPadding < 0) {
|
|
198027
|
+
dst[offset++] = 0;
|
|
198028
|
+
offset += signature.copy(dst, offset, 0, paramBytes);
|
|
198029
|
+
} else {
|
|
198030
|
+
offset += signature.copy(dst, offset, rPadding, paramBytes);
|
|
198031
|
+
}
|
|
198032
|
+
dst[offset++] = ENCODED_TAG_INT;
|
|
198033
|
+
dst[offset++] = sLength;
|
|
198034
|
+
if (sPadding < 0) {
|
|
198035
|
+
dst[offset++] = 0;
|
|
198036
|
+
signature.copy(dst, offset, paramBytes);
|
|
198037
|
+
} else {
|
|
198038
|
+
signature.copy(dst, offset, paramBytes + sPadding);
|
|
198039
|
+
}
|
|
198040
|
+
return dst;
|
|
198041
|
+
}
|
|
198042
|
+
module.exports = {
|
|
198043
|
+
derToJose,
|
|
198044
|
+
joseToDer
|
|
198045
|
+
};
|
|
198046
|
+
});
|
|
198047
|
+
|
|
198048
|
+
// ../../node_modules/buffer-equal-constant-time/index.js
|
|
198049
|
+
var require_buffer_equal_constant_time = __commonJS((exports, module) => {
|
|
198050
|
+
var Buffer7 = __require("buffer").Buffer;
|
|
198051
|
+
var SlowBuffer = __require("buffer").SlowBuffer;
|
|
198052
|
+
module.exports = bufferEq;
|
|
198053
|
+
function bufferEq(a5, b7) {
|
|
198054
|
+
if (!Buffer7.isBuffer(a5) || !Buffer7.isBuffer(b7)) {
|
|
198055
|
+
return false;
|
|
198056
|
+
}
|
|
198057
|
+
if (a5.length !== b7.length) {
|
|
198058
|
+
return false;
|
|
198059
|
+
}
|
|
198060
|
+
var c8 = 0;
|
|
198061
|
+
for (var i5 = 0;i5 < a5.length; i5++) {
|
|
198062
|
+
c8 |= a5[i5] ^ b7[i5];
|
|
198063
|
+
}
|
|
198064
|
+
return c8 === 0;
|
|
198065
|
+
}
|
|
198066
|
+
bufferEq.install = function() {
|
|
198067
|
+
Buffer7.prototype.equal = SlowBuffer.prototype.equal = function equal2(that) {
|
|
198068
|
+
return bufferEq(this, that);
|
|
198069
|
+
};
|
|
198070
|
+
};
|
|
198071
|
+
var origBufEqual = Buffer7.prototype.equal;
|
|
198072
|
+
var origSlowBufEqual = SlowBuffer.prototype.equal;
|
|
198073
|
+
bufferEq.restore = function() {
|
|
198074
|
+
Buffer7.prototype.equal = origBufEqual;
|
|
198075
|
+
SlowBuffer.prototype.equal = origSlowBufEqual;
|
|
198076
|
+
};
|
|
198077
|
+
});
|
|
198078
|
+
|
|
198079
|
+
// ../../node_modules/jwa/index.js
|
|
198080
|
+
var require_jwa = __commonJS((exports, module) => {
|
|
198081
|
+
var Buffer7 = require_safe_buffer().Buffer;
|
|
198082
|
+
var crypto2 = __require("crypto");
|
|
198083
|
+
var formatEcdsa = require_ecdsa_sig_formatter();
|
|
198084
|
+
var util2 = __require("util");
|
|
198085
|
+
var MSG_INVALID_ALGORITHM = `"%s" is not a valid algorithm.
|
|
198086
|
+
Supported algorithms are:
|
|
198087
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`;
|
|
198088
|
+
var MSG_INVALID_SECRET = "secret must be a string or buffer";
|
|
198089
|
+
var MSG_INVALID_VERIFIER_KEY = "key must be a string or a buffer";
|
|
198090
|
+
var MSG_INVALID_SIGNER_KEY = "key must be a string, a buffer or an object";
|
|
198091
|
+
var supportsKeyObjects = typeof crypto2.createPublicKey === "function";
|
|
198092
|
+
if (supportsKeyObjects) {
|
|
198093
|
+
MSG_INVALID_VERIFIER_KEY += " or a KeyObject";
|
|
198094
|
+
MSG_INVALID_SECRET += "or a KeyObject";
|
|
198095
|
+
}
|
|
198096
|
+
function checkIsPublicKey(key2) {
|
|
198097
|
+
if (Buffer7.isBuffer(key2)) {
|
|
198098
|
+
return;
|
|
198099
|
+
}
|
|
198100
|
+
if (typeof key2 === "string") {
|
|
198101
|
+
return;
|
|
198102
|
+
}
|
|
198103
|
+
if (!supportsKeyObjects) {
|
|
198104
|
+
throw typeError(MSG_INVALID_VERIFIER_KEY);
|
|
198105
|
+
}
|
|
198106
|
+
if (typeof key2 !== "object") {
|
|
198107
|
+
throw typeError(MSG_INVALID_VERIFIER_KEY);
|
|
198108
|
+
}
|
|
198109
|
+
if (typeof key2.type !== "string") {
|
|
198110
|
+
throw typeError(MSG_INVALID_VERIFIER_KEY);
|
|
198111
|
+
}
|
|
198112
|
+
if (typeof key2.asymmetricKeyType !== "string") {
|
|
198113
|
+
throw typeError(MSG_INVALID_VERIFIER_KEY);
|
|
198114
|
+
}
|
|
198115
|
+
if (typeof key2.export !== "function") {
|
|
198116
|
+
throw typeError(MSG_INVALID_VERIFIER_KEY);
|
|
198117
|
+
}
|
|
198118
|
+
}
|
|
198119
|
+
function checkIsPrivateKey(key2) {
|
|
198120
|
+
if (Buffer7.isBuffer(key2)) {
|
|
198121
|
+
return;
|
|
198122
|
+
}
|
|
198123
|
+
if (typeof key2 === "string") {
|
|
198124
|
+
return;
|
|
198125
|
+
}
|
|
198126
|
+
if (typeof key2 === "object") {
|
|
198127
|
+
return;
|
|
198128
|
+
}
|
|
198129
|
+
throw typeError(MSG_INVALID_SIGNER_KEY);
|
|
198130
|
+
}
|
|
198131
|
+
function checkIsSecretKey(key2) {
|
|
198132
|
+
if (Buffer7.isBuffer(key2)) {
|
|
198133
|
+
return;
|
|
198134
|
+
}
|
|
198135
|
+
if (typeof key2 === "string") {
|
|
198136
|
+
return key2;
|
|
198137
|
+
}
|
|
198138
|
+
if (!supportsKeyObjects) {
|
|
198139
|
+
throw typeError(MSG_INVALID_SECRET);
|
|
198140
|
+
}
|
|
198141
|
+
if (typeof key2 !== "object") {
|
|
198142
|
+
throw typeError(MSG_INVALID_SECRET);
|
|
198143
|
+
}
|
|
198144
|
+
if (key2.type !== "secret") {
|
|
198145
|
+
throw typeError(MSG_INVALID_SECRET);
|
|
198146
|
+
}
|
|
198147
|
+
if (typeof key2.export !== "function") {
|
|
198148
|
+
throw typeError(MSG_INVALID_SECRET);
|
|
198149
|
+
}
|
|
198150
|
+
}
|
|
198151
|
+
function fromBase64(base643) {
|
|
198152
|
+
return base643.replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
198153
|
+
}
|
|
198154
|
+
function toBase64(base64url3) {
|
|
198155
|
+
base64url3 = base64url3.toString();
|
|
198156
|
+
var padding = 4 - base64url3.length % 4;
|
|
198157
|
+
if (padding !== 4) {
|
|
198158
|
+
for (var i5 = 0;i5 < padding; ++i5) {
|
|
198159
|
+
base64url3 += "=";
|
|
198160
|
+
}
|
|
198161
|
+
}
|
|
198162
|
+
return base64url3.replace(/\-/g, "+").replace(/_/g, "/");
|
|
198163
|
+
}
|
|
198164
|
+
function typeError(template2) {
|
|
198165
|
+
var args = [].slice.call(arguments, 1);
|
|
198166
|
+
var errMsg = util2.format.bind(util2, template2).apply(null, args);
|
|
198167
|
+
return new TypeError(errMsg);
|
|
198168
|
+
}
|
|
198169
|
+
function bufferOrString(obj) {
|
|
198170
|
+
return Buffer7.isBuffer(obj) || typeof obj === "string";
|
|
198171
|
+
}
|
|
198172
|
+
function normalizeInput(thing) {
|
|
198173
|
+
if (!bufferOrString(thing))
|
|
198174
|
+
thing = JSON.stringify(thing);
|
|
198175
|
+
return thing;
|
|
198176
|
+
}
|
|
198177
|
+
function createHmacSigner(bits) {
|
|
198178
|
+
return function sign2(thing, secret2) {
|
|
198179
|
+
checkIsSecretKey(secret2);
|
|
198180
|
+
thing = normalizeInput(thing);
|
|
198181
|
+
var hmac = crypto2.createHmac("sha" + bits, secret2);
|
|
198182
|
+
var sig = (hmac.update(thing), hmac.digest("base64"));
|
|
198183
|
+
return fromBase64(sig);
|
|
198184
|
+
};
|
|
198185
|
+
}
|
|
198186
|
+
var bufferEqual;
|
|
198187
|
+
var timingSafeEqual = "timingSafeEqual" in crypto2 ? function timingSafeEqual2(a5, b7) {
|
|
198188
|
+
if (a5.byteLength !== b7.byteLength) {
|
|
198189
|
+
return false;
|
|
198190
|
+
}
|
|
198191
|
+
return crypto2.timingSafeEqual(a5, b7);
|
|
198192
|
+
} : function timingSafeEqual2(a5, b7) {
|
|
198193
|
+
if (!bufferEqual) {
|
|
198194
|
+
bufferEqual = require_buffer_equal_constant_time();
|
|
198195
|
+
}
|
|
198196
|
+
return bufferEqual(a5, b7);
|
|
198197
|
+
};
|
|
198198
|
+
function createHmacVerifier(bits) {
|
|
198199
|
+
return function verify(thing, signature, secret2) {
|
|
198200
|
+
var computedSig = createHmacSigner(bits)(thing, secret2);
|
|
198201
|
+
return timingSafeEqual(Buffer7.from(signature), Buffer7.from(computedSig));
|
|
198202
|
+
};
|
|
198203
|
+
}
|
|
198204
|
+
function createKeySigner(bits) {
|
|
198205
|
+
return function sign2(thing, privateKey) {
|
|
198206
|
+
checkIsPrivateKey(privateKey);
|
|
198207
|
+
thing = normalizeInput(thing);
|
|
198208
|
+
var signer = crypto2.createSign("RSA-SHA" + bits);
|
|
198209
|
+
var sig = (signer.update(thing), signer.sign(privateKey, "base64"));
|
|
198210
|
+
return fromBase64(sig);
|
|
198211
|
+
};
|
|
198212
|
+
}
|
|
198213
|
+
function createKeyVerifier(bits) {
|
|
198214
|
+
return function verify(thing, signature, publicKey) {
|
|
198215
|
+
checkIsPublicKey(publicKey);
|
|
198216
|
+
thing = normalizeInput(thing);
|
|
198217
|
+
signature = toBase64(signature);
|
|
198218
|
+
var verifier = crypto2.createVerify("RSA-SHA" + bits);
|
|
198219
|
+
verifier.update(thing);
|
|
198220
|
+
return verifier.verify(publicKey, signature, "base64");
|
|
198221
|
+
};
|
|
198222
|
+
}
|
|
198223
|
+
function createPSSKeySigner(bits) {
|
|
198224
|
+
return function sign2(thing, privateKey) {
|
|
198225
|
+
checkIsPrivateKey(privateKey);
|
|
198226
|
+
thing = normalizeInput(thing);
|
|
198227
|
+
var signer = crypto2.createSign("RSA-SHA" + bits);
|
|
198228
|
+
var sig = (signer.update(thing), signer.sign({
|
|
198229
|
+
key: privateKey,
|
|
198230
|
+
padding: crypto2.constants.RSA_PKCS1_PSS_PADDING,
|
|
198231
|
+
saltLength: crypto2.constants.RSA_PSS_SALTLEN_DIGEST
|
|
198232
|
+
}, "base64"));
|
|
198233
|
+
return fromBase64(sig);
|
|
198234
|
+
};
|
|
198235
|
+
}
|
|
198236
|
+
function createPSSKeyVerifier(bits) {
|
|
198237
|
+
return function verify(thing, signature, publicKey) {
|
|
198238
|
+
checkIsPublicKey(publicKey);
|
|
198239
|
+
thing = normalizeInput(thing);
|
|
198240
|
+
signature = toBase64(signature);
|
|
198241
|
+
var verifier = crypto2.createVerify("RSA-SHA" + bits);
|
|
198242
|
+
verifier.update(thing);
|
|
198243
|
+
return verifier.verify({
|
|
198244
|
+
key: publicKey,
|
|
198245
|
+
padding: crypto2.constants.RSA_PKCS1_PSS_PADDING,
|
|
198246
|
+
saltLength: crypto2.constants.RSA_PSS_SALTLEN_DIGEST
|
|
198247
|
+
}, signature, "base64");
|
|
198248
|
+
};
|
|
198249
|
+
}
|
|
198250
|
+
function createECDSASigner(bits) {
|
|
198251
|
+
var inner = createKeySigner(bits);
|
|
198252
|
+
return function sign2() {
|
|
198253
|
+
var signature = inner.apply(null, arguments);
|
|
198254
|
+
signature = formatEcdsa.derToJose(signature, "ES" + bits);
|
|
198255
|
+
return signature;
|
|
198256
|
+
};
|
|
198257
|
+
}
|
|
198258
|
+
function createECDSAVerifer(bits) {
|
|
198259
|
+
var inner = createKeyVerifier(bits);
|
|
198260
|
+
return function verify(thing, signature, publicKey) {
|
|
198261
|
+
signature = formatEcdsa.joseToDer(signature, "ES" + bits).toString("base64");
|
|
198262
|
+
var result = inner(thing, signature, publicKey);
|
|
198263
|
+
return result;
|
|
198264
|
+
};
|
|
198265
|
+
}
|
|
198266
|
+
function createNoneSigner() {
|
|
198267
|
+
return function sign2() {
|
|
198268
|
+
return "";
|
|
198269
|
+
};
|
|
198270
|
+
}
|
|
198271
|
+
function createNoneVerifier() {
|
|
198272
|
+
return function verify(thing, signature) {
|
|
198273
|
+
return signature === "";
|
|
198274
|
+
};
|
|
198275
|
+
}
|
|
198276
|
+
module.exports = function jwa(algorithm) {
|
|
198277
|
+
var signerFactories = {
|
|
198278
|
+
hs: createHmacSigner,
|
|
198279
|
+
rs: createKeySigner,
|
|
198280
|
+
ps: createPSSKeySigner,
|
|
198281
|
+
es: createECDSASigner,
|
|
198282
|
+
none: createNoneSigner
|
|
198283
|
+
};
|
|
198284
|
+
var verifierFactories = {
|
|
198285
|
+
hs: createHmacVerifier,
|
|
198286
|
+
rs: createKeyVerifier,
|
|
198287
|
+
ps: createPSSKeyVerifier,
|
|
198288
|
+
es: createECDSAVerifer,
|
|
198289
|
+
none: createNoneVerifier
|
|
198290
|
+
};
|
|
198291
|
+
var match = algorithm.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);
|
|
198292
|
+
if (!match)
|
|
198293
|
+
throw typeError(MSG_INVALID_ALGORITHM, algorithm);
|
|
198294
|
+
var algo = (match[1] || match[3]).toLowerCase();
|
|
198295
|
+
var bits = match[2];
|
|
198296
|
+
return {
|
|
198297
|
+
sign: signerFactories[algo](bits),
|
|
198298
|
+
verify: verifierFactories[algo](bits)
|
|
198299
|
+
};
|
|
198300
|
+
};
|
|
198301
|
+
});
|
|
198302
|
+
|
|
198303
|
+
// ../../node_modules/jws/lib/tostring.js
|
|
198304
|
+
var require_tostring = __commonJS((exports, module) => {
|
|
198305
|
+
var Buffer7 = __require("buffer").Buffer;
|
|
198306
|
+
module.exports = function toString2(obj) {
|
|
198307
|
+
if (typeof obj === "string")
|
|
198308
|
+
return obj;
|
|
198309
|
+
if (typeof obj === "number" || Buffer7.isBuffer(obj))
|
|
198310
|
+
return obj.toString();
|
|
198311
|
+
return JSON.stringify(obj);
|
|
198312
|
+
};
|
|
198313
|
+
});
|
|
198314
|
+
|
|
198315
|
+
// ../../node_modules/jws/lib/sign-stream.js
|
|
198316
|
+
var require_sign_stream = __commonJS((exports, module) => {
|
|
198317
|
+
var Buffer7 = require_safe_buffer().Buffer;
|
|
198318
|
+
var DataStream = require_data_stream();
|
|
198319
|
+
var jwa = require_jwa();
|
|
198320
|
+
var Stream2 = __require("stream");
|
|
198321
|
+
var toString2 = require_tostring();
|
|
198322
|
+
var util2 = __require("util");
|
|
198323
|
+
function base64url3(string4, encoding) {
|
|
198324
|
+
return Buffer7.from(string4, encoding).toString("base64").replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
198325
|
+
}
|
|
198326
|
+
function jwsSecuredInput(header2, payload, encoding) {
|
|
198327
|
+
encoding = encoding || "utf8";
|
|
198328
|
+
var encodedHeader = base64url3(toString2(header2), "binary");
|
|
198329
|
+
var encodedPayload = base64url3(toString2(payload), encoding);
|
|
198330
|
+
return util2.format("%s.%s", encodedHeader, encodedPayload);
|
|
198331
|
+
}
|
|
198332
|
+
function jwsSign(opts) {
|
|
198333
|
+
var header2 = opts.header;
|
|
198334
|
+
var payload = opts.payload;
|
|
198335
|
+
var secretOrKey = opts.secret || opts.privateKey;
|
|
198336
|
+
var encoding = opts.encoding;
|
|
198337
|
+
var algo = jwa(header2.alg);
|
|
198338
|
+
var securedInput = jwsSecuredInput(header2, payload, encoding);
|
|
198339
|
+
var signature = algo.sign(securedInput, secretOrKey);
|
|
198340
|
+
return util2.format("%s.%s", securedInput, signature);
|
|
198341
|
+
}
|
|
198342
|
+
function SignStream(opts) {
|
|
198343
|
+
var secret2 = opts.secret;
|
|
198344
|
+
secret2 = secret2 == null ? opts.privateKey : secret2;
|
|
198345
|
+
secret2 = secret2 == null ? opts.key : secret2;
|
|
198346
|
+
if (/^hs/i.test(opts.header.alg) === true && secret2 == null) {
|
|
198347
|
+
throw new TypeError("secret must be a string or buffer or a KeyObject");
|
|
198348
|
+
}
|
|
198349
|
+
var secretStream = new DataStream(secret2);
|
|
198350
|
+
this.readable = true;
|
|
198351
|
+
this.header = opts.header;
|
|
198352
|
+
this.encoding = opts.encoding;
|
|
198353
|
+
this.secret = this.privateKey = this.key = secretStream;
|
|
198354
|
+
this.payload = new DataStream(opts.payload);
|
|
198355
|
+
this.secret.once("close", function() {
|
|
198356
|
+
if (!this.payload.writable && this.readable)
|
|
198357
|
+
this.sign();
|
|
198358
|
+
}.bind(this));
|
|
198359
|
+
this.payload.once("close", function() {
|
|
198360
|
+
if (!this.secret.writable && this.readable)
|
|
198361
|
+
this.sign();
|
|
198362
|
+
}.bind(this));
|
|
198363
|
+
}
|
|
198364
|
+
util2.inherits(SignStream, Stream2);
|
|
198365
|
+
SignStream.prototype.sign = function sign2() {
|
|
198366
|
+
try {
|
|
198367
|
+
var signature = jwsSign({
|
|
198368
|
+
header: this.header,
|
|
198369
|
+
payload: this.payload.buffer,
|
|
198370
|
+
secret: this.secret.buffer,
|
|
198371
|
+
encoding: this.encoding
|
|
198372
|
+
});
|
|
198373
|
+
this.emit("done", signature);
|
|
198374
|
+
this.emit("data", signature);
|
|
198375
|
+
this.emit("end");
|
|
198376
|
+
this.readable = false;
|
|
198377
|
+
return signature;
|
|
198378
|
+
} catch (e8) {
|
|
198379
|
+
this.readable = false;
|
|
198380
|
+
this.emit("error", e8);
|
|
198381
|
+
this.emit("close");
|
|
198382
|
+
}
|
|
198383
|
+
};
|
|
198384
|
+
SignStream.sign = jwsSign;
|
|
198385
|
+
module.exports = SignStream;
|
|
198386
|
+
});
|
|
198387
|
+
|
|
198388
|
+
// ../../node_modules/jws/lib/verify-stream.js
|
|
198389
|
+
var require_verify_stream = __commonJS((exports, module) => {
|
|
198390
|
+
var Buffer7 = require_safe_buffer().Buffer;
|
|
198391
|
+
var DataStream = require_data_stream();
|
|
198392
|
+
var jwa = require_jwa();
|
|
198393
|
+
var Stream2 = __require("stream");
|
|
198394
|
+
var toString2 = require_tostring();
|
|
198395
|
+
var util2 = __require("util");
|
|
198396
|
+
var JWS_REGEX = /^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;
|
|
198397
|
+
function isObject5(thing) {
|
|
198398
|
+
return Object.prototype.toString.call(thing) === "[object Object]";
|
|
198399
|
+
}
|
|
198400
|
+
function safeJsonParse(thing) {
|
|
198401
|
+
if (isObject5(thing))
|
|
198402
|
+
return thing;
|
|
198403
|
+
try {
|
|
198404
|
+
return JSON.parse(thing);
|
|
198405
|
+
} catch (e8) {
|
|
198406
|
+
return;
|
|
198407
|
+
}
|
|
198408
|
+
}
|
|
198409
|
+
function headerFromJWS(jwsSig) {
|
|
198410
|
+
var encodedHeader = jwsSig.split(".", 1)[0];
|
|
198411
|
+
return safeJsonParse(Buffer7.from(encodedHeader, "base64").toString("binary"));
|
|
198412
|
+
}
|
|
198413
|
+
function securedInputFromJWS(jwsSig) {
|
|
198414
|
+
return jwsSig.split(".", 2).join(".");
|
|
198415
|
+
}
|
|
198416
|
+
function signatureFromJWS(jwsSig) {
|
|
198417
|
+
return jwsSig.split(".")[2];
|
|
198418
|
+
}
|
|
198419
|
+
function payloadFromJWS(jwsSig, encoding) {
|
|
198420
|
+
encoding = encoding || "utf8";
|
|
198421
|
+
var payload = jwsSig.split(".")[1];
|
|
198422
|
+
return Buffer7.from(payload, "base64").toString(encoding);
|
|
198423
|
+
}
|
|
198424
|
+
function isValidJws(string4) {
|
|
198425
|
+
return JWS_REGEX.test(string4) && !!headerFromJWS(string4);
|
|
198426
|
+
}
|
|
198427
|
+
function jwsVerify(jwsSig, algorithm, secretOrKey) {
|
|
198428
|
+
if (!algorithm) {
|
|
198429
|
+
var err = new Error("Missing algorithm parameter for jws.verify");
|
|
198430
|
+
err.code = "MISSING_ALGORITHM";
|
|
198431
|
+
throw err;
|
|
198432
|
+
}
|
|
198433
|
+
jwsSig = toString2(jwsSig);
|
|
198434
|
+
var signature = signatureFromJWS(jwsSig);
|
|
198435
|
+
var securedInput = securedInputFromJWS(jwsSig);
|
|
198436
|
+
var algo = jwa(algorithm);
|
|
198437
|
+
return algo.verify(securedInput, signature, secretOrKey);
|
|
198438
|
+
}
|
|
198439
|
+
function jwsDecode(jwsSig, opts) {
|
|
198440
|
+
opts = opts || {};
|
|
198441
|
+
jwsSig = toString2(jwsSig);
|
|
198442
|
+
if (!isValidJws(jwsSig))
|
|
198443
|
+
return null;
|
|
198444
|
+
var header2 = headerFromJWS(jwsSig);
|
|
198445
|
+
if (!header2)
|
|
198446
|
+
return null;
|
|
198447
|
+
var payload = payloadFromJWS(jwsSig);
|
|
198448
|
+
if (header2.typ === "JWT" || opts.json)
|
|
198449
|
+
payload = JSON.parse(payload, opts.encoding);
|
|
198450
|
+
return {
|
|
198451
|
+
header: header2,
|
|
198452
|
+
payload,
|
|
198453
|
+
signature: signatureFromJWS(jwsSig)
|
|
198454
|
+
};
|
|
198455
|
+
}
|
|
198456
|
+
function VerifyStream(opts) {
|
|
198457
|
+
opts = opts || {};
|
|
198458
|
+
var secretOrKey = opts.secret;
|
|
198459
|
+
secretOrKey = secretOrKey == null ? opts.publicKey : secretOrKey;
|
|
198460
|
+
secretOrKey = secretOrKey == null ? opts.key : secretOrKey;
|
|
198461
|
+
if (/^hs/i.test(opts.algorithm) === true && secretOrKey == null) {
|
|
198462
|
+
throw new TypeError("secret must be a string or buffer or a KeyObject");
|
|
198463
|
+
}
|
|
198464
|
+
var secretStream = new DataStream(secretOrKey);
|
|
198465
|
+
this.readable = true;
|
|
198466
|
+
this.algorithm = opts.algorithm;
|
|
198467
|
+
this.encoding = opts.encoding;
|
|
198468
|
+
this.secret = this.publicKey = this.key = secretStream;
|
|
198469
|
+
this.signature = new DataStream(opts.signature);
|
|
198470
|
+
this.secret.once("close", function() {
|
|
198471
|
+
if (!this.signature.writable && this.readable)
|
|
198472
|
+
this.verify();
|
|
198473
|
+
}.bind(this));
|
|
198474
|
+
this.signature.once("close", function() {
|
|
198475
|
+
if (!this.secret.writable && this.readable)
|
|
198476
|
+
this.verify();
|
|
198477
|
+
}.bind(this));
|
|
198478
|
+
}
|
|
198479
|
+
util2.inherits(VerifyStream, Stream2);
|
|
198480
|
+
VerifyStream.prototype.verify = function verify() {
|
|
198481
|
+
try {
|
|
198482
|
+
var valid = jwsVerify(this.signature.buffer, this.algorithm, this.key.buffer);
|
|
198483
|
+
var obj = jwsDecode(this.signature.buffer, this.encoding);
|
|
198484
|
+
this.emit("done", valid, obj);
|
|
198485
|
+
this.emit("data", valid);
|
|
198486
|
+
this.emit("end");
|
|
198487
|
+
this.readable = false;
|
|
198488
|
+
return valid;
|
|
198489
|
+
} catch (e8) {
|
|
198490
|
+
this.readable = false;
|
|
198491
|
+
this.emit("error", e8);
|
|
198492
|
+
this.emit("close");
|
|
198493
|
+
}
|
|
198494
|
+
};
|
|
198495
|
+
VerifyStream.decode = jwsDecode;
|
|
198496
|
+
VerifyStream.isValid = isValidJws;
|
|
198497
|
+
VerifyStream.verify = jwsVerify;
|
|
198498
|
+
module.exports = VerifyStream;
|
|
198499
|
+
});
|
|
198500
|
+
|
|
198501
|
+
// ../../node_modules/jws/index.js
|
|
198502
|
+
var require_jws = __commonJS((exports) => {
|
|
198503
|
+
var SignStream = require_sign_stream();
|
|
198504
|
+
var VerifyStream = require_verify_stream();
|
|
198505
|
+
var ALGORITHMS = [
|
|
198506
|
+
"HS256",
|
|
198507
|
+
"HS384",
|
|
198508
|
+
"HS512",
|
|
198509
|
+
"RS256",
|
|
198510
|
+
"RS384",
|
|
198511
|
+
"RS512",
|
|
198512
|
+
"PS256",
|
|
198513
|
+
"PS384",
|
|
198514
|
+
"PS512",
|
|
198515
|
+
"ES256",
|
|
198516
|
+
"ES384",
|
|
198517
|
+
"ES512"
|
|
198518
|
+
];
|
|
198519
|
+
exports.ALGORITHMS = ALGORITHMS;
|
|
198520
|
+
exports.sign = SignStream.sign;
|
|
198521
|
+
exports.verify = VerifyStream.verify;
|
|
198522
|
+
exports.decode = VerifyStream.decode;
|
|
198523
|
+
exports.isValid = VerifyStream.isValid;
|
|
198524
|
+
exports.createSign = function createSign(opts) {
|
|
198525
|
+
return new SignStream(opts);
|
|
198526
|
+
};
|
|
198527
|
+
exports.createVerify = function createVerify(opts) {
|
|
198528
|
+
return new VerifyStream(opts);
|
|
198529
|
+
};
|
|
198530
|
+
});
|
|
198531
|
+
|
|
198532
|
+
// ../../node_modules/jsonwebtoken/decode.js
|
|
198533
|
+
var require_decode = __commonJS((exports, module) => {
|
|
198534
|
+
var jws = require_jws();
|
|
198535
|
+
module.exports = function(jwt2, options8) {
|
|
198536
|
+
options8 = options8 || {};
|
|
198537
|
+
var decoded = jws.decode(jwt2, options8);
|
|
198538
|
+
if (!decoded) {
|
|
198539
|
+
return null;
|
|
198540
|
+
}
|
|
198541
|
+
var payload = decoded.payload;
|
|
198542
|
+
if (typeof payload === "string") {
|
|
198543
|
+
try {
|
|
198544
|
+
var obj = JSON.parse(payload);
|
|
198545
|
+
if (obj !== null && typeof obj === "object") {
|
|
198546
|
+
payload = obj;
|
|
198547
|
+
}
|
|
198548
|
+
} catch (e8) {}
|
|
198549
|
+
}
|
|
198550
|
+
if (options8.complete === true) {
|
|
198551
|
+
return {
|
|
198552
|
+
header: decoded.header,
|
|
198553
|
+
payload,
|
|
198554
|
+
signature: decoded.signature
|
|
198555
|
+
};
|
|
198556
|
+
}
|
|
198557
|
+
return payload;
|
|
198558
|
+
};
|
|
198559
|
+
});
|
|
198560
|
+
|
|
198561
|
+
// ../../node_modules/jsonwebtoken/lib/JsonWebTokenError.js
|
|
198562
|
+
var require_JsonWebTokenError = __commonJS((exports, module) => {
|
|
198563
|
+
var JsonWebTokenError = function(message, error48) {
|
|
198564
|
+
Error.call(this, message);
|
|
198565
|
+
if (Error.captureStackTrace) {
|
|
198566
|
+
Error.captureStackTrace(this, this.constructor);
|
|
198567
|
+
}
|
|
198568
|
+
this.name = "JsonWebTokenError";
|
|
198569
|
+
this.message = message;
|
|
198570
|
+
if (error48)
|
|
198571
|
+
this.inner = error48;
|
|
198572
|
+
};
|
|
198573
|
+
JsonWebTokenError.prototype = Object.create(Error.prototype);
|
|
198574
|
+
JsonWebTokenError.prototype.constructor = JsonWebTokenError;
|
|
198575
|
+
module.exports = JsonWebTokenError;
|
|
198576
|
+
});
|
|
198577
|
+
|
|
198578
|
+
// ../../node_modules/jsonwebtoken/lib/NotBeforeError.js
|
|
198579
|
+
var require_NotBeforeError = __commonJS((exports, module) => {
|
|
198580
|
+
var JsonWebTokenError = require_JsonWebTokenError();
|
|
198581
|
+
var NotBeforeError = function(message, date5) {
|
|
198582
|
+
JsonWebTokenError.call(this, message);
|
|
198583
|
+
this.name = "NotBeforeError";
|
|
198584
|
+
this.date = date5;
|
|
198585
|
+
};
|
|
198586
|
+
NotBeforeError.prototype = Object.create(JsonWebTokenError.prototype);
|
|
198587
|
+
NotBeforeError.prototype.constructor = NotBeforeError;
|
|
198588
|
+
module.exports = NotBeforeError;
|
|
198589
|
+
});
|
|
198590
|
+
|
|
198591
|
+
// ../../node_modules/jsonwebtoken/lib/TokenExpiredError.js
|
|
198592
|
+
var require_TokenExpiredError = __commonJS((exports, module) => {
|
|
198593
|
+
var JsonWebTokenError = require_JsonWebTokenError();
|
|
198594
|
+
var TokenExpiredError = function(message, expiredAt) {
|
|
198595
|
+
JsonWebTokenError.call(this, message);
|
|
198596
|
+
this.name = "TokenExpiredError";
|
|
198597
|
+
this.expiredAt = expiredAt;
|
|
198598
|
+
};
|
|
198599
|
+
TokenExpiredError.prototype = Object.create(JsonWebTokenError.prototype);
|
|
198600
|
+
TokenExpiredError.prototype.constructor = TokenExpiredError;
|
|
198601
|
+
module.exports = TokenExpiredError;
|
|
198602
|
+
});
|
|
198603
|
+
|
|
198604
|
+
// ../../node_modules/jsonwebtoken/lib/timespan.js
|
|
198605
|
+
var require_timespan = __commonJS((exports, module) => {
|
|
198606
|
+
var ms8 = require_ms();
|
|
198607
|
+
module.exports = function(time3, iat) {
|
|
198608
|
+
var timestamp = iat || Math.floor(Date.now() / 1000);
|
|
198609
|
+
if (typeof time3 === "string") {
|
|
198610
|
+
var milliseconds = ms8(time3);
|
|
198611
|
+
if (typeof milliseconds === "undefined") {
|
|
198612
|
+
return;
|
|
198613
|
+
}
|
|
198614
|
+
return Math.floor(timestamp + milliseconds / 1000);
|
|
198615
|
+
} else if (typeof time3 === "number") {
|
|
198616
|
+
return timestamp + time3;
|
|
198617
|
+
} else {
|
|
198618
|
+
return;
|
|
198619
|
+
}
|
|
198620
|
+
};
|
|
198621
|
+
});
|
|
198622
|
+
|
|
198623
|
+
// ../../node_modules/semver/internal/constants.js
|
|
198624
|
+
var require_constants6 = __commonJS((exports, module) => {
|
|
198625
|
+
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
198626
|
+
var MAX_LENGTH = 256;
|
|
198627
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
198628
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
198629
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
198630
|
+
var RELEASE_TYPES = [
|
|
198631
|
+
"major",
|
|
198632
|
+
"premajor",
|
|
198633
|
+
"minor",
|
|
198634
|
+
"preminor",
|
|
198635
|
+
"patch",
|
|
198636
|
+
"prepatch",
|
|
198637
|
+
"prerelease"
|
|
198638
|
+
];
|
|
198639
|
+
module.exports = {
|
|
198640
|
+
MAX_LENGTH,
|
|
198641
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
198642
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
198643
|
+
MAX_SAFE_INTEGER,
|
|
198644
|
+
RELEASE_TYPES,
|
|
198645
|
+
SEMVER_SPEC_VERSION,
|
|
198646
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
198647
|
+
FLAG_LOOSE: 2
|
|
198648
|
+
};
|
|
198649
|
+
});
|
|
198650
|
+
|
|
198651
|
+
// ../../node_modules/semver/internal/debug.js
|
|
198652
|
+
var require_debug4 = __commonJS((exports, module) => {
|
|
198653
|
+
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
198654
|
+
module.exports = debug;
|
|
198655
|
+
});
|
|
198656
|
+
|
|
198657
|
+
// ../../node_modules/semver/internal/re.js
|
|
198658
|
+
var require_re2 = __commonJS((exports, module) => {
|
|
198659
|
+
var {
|
|
198660
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
198661
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
198662
|
+
MAX_LENGTH
|
|
198663
|
+
} = require_constants6();
|
|
198664
|
+
var debug = require_debug4();
|
|
198665
|
+
exports = module.exports = {};
|
|
198666
|
+
var re9 = exports.re = [];
|
|
198667
|
+
var safeRe = exports.safeRe = [];
|
|
198668
|
+
var src = exports.src = [];
|
|
198669
|
+
var safeSrc = exports.safeSrc = [];
|
|
198670
|
+
var t25 = exports.t = {};
|
|
198671
|
+
var R12 = 0;
|
|
198672
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
198673
|
+
var safeRegexReplacements = [
|
|
198674
|
+
["\\s", 1],
|
|
198675
|
+
["\\d", MAX_LENGTH],
|
|
198676
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
198677
|
+
];
|
|
198678
|
+
var makeSafeRegex = (value) => {
|
|
198679
|
+
for (const [token2, max] of safeRegexReplacements) {
|
|
198680
|
+
value = value.split(`${token2}*`).join(`${token2}{0,${max}}`).split(`${token2}+`).join(`${token2}{1,${max}}`);
|
|
198681
|
+
}
|
|
198682
|
+
return value;
|
|
198683
|
+
};
|
|
198684
|
+
var createToken = (name2, value, isGlobal) => {
|
|
198685
|
+
const safe = makeSafeRegex(value);
|
|
198686
|
+
const index = R12++;
|
|
198687
|
+
debug(name2, index, value);
|
|
198688
|
+
t25[name2] = index;
|
|
198689
|
+
src[index] = value;
|
|
198690
|
+
safeSrc[index] = safe;
|
|
198691
|
+
re9[index] = new RegExp(value, isGlobal ? "g" : undefined);
|
|
198692
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : undefined);
|
|
198693
|
+
};
|
|
198694
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
198695
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
198696
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
198697
|
+
createToken("MAINVERSION", `(${src[t25.NUMERICIDENTIFIER]})\\.` + `(${src[t25.NUMERICIDENTIFIER]})\\.` + `(${src[t25.NUMERICIDENTIFIER]})`);
|
|
198698
|
+
createToken("MAINVERSIONLOOSE", `(${src[t25.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t25.NUMERICIDENTIFIERLOOSE]})\\.` + `(${src[t25.NUMERICIDENTIFIERLOOSE]})`);
|
|
198699
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t25.NONNUMERICIDENTIFIER]}|${src[t25.NUMERICIDENTIFIER]})`);
|
|
198700
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t25.NONNUMERICIDENTIFIER]}|${src[t25.NUMERICIDENTIFIERLOOSE]})`);
|
|
198701
|
+
createToken("PRERELEASE", `(?:-(${src[t25.PRERELEASEIDENTIFIER]}(?:\\.${src[t25.PRERELEASEIDENTIFIER]})*))`);
|
|
198702
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t25.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t25.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
198703
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
198704
|
+
createToken("BUILD", `(?:\\+(${src[t25.BUILDIDENTIFIER]}(?:\\.${src[t25.BUILDIDENTIFIER]})*))`);
|
|
198705
|
+
createToken("FULLPLAIN", `v?${src[t25.MAINVERSION]}${src[t25.PRERELEASE]}?${src[t25.BUILD]}?`);
|
|
198706
|
+
createToken("FULL", `^${src[t25.FULLPLAIN]}$`);
|
|
198707
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t25.MAINVERSIONLOOSE]}${src[t25.PRERELEASELOOSE]}?${src[t25.BUILD]}?`);
|
|
198708
|
+
createToken("LOOSE", `^${src[t25.LOOSEPLAIN]}$`);
|
|
198709
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
198710
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t25.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
198711
|
+
createToken("XRANGEIDENTIFIER", `${src[t25.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
198712
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t25.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t25.XRANGEIDENTIFIER]})` + `(?:\\.(${src[t25.XRANGEIDENTIFIER]})` + `(?:${src[t25.PRERELEASE]})?${src[t25.BUILD]}?` + `)?)?`);
|
|
198713
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t25.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t25.XRANGEIDENTIFIERLOOSE]})` + `(?:\\.(${src[t25.XRANGEIDENTIFIERLOOSE]})` + `(?:${src[t25.PRERELEASELOOSE]})?${src[t25.BUILD]}?` + `)?)?`);
|
|
198714
|
+
createToken("XRANGE", `^${src[t25.GTLT]}\\s*${src[t25.XRANGEPLAIN]}$`);
|
|
198715
|
+
createToken("XRANGELOOSE", `^${src[t25.GTLT]}\\s*${src[t25.XRANGEPLAINLOOSE]}$`);
|
|
198716
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])" + "(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
198717
|
+
createToken("COERCE", `${src[t25.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
198718
|
+
createToken("COERCEFULL", src[t25.COERCEPLAIN] + `(?:${src[t25.PRERELEASE]})?` + `(?:${src[t25.BUILD]})?` + `(?:$|[^\\d])`);
|
|
198719
|
+
createToken("COERCERTL", src[t25.COERCE], true);
|
|
198720
|
+
createToken("COERCERTLFULL", src[t25.COERCEFULL], true);
|
|
198721
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
198722
|
+
createToken("TILDETRIM", `(\\s*)${src[t25.LONETILDE]}\\s+`, true);
|
|
198723
|
+
exports.tildeTrimReplace = "$1~";
|
|
198724
|
+
createToken("TILDE", `^${src[t25.LONETILDE]}${src[t25.XRANGEPLAIN]}$`);
|
|
198725
|
+
createToken("TILDELOOSE", `^${src[t25.LONETILDE]}${src[t25.XRANGEPLAINLOOSE]}$`);
|
|
198726
|
+
createToken("LONECARET", "(?:\\^)");
|
|
198727
|
+
createToken("CARETTRIM", `(\\s*)${src[t25.LONECARET]}\\s+`, true);
|
|
198728
|
+
exports.caretTrimReplace = "$1^";
|
|
198729
|
+
createToken("CARET", `^${src[t25.LONECARET]}${src[t25.XRANGEPLAIN]}$`);
|
|
198730
|
+
createToken("CARETLOOSE", `^${src[t25.LONECARET]}${src[t25.XRANGEPLAINLOOSE]}$`);
|
|
198731
|
+
createToken("COMPARATORLOOSE", `^${src[t25.GTLT]}\\s*(${src[t25.LOOSEPLAIN]})$|^$`);
|
|
198732
|
+
createToken("COMPARATOR", `^${src[t25.GTLT]}\\s*(${src[t25.FULLPLAIN]})$|^$`);
|
|
198733
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t25.GTLT]}\\s*(${src[t25.LOOSEPLAIN]}|${src[t25.XRANGEPLAIN]})`, true);
|
|
198734
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
198735
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t25.XRANGEPLAIN]})` + `\\s+-\\s+` + `(${src[t25.XRANGEPLAIN]})` + `\\s*$`);
|
|
198736
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t25.XRANGEPLAINLOOSE]})` + `\\s+-\\s+` + `(${src[t25.XRANGEPLAINLOOSE]})` + `\\s*$`);
|
|
198737
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
198738
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
198739
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
198740
|
+
});
|
|
198741
|
+
|
|
198742
|
+
// ../../node_modules/semver/internal/parse-options.js
|
|
198743
|
+
var require_parse_options2 = __commonJS((exports, module) => {
|
|
198744
|
+
var looseOption = Object.freeze({ loose: true });
|
|
198745
|
+
var emptyOpts = Object.freeze({});
|
|
198746
|
+
var parseOptions = (options8) => {
|
|
198747
|
+
if (!options8) {
|
|
198748
|
+
return emptyOpts;
|
|
198749
|
+
}
|
|
198750
|
+
if (typeof options8 !== "object") {
|
|
198751
|
+
return looseOption;
|
|
198752
|
+
}
|
|
198753
|
+
return options8;
|
|
198754
|
+
};
|
|
198755
|
+
module.exports = parseOptions;
|
|
198756
|
+
});
|
|
198757
|
+
|
|
198758
|
+
// ../../node_modules/semver/internal/identifiers.js
|
|
198759
|
+
var require_identifiers2 = __commonJS((exports, module) => {
|
|
198760
|
+
var numeric = /^[0-9]+$/;
|
|
198761
|
+
var compareIdentifiers = (a5, b7) => {
|
|
198762
|
+
if (typeof a5 === "number" && typeof b7 === "number") {
|
|
198763
|
+
return a5 === b7 ? 0 : a5 < b7 ? -1 : 1;
|
|
198764
|
+
}
|
|
198765
|
+
const anum = numeric.test(a5);
|
|
198766
|
+
const bnum = numeric.test(b7);
|
|
198767
|
+
if (anum && bnum) {
|
|
198768
|
+
a5 = +a5;
|
|
198769
|
+
b7 = +b7;
|
|
198770
|
+
}
|
|
198771
|
+
return a5 === b7 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a5 < b7 ? -1 : 1;
|
|
198772
|
+
};
|
|
198773
|
+
var rcompareIdentifiers = (a5, b7) => compareIdentifiers(b7, a5);
|
|
198774
|
+
module.exports = {
|
|
198775
|
+
compareIdentifiers,
|
|
198776
|
+
rcompareIdentifiers
|
|
198777
|
+
};
|
|
198778
|
+
});
|
|
198779
|
+
|
|
198780
|
+
// ../../node_modules/semver/classes/semver.js
|
|
198781
|
+
var require_semver2 = __commonJS((exports, module) => {
|
|
198782
|
+
var debug = require_debug4();
|
|
198783
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants6();
|
|
198784
|
+
var { safeRe: re9, t: t25 } = require_re2();
|
|
198785
|
+
var parseOptions = require_parse_options2();
|
|
198786
|
+
var { compareIdentifiers } = require_identifiers2();
|
|
198787
|
+
|
|
198788
|
+
class SemVer {
|
|
198789
|
+
constructor(version2, options8) {
|
|
198790
|
+
options8 = parseOptions(options8);
|
|
198791
|
+
if (version2 instanceof SemVer) {
|
|
198792
|
+
if (version2.loose === !!options8.loose && version2.includePrerelease === !!options8.includePrerelease) {
|
|
198793
|
+
return version2;
|
|
198794
|
+
} else {
|
|
198795
|
+
version2 = version2.version;
|
|
198796
|
+
}
|
|
198797
|
+
} else if (typeof version2 !== "string") {
|
|
198798
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
|
|
198799
|
+
}
|
|
198800
|
+
if (version2.length > MAX_LENGTH) {
|
|
198801
|
+
throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
198802
|
+
}
|
|
198803
|
+
debug("SemVer", version2, options8);
|
|
198804
|
+
this.options = options8;
|
|
198805
|
+
this.loose = !!options8.loose;
|
|
198806
|
+
this.includePrerelease = !!options8.includePrerelease;
|
|
198807
|
+
const m7 = version2.trim().match(options8.loose ? re9[t25.LOOSE] : re9[t25.FULL]);
|
|
198808
|
+
if (!m7) {
|
|
198809
|
+
throw new TypeError(`Invalid Version: ${version2}`);
|
|
198810
|
+
}
|
|
198811
|
+
this.raw = version2;
|
|
198812
|
+
this.major = +m7[1];
|
|
198813
|
+
this.minor = +m7[2];
|
|
198814
|
+
this.patch = +m7[3];
|
|
198815
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
198816
|
+
throw new TypeError("Invalid major version");
|
|
198817
|
+
}
|
|
198818
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
198819
|
+
throw new TypeError("Invalid minor version");
|
|
198820
|
+
}
|
|
198821
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
198822
|
+
throw new TypeError("Invalid patch version");
|
|
198823
|
+
}
|
|
198824
|
+
if (!m7[4]) {
|
|
198825
|
+
this.prerelease = [];
|
|
198826
|
+
} else {
|
|
198827
|
+
this.prerelease = m7[4].split(".").map((id2) => {
|
|
198828
|
+
if (/^[0-9]+$/.test(id2)) {
|
|
198829
|
+
const num = +id2;
|
|
198830
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
198831
|
+
return num;
|
|
198832
|
+
}
|
|
198833
|
+
}
|
|
198834
|
+
return id2;
|
|
198835
|
+
});
|
|
198836
|
+
}
|
|
198837
|
+
this.build = m7[5] ? m7[5].split(".") : [];
|
|
198838
|
+
this.format();
|
|
198839
|
+
}
|
|
198840
|
+
format() {
|
|
198841
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
198842
|
+
if (this.prerelease.length) {
|
|
198843
|
+
this.version += `-${this.prerelease.join(".")}`;
|
|
198844
|
+
}
|
|
198845
|
+
return this.version;
|
|
198846
|
+
}
|
|
198847
|
+
toString() {
|
|
198848
|
+
return this.version;
|
|
198849
|
+
}
|
|
198850
|
+
compare(other) {
|
|
198851
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
198852
|
+
if (!(other instanceof SemVer)) {
|
|
198853
|
+
if (typeof other === "string" && other === this.version) {
|
|
198854
|
+
return 0;
|
|
198855
|
+
}
|
|
198856
|
+
other = new SemVer(other, this.options);
|
|
198857
|
+
}
|
|
198858
|
+
if (other.version === this.version) {
|
|
198859
|
+
return 0;
|
|
198860
|
+
}
|
|
198861
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
198862
|
+
}
|
|
198863
|
+
compareMain(other) {
|
|
198864
|
+
if (!(other instanceof SemVer)) {
|
|
198865
|
+
other = new SemVer(other, this.options);
|
|
198866
|
+
}
|
|
198867
|
+
if (this.major < other.major) {
|
|
198868
|
+
return -1;
|
|
198869
|
+
}
|
|
198870
|
+
if (this.major > other.major) {
|
|
198871
|
+
return 1;
|
|
198872
|
+
}
|
|
198873
|
+
if (this.minor < other.minor) {
|
|
198874
|
+
return -1;
|
|
198875
|
+
}
|
|
198876
|
+
if (this.minor > other.minor) {
|
|
198877
|
+
return 1;
|
|
198878
|
+
}
|
|
198879
|
+
if (this.patch < other.patch) {
|
|
198880
|
+
return -1;
|
|
198881
|
+
}
|
|
198882
|
+
if (this.patch > other.patch) {
|
|
198883
|
+
return 1;
|
|
198884
|
+
}
|
|
198885
|
+
return 0;
|
|
198886
|
+
}
|
|
198887
|
+
comparePre(other) {
|
|
198888
|
+
if (!(other instanceof SemVer)) {
|
|
198889
|
+
other = new SemVer(other, this.options);
|
|
198890
|
+
}
|
|
198891
|
+
if (this.prerelease.length && !other.prerelease.length) {
|
|
198892
|
+
return -1;
|
|
198893
|
+
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
198894
|
+
return 1;
|
|
198895
|
+
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
198896
|
+
return 0;
|
|
198897
|
+
}
|
|
198898
|
+
let i5 = 0;
|
|
198899
|
+
do {
|
|
198900
|
+
const a5 = this.prerelease[i5];
|
|
198901
|
+
const b7 = other.prerelease[i5];
|
|
198902
|
+
debug("prerelease compare", i5, a5, b7);
|
|
198903
|
+
if (a5 === undefined && b7 === undefined) {
|
|
198904
|
+
return 0;
|
|
198905
|
+
} else if (b7 === undefined) {
|
|
198906
|
+
return 1;
|
|
198907
|
+
} else if (a5 === undefined) {
|
|
198908
|
+
return -1;
|
|
198909
|
+
} else if (a5 === b7) {
|
|
198910
|
+
continue;
|
|
198911
|
+
} else {
|
|
198912
|
+
return compareIdentifiers(a5, b7);
|
|
198913
|
+
}
|
|
198914
|
+
} while (++i5);
|
|
198915
|
+
}
|
|
198916
|
+
compareBuild(other) {
|
|
198917
|
+
if (!(other instanceof SemVer)) {
|
|
198918
|
+
other = new SemVer(other, this.options);
|
|
198919
|
+
}
|
|
198920
|
+
let i5 = 0;
|
|
198921
|
+
do {
|
|
198922
|
+
const a5 = this.build[i5];
|
|
198923
|
+
const b7 = other.build[i5];
|
|
198924
|
+
debug("build compare", i5, a5, b7);
|
|
198925
|
+
if (a5 === undefined && b7 === undefined) {
|
|
198926
|
+
return 0;
|
|
198927
|
+
} else if (b7 === undefined) {
|
|
198928
|
+
return 1;
|
|
198929
|
+
} else if (a5 === undefined) {
|
|
198930
|
+
return -1;
|
|
198931
|
+
} else if (a5 === b7) {
|
|
198932
|
+
continue;
|
|
198933
|
+
} else {
|
|
198934
|
+
return compareIdentifiers(a5, b7);
|
|
198935
|
+
}
|
|
198936
|
+
} while (++i5);
|
|
198937
|
+
}
|
|
198938
|
+
inc(release, identifier, identifierBase) {
|
|
198939
|
+
if (release.startsWith("pre")) {
|
|
198940
|
+
if (!identifier && identifierBase === false) {
|
|
198941
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
198942
|
+
}
|
|
198943
|
+
if (identifier) {
|
|
198944
|
+
const match = `-${identifier}`.match(this.options.loose ? re9[t25.PRERELEASELOOSE] : re9[t25.PRERELEASE]);
|
|
198945
|
+
if (!match || match[1] !== identifier) {
|
|
198946
|
+
throw new Error(`invalid identifier: ${identifier}`);
|
|
198947
|
+
}
|
|
198948
|
+
}
|
|
198949
|
+
}
|
|
198950
|
+
switch (release) {
|
|
198951
|
+
case "premajor":
|
|
198952
|
+
this.prerelease.length = 0;
|
|
198953
|
+
this.patch = 0;
|
|
198954
|
+
this.minor = 0;
|
|
198955
|
+
this.major++;
|
|
198956
|
+
this.inc("pre", identifier, identifierBase);
|
|
198957
|
+
break;
|
|
198958
|
+
case "preminor":
|
|
198959
|
+
this.prerelease.length = 0;
|
|
198960
|
+
this.patch = 0;
|
|
198961
|
+
this.minor++;
|
|
198962
|
+
this.inc("pre", identifier, identifierBase);
|
|
198963
|
+
break;
|
|
198964
|
+
case "prepatch":
|
|
198965
|
+
this.prerelease.length = 0;
|
|
198966
|
+
this.inc("patch", identifier, identifierBase);
|
|
198967
|
+
this.inc("pre", identifier, identifierBase);
|
|
198968
|
+
break;
|
|
198969
|
+
case "prerelease":
|
|
198970
|
+
if (this.prerelease.length === 0) {
|
|
198971
|
+
this.inc("patch", identifier, identifierBase);
|
|
198972
|
+
}
|
|
198973
|
+
this.inc("pre", identifier, identifierBase);
|
|
198974
|
+
break;
|
|
198975
|
+
case "release":
|
|
198976
|
+
if (this.prerelease.length === 0) {
|
|
198977
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
198978
|
+
}
|
|
198979
|
+
this.prerelease.length = 0;
|
|
198980
|
+
break;
|
|
198981
|
+
case "major":
|
|
198982
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
198983
|
+
this.major++;
|
|
198984
|
+
}
|
|
198985
|
+
this.minor = 0;
|
|
198986
|
+
this.patch = 0;
|
|
198987
|
+
this.prerelease = [];
|
|
198988
|
+
break;
|
|
198989
|
+
case "minor":
|
|
198990
|
+
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
198991
|
+
this.minor++;
|
|
198992
|
+
}
|
|
198993
|
+
this.patch = 0;
|
|
198994
|
+
this.prerelease = [];
|
|
198995
|
+
break;
|
|
198996
|
+
case "patch":
|
|
198997
|
+
if (this.prerelease.length === 0) {
|
|
198998
|
+
this.patch++;
|
|
198999
|
+
}
|
|
199000
|
+
this.prerelease = [];
|
|
199001
|
+
break;
|
|
199002
|
+
case "pre": {
|
|
199003
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
199004
|
+
if (this.prerelease.length === 0) {
|
|
199005
|
+
this.prerelease = [base];
|
|
199006
|
+
} else {
|
|
199007
|
+
let i5 = this.prerelease.length;
|
|
199008
|
+
while (--i5 >= 0) {
|
|
199009
|
+
if (typeof this.prerelease[i5] === "number") {
|
|
199010
|
+
this.prerelease[i5]++;
|
|
199011
|
+
i5 = -2;
|
|
199012
|
+
}
|
|
199013
|
+
}
|
|
199014
|
+
if (i5 === -1) {
|
|
199015
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
199016
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
199017
|
+
}
|
|
199018
|
+
this.prerelease.push(base);
|
|
199019
|
+
}
|
|
199020
|
+
}
|
|
199021
|
+
if (identifier) {
|
|
199022
|
+
let prerelease = [identifier, base];
|
|
199023
|
+
if (identifierBase === false) {
|
|
199024
|
+
prerelease = [identifier];
|
|
199025
|
+
}
|
|
199026
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
199027
|
+
if (isNaN(this.prerelease[1])) {
|
|
199028
|
+
this.prerelease = prerelease;
|
|
199029
|
+
}
|
|
199030
|
+
} else {
|
|
199031
|
+
this.prerelease = prerelease;
|
|
199032
|
+
}
|
|
199033
|
+
}
|
|
199034
|
+
break;
|
|
199035
|
+
}
|
|
199036
|
+
default:
|
|
199037
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
199038
|
+
}
|
|
199039
|
+
this.raw = this.format();
|
|
199040
|
+
if (this.build.length) {
|
|
199041
|
+
this.raw += `+${this.build.join(".")}`;
|
|
199042
|
+
}
|
|
199043
|
+
return this;
|
|
199044
|
+
}
|
|
199045
|
+
}
|
|
199046
|
+
module.exports = SemVer;
|
|
199047
|
+
});
|
|
199048
|
+
|
|
199049
|
+
// ../../node_modules/semver/functions/parse.js
|
|
199050
|
+
var require_parse8 = __commonJS((exports, module) => {
|
|
199051
|
+
var SemVer = require_semver2();
|
|
199052
|
+
var parse11 = (version2, options8, throwErrors = false) => {
|
|
199053
|
+
if (version2 instanceof SemVer) {
|
|
199054
|
+
return version2;
|
|
199055
|
+
}
|
|
199056
|
+
try {
|
|
199057
|
+
return new SemVer(version2, options8);
|
|
199058
|
+
} catch (er10) {
|
|
199059
|
+
if (!throwErrors) {
|
|
199060
|
+
return null;
|
|
199061
|
+
}
|
|
199062
|
+
throw er10;
|
|
199063
|
+
}
|
|
199064
|
+
};
|
|
199065
|
+
module.exports = parse11;
|
|
199066
|
+
});
|
|
199067
|
+
|
|
199068
|
+
// ../../node_modules/semver/functions/valid.js
|
|
199069
|
+
var require_valid = __commonJS((exports, module) => {
|
|
199070
|
+
var parse11 = require_parse8();
|
|
199071
|
+
var valid = (version2, options8) => {
|
|
199072
|
+
const v10 = parse11(version2, options8);
|
|
199073
|
+
return v10 ? v10.version : null;
|
|
199074
|
+
};
|
|
199075
|
+
module.exports = valid;
|
|
199076
|
+
});
|
|
199077
|
+
|
|
199078
|
+
// ../../node_modules/semver/functions/clean.js
|
|
199079
|
+
var require_clean = __commonJS((exports, module) => {
|
|
199080
|
+
var parse11 = require_parse8();
|
|
199081
|
+
var clean2 = (version2, options8) => {
|
|
199082
|
+
const s5 = parse11(version2.trim().replace(/^[=v]+/, ""), options8);
|
|
199083
|
+
return s5 ? s5.version : null;
|
|
199084
|
+
};
|
|
199085
|
+
module.exports = clean2;
|
|
199086
|
+
});
|
|
199087
|
+
|
|
199088
|
+
// ../../node_modules/semver/functions/inc.js
|
|
199089
|
+
var require_inc = __commonJS((exports, module) => {
|
|
199090
|
+
var SemVer = require_semver2();
|
|
199091
|
+
var inc = (version2, release, options8, identifier, identifierBase) => {
|
|
199092
|
+
if (typeof options8 === "string") {
|
|
199093
|
+
identifierBase = identifier;
|
|
199094
|
+
identifier = options8;
|
|
199095
|
+
options8 = undefined;
|
|
199096
|
+
}
|
|
199097
|
+
try {
|
|
199098
|
+
return new SemVer(version2 instanceof SemVer ? version2.version : version2, options8).inc(release, identifier, identifierBase).version;
|
|
199099
|
+
} catch (er10) {
|
|
199100
|
+
return null;
|
|
199101
|
+
}
|
|
199102
|
+
};
|
|
199103
|
+
module.exports = inc;
|
|
199104
|
+
});
|
|
199105
|
+
|
|
199106
|
+
// ../../node_modules/semver/functions/diff.js
|
|
199107
|
+
var require_diff = __commonJS((exports, module) => {
|
|
199108
|
+
var parse11 = require_parse8();
|
|
199109
|
+
var diff = (version1, version2) => {
|
|
199110
|
+
const v12 = parse11(version1, null, true);
|
|
199111
|
+
const v24 = parse11(version2, null, true);
|
|
199112
|
+
const comparison = v12.compare(v24);
|
|
199113
|
+
if (comparison === 0) {
|
|
199114
|
+
return null;
|
|
199115
|
+
}
|
|
199116
|
+
const v1Higher = comparison > 0;
|
|
199117
|
+
const highVersion = v1Higher ? v12 : v24;
|
|
199118
|
+
const lowVersion = v1Higher ? v24 : v12;
|
|
199119
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
199120
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
199121
|
+
if (lowHasPre && !highHasPre) {
|
|
199122
|
+
if (!lowVersion.patch && !lowVersion.minor) {
|
|
199123
|
+
return "major";
|
|
199124
|
+
}
|
|
199125
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
199126
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
199127
|
+
return "minor";
|
|
199128
|
+
}
|
|
199129
|
+
return "patch";
|
|
199130
|
+
}
|
|
199131
|
+
}
|
|
199132
|
+
const prefix = highHasPre ? "pre" : "";
|
|
199133
|
+
if (v12.major !== v24.major) {
|
|
199134
|
+
return prefix + "major";
|
|
199135
|
+
}
|
|
199136
|
+
if (v12.minor !== v24.minor) {
|
|
199137
|
+
return prefix + "minor";
|
|
199138
|
+
}
|
|
199139
|
+
if (v12.patch !== v24.patch) {
|
|
199140
|
+
return prefix + "patch";
|
|
199141
|
+
}
|
|
199142
|
+
return "prerelease";
|
|
199143
|
+
};
|
|
199144
|
+
module.exports = diff;
|
|
199145
|
+
});
|
|
199146
|
+
|
|
199147
|
+
// ../../node_modules/semver/functions/major.js
|
|
199148
|
+
var require_major = __commonJS((exports, module) => {
|
|
199149
|
+
var SemVer = require_semver2();
|
|
199150
|
+
var major = (a5, loose) => new SemVer(a5, loose).major;
|
|
199151
|
+
module.exports = major;
|
|
199152
|
+
});
|
|
199153
|
+
|
|
199154
|
+
// ../../node_modules/semver/functions/minor.js
|
|
199155
|
+
var require_minor = __commonJS((exports, module) => {
|
|
199156
|
+
var SemVer = require_semver2();
|
|
199157
|
+
var minor = (a5, loose) => new SemVer(a5, loose).minor;
|
|
199158
|
+
module.exports = minor;
|
|
199159
|
+
});
|
|
199160
|
+
|
|
199161
|
+
// ../../node_modules/semver/functions/patch.js
|
|
199162
|
+
var require_patch = __commonJS((exports, module) => {
|
|
199163
|
+
var SemVer = require_semver2();
|
|
199164
|
+
var patch = (a5, loose) => new SemVer(a5, loose).patch;
|
|
199165
|
+
module.exports = patch;
|
|
199166
|
+
});
|
|
199167
|
+
|
|
199168
|
+
// ../../node_modules/semver/functions/prerelease.js
|
|
199169
|
+
var require_prerelease = __commonJS((exports, module) => {
|
|
199170
|
+
var parse11 = require_parse8();
|
|
199171
|
+
var prerelease = (version2, options8) => {
|
|
199172
|
+
const parsed = parse11(version2, options8);
|
|
199173
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
199174
|
+
};
|
|
199175
|
+
module.exports = prerelease;
|
|
199176
|
+
});
|
|
199177
|
+
|
|
199178
|
+
// ../../node_modules/semver/functions/compare.js
|
|
199179
|
+
var require_compare2 = __commonJS((exports, module) => {
|
|
199180
|
+
var SemVer = require_semver2();
|
|
199181
|
+
var compare = (a5, b7, loose) => new SemVer(a5, loose).compare(new SemVer(b7, loose));
|
|
199182
|
+
module.exports = compare;
|
|
199183
|
+
});
|
|
199184
|
+
|
|
199185
|
+
// ../../node_modules/semver/functions/rcompare.js
|
|
199186
|
+
var require_rcompare = __commonJS((exports, module) => {
|
|
199187
|
+
var compare = require_compare2();
|
|
199188
|
+
var rcompare = (a5, b7, loose) => compare(b7, a5, loose);
|
|
199189
|
+
module.exports = rcompare;
|
|
199190
|
+
});
|
|
199191
|
+
|
|
199192
|
+
// ../../node_modules/semver/functions/compare-loose.js
|
|
199193
|
+
var require_compare_loose = __commonJS((exports, module) => {
|
|
199194
|
+
var compare = require_compare2();
|
|
199195
|
+
var compareLoose = (a5, b7) => compare(a5, b7, true);
|
|
199196
|
+
module.exports = compareLoose;
|
|
199197
|
+
});
|
|
199198
|
+
|
|
199199
|
+
// ../../node_modules/semver/functions/compare-build.js
|
|
199200
|
+
var require_compare_build = __commonJS((exports, module) => {
|
|
199201
|
+
var SemVer = require_semver2();
|
|
199202
|
+
var compareBuild = (a5, b7, loose) => {
|
|
199203
|
+
const versionA = new SemVer(a5, loose);
|
|
199204
|
+
const versionB = new SemVer(b7, loose);
|
|
199205
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
199206
|
+
};
|
|
199207
|
+
module.exports = compareBuild;
|
|
199208
|
+
});
|
|
199209
|
+
|
|
199210
|
+
// ../../node_modules/semver/functions/sort.js
|
|
199211
|
+
var require_sort = __commonJS((exports, module) => {
|
|
199212
|
+
var compareBuild = require_compare_build();
|
|
199213
|
+
var sort = (list3, loose) => list3.sort((a5, b7) => compareBuild(a5, b7, loose));
|
|
199214
|
+
module.exports = sort;
|
|
199215
|
+
});
|
|
199216
|
+
|
|
199217
|
+
// ../../node_modules/semver/functions/rsort.js
|
|
199218
|
+
var require_rsort = __commonJS((exports, module) => {
|
|
199219
|
+
var compareBuild = require_compare_build();
|
|
199220
|
+
var rsort = (list3, loose) => list3.sort((a5, b7) => compareBuild(b7, a5, loose));
|
|
199221
|
+
module.exports = rsort;
|
|
199222
|
+
});
|
|
199223
|
+
|
|
199224
|
+
// ../../node_modules/semver/functions/gt.js
|
|
199225
|
+
var require_gt = __commonJS((exports, module) => {
|
|
199226
|
+
var compare = require_compare2();
|
|
199227
|
+
var gt12 = (a5, b7, loose) => compare(a5, b7, loose) > 0;
|
|
199228
|
+
module.exports = gt12;
|
|
199229
|
+
});
|
|
199230
|
+
|
|
199231
|
+
// ../../node_modules/semver/functions/lt.js
|
|
199232
|
+
var require_lt = __commonJS((exports, module) => {
|
|
199233
|
+
var compare = require_compare2();
|
|
199234
|
+
var lt10 = (a5, b7, loose) => compare(a5, b7, loose) < 0;
|
|
199235
|
+
module.exports = lt10;
|
|
199236
|
+
});
|
|
199237
|
+
|
|
199238
|
+
// ../../node_modules/semver/functions/eq.js
|
|
199239
|
+
var require_eq = __commonJS((exports, module) => {
|
|
199240
|
+
var compare = require_compare2();
|
|
199241
|
+
var eq = (a5, b7, loose) => compare(a5, b7, loose) === 0;
|
|
199242
|
+
module.exports = eq;
|
|
199243
|
+
});
|
|
199244
|
+
|
|
199245
|
+
// ../../node_modules/semver/functions/neq.js
|
|
199246
|
+
var require_neq = __commonJS((exports, module) => {
|
|
199247
|
+
var compare = require_compare2();
|
|
199248
|
+
var neq = (a5, b7, loose) => compare(a5, b7, loose) !== 0;
|
|
199249
|
+
module.exports = neq;
|
|
199250
|
+
});
|
|
199251
|
+
|
|
199252
|
+
// ../../node_modules/semver/functions/gte.js
|
|
199253
|
+
var require_gte2 = __commonJS((exports, module) => {
|
|
199254
|
+
var compare = require_compare2();
|
|
199255
|
+
var gte = (a5, b7, loose) => compare(a5, b7, loose) >= 0;
|
|
199256
|
+
module.exports = gte;
|
|
199257
|
+
});
|
|
199258
|
+
|
|
199259
|
+
// ../../node_modules/semver/functions/lte.js
|
|
199260
|
+
var require_lte = __commonJS((exports, module) => {
|
|
199261
|
+
var compare = require_compare2();
|
|
199262
|
+
var lte = (a5, b7, loose) => compare(a5, b7, loose) <= 0;
|
|
199263
|
+
module.exports = lte;
|
|
199264
|
+
});
|
|
199265
|
+
|
|
199266
|
+
// ../../node_modules/semver/functions/cmp.js
|
|
199267
|
+
var require_cmp = __commonJS((exports, module) => {
|
|
199268
|
+
var eq = require_eq();
|
|
199269
|
+
var neq = require_neq();
|
|
199270
|
+
var gt12 = require_gt();
|
|
199271
|
+
var gte = require_gte2();
|
|
199272
|
+
var lt10 = require_lt();
|
|
199273
|
+
var lte = require_lte();
|
|
199274
|
+
var cmp = (a5, op2, b7, loose) => {
|
|
199275
|
+
switch (op2) {
|
|
199276
|
+
case "===":
|
|
199277
|
+
if (typeof a5 === "object") {
|
|
199278
|
+
a5 = a5.version;
|
|
199279
|
+
}
|
|
199280
|
+
if (typeof b7 === "object") {
|
|
199281
|
+
b7 = b7.version;
|
|
199282
|
+
}
|
|
199283
|
+
return a5 === b7;
|
|
199284
|
+
case "!==":
|
|
199285
|
+
if (typeof a5 === "object") {
|
|
199286
|
+
a5 = a5.version;
|
|
199287
|
+
}
|
|
199288
|
+
if (typeof b7 === "object") {
|
|
199289
|
+
b7 = b7.version;
|
|
199290
|
+
}
|
|
199291
|
+
return a5 !== b7;
|
|
199292
|
+
case "":
|
|
199293
|
+
case "=":
|
|
199294
|
+
case "==":
|
|
199295
|
+
return eq(a5, b7, loose);
|
|
199296
|
+
case "!=":
|
|
199297
|
+
return neq(a5, b7, loose);
|
|
199298
|
+
case ">":
|
|
199299
|
+
return gt12(a5, b7, loose);
|
|
199300
|
+
case ">=":
|
|
199301
|
+
return gte(a5, b7, loose);
|
|
199302
|
+
case "<":
|
|
199303
|
+
return lt10(a5, b7, loose);
|
|
199304
|
+
case "<=":
|
|
199305
|
+
return lte(a5, b7, loose);
|
|
199306
|
+
default:
|
|
199307
|
+
throw new TypeError(`Invalid operator: ${op2}`);
|
|
199308
|
+
}
|
|
199309
|
+
};
|
|
199310
|
+
module.exports = cmp;
|
|
199311
|
+
});
|
|
199312
|
+
|
|
199313
|
+
// ../../node_modules/semver/functions/coerce.js
|
|
199314
|
+
var require_coerce = __commonJS((exports, module) => {
|
|
199315
|
+
var SemVer = require_semver2();
|
|
199316
|
+
var parse11 = require_parse8();
|
|
199317
|
+
var { safeRe: re9, t: t25 } = require_re2();
|
|
199318
|
+
var coerce = (version2, options8) => {
|
|
199319
|
+
if (version2 instanceof SemVer) {
|
|
199320
|
+
return version2;
|
|
199321
|
+
}
|
|
199322
|
+
if (typeof version2 === "number") {
|
|
199323
|
+
version2 = String(version2);
|
|
199324
|
+
}
|
|
199325
|
+
if (typeof version2 !== "string") {
|
|
199326
|
+
return null;
|
|
199327
|
+
}
|
|
199328
|
+
options8 = options8 || {};
|
|
199329
|
+
let match = null;
|
|
199330
|
+
if (!options8.rtl) {
|
|
199331
|
+
match = version2.match(options8.includePrerelease ? re9[t25.COERCEFULL] : re9[t25.COERCE]);
|
|
199332
|
+
} else {
|
|
199333
|
+
const coerceRtlRegex = options8.includePrerelease ? re9[t25.COERCERTLFULL] : re9[t25.COERCERTL];
|
|
199334
|
+
let next;
|
|
199335
|
+
while ((next = coerceRtlRegex.exec(version2)) && (!match || match.index + match[0].length !== version2.length)) {
|
|
199336
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
199337
|
+
match = next;
|
|
199338
|
+
}
|
|
199339
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
199340
|
+
}
|
|
199341
|
+
coerceRtlRegex.lastIndex = -1;
|
|
199342
|
+
}
|
|
199343
|
+
if (match === null) {
|
|
199344
|
+
return null;
|
|
199345
|
+
}
|
|
199346
|
+
const major = match[2];
|
|
199347
|
+
const minor = match[3] || "0";
|
|
199348
|
+
const patch = match[4] || "0";
|
|
199349
|
+
const prerelease = options8.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
199350
|
+
const build = options8.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
199351
|
+
return parse11(`${major}.${minor}.${patch}${prerelease}${build}`, options8);
|
|
199352
|
+
};
|
|
199353
|
+
module.exports = coerce;
|
|
199354
|
+
});
|
|
199355
|
+
|
|
199356
|
+
// ../../node_modules/semver/internal/lrucache.js
|
|
199357
|
+
var require_lrucache = __commonJS((exports, module) => {
|
|
199358
|
+
class LRUCache {
|
|
199359
|
+
constructor() {
|
|
199360
|
+
this.max = 1000;
|
|
199361
|
+
this.map = new Map;
|
|
199362
|
+
}
|
|
199363
|
+
get(key2) {
|
|
199364
|
+
const value = this.map.get(key2);
|
|
199365
|
+
if (value === undefined) {
|
|
199366
|
+
return;
|
|
199367
|
+
} else {
|
|
199368
|
+
this.map.delete(key2);
|
|
199369
|
+
this.map.set(key2, value);
|
|
199370
|
+
return value;
|
|
199371
|
+
}
|
|
199372
|
+
}
|
|
199373
|
+
delete(key2) {
|
|
199374
|
+
return this.map.delete(key2);
|
|
199375
|
+
}
|
|
199376
|
+
set(key2, value) {
|
|
199377
|
+
const deleted = this.delete(key2);
|
|
199378
|
+
if (!deleted && value !== undefined) {
|
|
199379
|
+
if (this.map.size >= this.max) {
|
|
199380
|
+
const firstKey = this.map.keys().next().value;
|
|
199381
|
+
this.delete(firstKey);
|
|
199382
|
+
}
|
|
199383
|
+
this.map.set(key2, value);
|
|
199384
|
+
}
|
|
199385
|
+
return this;
|
|
199386
|
+
}
|
|
199387
|
+
}
|
|
199388
|
+
module.exports = LRUCache;
|
|
199389
|
+
});
|
|
199390
|
+
|
|
199391
|
+
// ../../node_modules/semver/classes/range.js
|
|
199392
|
+
var require_range2 = __commonJS((exports, module) => {
|
|
199393
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
199394
|
+
|
|
199395
|
+
class Range {
|
|
199396
|
+
constructor(range, options8) {
|
|
199397
|
+
options8 = parseOptions(options8);
|
|
199398
|
+
if (range instanceof Range) {
|
|
199399
|
+
if (range.loose === !!options8.loose && range.includePrerelease === !!options8.includePrerelease) {
|
|
199400
|
+
return range;
|
|
199401
|
+
} else {
|
|
199402
|
+
return new Range(range.raw, options8);
|
|
199403
|
+
}
|
|
199404
|
+
}
|
|
199405
|
+
if (range instanceof Comparator) {
|
|
199406
|
+
this.raw = range.value;
|
|
199407
|
+
this.set = [[range]];
|
|
199408
|
+
this.formatted = undefined;
|
|
199409
|
+
return this;
|
|
199410
|
+
}
|
|
199411
|
+
this.options = options8;
|
|
199412
|
+
this.loose = !!options8.loose;
|
|
199413
|
+
this.includePrerelease = !!options8.includePrerelease;
|
|
199414
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
199415
|
+
this.set = this.raw.split("||").map((r5) => this.parseRange(r5.trim())).filter((c8) => c8.length);
|
|
199416
|
+
if (!this.set.length) {
|
|
199417
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
199418
|
+
}
|
|
199419
|
+
if (this.set.length > 1) {
|
|
199420
|
+
const first = this.set[0];
|
|
199421
|
+
this.set = this.set.filter((c8) => !isNullSet(c8[0]));
|
|
199422
|
+
if (this.set.length === 0) {
|
|
199423
|
+
this.set = [first];
|
|
199424
|
+
} else if (this.set.length > 1) {
|
|
199425
|
+
for (const c8 of this.set) {
|
|
199426
|
+
if (c8.length === 1 && isAny(c8[0])) {
|
|
199427
|
+
this.set = [c8];
|
|
199428
|
+
break;
|
|
199429
|
+
}
|
|
199430
|
+
}
|
|
199431
|
+
}
|
|
199432
|
+
}
|
|
199433
|
+
this.formatted = undefined;
|
|
199434
|
+
}
|
|
199435
|
+
get range() {
|
|
199436
|
+
if (this.formatted === undefined) {
|
|
199437
|
+
this.formatted = "";
|
|
199438
|
+
for (let i5 = 0;i5 < this.set.length; i5++) {
|
|
199439
|
+
if (i5 > 0) {
|
|
199440
|
+
this.formatted += "||";
|
|
199441
|
+
}
|
|
199442
|
+
const comps = this.set[i5];
|
|
199443
|
+
for (let k9 = 0;k9 < comps.length; k9++) {
|
|
199444
|
+
if (k9 > 0) {
|
|
199445
|
+
this.formatted += " ";
|
|
199446
|
+
}
|
|
199447
|
+
this.formatted += comps[k9].toString().trim();
|
|
199448
|
+
}
|
|
199449
|
+
}
|
|
199450
|
+
}
|
|
199451
|
+
return this.formatted;
|
|
199452
|
+
}
|
|
199453
|
+
format() {
|
|
199454
|
+
return this.range;
|
|
199455
|
+
}
|
|
199456
|
+
toString() {
|
|
199457
|
+
return this.range;
|
|
199458
|
+
}
|
|
199459
|
+
parseRange(range) {
|
|
199460
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
199461
|
+
const memoKey = memoOpts + ":" + range;
|
|
199462
|
+
const cached2 = cache4.get(memoKey);
|
|
199463
|
+
if (cached2) {
|
|
199464
|
+
return cached2;
|
|
199465
|
+
}
|
|
199466
|
+
const loose = this.options.loose;
|
|
199467
|
+
const hr8 = loose ? re9[t25.HYPHENRANGELOOSE] : re9[t25.HYPHENRANGE];
|
|
199468
|
+
range = range.replace(hr8, hyphenReplace(this.options.includePrerelease));
|
|
199469
|
+
debug("hyphen replace", range);
|
|
199470
|
+
range = range.replace(re9[t25.COMPARATORTRIM], comparatorTrimReplace);
|
|
199471
|
+
debug("comparator trim", range);
|
|
199472
|
+
range = range.replace(re9[t25.TILDETRIM], tildeTrimReplace);
|
|
199473
|
+
debug("tilde trim", range);
|
|
199474
|
+
range = range.replace(re9[t25.CARETTRIM], caretTrimReplace);
|
|
199475
|
+
debug("caret trim", range);
|
|
199476
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
199477
|
+
if (loose) {
|
|
199478
|
+
rangeList = rangeList.filter((comp) => {
|
|
199479
|
+
debug("loose invalid filter", comp, this.options);
|
|
199480
|
+
return !!comp.match(re9[t25.COMPARATORLOOSE]);
|
|
199481
|
+
});
|
|
199482
|
+
}
|
|
199483
|
+
debug("range list", rangeList);
|
|
199484
|
+
const rangeMap = new Map;
|
|
199485
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
199486
|
+
for (const comp of comparators) {
|
|
199487
|
+
if (isNullSet(comp)) {
|
|
199488
|
+
return [comp];
|
|
199489
|
+
}
|
|
199490
|
+
rangeMap.set(comp.value, comp);
|
|
199491
|
+
}
|
|
199492
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
199493
|
+
rangeMap.delete("");
|
|
199494
|
+
}
|
|
199495
|
+
const result = [...rangeMap.values()];
|
|
199496
|
+
cache4.set(memoKey, result);
|
|
199497
|
+
return result;
|
|
199498
|
+
}
|
|
199499
|
+
intersects(range, options8) {
|
|
199500
|
+
if (!(range instanceof Range)) {
|
|
199501
|
+
throw new TypeError("a Range is required");
|
|
199502
|
+
}
|
|
199503
|
+
return this.set.some((thisComparators) => {
|
|
199504
|
+
return isSatisfiable(thisComparators, options8) && range.set.some((rangeComparators) => {
|
|
199505
|
+
return isSatisfiable(rangeComparators, options8) && thisComparators.every((thisComparator) => {
|
|
199506
|
+
return rangeComparators.every((rangeComparator) => {
|
|
199507
|
+
return thisComparator.intersects(rangeComparator, options8);
|
|
199508
|
+
});
|
|
199509
|
+
});
|
|
199510
|
+
});
|
|
199511
|
+
});
|
|
199512
|
+
}
|
|
199513
|
+
test(version2) {
|
|
199514
|
+
if (!version2) {
|
|
199515
|
+
return false;
|
|
199516
|
+
}
|
|
199517
|
+
if (typeof version2 === "string") {
|
|
199518
|
+
try {
|
|
199519
|
+
version2 = new SemVer(version2, this.options);
|
|
199520
|
+
} catch (er10) {
|
|
199521
|
+
return false;
|
|
199522
|
+
}
|
|
199523
|
+
}
|
|
199524
|
+
for (let i5 = 0;i5 < this.set.length; i5++) {
|
|
199525
|
+
if (testSet(this.set[i5], version2, this.options)) {
|
|
199526
|
+
return true;
|
|
199527
|
+
}
|
|
199528
|
+
}
|
|
199529
|
+
return false;
|
|
199530
|
+
}
|
|
199531
|
+
}
|
|
199532
|
+
module.exports = Range;
|
|
199533
|
+
var LRU = require_lrucache();
|
|
199534
|
+
var cache4 = new LRU;
|
|
199535
|
+
var parseOptions = require_parse_options2();
|
|
199536
|
+
var Comparator = require_comparator();
|
|
199537
|
+
var debug = require_debug4();
|
|
199538
|
+
var SemVer = require_semver2();
|
|
199539
|
+
var {
|
|
199540
|
+
safeRe: re9,
|
|
199541
|
+
t: t25,
|
|
199542
|
+
comparatorTrimReplace,
|
|
199543
|
+
tildeTrimReplace,
|
|
199544
|
+
caretTrimReplace
|
|
199545
|
+
} = require_re2();
|
|
199546
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants6();
|
|
199547
|
+
var isNullSet = (c8) => c8.value === "<0.0.0-0";
|
|
199548
|
+
var isAny = (c8) => c8.value === "";
|
|
199549
|
+
var isSatisfiable = (comparators, options8) => {
|
|
199550
|
+
let result = true;
|
|
199551
|
+
const remainingComparators = comparators.slice();
|
|
199552
|
+
let testComparator = remainingComparators.pop();
|
|
199553
|
+
while (result && remainingComparators.length) {
|
|
199554
|
+
result = remainingComparators.every((otherComparator) => {
|
|
199555
|
+
return testComparator.intersects(otherComparator, options8);
|
|
199556
|
+
});
|
|
199557
|
+
testComparator = remainingComparators.pop();
|
|
199558
|
+
}
|
|
199559
|
+
return result;
|
|
199560
|
+
};
|
|
199561
|
+
var parseComparator = (comp, options8) => {
|
|
199562
|
+
comp = comp.replace(re9[t25.BUILD], "");
|
|
199563
|
+
debug("comp", comp, options8);
|
|
199564
|
+
comp = replaceCarets(comp, options8);
|
|
199565
|
+
debug("caret", comp);
|
|
199566
|
+
comp = replaceTildes(comp, options8);
|
|
199567
|
+
debug("tildes", comp);
|
|
199568
|
+
comp = replaceXRanges(comp, options8);
|
|
199569
|
+
debug("xrange", comp);
|
|
199570
|
+
comp = replaceStars(comp, options8);
|
|
199571
|
+
debug("stars", comp);
|
|
199572
|
+
return comp;
|
|
199573
|
+
};
|
|
199574
|
+
var isX = (id2) => !id2 || id2.toLowerCase() === "x" || id2 === "*";
|
|
199575
|
+
var replaceTildes = (comp, options8) => {
|
|
199576
|
+
return comp.trim().split(/\s+/).map((c8) => replaceTilde(c8, options8)).join(" ");
|
|
199577
|
+
};
|
|
199578
|
+
var replaceTilde = (comp, options8) => {
|
|
199579
|
+
const r5 = options8.loose ? re9[t25.TILDELOOSE] : re9[t25.TILDE];
|
|
199580
|
+
return comp.replace(r5, (_10, M12, m7, p4, pr8) => {
|
|
199581
|
+
debug("tilde", comp, _10, M12, m7, p4, pr8);
|
|
199582
|
+
let ret;
|
|
199583
|
+
if (isX(M12)) {
|
|
199584
|
+
ret = "";
|
|
199585
|
+
} else if (isX(m7)) {
|
|
199586
|
+
ret = `>=${M12}.0.0 <${+M12 + 1}.0.0-0`;
|
|
199587
|
+
} else if (isX(p4)) {
|
|
199588
|
+
ret = `>=${M12}.${m7}.0 <${M12}.${+m7 + 1}.0-0`;
|
|
199589
|
+
} else if (pr8) {
|
|
199590
|
+
debug("replaceTilde pr", pr8);
|
|
199591
|
+
ret = `>=${M12}.${m7}.${p4}-${pr8} <${M12}.${+m7 + 1}.0-0`;
|
|
199592
|
+
} else {
|
|
199593
|
+
ret = `>=${M12}.${m7}.${p4} <${M12}.${+m7 + 1}.0-0`;
|
|
199594
|
+
}
|
|
199595
|
+
debug("tilde return", ret);
|
|
199596
|
+
return ret;
|
|
199597
|
+
});
|
|
199598
|
+
};
|
|
199599
|
+
var replaceCarets = (comp, options8) => {
|
|
199600
|
+
return comp.trim().split(/\s+/).map((c8) => replaceCaret(c8, options8)).join(" ");
|
|
199601
|
+
};
|
|
199602
|
+
var replaceCaret = (comp, options8) => {
|
|
199603
|
+
debug("caret", comp, options8);
|
|
199604
|
+
const r5 = options8.loose ? re9[t25.CARETLOOSE] : re9[t25.CARET];
|
|
199605
|
+
const z11 = options8.includePrerelease ? "-0" : "";
|
|
199606
|
+
return comp.replace(r5, (_10, M12, m7, p4, pr8) => {
|
|
199607
|
+
debug("caret", comp, _10, M12, m7, p4, pr8);
|
|
199608
|
+
let ret;
|
|
199609
|
+
if (isX(M12)) {
|
|
199610
|
+
ret = "";
|
|
199611
|
+
} else if (isX(m7)) {
|
|
199612
|
+
ret = `>=${M12}.0.0${z11} <${+M12 + 1}.0.0-0`;
|
|
199613
|
+
} else if (isX(p4)) {
|
|
199614
|
+
if (M12 === "0") {
|
|
199615
|
+
ret = `>=${M12}.${m7}.0${z11} <${M12}.${+m7 + 1}.0-0`;
|
|
199616
|
+
} else {
|
|
199617
|
+
ret = `>=${M12}.${m7}.0${z11} <${+M12 + 1}.0.0-0`;
|
|
199618
|
+
}
|
|
199619
|
+
} else if (pr8) {
|
|
199620
|
+
debug("replaceCaret pr", pr8);
|
|
199621
|
+
if (M12 === "0") {
|
|
199622
|
+
if (m7 === "0") {
|
|
199623
|
+
ret = `>=${M12}.${m7}.${p4}-${pr8} <${M12}.${m7}.${+p4 + 1}-0`;
|
|
199624
|
+
} else {
|
|
199625
|
+
ret = `>=${M12}.${m7}.${p4}-${pr8} <${M12}.${+m7 + 1}.0-0`;
|
|
199626
|
+
}
|
|
199627
|
+
} else {
|
|
199628
|
+
ret = `>=${M12}.${m7}.${p4}-${pr8} <${+M12 + 1}.0.0-0`;
|
|
199629
|
+
}
|
|
199630
|
+
} else {
|
|
199631
|
+
debug("no pr");
|
|
199632
|
+
if (M12 === "0") {
|
|
199633
|
+
if (m7 === "0") {
|
|
199634
|
+
ret = `>=${M12}.${m7}.${p4}${z11} <${M12}.${m7}.${+p4 + 1}-0`;
|
|
199635
|
+
} else {
|
|
199636
|
+
ret = `>=${M12}.${m7}.${p4}${z11} <${M12}.${+m7 + 1}.0-0`;
|
|
199637
|
+
}
|
|
199638
|
+
} else {
|
|
199639
|
+
ret = `>=${M12}.${m7}.${p4} <${+M12 + 1}.0.0-0`;
|
|
199640
|
+
}
|
|
199641
|
+
}
|
|
199642
|
+
debug("caret return", ret);
|
|
199643
|
+
return ret;
|
|
199644
|
+
});
|
|
199645
|
+
};
|
|
199646
|
+
var replaceXRanges = (comp, options8) => {
|
|
199647
|
+
debug("replaceXRanges", comp, options8);
|
|
199648
|
+
return comp.split(/\s+/).map((c8) => replaceXRange(c8, options8)).join(" ");
|
|
199649
|
+
};
|
|
199650
|
+
var replaceXRange = (comp, options8) => {
|
|
199651
|
+
comp = comp.trim();
|
|
199652
|
+
const r5 = options8.loose ? re9[t25.XRANGELOOSE] : re9[t25.XRANGE];
|
|
199653
|
+
return comp.replace(r5, (ret, gtlt, M12, m7, p4, pr8) => {
|
|
199654
|
+
debug("xRange", comp, ret, gtlt, M12, m7, p4, pr8);
|
|
199655
|
+
const xM = isX(M12);
|
|
199656
|
+
const xm3 = xM || isX(m7);
|
|
199657
|
+
const xp3 = xm3 || isX(p4);
|
|
199658
|
+
const anyX = xp3;
|
|
199659
|
+
if (gtlt === "=" && anyX) {
|
|
199660
|
+
gtlt = "";
|
|
199661
|
+
}
|
|
199662
|
+
pr8 = options8.includePrerelease ? "-0" : "";
|
|
199663
|
+
if (xM) {
|
|
199664
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
199665
|
+
ret = "<0.0.0-0";
|
|
199666
|
+
} else {
|
|
199667
|
+
ret = "*";
|
|
199668
|
+
}
|
|
199669
|
+
} else if (gtlt && anyX) {
|
|
199670
|
+
if (xm3) {
|
|
199671
|
+
m7 = 0;
|
|
199672
|
+
}
|
|
199673
|
+
p4 = 0;
|
|
199674
|
+
if (gtlt === ">") {
|
|
199675
|
+
gtlt = ">=";
|
|
199676
|
+
if (xm3) {
|
|
199677
|
+
M12 = +M12 + 1;
|
|
199678
|
+
m7 = 0;
|
|
199679
|
+
p4 = 0;
|
|
199680
|
+
} else {
|
|
199681
|
+
m7 = +m7 + 1;
|
|
199682
|
+
p4 = 0;
|
|
199683
|
+
}
|
|
199684
|
+
} else if (gtlt === "<=") {
|
|
199685
|
+
gtlt = "<";
|
|
199686
|
+
if (xm3) {
|
|
199687
|
+
M12 = +M12 + 1;
|
|
199688
|
+
} else {
|
|
199689
|
+
m7 = +m7 + 1;
|
|
199690
|
+
}
|
|
199691
|
+
}
|
|
199692
|
+
if (gtlt === "<") {
|
|
199693
|
+
pr8 = "-0";
|
|
199694
|
+
}
|
|
199695
|
+
ret = `${gtlt + M12}.${m7}.${p4}${pr8}`;
|
|
199696
|
+
} else if (xm3) {
|
|
199697
|
+
ret = `>=${M12}.0.0${pr8} <${+M12 + 1}.0.0-0`;
|
|
199698
|
+
} else if (xp3) {
|
|
199699
|
+
ret = `>=${M12}.${m7}.0${pr8} <${M12}.${+m7 + 1}.0-0`;
|
|
199700
|
+
}
|
|
199701
|
+
debug("xRange return", ret);
|
|
199702
|
+
return ret;
|
|
199703
|
+
});
|
|
199704
|
+
};
|
|
199705
|
+
var replaceStars = (comp, options8) => {
|
|
199706
|
+
debug("replaceStars", comp, options8);
|
|
199707
|
+
return comp.trim().replace(re9[t25.STAR], "");
|
|
199708
|
+
};
|
|
199709
|
+
var replaceGTE0 = (comp, options8) => {
|
|
199710
|
+
debug("replaceGTE0", comp, options8);
|
|
199711
|
+
return comp.trim().replace(re9[options8.includePrerelease ? t25.GTE0PRE : t25.GTE0], "");
|
|
199712
|
+
};
|
|
199713
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm3, fp2, fpr, fb2, to5, tM, tm3, tp2, tpr) => {
|
|
199714
|
+
if (isX(fM)) {
|
|
199715
|
+
from = "";
|
|
199716
|
+
} else if (isX(fm3)) {
|
|
199717
|
+
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
199718
|
+
} else if (isX(fp2)) {
|
|
199719
|
+
from = `>=${fM}.${fm3}.0${incPr ? "-0" : ""}`;
|
|
199720
|
+
} else if (fpr) {
|
|
199721
|
+
from = `>=${from}`;
|
|
199722
|
+
} else {
|
|
199723
|
+
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
199724
|
+
}
|
|
199725
|
+
if (isX(tM)) {
|
|
199726
|
+
to5 = "";
|
|
199727
|
+
} else if (isX(tm3)) {
|
|
199728
|
+
to5 = `<${+tM + 1}.0.0-0`;
|
|
199729
|
+
} else if (isX(tp2)) {
|
|
199730
|
+
to5 = `<${tM}.${+tm3 + 1}.0-0`;
|
|
199731
|
+
} else if (tpr) {
|
|
199732
|
+
to5 = `<=${tM}.${tm3}.${tp2}-${tpr}`;
|
|
199733
|
+
} else if (incPr) {
|
|
199734
|
+
to5 = `<${tM}.${tm3}.${+tp2 + 1}-0`;
|
|
199735
|
+
} else {
|
|
199736
|
+
to5 = `<=${to5}`;
|
|
199737
|
+
}
|
|
199738
|
+
return `${from} ${to5}`.trim();
|
|
199739
|
+
};
|
|
199740
|
+
var testSet = (set2, version2, options8) => {
|
|
199741
|
+
for (let i5 = 0;i5 < set2.length; i5++) {
|
|
199742
|
+
if (!set2[i5].test(version2)) {
|
|
199743
|
+
return false;
|
|
199744
|
+
}
|
|
199745
|
+
}
|
|
199746
|
+
if (version2.prerelease.length && !options8.includePrerelease) {
|
|
199747
|
+
for (let i5 = 0;i5 < set2.length; i5++) {
|
|
199748
|
+
debug(set2[i5].semver);
|
|
199749
|
+
if (set2[i5].semver === Comparator.ANY) {
|
|
199750
|
+
continue;
|
|
199751
|
+
}
|
|
199752
|
+
if (set2[i5].semver.prerelease.length > 0) {
|
|
199753
|
+
const allowed = set2[i5].semver;
|
|
199754
|
+
if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) {
|
|
199755
|
+
return true;
|
|
199756
|
+
}
|
|
199757
|
+
}
|
|
199758
|
+
}
|
|
199759
|
+
return false;
|
|
199760
|
+
}
|
|
199761
|
+
return true;
|
|
199762
|
+
};
|
|
199763
|
+
});
|
|
199764
|
+
|
|
199765
|
+
// ../../node_modules/semver/classes/comparator.js
|
|
199766
|
+
var require_comparator = __commonJS((exports, module) => {
|
|
199767
|
+
var ANY = Symbol("SemVer ANY");
|
|
199768
|
+
|
|
199769
|
+
class Comparator {
|
|
199770
|
+
static get ANY() {
|
|
199771
|
+
return ANY;
|
|
199772
|
+
}
|
|
199773
|
+
constructor(comp, options8) {
|
|
199774
|
+
options8 = parseOptions(options8);
|
|
199775
|
+
if (comp instanceof Comparator) {
|
|
199776
|
+
if (comp.loose === !!options8.loose) {
|
|
199777
|
+
return comp;
|
|
199778
|
+
} else {
|
|
199779
|
+
comp = comp.value;
|
|
199780
|
+
}
|
|
199781
|
+
}
|
|
199782
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
199783
|
+
debug("comparator", comp, options8);
|
|
199784
|
+
this.options = options8;
|
|
199785
|
+
this.loose = !!options8.loose;
|
|
199786
|
+
this.parse(comp);
|
|
199787
|
+
if (this.semver === ANY) {
|
|
199788
|
+
this.value = "";
|
|
199789
|
+
} else {
|
|
199790
|
+
this.value = this.operator + this.semver.version;
|
|
199791
|
+
}
|
|
199792
|
+
debug("comp", this);
|
|
199793
|
+
}
|
|
199794
|
+
parse(comp) {
|
|
199795
|
+
const r5 = this.options.loose ? re9[t25.COMPARATORLOOSE] : re9[t25.COMPARATOR];
|
|
199796
|
+
const m7 = comp.match(r5);
|
|
199797
|
+
if (!m7) {
|
|
199798
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
199799
|
+
}
|
|
199800
|
+
this.operator = m7[1] !== undefined ? m7[1] : "";
|
|
199801
|
+
if (this.operator === "=") {
|
|
199802
|
+
this.operator = "";
|
|
199803
|
+
}
|
|
199804
|
+
if (!m7[2]) {
|
|
199805
|
+
this.semver = ANY;
|
|
199806
|
+
} else {
|
|
199807
|
+
this.semver = new SemVer(m7[2], this.options.loose);
|
|
199808
|
+
}
|
|
199809
|
+
}
|
|
199810
|
+
toString() {
|
|
199811
|
+
return this.value;
|
|
199812
|
+
}
|
|
199813
|
+
test(version2) {
|
|
199814
|
+
debug("Comparator.test", version2, this.options.loose);
|
|
199815
|
+
if (this.semver === ANY || version2 === ANY) {
|
|
199816
|
+
return true;
|
|
199817
|
+
}
|
|
199818
|
+
if (typeof version2 === "string") {
|
|
199819
|
+
try {
|
|
199820
|
+
version2 = new SemVer(version2, this.options);
|
|
199821
|
+
} catch (er10) {
|
|
199822
|
+
return false;
|
|
199823
|
+
}
|
|
199824
|
+
}
|
|
199825
|
+
return cmp(version2, this.operator, this.semver, this.options);
|
|
199826
|
+
}
|
|
199827
|
+
intersects(comp, options8) {
|
|
199828
|
+
if (!(comp instanceof Comparator)) {
|
|
199829
|
+
throw new TypeError("a Comparator is required");
|
|
199830
|
+
}
|
|
199831
|
+
if (this.operator === "") {
|
|
199832
|
+
if (this.value === "") {
|
|
199833
|
+
return true;
|
|
199834
|
+
}
|
|
199835
|
+
return new Range(comp.value, options8).test(this.value);
|
|
199836
|
+
} else if (comp.operator === "") {
|
|
199837
|
+
if (comp.value === "") {
|
|
199838
|
+
return true;
|
|
199839
|
+
}
|
|
199840
|
+
return new Range(this.value, options8).test(comp.semver);
|
|
199841
|
+
}
|
|
199842
|
+
options8 = parseOptions(options8);
|
|
199843
|
+
if (options8.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
199844
|
+
return false;
|
|
199845
|
+
}
|
|
199846
|
+
if (!options8.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
199847
|
+
return false;
|
|
199848
|
+
}
|
|
199849
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
199850
|
+
return true;
|
|
199851
|
+
}
|
|
199852
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
199853
|
+
return true;
|
|
199854
|
+
}
|
|
199855
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
199856
|
+
return true;
|
|
199857
|
+
}
|
|
199858
|
+
if (cmp(this.semver, "<", comp.semver, options8) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
199859
|
+
return true;
|
|
199860
|
+
}
|
|
199861
|
+
if (cmp(this.semver, ">", comp.semver, options8) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
199862
|
+
return true;
|
|
199863
|
+
}
|
|
199864
|
+
return false;
|
|
199865
|
+
}
|
|
199866
|
+
}
|
|
199867
|
+
module.exports = Comparator;
|
|
199868
|
+
var parseOptions = require_parse_options2();
|
|
199869
|
+
var { safeRe: re9, t: t25 } = require_re2();
|
|
199870
|
+
var cmp = require_cmp();
|
|
199871
|
+
var debug = require_debug4();
|
|
199872
|
+
var SemVer = require_semver2();
|
|
199873
|
+
var Range = require_range2();
|
|
199874
|
+
});
|
|
199875
|
+
|
|
199876
|
+
// ../../node_modules/semver/functions/satisfies.js
|
|
199877
|
+
var require_satisfies = __commonJS((exports, module) => {
|
|
199878
|
+
var Range = require_range2();
|
|
199879
|
+
var satisfies = (version2, range, options8) => {
|
|
199880
|
+
try {
|
|
199881
|
+
range = new Range(range, options8);
|
|
199882
|
+
} catch (er10) {
|
|
199883
|
+
return false;
|
|
199884
|
+
}
|
|
199885
|
+
return range.test(version2);
|
|
199886
|
+
};
|
|
199887
|
+
module.exports = satisfies;
|
|
199888
|
+
});
|
|
199889
|
+
|
|
199890
|
+
// ../../node_modules/semver/ranges/to-comparators.js
|
|
199891
|
+
var require_to_comparators = __commonJS((exports, module) => {
|
|
199892
|
+
var Range = require_range2();
|
|
199893
|
+
var toComparators = (range, options8) => new Range(range, options8).set.map((comp) => comp.map((c8) => c8.value).join(" ").trim().split(" "));
|
|
199894
|
+
module.exports = toComparators;
|
|
199895
|
+
});
|
|
199896
|
+
|
|
199897
|
+
// ../../node_modules/semver/ranges/max-satisfying.js
|
|
199898
|
+
var require_max_satisfying = __commonJS((exports, module) => {
|
|
199899
|
+
var SemVer = require_semver2();
|
|
199900
|
+
var Range = require_range2();
|
|
199901
|
+
var maxSatisfying = (versions2, range, options8) => {
|
|
199902
|
+
let max = null;
|
|
199903
|
+
let maxSV = null;
|
|
199904
|
+
let rangeObj = null;
|
|
199905
|
+
try {
|
|
199906
|
+
rangeObj = new Range(range, options8);
|
|
199907
|
+
} catch (er10) {
|
|
199908
|
+
return null;
|
|
199909
|
+
}
|
|
199910
|
+
versions2.forEach((v10) => {
|
|
199911
|
+
if (rangeObj.test(v10)) {
|
|
199912
|
+
if (!max || maxSV.compare(v10) === -1) {
|
|
199913
|
+
max = v10;
|
|
199914
|
+
maxSV = new SemVer(max, options8);
|
|
199915
|
+
}
|
|
199916
|
+
}
|
|
199917
|
+
});
|
|
199918
|
+
return max;
|
|
199919
|
+
};
|
|
199920
|
+
module.exports = maxSatisfying;
|
|
199921
|
+
});
|
|
199922
|
+
|
|
199923
|
+
// ../../node_modules/semver/ranges/min-satisfying.js
|
|
199924
|
+
var require_min_satisfying = __commonJS((exports, module) => {
|
|
199925
|
+
var SemVer = require_semver2();
|
|
199926
|
+
var Range = require_range2();
|
|
199927
|
+
var minSatisfying = (versions2, range, options8) => {
|
|
199928
|
+
let min = null;
|
|
199929
|
+
let minSV = null;
|
|
199930
|
+
let rangeObj = null;
|
|
199931
|
+
try {
|
|
199932
|
+
rangeObj = new Range(range, options8);
|
|
199933
|
+
} catch (er10) {
|
|
199934
|
+
return null;
|
|
199935
|
+
}
|
|
199936
|
+
versions2.forEach((v10) => {
|
|
199937
|
+
if (rangeObj.test(v10)) {
|
|
199938
|
+
if (!min || minSV.compare(v10) === 1) {
|
|
199939
|
+
min = v10;
|
|
199940
|
+
minSV = new SemVer(min, options8);
|
|
199941
|
+
}
|
|
199942
|
+
}
|
|
199943
|
+
});
|
|
199944
|
+
return min;
|
|
199945
|
+
};
|
|
199946
|
+
module.exports = minSatisfying;
|
|
199947
|
+
});
|
|
199948
|
+
|
|
199949
|
+
// ../../node_modules/semver/ranges/min-version.js
|
|
199950
|
+
var require_min_version = __commonJS((exports, module) => {
|
|
199951
|
+
var SemVer = require_semver2();
|
|
199952
|
+
var Range = require_range2();
|
|
199953
|
+
var gt12 = require_gt();
|
|
199954
|
+
var minVersion = (range, loose) => {
|
|
199955
|
+
range = new Range(range, loose);
|
|
199956
|
+
let minver = new SemVer("0.0.0");
|
|
199957
|
+
if (range.test(minver)) {
|
|
199958
|
+
return minver;
|
|
199959
|
+
}
|
|
199960
|
+
minver = new SemVer("0.0.0-0");
|
|
199961
|
+
if (range.test(minver)) {
|
|
199962
|
+
return minver;
|
|
199963
|
+
}
|
|
199964
|
+
minver = null;
|
|
199965
|
+
for (let i5 = 0;i5 < range.set.length; ++i5) {
|
|
199966
|
+
const comparators = range.set[i5];
|
|
199967
|
+
let setMin = null;
|
|
199968
|
+
comparators.forEach((comparator) => {
|
|
199969
|
+
const compver = new SemVer(comparator.semver.version);
|
|
199970
|
+
switch (comparator.operator) {
|
|
199971
|
+
case ">":
|
|
199972
|
+
if (compver.prerelease.length === 0) {
|
|
199973
|
+
compver.patch++;
|
|
199974
|
+
} else {
|
|
199975
|
+
compver.prerelease.push(0);
|
|
199976
|
+
}
|
|
199977
|
+
compver.raw = compver.format();
|
|
199978
|
+
case "":
|
|
199979
|
+
case ">=":
|
|
199980
|
+
if (!setMin || gt12(compver, setMin)) {
|
|
199981
|
+
setMin = compver;
|
|
199982
|
+
}
|
|
199983
|
+
break;
|
|
199984
|
+
case "<":
|
|
199985
|
+
case "<=":
|
|
199986
|
+
break;
|
|
199987
|
+
default:
|
|
199988
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
199989
|
+
}
|
|
199990
|
+
});
|
|
199991
|
+
if (setMin && (!minver || gt12(minver, setMin))) {
|
|
199992
|
+
minver = setMin;
|
|
199993
|
+
}
|
|
199994
|
+
}
|
|
199995
|
+
if (minver && range.test(minver)) {
|
|
199996
|
+
return minver;
|
|
199997
|
+
}
|
|
199998
|
+
return null;
|
|
199999
|
+
};
|
|
200000
|
+
module.exports = minVersion;
|
|
200001
|
+
});
|
|
200002
|
+
|
|
200003
|
+
// ../../node_modules/semver/ranges/valid.js
|
|
200004
|
+
var require_valid2 = __commonJS((exports, module) => {
|
|
200005
|
+
var Range = require_range2();
|
|
200006
|
+
var validRange = (range, options8) => {
|
|
200007
|
+
try {
|
|
200008
|
+
return new Range(range, options8).range || "*";
|
|
200009
|
+
} catch (er10) {
|
|
200010
|
+
return null;
|
|
200011
|
+
}
|
|
200012
|
+
};
|
|
200013
|
+
module.exports = validRange;
|
|
200014
|
+
});
|
|
200015
|
+
|
|
200016
|
+
// ../../node_modules/semver/ranges/outside.js
|
|
200017
|
+
var require_outside = __commonJS((exports, module) => {
|
|
200018
|
+
var SemVer = require_semver2();
|
|
200019
|
+
var Comparator = require_comparator();
|
|
200020
|
+
var { ANY } = Comparator;
|
|
200021
|
+
var Range = require_range2();
|
|
200022
|
+
var satisfies = require_satisfies();
|
|
200023
|
+
var gt12 = require_gt();
|
|
200024
|
+
var lt10 = require_lt();
|
|
200025
|
+
var lte = require_lte();
|
|
200026
|
+
var gte = require_gte2();
|
|
200027
|
+
var outside = (version2, range, hilo, options8) => {
|
|
200028
|
+
version2 = new SemVer(version2, options8);
|
|
200029
|
+
range = new Range(range, options8);
|
|
200030
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
200031
|
+
switch (hilo) {
|
|
200032
|
+
case ">":
|
|
200033
|
+
gtfn = gt12;
|
|
200034
|
+
ltefn = lte;
|
|
200035
|
+
ltfn = lt10;
|
|
200036
|
+
comp = ">";
|
|
200037
|
+
ecomp = ">=";
|
|
200038
|
+
break;
|
|
200039
|
+
case "<":
|
|
200040
|
+
gtfn = lt10;
|
|
200041
|
+
ltefn = gte;
|
|
200042
|
+
ltfn = gt12;
|
|
200043
|
+
comp = "<";
|
|
200044
|
+
ecomp = "<=";
|
|
200045
|
+
break;
|
|
200046
|
+
default:
|
|
200047
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
200048
|
+
}
|
|
200049
|
+
if (satisfies(version2, range, options8)) {
|
|
200050
|
+
return false;
|
|
200051
|
+
}
|
|
200052
|
+
for (let i5 = 0;i5 < range.set.length; ++i5) {
|
|
200053
|
+
const comparators = range.set[i5];
|
|
200054
|
+
let high = null;
|
|
200055
|
+
let low = null;
|
|
200056
|
+
comparators.forEach((comparator) => {
|
|
200057
|
+
if (comparator.semver === ANY) {
|
|
200058
|
+
comparator = new Comparator(">=0.0.0");
|
|
200059
|
+
}
|
|
200060
|
+
high = high || comparator;
|
|
200061
|
+
low = low || comparator;
|
|
200062
|
+
if (gtfn(comparator.semver, high.semver, options8)) {
|
|
200063
|
+
high = comparator;
|
|
200064
|
+
} else if (ltfn(comparator.semver, low.semver, options8)) {
|
|
200065
|
+
low = comparator;
|
|
200066
|
+
}
|
|
200067
|
+
});
|
|
200068
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
200069
|
+
return false;
|
|
200070
|
+
}
|
|
200071
|
+
if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) {
|
|
200072
|
+
return false;
|
|
200073
|
+
} else if (low.operator === ecomp && ltfn(version2, low.semver)) {
|
|
200074
|
+
return false;
|
|
200075
|
+
}
|
|
200076
|
+
}
|
|
200077
|
+
return true;
|
|
200078
|
+
};
|
|
200079
|
+
module.exports = outside;
|
|
200080
|
+
});
|
|
200081
|
+
|
|
200082
|
+
// ../../node_modules/semver/ranges/gtr.js
|
|
200083
|
+
var require_gtr = __commonJS((exports, module) => {
|
|
200084
|
+
var outside = require_outside();
|
|
200085
|
+
var gtr = (version2, range, options8) => outside(version2, range, ">", options8);
|
|
200086
|
+
module.exports = gtr;
|
|
200087
|
+
});
|
|
200088
|
+
|
|
200089
|
+
// ../../node_modules/semver/ranges/ltr.js
|
|
200090
|
+
var require_ltr = __commonJS((exports, module) => {
|
|
200091
|
+
var outside = require_outside();
|
|
200092
|
+
var ltr = (version2, range, options8) => outside(version2, range, "<", options8);
|
|
200093
|
+
module.exports = ltr;
|
|
200094
|
+
});
|
|
200095
|
+
|
|
200096
|
+
// ../../node_modules/semver/ranges/intersects.js
|
|
200097
|
+
var require_intersects = __commonJS((exports, module) => {
|
|
200098
|
+
var Range = require_range2();
|
|
200099
|
+
var intersects = (r12, r23, options8) => {
|
|
200100
|
+
r12 = new Range(r12, options8);
|
|
200101
|
+
r23 = new Range(r23, options8);
|
|
200102
|
+
return r12.intersects(r23, options8);
|
|
200103
|
+
};
|
|
200104
|
+
module.exports = intersects;
|
|
200105
|
+
});
|
|
200106
|
+
|
|
200107
|
+
// ../../node_modules/semver/ranges/simplify.js
|
|
200108
|
+
var require_simplify = __commonJS((exports, module) => {
|
|
200109
|
+
var satisfies = require_satisfies();
|
|
200110
|
+
var compare = require_compare2();
|
|
200111
|
+
module.exports = (versions2, range, options8) => {
|
|
200112
|
+
const set2 = [];
|
|
200113
|
+
let first = null;
|
|
200114
|
+
let prev = null;
|
|
200115
|
+
const v10 = versions2.sort((a5, b7) => compare(a5, b7, options8));
|
|
200116
|
+
for (const version2 of v10) {
|
|
200117
|
+
const included = satisfies(version2, range, options8);
|
|
200118
|
+
if (included) {
|
|
200119
|
+
prev = version2;
|
|
200120
|
+
if (!first) {
|
|
200121
|
+
first = version2;
|
|
200122
|
+
}
|
|
200123
|
+
} else {
|
|
200124
|
+
if (prev) {
|
|
200125
|
+
set2.push([first, prev]);
|
|
200126
|
+
}
|
|
200127
|
+
prev = null;
|
|
200128
|
+
first = null;
|
|
200129
|
+
}
|
|
200130
|
+
}
|
|
200131
|
+
if (first) {
|
|
200132
|
+
set2.push([first, null]);
|
|
200133
|
+
}
|
|
200134
|
+
const ranges = [];
|
|
200135
|
+
for (const [min, max] of set2) {
|
|
200136
|
+
if (min === max) {
|
|
200137
|
+
ranges.push(min);
|
|
200138
|
+
} else if (!max && min === v10[0]) {
|
|
200139
|
+
ranges.push("*");
|
|
200140
|
+
} else if (!max) {
|
|
200141
|
+
ranges.push(`>=${min}`);
|
|
200142
|
+
} else if (min === v10[0]) {
|
|
200143
|
+
ranges.push(`<=${max}`);
|
|
200144
|
+
} else {
|
|
200145
|
+
ranges.push(`${min} - ${max}`);
|
|
200146
|
+
}
|
|
200147
|
+
}
|
|
200148
|
+
const simplified = ranges.join(" || ");
|
|
200149
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
200150
|
+
return simplified.length < original.length ? simplified : range;
|
|
200151
|
+
};
|
|
200152
|
+
});
|
|
200153
|
+
|
|
200154
|
+
// ../../node_modules/semver/ranges/subset.js
|
|
200155
|
+
var require_subset = __commonJS((exports, module) => {
|
|
200156
|
+
var Range = require_range2();
|
|
200157
|
+
var Comparator = require_comparator();
|
|
200158
|
+
var { ANY } = Comparator;
|
|
200159
|
+
var satisfies = require_satisfies();
|
|
200160
|
+
var compare = require_compare2();
|
|
200161
|
+
var subset = (sub, dom, options8 = {}) => {
|
|
200162
|
+
if (sub === dom) {
|
|
200163
|
+
return true;
|
|
200164
|
+
}
|
|
200165
|
+
sub = new Range(sub, options8);
|
|
200166
|
+
dom = new Range(dom, options8);
|
|
200167
|
+
let sawNonNull = false;
|
|
200168
|
+
OUTER:
|
|
200169
|
+
for (const simpleSub of sub.set) {
|
|
200170
|
+
for (const simpleDom of dom.set) {
|
|
200171
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options8);
|
|
200172
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
200173
|
+
if (isSub) {
|
|
200174
|
+
continue OUTER;
|
|
200175
|
+
}
|
|
200176
|
+
}
|
|
200177
|
+
if (sawNonNull) {
|
|
200178
|
+
return false;
|
|
200179
|
+
}
|
|
200180
|
+
}
|
|
200181
|
+
return true;
|
|
200182
|
+
};
|
|
200183
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
200184
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
200185
|
+
var simpleSubset = (sub, dom, options8) => {
|
|
200186
|
+
if (sub === dom) {
|
|
200187
|
+
return true;
|
|
200188
|
+
}
|
|
200189
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
200190
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
200191
|
+
return true;
|
|
200192
|
+
} else if (options8.includePrerelease) {
|
|
200193
|
+
sub = minimumVersionWithPreRelease;
|
|
200194
|
+
} else {
|
|
200195
|
+
sub = minimumVersion;
|
|
200196
|
+
}
|
|
200197
|
+
}
|
|
200198
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
200199
|
+
if (options8.includePrerelease) {
|
|
200200
|
+
return true;
|
|
200201
|
+
} else {
|
|
200202
|
+
dom = minimumVersion;
|
|
200203
|
+
}
|
|
200204
|
+
}
|
|
200205
|
+
const eqSet = new Set;
|
|
200206
|
+
let gt12, lt10;
|
|
200207
|
+
for (const c8 of sub) {
|
|
200208
|
+
if (c8.operator === ">" || c8.operator === ">=") {
|
|
200209
|
+
gt12 = higherGT(gt12, c8, options8);
|
|
200210
|
+
} else if (c8.operator === "<" || c8.operator === "<=") {
|
|
200211
|
+
lt10 = lowerLT(lt10, c8, options8);
|
|
200212
|
+
} else {
|
|
200213
|
+
eqSet.add(c8.semver);
|
|
200214
|
+
}
|
|
200215
|
+
}
|
|
200216
|
+
if (eqSet.size > 1) {
|
|
200217
|
+
return null;
|
|
200218
|
+
}
|
|
200219
|
+
let gtltComp;
|
|
200220
|
+
if (gt12 && lt10) {
|
|
200221
|
+
gtltComp = compare(gt12.semver, lt10.semver, options8);
|
|
200222
|
+
if (gtltComp > 0) {
|
|
200223
|
+
return null;
|
|
200224
|
+
} else if (gtltComp === 0 && (gt12.operator !== ">=" || lt10.operator !== "<=")) {
|
|
200225
|
+
return null;
|
|
200226
|
+
}
|
|
200227
|
+
}
|
|
200228
|
+
for (const eq of eqSet) {
|
|
200229
|
+
if (gt12 && !satisfies(eq, String(gt12), options8)) {
|
|
200230
|
+
return null;
|
|
200231
|
+
}
|
|
200232
|
+
if (lt10 && !satisfies(eq, String(lt10), options8)) {
|
|
200233
|
+
return null;
|
|
200234
|
+
}
|
|
200235
|
+
for (const c8 of dom) {
|
|
200236
|
+
if (!satisfies(eq, String(c8), options8)) {
|
|
200237
|
+
return false;
|
|
200238
|
+
}
|
|
200239
|
+
}
|
|
200240
|
+
return true;
|
|
200241
|
+
}
|
|
200242
|
+
let higher, lower;
|
|
200243
|
+
let hasDomLT, hasDomGT;
|
|
200244
|
+
let needDomLTPre = lt10 && !options8.includePrerelease && lt10.semver.prerelease.length ? lt10.semver : false;
|
|
200245
|
+
let needDomGTPre = gt12 && !options8.includePrerelease && gt12.semver.prerelease.length ? gt12.semver : false;
|
|
200246
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt10.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
200247
|
+
needDomLTPre = false;
|
|
200248
|
+
}
|
|
200249
|
+
for (const c8 of dom) {
|
|
200250
|
+
hasDomGT = hasDomGT || c8.operator === ">" || c8.operator === ">=";
|
|
200251
|
+
hasDomLT = hasDomLT || c8.operator === "<" || c8.operator === "<=";
|
|
200252
|
+
if (gt12) {
|
|
200253
|
+
if (needDomGTPre) {
|
|
200254
|
+
if (c8.semver.prerelease && c8.semver.prerelease.length && c8.semver.major === needDomGTPre.major && c8.semver.minor === needDomGTPre.minor && c8.semver.patch === needDomGTPre.patch) {
|
|
200255
|
+
needDomGTPre = false;
|
|
200256
|
+
}
|
|
200257
|
+
}
|
|
200258
|
+
if (c8.operator === ">" || c8.operator === ">=") {
|
|
200259
|
+
higher = higherGT(gt12, c8, options8);
|
|
200260
|
+
if (higher === c8 && higher !== gt12) {
|
|
200261
|
+
return false;
|
|
200262
|
+
}
|
|
200263
|
+
} else if (gt12.operator === ">=" && !satisfies(gt12.semver, String(c8), options8)) {
|
|
200264
|
+
return false;
|
|
200265
|
+
}
|
|
200266
|
+
}
|
|
200267
|
+
if (lt10) {
|
|
200268
|
+
if (needDomLTPre) {
|
|
200269
|
+
if (c8.semver.prerelease && c8.semver.prerelease.length && c8.semver.major === needDomLTPre.major && c8.semver.minor === needDomLTPre.minor && c8.semver.patch === needDomLTPre.patch) {
|
|
200270
|
+
needDomLTPre = false;
|
|
200271
|
+
}
|
|
200272
|
+
}
|
|
200273
|
+
if (c8.operator === "<" || c8.operator === "<=") {
|
|
200274
|
+
lower = lowerLT(lt10, c8, options8);
|
|
200275
|
+
if (lower === c8 && lower !== lt10) {
|
|
200276
|
+
return false;
|
|
200277
|
+
}
|
|
200278
|
+
} else if (lt10.operator === "<=" && !satisfies(lt10.semver, String(c8), options8)) {
|
|
200279
|
+
return false;
|
|
200280
|
+
}
|
|
200281
|
+
}
|
|
200282
|
+
if (!c8.operator && (lt10 || gt12) && gtltComp !== 0) {
|
|
200283
|
+
return false;
|
|
200284
|
+
}
|
|
200285
|
+
}
|
|
200286
|
+
if (gt12 && hasDomLT && !lt10 && gtltComp !== 0) {
|
|
200287
|
+
return false;
|
|
200288
|
+
}
|
|
200289
|
+
if (lt10 && hasDomGT && !gt12 && gtltComp !== 0) {
|
|
200290
|
+
return false;
|
|
200291
|
+
}
|
|
200292
|
+
if (needDomGTPre || needDomLTPre) {
|
|
200293
|
+
return false;
|
|
200294
|
+
}
|
|
200295
|
+
return true;
|
|
200296
|
+
};
|
|
200297
|
+
var higherGT = (a5, b7, options8) => {
|
|
200298
|
+
if (!a5) {
|
|
200299
|
+
return b7;
|
|
200300
|
+
}
|
|
200301
|
+
const comp = compare(a5.semver, b7.semver, options8);
|
|
200302
|
+
return comp > 0 ? a5 : comp < 0 ? b7 : b7.operator === ">" && a5.operator === ">=" ? b7 : a5;
|
|
200303
|
+
};
|
|
200304
|
+
var lowerLT = (a5, b7, options8) => {
|
|
200305
|
+
if (!a5) {
|
|
200306
|
+
return b7;
|
|
200307
|
+
}
|
|
200308
|
+
const comp = compare(a5.semver, b7.semver, options8);
|
|
200309
|
+
return comp < 0 ? a5 : comp > 0 ? b7 : b7.operator === "<" && a5.operator === "<=" ? b7 : a5;
|
|
200310
|
+
};
|
|
200311
|
+
module.exports = subset;
|
|
200312
|
+
});
|
|
200313
|
+
|
|
200314
|
+
// ../../node_modules/semver/index.js
|
|
200315
|
+
var require_semver3 = __commonJS((exports, module) => {
|
|
200316
|
+
var internalRe = require_re2();
|
|
200317
|
+
var constants5 = require_constants6();
|
|
200318
|
+
var SemVer = require_semver2();
|
|
200319
|
+
var identifiers = require_identifiers2();
|
|
200320
|
+
var parse11 = require_parse8();
|
|
200321
|
+
var valid = require_valid();
|
|
200322
|
+
var clean2 = require_clean();
|
|
200323
|
+
var inc = require_inc();
|
|
200324
|
+
var diff = require_diff();
|
|
200325
|
+
var major = require_major();
|
|
200326
|
+
var minor = require_minor();
|
|
200327
|
+
var patch = require_patch();
|
|
200328
|
+
var prerelease = require_prerelease();
|
|
200329
|
+
var compare = require_compare2();
|
|
200330
|
+
var rcompare = require_rcompare();
|
|
200331
|
+
var compareLoose = require_compare_loose();
|
|
200332
|
+
var compareBuild = require_compare_build();
|
|
200333
|
+
var sort = require_sort();
|
|
200334
|
+
var rsort = require_rsort();
|
|
200335
|
+
var gt12 = require_gt();
|
|
200336
|
+
var lt10 = require_lt();
|
|
200337
|
+
var eq = require_eq();
|
|
200338
|
+
var neq = require_neq();
|
|
200339
|
+
var gte = require_gte2();
|
|
200340
|
+
var lte = require_lte();
|
|
200341
|
+
var cmp = require_cmp();
|
|
200342
|
+
var coerce = require_coerce();
|
|
200343
|
+
var Comparator = require_comparator();
|
|
200344
|
+
var Range = require_range2();
|
|
200345
|
+
var satisfies = require_satisfies();
|
|
200346
|
+
var toComparators = require_to_comparators();
|
|
200347
|
+
var maxSatisfying = require_max_satisfying();
|
|
200348
|
+
var minSatisfying = require_min_satisfying();
|
|
200349
|
+
var minVersion = require_min_version();
|
|
200350
|
+
var validRange = require_valid2();
|
|
200351
|
+
var outside = require_outside();
|
|
200352
|
+
var gtr = require_gtr();
|
|
200353
|
+
var ltr = require_ltr();
|
|
200354
|
+
var intersects = require_intersects();
|
|
200355
|
+
var simplifyRange = require_simplify();
|
|
200356
|
+
var subset = require_subset();
|
|
200357
|
+
module.exports = {
|
|
200358
|
+
parse: parse11,
|
|
200359
|
+
valid,
|
|
200360
|
+
clean: clean2,
|
|
200361
|
+
inc,
|
|
200362
|
+
diff,
|
|
200363
|
+
major,
|
|
200364
|
+
minor,
|
|
200365
|
+
patch,
|
|
200366
|
+
prerelease,
|
|
200367
|
+
compare,
|
|
200368
|
+
rcompare,
|
|
200369
|
+
compareLoose,
|
|
200370
|
+
compareBuild,
|
|
200371
|
+
sort,
|
|
200372
|
+
rsort,
|
|
200373
|
+
gt: gt12,
|
|
200374
|
+
lt: lt10,
|
|
200375
|
+
eq,
|
|
200376
|
+
neq,
|
|
200377
|
+
gte,
|
|
200378
|
+
lte,
|
|
200379
|
+
cmp,
|
|
200380
|
+
coerce,
|
|
200381
|
+
Comparator,
|
|
200382
|
+
Range,
|
|
200383
|
+
satisfies,
|
|
200384
|
+
toComparators,
|
|
200385
|
+
maxSatisfying,
|
|
200386
|
+
minSatisfying,
|
|
200387
|
+
minVersion,
|
|
200388
|
+
validRange,
|
|
200389
|
+
outside,
|
|
200390
|
+
gtr,
|
|
200391
|
+
ltr,
|
|
200392
|
+
intersects,
|
|
200393
|
+
simplifyRange,
|
|
200394
|
+
subset,
|
|
200395
|
+
SemVer,
|
|
200396
|
+
re: internalRe.re,
|
|
200397
|
+
src: internalRe.src,
|
|
200398
|
+
tokens: internalRe.t,
|
|
200399
|
+
SEMVER_SPEC_VERSION: constants5.SEMVER_SPEC_VERSION,
|
|
200400
|
+
RELEASE_TYPES: constants5.RELEASE_TYPES,
|
|
200401
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
200402
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
200403
|
+
};
|
|
200404
|
+
});
|
|
200405
|
+
|
|
200406
|
+
// ../../node_modules/jsonwebtoken/lib/asymmetricKeyDetailsSupported.js
|
|
200407
|
+
var require_asymmetricKeyDetailsSupported = __commonJS((exports, module) => {
|
|
200408
|
+
var semver = require_semver3();
|
|
200409
|
+
module.exports = semver.satisfies(process.version, ">=15.7.0");
|
|
200410
|
+
});
|
|
200411
|
+
|
|
200412
|
+
// ../../node_modules/jsonwebtoken/lib/rsaPssKeyDetailsSupported.js
|
|
200413
|
+
var require_rsaPssKeyDetailsSupported = __commonJS((exports, module) => {
|
|
200414
|
+
var semver = require_semver3();
|
|
200415
|
+
module.exports = semver.satisfies(process.version, ">=16.9.0");
|
|
200416
|
+
});
|
|
200417
|
+
|
|
200418
|
+
// ../../node_modules/jsonwebtoken/lib/validateAsymmetricKey.js
|
|
200419
|
+
var require_validateAsymmetricKey = __commonJS((exports, module) => {
|
|
200420
|
+
var ASYMMETRIC_KEY_DETAILS_SUPPORTED = require_asymmetricKeyDetailsSupported();
|
|
200421
|
+
var RSA_PSS_KEY_DETAILS_SUPPORTED = require_rsaPssKeyDetailsSupported();
|
|
200422
|
+
var allowedAlgorithmsForKeys = {
|
|
200423
|
+
ec: ["ES256", "ES384", "ES512"],
|
|
200424
|
+
rsa: ["RS256", "PS256", "RS384", "PS384", "RS512", "PS512"],
|
|
200425
|
+
"rsa-pss": ["PS256", "PS384", "PS512"]
|
|
200426
|
+
};
|
|
200427
|
+
var allowedCurves = {
|
|
200428
|
+
ES256: "prime256v1",
|
|
200429
|
+
ES384: "secp384r1",
|
|
200430
|
+
ES512: "secp521r1"
|
|
200431
|
+
};
|
|
200432
|
+
module.exports = function(algorithm, key2) {
|
|
200433
|
+
if (!algorithm || !key2)
|
|
200434
|
+
return;
|
|
200435
|
+
const keyType = key2.asymmetricKeyType;
|
|
200436
|
+
if (!keyType)
|
|
200437
|
+
return;
|
|
200438
|
+
const allowedAlgorithms = allowedAlgorithmsForKeys[keyType];
|
|
200439
|
+
if (!allowedAlgorithms) {
|
|
200440
|
+
throw new Error(`Unknown key type "${keyType}".`);
|
|
200441
|
+
}
|
|
200442
|
+
if (!allowedAlgorithms.includes(algorithm)) {
|
|
200443
|
+
throw new Error(`"alg" parameter for "${keyType}" key type must be one of: ${allowedAlgorithms.join(", ")}.`);
|
|
200444
|
+
}
|
|
200445
|
+
if (ASYMMETRIC_KEY_DETAILS_SUPPORTED) {
|
|
200446
|
+
switch (keyType) {
|
|
200447
|
+
case "ec":
|
|
200448
|
+
const keyCurve = key2.asymmetricKeyDetails.namedCurve;
|
|
200449
|
+
const allowedCurve = allowedCurves[algorithm];
|
|
200450
|
+
if (keyCurve !== allowedCurve) {
|
|
200451
|
+
throw new Error(`"alg" parameter "${algorithm}" requires curve "${allowedCurve}".`);
|
|
200452
|
+
}
|
|
200453
|
+
break;
|
|
200454
|
+
case "rsa-pss":
|
|
200455
|
+
if (RSA_PSS_KEY_DETAILS_SUPPORTED) {
|
|
200456
|
+
const length = parseInt(algorithm.slice(-3), 10);
|
|
200457
|
+
const { hashAlgorithm, mgf1HashAlgorithm, saltLength } = key2.asymmetricKeyDetails;
|
|
200458
|
+
if (hashAlgorithm !== `sha${length}` || mgf1HashAlgorithm !== hashAlgorithm) {
|
|
200459
|
+
throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${algorithm}.`);
|
|
200460
|
+
}
|
|
200461
|
+
if (saltLength !== undefined && saltLength > length >> 3) {
|
|
200462
|
+
throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${algorithm}.`);
|
|
200463
|
+
}
|
|
200464
|
+
}
|
|
200465
|
+
break;
|
|
200466
|
+
}
|
|
200467
|
+
}
|
|
200468
|
+
};
|
|
200469
|
+
});
|
|
200470
|
+
|
|
200471
|
+
// ../../node_modules/jsonwebtoken/lib/psSupported.js
|
|
200472
|
+
var require_psSupported = __commonJS((exports, module) => {
|
|
200473
|
+
var semver = require_semver3();
|
|
200474
|
+
module.exports = semver.satisfies(process.version, "^6.12.0 || >=8.0.0");
|
|
200475
|
+
});
|
|
200476
|
+
|
|
200477
|
+
// ../../node_modules/jsonwebtoken/verify.js
|
|
200478
|
+
var require_verify = __commonJS((exports, module) => {
|
|
200479
|
+
var JsonWebTokenError = require_JsonWebTokenError();
|
|
200480
|
+
var NotBeforeError = require_NotBeforeError();
|
|
200481
|
+
var TokenExpiredError = require_TokenExpiredError();
|
|
200482
|
+
var decode4 = require_decode();
|
|
200483
|
+
var timespan = require_timespan();
|
|
200484
|
+
var validateAsymmetricKey = require_validateAsymmetricKey();
|
|
200485
|
+
var PS_SUPPORTED = require_psSupported();
|
|
200486
|
+
var jws = require_jws();
|
|
200487
|
+
var { KeyObject, createSecretKey, createPublicKey } = __require("crypto");
|
|
200488
|
+
var PUB_KEY_ALGS = ["RS256", "RS384", "RS512"];
|
|
200489
|
+
var EC_KEY_ALGS = ["ES256", "ES384", "ES512"];
|
|
200490
|
+
var RSA_KEY_ALGS = ["RS256", "RS384", "RS512"];
|
|
200491
|
+
var HS_ALGS = ["HS256", "HS384", "HS512"];
|
|
200492
|
+
if (PS_SUPPORTED) {
|
|
200493
|
+
PUB_KEY_ALGS.splice(PUB_KEY_ALGS.length, 0, "PS256", "PS384", "PS512");
|
|
200494
|
+
RSA_KEY_ALGS.splice(RSA_KEY_ALGS.length, 0, "PS256", "PS384", "PS512");
|
|
200495
|
+
}
|
|
200496
|
+
module.exports = function(jwtString, secretOrPublicKey, options8, callback) {
|
|
200497
|
+
if (typeof options8 === "function" && !callback) {
|
|
200498
|
+
callback = options8;
|
|
200499
|
+
options8 = {};
|
|
200500
|
+
}
|
|
200501
|
+
if (!options8) {
|
|
200502
|
+
options8 = {};
|
|
200503
|
+
}
|
|
200504
|
+
options8 = Object.assign({}, options8);
|
|
200505
|
+
let done;
|
|
200506
|
+
if (callback) {
|
|
200507
|
+
done = callback;
|
|
200508
|
+
} else {
|
|
200509
|
+
done = function(err, data) {
|
|
200510
|
+
if (err)
|
|
200511
|
+
throw err;
|
|
200512
|
+
return data;
|
|
200513
|
+
};
|
|
200514
|
+
}
|
|
200515
|
+
if (options8.clockTimestamp && typeof options8.clockTimestamp !== "number") {
|
|
200516
|
+
return done(new JsonWebTokenError("clockTimestamp must be a number"));
|
|
200517
|
+
}
|
|
200518
|
+
if (options8.nonce !== undefined && (typeof options8.nonce !== "string" || options8.nonce.trim() === "")) {
|
|
200519
|
+
return done(new JsonWebTokenError("nonce must be a non-empty string"));
|
|
200520
|
+
}
|
|
200521
|
+
if (options8.allowInvalidAsymmetricKeyTypes !== undefined && typeof options8.allowInvalidAsymmetricKeyTypes !== "boolean") {
|
|
200522
|
+
return done(new JsonWebTokenError("allowInvalidAsymmetricKeyTypes must be a boolean"));
|
|
200523
|
+
}
|
|
200524
|
+
const clockTimestamp = options8.clockTimestamp || Math.floor(Date.now() / 1000);
|
|
200525
|
+
if (!jwtString) {
|
|
200526
|
+
return done(new JsonWebTokenError("jwt must be provided"));
|
|
200527
|
+
}
|
|
200528
|
+
if (typeof jwtString !== "string") {
|
|
200529
|
+
return done(new JsonWebTokenError("jwt must be a string"));
|
|
200530
|
+
}
|
|
200531
|
+
const parts = jwtString.split(".");
|
|
200532
|
+
if (parts.length !== 3) {
|
|
200533
|
+
return done(new JsonWebTokenError("jwt malformed"));
|
|
200534
|
+
}
|
|
200535
|
+
let decodedToken;
|
|
200536
|
+
try {
|
|
200537
|
+
decodedToken = decode4(jwtString, { complete: true });
|
|
200538
|
+
} catch (err) {
|
|
200539
|
+
return done(err);
|
|
200540
|
+
}
|
|
200541
|
+
if (!decodedToken) {
|
|
200542
|
+
return done(new JsonWebTokenError("invalid token"));
|
|
200543
|
+
}
|
|
200544
|
+
const header2 = decodedToken.header;
|
|
200545
|
+
let getSecret;
|
|
200546
|
+
if (typeof secretOrPublicKey === "function") {
|
|
200547
|
+
if (!callback) {
|
|
200548
|
+
return done(new JsonWebTokenError("verify must be called asynchronous if secret or public key is provided as a callback"));
|
|
200549
|
+
}
|
|
200550
|
+
getSecret = secretOrPublicKey;
|
|
200551
|
+
} else {
|
|
200552
|
+
getSecret = function(header3, secretCallback) {
|
|
200553
|
+
return secretCallback(null, secretOrPublicKey);
|
|
200554
|
+
};
|
|
200555
|
+
}
|
|
200556
|
+
return getSecret(header2, function(err, secretOrPublicKey2) {
|
|
200557
|
+
if (err) {
|
|
200558
|
+
return done(new JsonWebTokenError("error in secret or public key callback: " + err.message));
|
|
200559
|
+
}
|
|
200560
|
+
const hasSignature = parts[2].trim() !== "";
|
|
200561
|
+
if (!hasSignature && secretOrPublicKey2) {
|
|
200562
|
+
return done(new JsonWebTokenError("jwt signature is required"));
|
|
200563
|
+
}
|
|
200564
|
+
if (hasSignature && !secretOrPublicKey2) {
|
|
200565
|
+
return done(new JsonWebTokenError("secret or public key must be provided"));
|
|
200566
|
+
}
|
|
200567
|
+
if (!hasSignature && !options8.algorithms) {
|
|
200568
|
+
return done(new JsonWebTokenError('please specify "none" in "algorithms" to verify unsigned tokens'));
|
|
200569
|
+
}
|
|
200570
|
+
if (secretOrPublicKey2 != null && !(secretOrPublicKey2 instanceof KeyObject)) {
|
|
200571
|
+
try {
|
|
200572
|
+
secretOrPublicKey2 = createPublicKey(secretOrPublicKey2);
|
|
200573
|
+
} catch (_10) {
|
|
200574
|
+
try {
|
|
200575
|
+
secretOrPublicKey2 = createSecretKey(typeof secretOrPublicKey2 === "string" ? Buffer.from(secretOrPublicKey2) : secretOrPublicKey2);
|
|
200576
|
+
} catch (_11) {
|
|
200577
|
+
return done(new JsonWebTokenError("secretOrPublicKey is not valid key material"));
|
|
200578
|
+
}
|
|
200579
|
+
}
|
|
200580
|
+
}
|
|
200581
|
+
if (!options8.algorithms) {
|
|
200582
|
+
if (secretOrPublicKey2.type === "secret") {
|
|
200583
|
+
options8.algorithms = HS_ALGS;
|
|
200584
|
+
} else if (["rsa", "rsa-pss"].includes(secretOrPublicKey2.asymmetricKeyType)) {
|
|
200585
|
+
options8.algorithms = RSA_KEY_ALGS;
|
|
200586
|
+
} else if (secretOrPublicKey2.asymmetricKeyType === "ec") {
|
|
200587
|
+
options8.algorithms = EC_KEY_ALGS;
|
|
200588
|
+
} else {
|
|
200589
|
+
options8.algorithms = PUB_KEY_ALGS;
|
|
200590
|
+
}
|
|
200591
|
+
}
|
|
200592
|
+
if (options8.algorithms.indexOf(decodedToken.header.alg) === -1) {
|
|
200593
|
+
return done(new JsonWebTokenError("invalid algorithm"));
|
|
200594
|
+
}
|
|
200595
|
+
if (header2.alg.startsWith("HS") && secretOrPublicKey2.type !== "secret") {
|
|
200596
|
+
return done(new JsonWebTokenError(`secretOrPublicKey must be a symmetric key when using ${header2.alg}`));
|
|
200597
|
+
} else if (/^(?:RS|PS|ES)/.test(header2.alg) && secretOrPublicKey2.type !== "public") {
|
|
200598
|
+
return done(new JsonWebTokenError(`secretOrPublicKey must be an asymmetric key when using ${header2.alg}`));
|
|
200599
|
+
}
|
|
200600
|
+
if (!options8.allowInvalidAsymmetricKeyTypes) {
|
|
200601
|
+
try {
|
|
200602
|
+
validateAsymmetricKey(header2.alg, secretOrPublicKey2);
|
|
200603
|
+
} catch (e8) {
|
|
200604
|
+
return done(e8);
|
|
200605
|
+
}
|
|
200606
|
+
}
|
|
200607
|
+
let valid;
|
|
200608
|
+
try {
|
|
200609
|
+
valid = jws.verify(jwtString, decodedToken.header.alg, secretOrPublicKey2);
|
|
200610
|
+
} catch (e8) {
|
|
200611
|
+
return done(e8);
|
|
200612
|
+
}
|
|
200613
|
+
if (!valid) {
|
|
200614
|
+
return done(new JsonWebTokenError("invalid signature"));
|
|
200615
|
+
}
|
|
200616
|
+
const payload = decodedToken.payload;
|
|
200617
|
+
if (typeof payload.nbf !== "undefined" && !options8.ignoreNotBefore) {
|
|
200618
|
+
if (typeof payload.nbf !== "number") {
|
|
200619
|
+
return done(new JsonWebTokenError("invalid nbf value"));
|
|
200620
|
+
}
|
|
200621
|
+
if (payload.nbf > clockTimestamp + (options8.clockTolerance || 0)) {
|
|
200622
|
+
return done(new NotBeforeError("jwt not active", new Date(payload.nbf * 1000)));
|
|
200623
|
+
}
|
|
200624
|
+
}
|
|
200625
|
+
if (typeof payload.exp !== "undefined" && !options8.ignoreExpiration) {
|
|
200626
|
+
if (typeof payload.exp !== "number") {
|
|
200627
|
+
return done(new JsonWebTokenError("invalid exp value"));
|
|
200628
|
+
}
|
|
200629
|
+
if (clockTimestamp >= payload.exp + (options8.clockTolerance || 0)) {
|
|
200630
|
+
return done(new TokenExpiredError("jwt expired", new Date(payload.exp * 1000)));
|
|
200631
|
+
}
|
|
200632
|
+
}
|
|
200633
|
+
if (options8.audience) {
|
|
200634
|
+
const audiences = Array.isArray(options8.audience) ? options8.audience : [options8.audience];
|
|
200635
|
+
const target = Array.isArray(payload.aud) ? payload.aud : [payload.aud];
|
|
200636
|
+
const match = target.some(function(targetAudience) {
|
|
200637
|
+
return audiences.some(function(audience) {
|
|
200638
|
+
return audience instanceof RegExp ? audience.test(targetAudience) : audience === targetAudience;
|
|
200639
|
+
});
|
|
200640
|
+
});
|
|
200641
|
+
if (!match) {
|
|
200642
|
+
return done(new JsonWebTokenError("jwt audience invalid. expected: " + audiences.join(" or ")));
|
|
200643
|
+
}
|
|
200644
|
+
}
|
|
200645
|
+
if (options8.issuer) {
|
|
200646
|
+
const invalid_issuer = typeof options8.issuer === "string" && payload.iss !== options8.issuer || Array.isArray(options8.issuer) && options8.issuer.indexOf(payload.iss) === -1;
|
|
200647
|
+
if (invalid_issuer) {
|
|
200648
|
+
return done(new JsonWebTokenError("jwt issuer invalid. expected: " + options8.issuer));
|
|
200649
|
+
}
|
|
200650
|
+
}
|
|
200651
|
+
if (options8.subject) {
|
|
200652
|
+
if (payload.sub !== options8.subject) {
|
|
200653
|
+
return done(new JsonWebTokenError("jwt subject invalid. expected: " + options8.subject));
|
|
200654
|
+
}
|
|
200655
|
+
}
|
|
200656
|
+
if (options8.jwtid) {
|
|
200657
|
+
if (payload.jti !== options8.jwtid) {
|
|
200658
|
+
return done(new JsonWebTokenError("jwt jwtid invalid. expected: " + options8.jwtid));
|
|
200659
|
+
}
|
|
200660
|
+
}
|
|
200661
|
+
if (options8.nonce) {
|
|
200662
|
+
if (payload.nonce !== options8.nonce) {
|
|
200663
|
+
return done(new JsonWebTokenError("jwt nonce invalid. expected: " + options8.nonce));
|
|
200664
|
+
}
|
|
200665
|
+
}
|
|
200666
|
+
if (options8.maxAge) {
|
|
200667
|
+
if (typeof payload.iat !== "number") {
|
|
200668
|
+
return done(new JsonWebTokenError("iat required when maxAge is specified"));
|
|
200669
|
+
}
|
|
200670
|
+
const maxAgeTimestamp = timespan(options8.maxAge, payload.iat);
|
|
200671
|
+
if (typeof maxAgeTimestamp === "undefined") {
|
|
200672
|
+
return done(new JsonWebTokenError('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));
|
|
200673
|
+
}
|
|
200674
|
+
if (clockTimestamp >= maxAgeTimestamp + (options8.clockTolerance || 0)) {
|
|
200675
|
+
return done(new TokenExpiredError("maxAge exceeded", new Date(maxAgeTimestamp * 1000)));
|
|
200676
|
+
}
|
|
200677
|
+
}
|
|
200678
|
+
if (options8.complete === true) {
|
|
200679
|
+
const signature = decodedToken.signature;
|
|
200680
|
+
return done(null, {
|
|
200681
|
+
header: header2,
|
|
200682
|
+
payload,
|
|
200683
|
+
signature
|
|
200684
|
+
});
|
|
200685
|
+
}
|
|
200686
|
+
return done(null, payload);
|
|
200687
|
+
});
|
|
200688
|
+
};
|
|
200689
|
+
});
|
|
200690
|
+
|
|
200691
|
+
// ../../node_modules/lodash.includes/index.js
|
|
200692
|
+
var require_lodash2 = __commonJS((exports, module) => {
|
|
200693
|
+
var INFINITY = 1 / 0;
|
|
200694
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
200695
|
+
var MAX_INTEGER = 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
|
200696
|
+
var NAN = 0 / 0;
|
|
200697
|
+
var argsTag = "[object Arguments]";
|
|
200698
|
+
var funcTag = "[object Function]";
|
|
200699
|
+
var genTag = "[object GeneratorFunction]";
|
|
200700
|
+
var stringTag = "[object String]";
|
|
200701
|
+
var symbolTag = "[object Symbol]";
|
|
200702
|
+
var reTrim = /^\s+|\s+$/g;
|
|
200703
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
200704
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
200705
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
200706
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
200707
|
+
var freeParseInt = parseInt;
|
|
200708
|
+
function arrayMap(array3, iteratee) {
|
|
200709
|
+
var index = -1, length = array3 ? array3.length : 0, result = Array(length);
|
|
200710
|
+
while (++index < length) {
|
|
200711
|
+
result[index] = iteratee(array3[index], index, array3);
|
|
200712
|
+
}
|
|
200713
|
+
return result;
|
|
200714
|
+
}
|
|
200715
|
+
function baseFindIndex(array3, predicate, fromIndex, fromRight) {
|
|
200716
|
+
var length = array3.length, index = fromIndex + (fromRight ? 1 : -1);
|
|
200717
|
+
while (fromRight ? index-- : ++index < length) {
|
|
200718
|
+
if (predicate(array3[index], index, array3)) {
|
|
200719
|
+
return index;
|
|
200720
|
+
}
|
|
200721
|
+
}
|
|
200722
|
+
return -1;
|
|
200723
|
+
}
|
|
200724
|
+
function baseIndexOf(array3, value, fromIndex) {
|
|
200725
|
+
if (value !== value) {
|
|
200726
|
+
return baseFindIndex(array3, baseIsNaN, fromIndex);
|
|
200727
|
+
}
|
|
200728
|
+
var index = fromIndex - 1, length = array3.length;
|
|
200729
|
+
while (++index < length) {
|
|
200730
|
+
if (array3[index] === value) {
|
|
200731
|
+
return index;
|
|
200732
|
+
}
|
|
200733
|
+
}
|
|
200734
|
+
return -1;
|
|
200735
|
+
}
|
|
200736
|
+
function baseIsNaN(value) {
|
|
200737
|
+
return value !== value;
|
|
200738
|
+
}
|
|
200739
|
+
function baseTimes(n5, iteratee) {
|
|
200740
|
+
var index = -1, result = Array(n5);
|
|
200741
|
+
while (++index < n5) {
|
|
200742
|
+
result[index] = iteratee(index);
|
|
200743
|
+
}
|
|
200744
|
+
return result;
|
|
200745
|
+
}
|
|
200746
|
+
function baseValues(object2, props) {
|
|
200747
|
+
return arrayMap(props, function(key2) {
|
|
200748
|
+
return object2[key2];
|
|
200749
|
+
});
|
|
200750
|
+
}
|
|
200751
|
+
function overArg(func, transform2) {
|
|
200752
|
+
return function(arg) {
|
|
200753
|
+
return func(transform2(arg));
|
|
200754
|
+
};
|
|
200755
|
+
}
|
|
200756
|
+
var objectProto = Object.prototype;
|
|
200757
|
+
var hasOwnProperty3 = objectProto.hasOwnProperty;
|
|
200758
|
+
var objectToString3 = objectProto.toString;
|
|
200759
|
+
var propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
|
200760
|
+
var nativeKeys = overArg(Object.keys, Object);
|
|
200761
|
+
var nativeMax = Math.max;
|
|
200762
|
+
function arrayLikeKeys(value, inherited) {
|
|
200763
|
+
var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
|
|
200764
|
+
var length = result.length, skipIndexes = !!length;
|
|
200765
|
+
for (var key2 in value) {
|
|
200766
|
+
if ((inherited || hasOwnProperty3.call(value, key2)) && !(skipIndexes && (key2 == "length" || isIndex(key2, length)))) {
|
|
200767
|
+
result.push(key2);
|
|
200768
|
+
}
|
|
200769
|
+
}
|
|
200770
|
+
return result;
|
|
200771
|
+
}
|
|
200772
|
+
function baseKeys(object2) {
|
|
200773
|
+
if (!isPrototype(object2)) {
|
|
200774
|
+
return nativeKeys(object2);
|
|
200775
|
+
}
|
|
200776
|
+
var result = [];
|
|
200777
|
+
for (var key2 in Object(object2)) {
|
|
200778
|
+
if (hasOwnProperty3.call(object2, key2) && key2 != "constructor") {
|
|
200779
|
+
result.push(key2);
|
|
200780
|
+
}
|
|
200781
|
+
}
|
|
200782
|
+
return result;
|
|
200783
|
+
}
|
|
200784
|
+
function isIndex(value, length) {
|
|
200785
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
200786
|
+
return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
200787
|
+
}
|
|
200788
|
+
function isPrototype(value) {
|
|
200789
|
+
var Ctor = value && value.constructor, proto2 = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
200790
|
+
return value === proto2;
|
|
200791
|
+
}
|
|
200792
|
+
function includes(collection, value, fromIndex, guard) {
|
|
200793
|
+
collection = isArrayLike(collection) ? collection : values(collection);
|
|
200794
|
+
fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
|
|
200795
|
+
var length = collection.length;
|
|
200796
|
+
if (fromIndex < 0) {
|
|
200797
|
+
fromIndex = nativeMax(length + fromIndex, 0);
|
|
200798
|
+
}
|
|
200799
|
+
return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
|
|
200800
|
+
}
|
|
200801
|
+
function isArguments(value) {
|
|
200802
|
+
return isArrayLikeObject(value) && hasOwnProperty3.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString3.call(value) == argsTag);
|
|
200803
|
+
}
|
|
200804
|
+
var isArray = Array.isArray;
|
|
200805
|
+
function isArrayLike(value) {
|
|
200806
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
|
200807
|
+
}
|
|
200808
|
+
function isArrayLikeObject(value) {
|
|
200809
|
+
return isObjectLike(value) && isArrayLike(value);
|
|
200810
|
+
}
|
|
200811
|
+
function isFunction(value) {
|
|
200812
|
+
var tag = isObject5(value) ? objectToString3.call(value) : "";
|
|
200813
|
+
return tag == funcTag || tag == genTag;
|
|
200814
|
+
}
|
|
200815
|
+
function isLength(value) {
|
|
200816
|
+
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
200817
|
+
}
|
|
200818
|
+
function isObject5(value) {
|
|
200819
|
+
var type = typeof value;
|
|
200820
|
+
return !!value && (type == "object" || type == "function");
|
|
200821
|
+
}
|
|
200822
|
+
function isObjectLike(value) {
|
|
200823
|
+
return !!value && typeof value == "object";
|
|
200824
|
+
}
|
|
200825
|
+
function isString(value) {
|
|
200826
|
+
return typeof value == "string" || !isArray(value) && isObjectLike(value) && objectToString3.call(value) == stringTag;
|
|
200827
|
+
}
|
|
200828
|
+
function isSymbol(value) {
|
|
200829
|
+
return typeof value == "symbol" || isObjectLike(value) && objectToString3.call(value) == symbolTag;
|
|
200830
|
+
}
|
|
200831
|
+
function toFinite(value) {
|
|
200832
|
+
if (!value) {
|
|
200833
|
+
return value === 0 ? value : 0;
|
|
200834
|
+
}
|
|
200835
|
+
value = toNumber(value);
|
|
200836
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
200837
|
+
var sign2 = value < 0 ? -1 : 1;
|
|
200838
|
+
return sign2 * MAX_INTEGER;
|
|
200839
|
+
}
|
|
200840
|
+
return value === value ? value : 0;
|
|
200841
|
+
}
|
|
200842
|
+
function toInteger(value) {
|
|
200843
|
+
var result = toFinite(value), remainder = result % 1;
|
|
200844
|
+
return result === result ? remainder ? result - remainder : result : 0;
|
|
200845
|
+
}
|
|
200846
|
+
function toNumber(value) {
|
|
200847
|
+
if (typeof value == "number") {
|
|
200848
|
+
return value;
|
|
200849
|
+
}
|
|
200850
|
+
if (isSymbol(value)) {
|
|
200851
|
+
return NAN;
|
|
200852
|
+
}
|
|
200853
|
+
if (isObject5(value)) {
|
|
200854
|
+
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
200855
|
+
value = isObject5(other) ? other + "" : other;
|
|
200856
|
+
}
|
|
200857
|
+
if (typeof value != "string") {
|
|
200858
|
+
return value === 0 ? value : +value;
|
|
200859
|
+
}
|
|
200860
|
+
value = value.replace(reTrim, "");
|
|
200861
|
+
var isBinary = reIsBinary.test(value);
|
|
200862
|
+
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
200863
|
+
}
|
|
200864
|
+
function keys(object2) {
|
|
200865
|
+
return isArrayLike(object2) ? arrayLikeKeys(object2) : baseKeys(object2);
|
|
200866
|
+
}
|
|
200867
|
+
function values(object2) {
|
|
200868
|
+
return object2 ? baseValues(object2, keys(object2)) : [];
|
|
200869
|
+
}
|
|
200870
|
+
module.exports = includes;
|
|
200871
|
+
});
|
|
200872
|
+
|
|
200873
|
+
// ../../node_modules/lodash.isboolean/index.js
|
|
200874
|
+
var require_lodash3 = __commonJS((exports, module) => {
|
|
200875
|
+
var boolTag = "[object Boolean]";
|
|
200876
|
+
var objectProto = Object.prototype;
|
|
200877
|
+
var objectToString3 = objectProto.toString;
|
|
200878
|
+
function isBoolean(value) {
|
|
200879
|
+
return value === true || value === false || isObjectLike(value) && objectToString3.call(value) == boolTag;
|
|
200880
|
+
}
|
|
200881
|
+
function isObjectLike(value) {
|
|
200882
|
+
return !!value && typeof value == "object";
|
|
200883
|
+
}
|
|
200884
|
+
module.exports = isBoolean;
|
|
200885
|
+
});
|
|
200886
|
+
|
|
200887
|
+
// ../../node_modules/lodash.isinteger/index.js
|
|
200888
|
+
var require_lodash4 = __commonJS((exports, module) => {
|
|
200889
|
+
var INFINITY = 1 / 0;
|
|
200890
|
+
var MAX_INTEGER = 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
|
200891
|
+
var NAN = 0 / 0;
|
|
200892
|
+
var symbolTag = "[object Symbol]";
|
|
200893
|
+
var reTrim = /^\s+|\s+$/g;
|
|
200894
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
200895
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
200896
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
200897
|
+
var freeParseInt = parseInt;
|
|
200898
|
+
var objectProto = Object.prototype;
|
|
200899
|
+
var objectToString3 = objectProto.toString;
|
|
200900
|
+
function isInteger(value) {
|
|
200901
|
+
return typeof value == "number" && value == toInteger(value);
|
|
200902
|
+
}
|
|
200903
|
+
function isObject5(value) {
|
|
200904
|
+
var type = typeof value;
|
|
200905
|
+
return !!value && (type == "object" || type == "function");
|
|
200906
|
+
}
|
|
200907
|
+
function isObjectLike(value) {
|
|
200908
|
+
return !!value && typeof value == "object";
|
|
200909
|
+
}
|
|
200910
|
+
function isSymbol(value) {
|
|
200911
|
+
return typeof value == "symbol" || isObjectLike(value) && objectToString3.call(value) == symbolTag;
|
|
200912
|
+
}
|
|
200913
|
+
function toFinite(value) {
|
|
200914
|
+
if (!value) {
|
|
200915
|
+
return value === 0 ? value : 0;
|
|
200916
|
+
}
|
|
200917
|
+
value = toNumber(value);
|
|
200918
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
200919
|
+
var sign2 = value < 0 ? -1 : 1;
|
|
200920
|
+
return sign2 * MAX_INTEGER;
|
|
200921
|
+
}
|
|
200922
|
+
return value === value ? value : 0;
|
|
200923
|
+
}
|
|
200924
|
+
function toInteger(value) {
|
|
200925
|
+
var result = toFinite(value), remainder = result % 1;
|
|
200926
|
+
return result === result ? remainder ? result - remainder : result : 0;
|
|
200927
|
+
}
|
|
200928
|
+
function toNumber(value) {
|
|
200929
|
+
if (typeof value == "number") {
|
|
200930
|
+
return value;
|
|
200931
|
+
}
|
|
200932
|
+
if (isSymbol(value)) {
|
|
200933
|
+
return NAN;
|
|
197618
200934
|
}
|
|
197619
|
-
|
|
197620
|
-
|
|
197621
|
-
|
|
197622
|
-
const onError = (err) => {
|
|
197623
|
-
if (err) {
|
|
197624
|
-
res.end();
|
|
197625
|
-
}
|
|
197626
|
-
};
|
|
197627
|
-
switch (encoding) {
|
|
197628
|
-
case "br":
|
|
197629
|
-
res.writeHead(200, { "content-encoding": "br" });
|
|
197630
|
-
(0, stream_1.pipeline)(readStream, (0, zlib_1.createBrotliCompress)(), res, onError);
|
|
197631
|
-
break;
|
|
197632
|
-
case "gzip":
|
|
197633
|
-
res.writeHead(200, { "content-encoding": "gzip" });
|
|
197634
|
-
(0, stream_1.pipeline)(readStream, (0, zlib_1.createGzip)(), res, onError);
|
|
197635
|
-
break;
|
|
197636
|
-
case "deflate":
|
|
197637
|
-
res.writeHead(200, { "content-encoding": "deflate" });
|
|
197638
|
-
(0, stream_1.pipeline)(readStream, (0, zlib_1.createDeflate)(), res, onError);
|
|
197639
|
-
break;
|
|
197640
|
-
default:
|
|
197641
|
-
res.writeHead(200);
|
|
197642
|
-
(0, stream_1.pipeline)(readStream, res, onError);
|
|
197643
|
-
}
|
|
200935
|
+
if (isObject5(value)) {
|
|
200936
|
+
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
200937
|
+
value = isObject5(other) ? other + "" : other;
|
|
197644
200938
|
}
|
|
197645
|
-
|
|
197646
|
-
|
|
197647
|
-
this.engine.on("connection", this.onconnection.bind(this));
|
|
197648
|
-
return this;
|
|
200939
|
+
if (typeof value != "string") {
|
|
200940
|
+
return value === 0 ? value : +value;
|
|
197649
200941
|
}
|
|
197650
|
-
|
|
197651
|
-
|
|
197652
|
-
|
|
197653
|
-
|
|
197654
|
-
|
|
197655
|
-
|
|
197656
|
-
|
|
200942
|
+
value = value.replace(reTrim, "");
|
|
200943
|
+
var isBinary = reIsBinary.test(value);
|
|
200944
|
+
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
200945
|
+
}
|
|
200946
|
+
module.exports = isInteger;
|
|
200947
|
+
});
|
|
200948
|
+
|
|
200949
|
+
// ../../node_modules/lodash.isnumber/index.js
|
|
200950
|
+
var require_lodash5 = __commonJS((exports, module) => {
|
|
200951
|
+
var numberTag = "[object Number]";
|
|
200952
|
+
var objectProto = Object.prototype;
|
|
200953
|
+
var objectToString3 = objectProto.toString;
|
|
200954
|
+
function isObjectLike(value) {
|
|
200955
|
+
return !!value && typeof value == "object";
|
|
200956
|
+
}
|
|
200957
|
+
function isNumber(value) {
|
|
200958
|
+
return typeof value == "number" || isObjectLike(value) && objectToString3.call(value) == numberTag;
|
|
200959
|
+
}
|
|
200960
|
+
module.exports = isNumber;
|
|
200961
|
+
});
|
|
200962
|
+
|
|
200963
|
+
// ../../node_modules/lodash.isplainobject/index.js
|
|
200964
|
+
var require_lodash6 = __commonJS((exports, module) => {
|
|
200965
|
+
var objectTag = "[object Object]";
|
|
200966
|
+
function isHostObject(value) {
|
|
200967
|
+
var result = false;
|
|
200968
|
+
if (value != null && typeof value.toString != "function") {
|
|
200969
|
+
try {
|
|
200970
|
+
result = !!(value + "");
|
|
200971
|
+
} catch (e8) {}
|
|
197657
200972
|
}
|
|
197658
|
-
|
|
197659
|
-
|
|
197660
|
-
|
|
197661
|
-
|
|
197662
|
-
|
|
197663
|
-
|
|
197664
|
-
|
|
197665
|
-
|
|
197666
|
-
|
|
197667
|
-
|
|
197668
|
-
|
|
197669
|
-
|
|
197670
|
-
|
|
197671
|
-
|
|
200973
|
+
return result;
|
|
200974
|
+
}
|
|
200975
|
+
function overArg(func, transform2) {
|
|
200976
|
+
return function(arg) {
|
|
200977
|
+
return func(transform2(arg));
|
|
200978
|
+
};
|
|
200979
|
+
}
|
|
200980
|
+
var funcProto = Function.prototype;
|
|
200981
|
+
var objectProto = Object.prototype;
|
|
200982
|
+
var funcToString = funcProto.toString;
|
|
200983
|
+
var hasOwnProperty3 = objectProto.hasOwnProperty;
|
|
200984
|
+
var objectCtorString = funcToString.call(Object);
|
|
200985
|
+
var objectToString3 = objectProto.toString;
|
|
200986
|
+
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
200987
|
+
function isObjectLike(value) {
|
|
200988
|
+
return !!value && typeof value == "object";
|
|
200989
|
+
}
|
|
200990
|
+
function isPlainObject3(value) {
|
|
200991
|
+
if (!isObjectLike(value) || objectToString3.call(value) != objectTag || isHostObject(value)) {
|
|
200992
|
+
return false;
|
|
200993
|
+
}
|
|
200994
|
+
var proto2 = getPrototype(value);
|
|
200995
|
+
if (proto2 === null) {
|
|
200996
|
+
return true;
|
|
200997
|
+
}
|
|
200998
|
+
var Ctor = hasOwnProperty3.call(proto2, "constructor") && proto2.constructor;
|
|
200999
|
+
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
201000
|
+
}
|
|
201001
|
+
module.exports = isPlainObject3;
|
|
201002
|
+
});
|
|
201003
|
+
|
|
201004
|
+
// ../../node_modules/lodash.isstring/index.js
|
|
201005
|
+
var require_lodash7 = __commonJS((exports, module) => {
|
|
201006
|
+
var stringTag = "[object String]";
|
|
201007
|
+
var objectProto = Object.prototype;
|
|
201008
|
+
var objectToString3 = objectProto.toString;
|
|
201009
|
+
var isArray = Array.isArray;
|
|
201010
|
+
function isObjectLike(value) {
|
|
201011
|
+
return !!value && typeof value == "object";
|
|
201012
|
+
}
|
|
201013
|
+
function isString(value) {
|
|
201014
|
+
return typeof value == "string" || !isArray(value) && isObjectLike(value) && objectToString3.call(value) == stringTag;
|
|
201015
|
+
}
|
|
201016
|
+
module.exports = isString;
|
|
201017
|
+
});
|
|
201018
|
+
|
|
201019
|
+
// ../../node_modules/lodash.once/index.js
|
|
201020
|
+
var require_lodash8 = __commonJS((exports, module) => {
|
|
201021
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
201022
|
+
var INFINITY = 1 / 0;
|
|
201023
|
+
var MAX_INTEGER = 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
|
|
201024
|
+
var NAN = 0 / 0;
|
|
201025
|
+
var symbolTag = "[object Symbol]";
|
|
201026
|
+
var reTrim = /^\s+|\s+$/g;
|
|
201027
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
201028
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
201029
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
201030
|
+
var freeParseInt = parseInt;
|
|
201031
|
+
var objectProto = Object.prototype;
|
|
201032
|
+
var objectToString3 = objectProto.toString;
|
|
201033
|
+
function before(n5, func) {
|
|
201034
|
+
var result;
|
|
201035
|
+
if (typeof func != "function") {
|
|
201036
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
201037
|
+
}
|
|
201038
|
+
n5 = toInteger(n5);
|
|
201039
|
+
return function() {
|
|
201040
|
+
if (--n5 > 0) {
|
|
201041
|
+
result = func.apply(this, arguments);
|
|
197672
201042
|
}
|
|
197673
|
-
if (
|
|
197674
|
-
|
|
197675
|
-
let nsp = this._nsps.get(name2);
|
|
197676
|
-
if (!nsp) {
|
|
197677
|
-
for (const [regex, parentNamespace] of this.parentNamespacesFromRegExp) {
|
|
197678
|
-
if (regex.test(name2)) {
|
|
197679
|
-
debug("attaching namespace %s to parent namespace %s", name2, regex);
|
|
197680
|
-
return parentNamespace.createChild(name2);
|
|
197681
|
-
}
|
|
197682
|
-
}
|
|
197683
|
-
debug("initializing namespace %s", name2);
|
|
197684
|
-
nsp = new namespace_1.Namespace(this, name2);
|
|
197685
|
-
this._nsps.set(name2, nsp);
|
|
197686
|
-
if (name2 !== "/") {
|
|
197687
|
-
this.sockets.emitReserved("new_namespace", nsp);
|
|
197688
|
-
}
|
|
201043
|
+
if (n5 <= 1) {
|
|
201044
|
+
func = undefined;
|
|
197689
201045
|
}
|
|
197690
|
-
|
|
197691
|
-
|
|
197692
|
-
|
|
201046
|
+
return result;
|
|
201047
|
+
};
|
|
201048
|
+
}
|
|
201049
|
+
function once9(func) {
|
|
201050
|
+
return before(2, func);
|
|
201051
|
+
}
|
|
201052
|
+
function isObject5(value) {
|
|
201053
|
+
var type = typeof value;
|
|
201054
|
+
return !!value && (type == "object" || type == "function");
|
|
201055
|
+
}
|
|
201056
|
+
function isObjectLike(value) {
|
|
201057
|
+
return !!value && typeof value == "object";
|
|
201058
|
+
}
|
|
201059
|
+
function isSymbol(value) {
|
|
201060
|
+
return typeof value == "symbol" || isObjectLike(value) && objectToString3.call(value) == symbolTag;
|
|
201061
|
+
}
|
|
201062
|
+
function toFinite(value) {
|
|
201063
|
+
if (!value) {
|
|
201064
|
+
return value === 0 ? value : 0;
|
|
197693
201065
|
}
|
|
197694
|
-
|
|
197695
|
-
|
|
197696
|
-
|
|
197697
|
-
|
|
197698
|
-
});
|
|
197699
|
-
await nsp.adapter.close();
|
|
197700
|
-
}));
|
|
197701
|
-
this.engine.close();
|
|
197702
|
-
(0, uws_1.restoreAdapter)();
|
|
197703
|
-
if (this.httpServer) {
|
|
197704
|
-
return new Promise((resolve6) => {
|
|
197705
|
-
this.httpServer.close((err) => {
|
|
197706
|
-
fn9 && fn9(err);
|
|
197707
|
-
if (err) {
|
|
197708
|
-
debug("server was not running");
|
|
197709
|
-
}
|
|
197710
|
-
resolve6();
|
|
197711
|
-
});
|
|
197712
|
-
});
|
|
197713
|
-
} else {
|
|
197714
|
-
fn9 && fn9();
|
|
197715
|
-
}
|
|
201066
|
+
value = toNumber(value);
|
|
201067
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
201068
|
+
var sign2 = value < 0 ? -1 : 1;
|
|
201069
|
+
return sign2 * MAX_INTEGER;
|
|
197716
201070
|
}
|
|
197717
|
-
|
|
197718
|
-
|
|
197719
|
-
|
|
201071
|
+
return value === value ? value : 0;
|
|
201072
|
+
}
|
|
201073
|
+
function toInteger(value) {
|
|
201074
|
+
var result = toFinite(value), remainder = result % 1;
|
|
201075
|
+
return result === result ? remainder ? result - remainder : result : 0;
|
|
201076
|
+
}
|
|
201077
|
+
function toNumber(value) {
|
|
201078
|
+
if (typeof value == "number") {
|
|
201079
|
+
return value;
|
|
197720
201080
|
}
|
|
197721
|
-
|
|
197722
|
-
return
|
|
201081
|
+
if (isSymbol(value)) {
|
|
201082
|
+
return NAN;
|
|
197723
201083
|
}
|
|
197724
|
-
|
|
197725
|
-
|
|
201084
|
+
if (isObject5(value)) {
|
|
201085
|
+
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
201086
|
+
value = isObject5(other) ? other + "" : other;
|
|
197726
201087
|
}
|
|
197727
|
-
|
|
197728
|
-
return
|
|
201088
|
+
if (typeof value != "string") {
|
|
201089
|
+
return value === 0 ? value : +value;
|
|
197729
201090
|
}
|
|
197730
|
-
|
|
197731
|
-
|
|
197732
|
-
|
|
201091
|
+
value = value.replace(reTrim, "");
|
|
201092
|
+
var isBinary = reIsBinary.test(value);
|
|
201093
|
+
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
201094
|
+
}
|
|
201095
|
+
module.exports = once9;
|
|
201096
|
+
});
|
|
201097
|
+
|
|
201098
|
+
// ../../node_modules/jsonwebtoken/sign.js
|
|
201099
|
+
var require_sign2 = __commonJS((exports, module) => {
|
|
201100
|
+
var timespan = require_timespan();
|
|
201101
|
+
var PS_SUPPORTED = require_psSupported();
|
|
201102
|
+
var validateAsymmetricKey = require_validateAsymmetricKey();
|
|
201103
|
+
var jws = require_jws();
|
|
201104
|
+
var includes = require_lodash2();
|
|
201105
|
+
var isBoolean = require_lodash3();
|
|
201106
|
+
var isInteger = require_lodash4();
|
|
201107
|
+
var isNumber = require_lodash5();
|
|
201108
|
+
var isPlainObject3 = require_lodash6();
|
|
201109
|
+
var isString = require_lodash7();
|
|
201110
|
+
var once9 = require_lodash8();
|
|
201111
|
+
var { KeyObject, createSecretKey, createPrivateKey } = __require("crypto");
|
|
201112
|
+
var SUPPORTED_ALGS = ["RS256", "RS384", "RS512", "ES256", "ES384", "ES512", "HS256", "HS384", "HS512", "none"];
|
|
201113
|
+
if (PS_SUPPORTED) {
|
|
201114
|
+
SUPPORTED_ALGS.splice(3, 0, "PS256", "PS384", "PS512");
|
|
201115
|
+
}
|
|
201116
|
+
var sign_options_schema = {
|
|
201117
|
+
expiresIn: { isValid: function(value) {
|
|
201118
|
+
return isInteger(value) || isString(value) && value;
|
|
201119
|
+
}, message: '"expiresIn" should be a number of seconds or string representing a timespan' },
|
|
201120
|
+
notBefore: { isValid: function(value) {
|
|
201121
|
+
return isInteger(value) || isString(value) && value;
|
|
201122
|
+
}, message: '"notBefore" should be a number of seconds or string representing a timespan' },
|
|
201123
|
+
audience: { isValid: function(value) {
|
|
201124
|
+
return isString(value) || Array.isArray(value);
|
|
201125
|
+
}, message: '"audience" must be a string or array' },
|
|
201126
|
+
algorithm: { isValid: includes.bind(null, SUPPORTED_ALGS), message: '"algorithm" must be a valid string enum value' },
|
|
201127
|
+
header: { isValid: isPlainObject3, message: '"header" must be an object' },
|
|
201128
|
+
encoding: { isValid: isString, message: '"encoding" must be a string' },
|
|
201129
|
+
issuer: { isValid: isString, message: '"issuer" must be a string' },
|
|
201130
|
+
subject: { isValid: isString, message: '"subject" must be a string' },
|
|
201131
|
+
jwtid: { isValid: isString, message: '"jwtid" must be a string' },
|
|
201132
|
+
noTimestamp: { isValid: isBoolean, message: '"noTimestamp" must be a boolean' },
|
|
201133
|
+
keyid: { isValid: isString, message: '"keyid" must be a string' },
|
|
201134
|
+
mutatePayload: { isValid: isBoolean, message: '"mutatePayload" must be a boolean' },
|
|
201135
|
+
allowInsecureKeySizes: { isValid: isBoolean, message: '"allowInsecureKeySizes" must be a boolean' },
|
|
201136
|
+
allowInvalidAsymmetricKeyTypes: { isValid: isBoolean, message: '"allowInvalidAsymmetricKeyTypes" must be a boolean' }
|
|
201137
|
+
};
|
|
201138
|
+
var registered_claims_schema = {
|
|
201139
|
+
iat: { isValid: isNumber, message: '"iat" should be a number of seconds' },
|
|
201140
|
+
exp: { isValid: isNumber, message: '"exp" should be a number of seconds' },
|
|
201141
|
+
nbf: { isValid: isNumber, message: '"nbf" should be a number of seconds' }
|
|
201142
|
+
};
|
|
201143
|
+
function validate2(schema9, allowUnknown, object2, parameterName) {
|
|
201144
|
+
if (!isPlainObject3(object2)) {
|
|
201145
|
+
throw new Error('Expected "' + parameterName + '" to be a plain object.');
|
|
201146
|
+
}
|
|
201147
|
+
Object.keys(object2).forEach(function(key2) {
|
|
201148
|
+
const validator = schema9[key2];
|
|
201149
|
+
if (!validator) {
|
|
201150
|
+
if (!allowUnknown) {
|
|
201151
|
+
throw new Error('"' + key2 + '" is not allowed in "' + parameterName + '"');
|
|
201152
|
+
}
|
|
201153
|
+
return;
|
|
201154
|
+
}
|
|
201155
|
+
if (!validator.isValid(object2[key2])) {
|
|
201156
|
+
throw new Error(validator.message);
|
|
201157
|
+
}
|
|
201158
|
+
});
|
|
201159
|
+
}
|
|
201160
|
+
function validateOptions2(options8) {
|
|
201161
|
+
return validate2(sign_options_schema, false, options8, "options");
|
|
201162
|
+
}
|
|
201163
|
+
function validatePayload(payload) {
|
|
201164
|
+
return validate2(registered_claims_schema, true, payload, "payload");
|
|
201165
|
+
}
|
|
201166
|
+
var options_to_payload = {
|
|
201167
|
+
audience: "aud",
|
|
201168
|
+
issuer: "iss",
|
|
201169
|
+
subject: "sub",
|
|
201170
|
+
jwtid: "jti"
|
|
201171
|
+
};
|
|
201172
|
+
var options_for_objects = [
|
|
201173
|
+
"expiresIn",
|
|
201174
|
+
"notBefore",
|
|
201175
|
+
"noTimestamp",
|
|
201176
|
+
"audience",
|
|
201177
|
+
"issuer",
|
|
201178
|
+
"subject",
|
|
201179
|
+
"jwtid"
|
|
201180
|
+
];
|
|
201181
|
+
module.exports = function(payload, secretOrPrivateKey, options8, callback) {
|
|
201182
|
+
if (typeof options8 === "function") {
|
|
201183
|
+
callback = options8;
|
|
201184
|
+
options8 = {};
|
|
201185
|
+
} else {
|
|
201186
|
+
options8 = options8 || {};
|
|
197733
201187
|
}
|
|
197734
|
-
|
|
197735
|
-
|
|
197736
|
-
|
|
201188
|
+
const isObjectPayload = typeof payload === "object" && !Buffer.isBuffer(payload);
|
|
201189
|
+
const header2 = Object.assign({
|
|
201190
|
+
alg: options8.algorithm || "HS256",
|
|
201191
|
+
typ: isObjectPayload ? "JWT" : undefined,
|
|
201192
|
+
kid: options8.keyid
|
|
201193
|
+
}, options8.header);
|
|
201194
|
+
function failure(err) {
|
|
201195
|
+
if (callback) {
|
|
201196
|
+
return callback(err);
|
|
201197
|
+
}
|
|
201198
|
+
throw err;
|
|
197737
201199
|
}
|
|
197738
|
-
|
|
197739
|
-
return
|
|
201200
|
+
if (!secretOrPrivateKey && options8.algorithm !== "none") {
|
|
201201
|
+
return failure(new Error("secretOrPrivateKey must have a value"));
|
|
197740
201202
|
}
|
|
197741
|
-
|
|
197742
|
-
|
|
201203
|
+
if (secretOrPrivateKey != null && !(secretOrPrivateKey instanceof KeyObject)) {
|
|
201204
|
+
try {
|
|
201205
|
+
secretOrPrivateKey = createPrivateKey(secretOrPrivateKey);
|
|
201206
|
+
} catch (_10) {
|
|
201207
|
+
try {
|
|
201208
|
+
secretOrPrivateKey = createSecretKey(typeof secretOrPrivateKey === "string" ? Buffer.from(secretOrPrivateKey) : secretOrPrivateKey);
|
|
201209
|
+
} catch (_11) {
|
|
201210
|
+
return failure(new Error("secretOrPrivateKey is not valid key material"));
|
|
201211
|
+
}
|
|
201212
|
+
}
|
|
197743
201213
|
}
|
|
197744
|
-
|
|
197745
|
-
return
|
|
201214
|
+
if (header2.alg.startsWith("HS") && secretOrPrivateKey.type !== "secret") {
|
|
201215
|
+
return failure(new Error(`secretOrPrivateKey must be a symmetric key when using ${header2.alg}`));
|
|
201216
|
+
} else if (/^(?:RS|PS|ES)/.test(header2.alg)) {
|
|
201217
|
+
if (secretOrPrivateKey.type !== "private") {
|
|
201218
|
+
return failure(new Error(`secretOrPrivateKey must be an asymmetric key when using ${header2.alg}`));
|
|
201219
|
+
}
|
|
201220
|
+
if (!options8.allowInsecureKeySizes && !header2.alg.startsWith("ES") && secretOrPrivateKey.asymmetricKeyDetails !== undefined && secretOrPrivateKey.asymmetricKeyDetails.modulusLength < 2048) {
|
|
201221
|
+
return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header2.alg}`));
|
|
201222
|
+
}
|
|
197746
201223
|
}
|
|
197747
|
-
|
|
197748
|
-
return
|
|
201224
|
+
if (typeof payload === "undefined") {
|
|
201225
|
+
return failure(new Error("payload is required"));
|
|
201226
|
+
} else if (isObjectPayload) {
|
|
201227
|
+
try {
|
|
201228
|
+
validatePayload(payload);
|
|
201229
|
+
} catch (error48) {
|
|
201230
|
+
return failure(error48);
|
|
201231
|
+
}
|
|
201232
|
+
if (!options8.mutatePayload) {
|
|
201233
|
+
payload = Object.assign({}, payload);
|
|
201234
|
+
}
|
|
201235
|
+
} else {
|
|
201236
|
+
const invalid_options = options_for_objects.filter(function(opt) {
|
|
201237
|
+
return typeof options8[opt] !== "undefined";
|
|
201238
|
+
});
|
|
201239
|
+
if (invalid_options.length > 0) {
|
|
201240
|
+
return failure(new Error("invalid " + invalid_options.join(",") + " option for " + typeof payload + " payload"));
|
|
201241
|
+
}
|
|
197749
201242
|
}
|
|
197750
|
-
|
|
197751
|
-
return
|
|
201243
|
+
if (typeof payload.exp !== "undefined" && typeof options8.expiresIn !== "undefined") {
|
|
201244
|
+
return failure(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));
|
|
197752
201245
|
}
|
|
197753
|
-
|
|
197754
|
-
return
|
|
201246
|
+
if (typeof payload.nbf !== "undefined" && typeof options8.notBefore !== "undefined") {
|
|
201247
|
+
return failure(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));
|
|
197755
201248
|
}
|
|
197756
|
-
|
|
197757
|
-
|
|
201249
|
+
try {
|
|
201250
|
+
validateOptions2(options8);
|
|
201251
|
+
} catch (error48) {
|
|
201252
|
+
return failure(error48);
|
|
197758
201253
|
}
|
|
197759
|
-
|
|
197760
|
-
|
|
201254
|
+
if (!options8.allowInvalidAsymmetricKeyTypes) {
|
|
201255
|
+
try {
|
|
201256
|
+
validateAsymmetricKey(header2.alg, secretOrPrivateKey);
|
|
201257
|
+
} catch (error48) {
|
|
201258
|
+
return failure(error48);
|
|
201259
|
+
}
|
|
197761
201260
|
}
|
|
197762
|
-
|
|
197763
|
-
|
|
201261
|
+
const timestamp = payload.iat || Math.floor(Date.now() / 1000);
|
|
201262
|
+
if (options8.noTimestamp) {
|
|
201263
|
+
delete payload.iat;
|
|
201264
|
+
} else if (isObjectPayload) {
|
|
201265
|
+
payload.iat = timestamp;
|
|
197764
201266
|
}
|
|
197765
|
-
|
|
197766
|
-
|
|
201267
|
+
if (typeof options8.notBefore !== "undefined") {
|
|
201268
|
+
try {
|
|
201269
|
+
payload.nbf = timespan(options8.notBefore, timestamp);
|
|
201270
|
+
} catch (err) {
|
|
201271
|
+
return failure(err);
|
|
201272
|
+
}
|
|
201273
|
+
if (typeof payload.nbf === "undefined") {
|
|
201274
|
+
return failure(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));
|
|
201275
|
+
}
|
|
197767
201276
|
}
|
|
197768
|
-
|
|
197769
|
-
|
|
201277
|
+
if (typeof options8.expiresIn !== "undefined" && typeof payload === "object") {
|
|
201278
|
+
try {
|
|
201279
|
+
payload.exp = timespan(options8.expiresIn, timestamp);
|
|
201280
|
+
} catch (err) {
|
|
201281
|
+
return failure(err);
|
|
201282
|
+
}
|
|
201283
|
+
if (typeof payload.exp === "undefined") {
|
|
201284
|
+
return failure(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));
|
|
201285
|
+
}
|
|
197770
201286
|
}
|
|
197771
|
-
|
|
197772
|
-
|
|
197773
|
-
|
|
197774
|
-
|
|
197775
|
-
|
|
197776
|
-
|
|
197777
|
-
|
|
197778
|
-
|
|
197779
|
-
};
|
|
197780
|
-
|
|
197781
|
-
|
|
197782
|
-
|
|
197783
|
-
|
|
197784
|
-
|
|
201287
|
+
Object.keys(options_to_payload).forEach(function(key2) {
|
|
201288
|
+
const claim = options_to_payload[key2];
|
|
201289
|
+
if (typeof options8[key2] !== "undefined") {
|
|
201290
|
+
if (typeof payload[claim] !== "undefined") {
|
|
201291
|
+
return failure(new Error('Bad "options.' + key2 + '" option. The payload already has an "' + claim + '" property.'));
|
|
201292
|
+
}
|
|
201293
|
+
payload[claim] = options8[key2];
|
|
201294
|
+
}
|
|
201295
|
+
});
|
|
201296
|
+
const encoding = options8.encoding || "utf8";
|
|
201297
|
+
if (typeof callback === "function") {
|
|
201298
|
+
callback = callback && once9(callback);
|
|
201299
|
+
jws.createSign({
|
|
201300
|
+
header: header2,
|
|
201301
|
+
privateKey: secretOrPrivateKey,
|
|
201302
|
+
payload,
|
|
201303
|
+
encoding
|
|
201304
|
+
}).once("error", callback).once("done", function(signature) {
|
|
201305
|
+
if (!options8.allowInsecureKeySizes && /^(?:RS|PS)/.test(header2.alg) && signature.length < 256) {
|
|
201306
|
+
return callback(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header2.alg}`));
|
|
201307
|
+
}
|
|
201308
|
+
callback(null, signature);
|
|
201309
|
+
});
|
|
201310
|
+
} else {
|
|
201311
|
+
let signature = jws.sign({ header: header2, payload, secret: secretOrPrivateKey, encoding });
|
|
201312
|
+
if (!options8.allowInsecureKeySizes && /^(?:RS|PS)/.test(header2.alg) && signature.length < 256) {
|
|
201313
|
+
throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header2.alg}`);
|
|
201314
|
+
}
|
|
201315
|
+
return signature;
|
|
201316
|
+
}
|
|
201317
|
+
};
|
|
201318
|
+
});
|
|
201319
|
+
|
|
201320
|
+
// ../../node_modules/jsonwebtoken/index.js
|
|
201321
|
+
var require_jsonwebtoken = __commonJS((exports, module) => {
|
|
201322
|
+
module.exports = {
|
|
201323
|
+
decode: require_decode(),
|
|
201324
|
+
verify: require_verify(),
|
|
201325
|
+
sign: require_sign2(),
|
|
201326
|
+
JsonWebTokenError: require_JsonWebTokenError(),
|
|
201327
|
+
NotBeforeError: require_NotBeforeError(),
|
|
201328
|
+
TokenExpiredError: require_TokenExpiredError()
|
|
201329
|
+
};
|
|
197785
201330
|
});
|
|
197786
201331
|
|
|
197787
201332
|
// ../../node_modules/multer/node_modules/type-is/node_modules/media-typer/index.js
|
|
@@ -211972,63 +215517,6 @@ var require__stream_duplex = __commonJS((exports, module) => {
|
|
|
211972
215517
|
});
|
|
211973
215518
|
});
|
|
211974
215519
|
|
|
211975
|
-
// ../../node_modules/safe-buffer/index.js
|
|
211976
|
-
var require_safe_buffer = __commonJS((exports, module) => {
|
|
211977
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
211978
|
-
var buffer2 = __require("buffer");
|
|
211979
|
-
var Buffer7 = buffer2.Buffer;
|
|
211980
|
-
function copyProps(src, dst) {
|
|
211981
|
-
for (var key2 in src) {
|
|
211982
|
-
dst[key2] = src[key2];
|
|
211983
|
-
}
|
|
211984
|
-
}
|
|
211985
|
-
if (Buffer7.from && Buffer7.alloc && Buffer7.allocUnsafe && Buffer7.allocUnsafeSlow) {
|
|
211986
|
-
module.exports = buffer2;
|
|
211987
|
-
} else {
|
|
211988
|
-
copyProps(buffer2, exports);
|
|
211989
|
-
exports.Buffer = SafeBuffer;
|
|
211990
|
-
}
|
|
211991
|
-
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
211992
|
-
return Buffer7(arg, encodingOrOffset, length);
|
|
211993
|
-
}
|
|
211994
|
-
SafeBuffer.prototype = Object.create(Buffer7.prototype);
|
|
211995
|
-
copyProps(Buffer7, SafeBuffer);
|
|
211996
|
-
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
211997
|
-
if (typeof arg === "number") {
|
|
211998
|
-
throw new TypeError("Argument must not be a number");
|
|
211999
|
-
}
|
|
212000
|
-
return Buffer7(arg, encodingOrOffset, length);
|
|
212001
|
-
};
|
|
212002
|
-
SafeBuffer.alloc = function(size, fill2, encoding) {
|
|
212003
|
-
if (typeof size !== "number") {
|
|
212004
|
-
throw new TypeError("Argument must be a number");
|
|
212005
|
-
}
|
|
212006
|
-
var buf = Buffer7(size);
|
|
212007
|
-
if (fill2 !== undefined) {
|
|
212008
|
-
if (typeof encoding === "string") {
|
|
212009
|
-
buf.fill(fill2, encoding);
|
|
212010
|
-
} else {
|
|
212011
|
-
buf.fill(fill2);
|
|
212012
|
-
}
|
|
212013
|
-
} else {
|
|
212014
|
-
buf.fill(0);
|
|
212015
|
-
}
|
|
212016
|
-
return buf;
|
|
212017
|
-
};
|
|
212018
|
-
SafeBuffer.allocUnsafe = function(size) {
|
|
212019
|
-
if (typeof size !== "number") {
|
|
212020
|
-
throw new TypeError("Argument must be a number");
|
|
212021
|
-
}
|
|
212022
|
-
return Buffer7(size);
|
|
212023
|
-
};
|
|
212024
|
-
SafeBuffer.allocUnsafeSlow = function(size) {
|
|
212025
|
-
if (typeof size !== "number") {
|
|
212026
|
-
throw new TypeError("Argument must be a number");
|
|
212027
|
-
}
|
|
212028
|
-
return buffer2.SlowBuffer(size);
|
|
212029
|
-
};
|
|
212030
|
-
});
|
|
212031
|
-
|
|
212032
215520
|
// ../../node_modules/string_decoder/lib/string_decoder.js
|
|
212033
215521
|
var require_string_decoder = __commonJS((exports) => {
|
|
212034
215522
|
var Buffer7 = require_safe_buffer().Buffer;
|
|
@@ -248926,7 +252414,7 @@ function getTypesCommand() {
|
|
|
248926
252414
|
// src/cli/dev/dev-server/main.ts
|
|
248927
252415
|
import { dirname as dirname14, join as join20 } from "node:path";
|
|
248928
252416
|
var import_cors = __toESM(require_lib4(), 1);
|
|
248929
|
-
var
|
|
252417
|
+
var import_express5 = __toESM(require_express(), 1);
|
|
248930
252418
|
|
|
248931
252419
|
// ../../node_modules/get-port/index.js
|
|
248932
252420
|
import net from "node:net";
|
|
@@ -249277,7 +252765,56 @@ function createFunctionRouter(manager, logger) {
|
|
|
249277
252765
|
// src/cli/dev/dev-server/db/database.ts
|
|
249278
252766
|
var import_nedb = __toESM(require_nedb(), 1);
|
|
249279
252767
|
|
|
252768
|
+
// ../../node_modules/nanoid/index.js
|
|
252769
|
+
import { webcrypto as crypto } from "node:crypto";
|
|
252770
|
+
|
|
252771
|
+
// ../../node_modules/nanoid/url-alphabet/index.js
|
|
252772
|
+
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
252773
|
+
|
|
252774
|
+
// ../../node_modules/nanoid/index.js
|
|
252775
|
+
var POOL_SIZE_MULTIPLIER = 128;
|
|
252776
|
+
var pool;
|
|
252777
|
+
var poolOffset;
|
|
252778
|
+
function fillPool(bytes) {
|
|
252779
|
+
if (!pool || pool.length < bytes) {
|
|
252780
|
+
pool = Buffer.allocUnsafe(bytes * POOL_SIZE_MULTIPLIER);
|
|
252781
|
+
crypto.getRandomValues(pool);
|
|
252782
|
+
poolOffset = 0;
|
|
252783
|
+
} else if (poolOffset + bytes > pool.length) {
|
|
252784
|
+
crypto.getRandomValues(pool);
|
|
252785
|
+
poolOffset = 0;
|
|
252786
|
+
}
|
|
252787
|
+
poolOffset += bytes;
|
|
252788
|
+
}
|
|
252789
|
+
function nanoid3(size = 21) {
|
|
252790
|
+
fillPool(size |= 0);
|
|
252791
|
+
let id2 = "";
|
|
252792
|
+
for (let i5 = poolOffset - size;i5 < poolOffset; i5++) {
|
|
252793
|
+
id2 += urlAlphabet[pool[i5] & 63];
|
|
252794
|
+
}
|
|
252795
|
+
return id2;
|
|
252796
|
+
}
|
|
252797
|
+
|
|
252798
|
+
// src/cli/dev/dev-server/utils.ts
|
|
252799
|
+
function stripInternalFields(doc2) {
|
|
252800
|
+
if (Array.isArray(doc2)) {
|
|
252801
|
+
return doc2.map((d5) => stripInternalFields(d5));
|
|
252802
|
+
}
|
|
252803
|
+
const { _id, ...rest } = doc2;
|
|
252804
|
+
return rest;
|
|
252805
|
+
}
|
|
252806
|
+
var getNowISOTimestamp = () => {
|
|
252807
|
+
return new Date().toISOString().replace("Z", "000");
|
|
252808
|
+
};
|
|
252809
|
+
|
|
249280
252810
|
// src/cli/dev/dev-server/db/validator.ts
|
|
252811
|
+
class EntityValidationError extends Error {
|
|
252812
|
+
context;
|
|
252813
|
+
constructor(context) {
|
|
252814
|
+
super(context.message);
|
|
252815
|
+
this.context = context;
|
|
252816
|
+
}
|
|
252817
|
+
}
|
|
249281
252818
|
var fieldTypes = [
|
|
249282
252819
|
"string",
|
|
249283
252820
|
"integer",
|
|
@@ -249313,16 +252850,13 @@ class Validator {
|
|
|
249313
252850
|
if (!partial2) {
|
|
249314
252851
|
const requiredFieldsResponse = this.validateRequiredFields(record2, entitySchema);
|
|
249315
252852
|
if (requiredFieldsResponse.hasError) {
|
|
249316
|
-
|
|
252853
|
+
throw new EntityValidationError(requiredFieldsResponse.error);
|
|
249317
252854
|
}
|
|
249318
252855
|
}
|
|
249319
252856
|
const fieldTypesResponse = this.validateFieldTypes(record2, entitySchema);
|
|
249320
252857
|
if (fieldTypesResponse.hasError) {
|
|
249321
|
-
|
|
252858
|
+
throw new EntityValidationError(fieldTypesResponse.error);
|
|
249322
252859
|
}
|
|
249323
|
-
return {
|
|
249324
|
-
hasError: false
|
|
249325
|
-
};
|
|
249326
252860
|
}
|
|
249327
252861
|
createValidationError(message) {
|
|
249328
252862
|
return {
|
|
@@ -249423,18 +252957,67 @@ class Validator {
|
|
|
249423
252957
|
}
|
|
249424
252958
|
|
|
249425
252959
|
// src/cli/dev/dev-server/db/database.ts
|
|
252960
|
+
var USER_COLLECTION = "user";
|
|
252961
|
+
|
|
249426
252962
|
class Database {
|
|
249427
252963
|
collections = new Map;
|
|
249428
252964
|
schemas = new Map;
|
|
249429
252965
|
validator = new Validator;
|
|
249430
|
-
load(entities) {
|
|
252966
|
+
async load(entities) {
|
|
252967
|
+
await this.loadUserCollection(entities);
|
|
249431
252968
|
for (const entity2 of entities) {
|
|
249432
|
-
this.
|
|
249433
|
-
|
|
252969
|
+
const entityName = this.normalizeName(entity2.name);
|
|
252970
|
+
if (entityName === USER_COLLECTION) {
|
|
252971
|
+
continue;
|
|
252972
|
+
}
|
|
252973
|
+
this.collections.set(entityName, new import_nedb.default);
|
|
252974
|
+
this.schemas.set(entityName, entity2);
|
|
252975
|
+
}
|
|
252976
|
+
}
|
|
252977
|
+
async loadUserCollection(entities) {
|
|
252978
|
+
const userEntity = entities.find((e8) => this.normalizeName(e8.name) === USER_COLLECTION);
|
|
252979
|
+
this.schemas.set(USER_COLLECTION, this.buildUserSchema(userEntity));
|
|
252980
|
+
const collection = new import_nedb.default;
|
|
252981
|
+
this.collections.set(USER_COLLECTION, collection);
|
|
252982
|
+
const userInfo = await readAuth();
|
|
252983
|
+
const now = getNowISOTimestamp();
|
|
252984
|
+
await collection.insertAsync({
|
|
252985
|
+
id: nanoid3(),
|
|
252986
|
+
email: userInfo.email,
|
|
252987
|
+
full_name: userInfo.name,
|
|
252988
|
+
is_service: false,
|
|
252989
|
+
is_verified: true,
|
|
252990
|
+
disabled: null,
|
|
252991
|
+
role: "admin",
|
|
252992
|
+
collaborator_role: "editor",
|
|
252993
|
+
created_date: now,
|
|
252994
|
+
updated_date: now
|
|
252995
|
+
});
|
|
252996
|
+
}
|
|
252997
|
+
buildUserSchema(customUserEntity) {
|
|
252998
|
+
const builtInFields = {
|
|
252999
|
+
full_name: { type: "string" },
|
|
253000
|
+
email: { type: "string" }
|
|
253001
|
+
};
|
|
253002
|
+
if (!customUserEntity) {
|
|
253003
|
+
return {
|
|
253004
|
+
name: "User",
|
|
253005
|
+
type: "object",
|
|
253006
|
+
properties: { ...builtInFields, role: { type: "string" } }
|
|
253007
|
+
};
|
|
253008
|
+
}
|
|
253009
|
+
for (const field of Object.keys(builtInFields)) {
|
|
253010
|
+
if (field in customUserEntity.properties) {
|
|
253011
|
+
throw new Error(`Error syncing entities: Invalid User schema: User schema cannot contain base fields: ${field}. These fields are built-in and managed by the system.`);
|
|
253012
|
+
}
|
|
249434
253013
|
}
|
|
253014
|
+
return {
|
|
253015
|
+
...customUserEntity,
|
|
253016
|
+
properties: { ...customUserEntity.properties, ...builtInFields }
|
|
253017
|
+
};
|
|
249435
253018
|
}
|
|
249436
253019
|
getCollection(name2) {
|
|
249437
|
-
return this.collections.get(name2);
|
|
253020
|
+
return this.collections.get(this.normalizeName(name2));
|
|
249438
253021
|
}
|
|
249439
253022
|
getCollectionNames() {
|
|
249440
253023
|
return Array.from(this.collections.keys());
|
|
@@ -249447,14 +253030,14 @@ class Database {
|
|
|
249447
253030
|
this.schemas.clear();
|
|
249448
253031
|
}
|
|
249449
253032
|
validate(entityName, record2, partial2 = false) {
|
|
249450
|
-
const schema9 = this.schemas.get(entityName);
|
|
253033
|
+
const schema9 = this.schemas.get(this.normalizeName(entityName));
|
|
249451
253034
|
if (!schema9) {
|
|
249452
253035
|
throw new Error(`Entity "${entityName}" not found`);
|
|
249453
253036
|
}
|
|
249454
253037
|
return this.validator.validate(record2, schema9, partial2);
|
|
249455
253038
|
}
|
|
249456
253039
|
prepareRecord(entityName, record2, partial2 = false) {
|
|
249457
|
-
const schema9 = this.schemas.get(entityName);
|
|
253040
|
+
const schema9 = this.schemas.get(this.normalizeName(entityName));
|
|
249458
253041
|
if (!schema9) {
|
|
249459
253042
|
throw new Error(`Entity "${entityName}" not found`);
|
|
249460
253043
|
}
|
|
@@ -249464,6 +253047,9 @@ class Database {
|
|
|
249464
253047
|
}
|
|
249465
253048
|
return this.validator.applyDefaults(filteredRecord, schema9);
|
|
249466
253049
|
}
|
|
253050
|
+
normalizeName(entityName) {
|
|
253051
|
+
return entityName.toLowerCase();
|
|
253052
|
+
}
|
|
249467
253053
|
}
|
|
249468
253054
|
|
|
249469
253055
|
// ../../node_modules/socket.io/wrapper.mjs
|
|
@@ -249498,40 +253084,105 @@ function broadcastEntityEvent(io6, appId, entityName, event) {
|
|
|
249498
253084
|
});
|
|
249499
253085
|
}
|
|
249500
253086
|
|
|
249501
|
-
// src/cli/dev/dev-server/routes/entities.ts
|
|
249502
|
-
var
|
|
249503
|
-
|
|
249504
|
-
// ../../node_modules/nanoid/index.js
|
|
249505
|
-
import { webcrypto as crypto } from "node:crypto";
|
|
249506
|
-
|
|
249507
|
-
// ../../node_modules/nanoid/url-alphabet/index.js
|
|
249508
|
-
var urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
253087
|
+
// src/cli/dev/dev-server/routes/entities/entities-router.ts
|
|
253088
|
+
var import_express3 = __toESM(require_express(), 1);
|
|
249509
253089
|
|
|
249510
|
-
//
|
|
249511
|
-
var
|
|
249512
|
-
var
|
|
249513
|
-
|
|
249514
|
-
|
|
249515
|
-
|
|
249516
|
-
|
|
249517
|
-
|
|
249518
|
-
|
|
249519
|
-
|
|
249520
|
-
|
|
249521
|
-
|
|
249522
|
-
|
|
249523
|
-
|
|
249524
|
-
}
|
|
249525
|
-
|
|
249526
|
-
|
|
249527
|
-
|
|
249528
|
-
|
|
249529
|
-
|
|
253090
|
+
// src/cli/dev/dev-server/routes/entities/entities-user-router.ts
|
|
253091
|
+
var import_express2 = __toESM(require_express(), 1);
|
|
253092
|
+
var import_jsonwebtoken = __toESM(require_jsonwebtoken(), 1);
|
|
253093
|
+
function createUserRouter(db2, logger) {
|
|
253094
|
+
const router = import_express2.Router({ mergeParams: true });
|
|
253095
|
+
const parseBody = import_express2.json();
|
|
253096
|
+
function withAuth(handler) {
|
|
253097
|
+
return async (req, res) => {
|
|
253098
|
+
const auth2 = req.headers.authorization;
|
|
253099
|
+
if (!auth2 || !auth2.startsWith("Bearer ")) {
|
|
253100
|
+
res.status(401).json({ error: "Unauthorized" });
|
|
253101
|
+
return;
|
|
253102
|
+
}
|
|
253103
|
+
try {
|
|
253104
|
+
const { payload } = import_jsonwebtoken.default.decode(auth2.replace("Bearer ", ""), { complete: true }) ?? {};
|
|
253105
|
+
const result = await db2.getCollection(USER_COLLECTION)?.findOneAsync({ email: payload?.sub });
|
|
253106
|
+
if (!result) {
|
|
253107
|
+
res.status(404).json({ error: "Unable to read data for the current user" });
|
|
253108
|
+
return;
|
|
253109
|
+
}
|
|
253110
|
+
await handler(req, res, result);
|
|
253111
|
+
} catch {
|
|
253112
|
+
res.status(401).json({ error: "Unauthorized" });
|
|
253113
|
+
}
|
|
253114
|
+
};
|
|
249530
253115
|
}
|
|
249531
|
-
|
|
253116
|
+
router.get("/:id", withAuth(async (req, res, currentUser) => {
|
|
253117
|
+
const id2 = req.params.id === "me" ? currentUser.id : req.params.id;
|
|
253118
|
+
const result = await db2.getCollection(USER_COLLECTION)?.findOneAsync({ id: id2 });
|
|
253119
|
+
if (!result) {
|
|
253120
|
+
res.status(404).json({ error: `User with id "${req.params.id}" not found` });
|
|
253121
|
+
return;
|
|
253122
|
+
}
|
|
253123
|
+
res.json(stripInternalFields(result));
|
|
253124
|
+
}));
|
|
253125
|
+
router.post("/", parseBody, withAuth(async (req, res, currentUser) => {
|
|
253126
|
+
const now = getNowISOTimestamp();
|
|
253127
|
+
res.json({
|
|
253128
|
+
created_by: currentUser.email,
|
|
253129
|
+
created_by_id: currentUser.id,
|
|
253130
|
+
id: nanoid3(),
|
|
253131
|
+
created_date: now,
|
|
253132
|
+
updated_date: now,
|
|
253133
|
+
is_sample: false,
|
|
253134
|
+
...req.body
|
|
253135
|
+
});
|
|
253136
|
+
}));
|
|
253137
|
+
router.post("/bulk", async (_req, res) => {
|
|
253138
|
+
res.json({});
|
|
253139
|
+
});
|
|
253140
|
+
router.put("/:id", parseBody, withAuth(async (req, res, currentUser) => {
|
|
253141
|
+
const restrictedFields = ["full_name", "email", "role"];
|
|
253142
|
+
const collection = db2.getCollection(USER_COLLECTION);
|
|
253143
|
+
const id2 = req.params.id === "me" ? currentUser.id : req.params.id;
|
|
253144
|
+
const userRecord = await collection?.findOneAsync({
|
|
253145
|
+
id: id2
|
|
253146
|
+
});
|
|
253147
|
+
if (userRecord) {
|
|
253148
|
+
try {
|
|
253149
|
+
const { id: _id, created_date: _created_date, ...body } = req.body;
|
|
253150
|
+
const filteredBody = db2.prepareRecord(USER_COLLECTION, body, true);
|
|
253151
|
+
const allowedFields = {};
|
|
253152
|
+
for (const [key2, property] of Object.entries(filteredBody)) {
|
|
253153
|
+
if (!restrictedFields.includes(key2)) {
|
|
253154
|
+
allowedFields[key2] = property;
|
|
253155
|
+
}
|
|
253156
|
+
}
|
|
253157
|
+
db2.validate(USER_COLLECTION, allowedFields, true);
|
|
253158
|
+
const updateData = {
|
|
253159
|
+
...allowedFields,
|
|
253160
|
+
updated_date: new Date().toISOString()
|
|
253161
|
+
};
|
|
253162
|
+
const updResult = await collection?.updateAsync({ id: userRecord.id }, { $set: updateData }, { returnUpdatedDocs: true });
|
|
253163
|
+
if (!updResult?.affectedDocuments) {
|
|
253164
|
+
throw new Error(`Failed to update user`);
|
|
253165
|
+
}
|
|
253166
|
+
res.json(stripInternalFields(updResult.affectedDocuments));
|
|
253167
|
+
} catch (error48) {
|
|
253168
|
+
if (error48 instanceof EntityValidationError) {
|
|
253169
|
+
res.status(422).json(error48.context);
|
|
253170
|
+
return;
|
|
253171
|
+
}
|
|
253172
|
+
logger.error(`Error in PUT /${USER_COLLECTION}/${req.params.id}:`, error48);
|
|
253173
|
+
res.status(500).json({ error: "Internal server error" });
|
|
253174
|
+
}
|
|
253175
|
+
} else {
|
|
253176
|
+
res.status(404).json({ error: `User record not found` });
|
|
253177
|
+
}
|
|
253178
|
+
}));
|
|
253179
|
+
router.delete("/:id", async (_req, res) => {
|
|
253180
|
+
res.json({});
|
|
253181
|
+
});
|
|
253182
|
+
return router;
|
|
249532
253183
|
}
|
|
249533
253184
|
|
|
249534
|
-
// src/cli/dev/dev-server/routes/entities.ts
|
|
253185
|
+
// src/cli/dev/dev-server/routes/entities/entities-router.ts
|
|
249535
253186
|
function parseSort(sort) {
|
|
249536
253187
|
if (!sort) {
|
|
249537
253188
|
return;
|
|
@@ -249554,16 +253205,9 @@ function parseFields(fields) {
|
|
|
249554
253205
|
}
|
|
249555
253206
|
return Object.keys(projection).length > 0 ? projection : undefined;
|
|
249556
253207
|
}
|
|
249557
|
-
function
|
|
249558
|
-
|
|
249559
|
-
|
|
249560
|
-
}
|
|
249561
|
-
const { _id, ...rest } = doc2;
|
|
249562
|
-
return rest;
|
|
249563
|
-
}
|
|
249564
|
-
function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
249565
|
-
const router = import_express2.Router({ mergeParams: true });
|
|
249566
|
-
const parseBody = import_express2.json();
|
|
253208
|
+
async function createEntityRoutes(db2, logger, broadcast) {
|
|
253209
|
+
const router = import_express3.Router({ mergeParams: true });
|
|
253210
|
+
const parseBody = import_express3.json();
|
|
249567
253211
|
function withCollection(handler) {
|
|
249568
253212
|
return async (req, res) => {
|
|
249569
253213
|
const collection = db2.getCollection(req.params.entityName);
|
|
@@ -249589,11 +253233,8 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
|
249589
253233
|
}
|
|
249590
253234
|
broadcast(appId, entityName, createData(data));
|
|
249591
253235
|
}
|
|
249592
|
-
|
|
249593
|
-
|
|
249594
|
-
req.url = req.originalUrl;
|
|
249595
|
-
remoteProxy(req, res, next);
|
|
249596
|
-
});
|
|
253236
|
+
const userRouter = createUserRouter(db2, logger);
|
|
253237
|
+
router.use("/User", userRouter);
|
|
249597
253238
|
router.get("/:entityName/:id", withCollection(async (req, res, collection) => {
|
|
249598
253239
|
const { entityName, id: id2 } = req.params;
|
|
249599
253240
|
try {
|
|
@@ -249655,11 +253296,7 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
|
249655
253296
|
const now = new Date().toISOString();
|
|
249656
253297
|
const { _id, ...body } = req.body;
|
|
249657
253298
|
const filteredBody = db2.prepareRecord(entityName, body);
|
|
249658
|
-
|
|
249659
|
-
if (validation.hasError) {
|
|
249660
|
-
res.status(422).json(validation.error);
|
|
249661
|
-
return;
|
|
249662
|
-
}
|
|
253299
|
+
db2.validate(entityName, filteredBody);
|
|
249663
253300
|
const record2 = {
|
|
249664
253301
|
...filteredBody,
|
|
249665
253302
|
id: nanoid3(),
|
|
@@ -249670,6 +253307,10 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
|
249670
253307
|
emit(appId, entityName, "create", inserted);
|
|
249671
253308
|
res.status(201).json(inserted);
|
|
249672
253309
|
} catch (error48) {
|
|
253310
|
+
if (error48 instanceof EntityValidationError) {
|
|
253311
|
+
res.status(422).json(error48.context);
|
|
253312
|
+
return;
|
|
253313
|
+
}
|
|
249673
253314
|
logger.error(`Error in POST /${entityName}:`, error48);
|
|
249674
253315
|
res.status(500).json({ error: "Internal server error" });
|
|
249675
253316
|
}
|
|
@@ -249685,11 +253326,7 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
|
249685
253326
|
const records = [];
|
|
249686
253327
|
for (const record2 of req.body) {
|
|
249687
253328
|
const filteredRecord = db2.prepareRecord(entityName, record2);
|
|
249688
|
-
|
|
249689
|
-
if (validation.hasError) {
|
|
249690
|
-
res.status(422).json(validation.error);
|
|
249691
|
-
return;
|
|
249692
|
-
}
|
|
253329
|
+
db2.validate(entityName, filteredRecord);
|
|
249693
253330
|
records.push({
|
|
249694
253331
|
...filteredRecord,
|
|
249695
253332
|
id: nanoid3(),
|
|
@@ -249701,6 +253338,10 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
|
249701
253338
|
emit(appId, entityName, "create", inserted);
|
|
249702
253339
|
res.status(201).json(inserted);
|
|
249703
253340
|
} catch (error48) {
|
|
253341
|
+
if (error48 instanceof EntityValidationError) {
|
|
253342
|
+
res.status(422).json(error48.context);
|
|
253343
|
+
return;
|
|
253344
|
+
}
|
|
249704
253345
|
logger.error(`Error in POST /${entityName}/bulk:`, error48);
|
|
249705
253346
|
res.status(500).json({ error: "Internal server error" });
|
|
249706
253347
|
}
|
|
@@ -249710,11 +253351,7 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
|
249710
253351
|
const { id: _id, created_date: _created_date, ...body } = req.body;
|
|
249711
253352
|
try {
|
|
249712
253353
|
const filteredBody = db2.prepareRecord(entityName, body, true);
|
|
249713
|
-
|
|
249714
|
-
if (validation.hasError) {
|
|
249715
|
-
res.status(422).json(validation.error);
|
|
249716
|
-
return;
|
|
249717
|
-
}
|
|
253354
|
+
db2.validate(entityName, filteredBody, true);
|
|
249718
253355
|
const updateData = {
|
|
249719
253356
|
...filteredBody,
|
|
249720
253357
|
updated_date: new Date().toISOString()
|
|
@@ -249728,6 +253365,10 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
|
249728
253365
|
emit(appId, entityName, "update", updated);
|
|
249729
253366
|
res.json(updated);
|
|
249730
253367
|
} catch (error48) {
|
|
253368
|
+
if (error48 instanceof EntityValidationError) {
|
|
253369
|
+
res.status(422).json(error48.context);
|
|
253370
|
+
return;
|
|
253371
|
+
}
|
|
249731
253372
|
logger.error(`Error in PUT /${entityName}/${id2}:`, error48);
|
|
249732
253373
|
res.status(500).json({ error: "Internal server error" });
|
|
249733
253374
|
}
|
|
@@ -249765,7 +253406,7 @@ function createEntityRoutes(db2, logger, remoteProxy, broadcast) {
|
|
|
249765
253406
|
}
|
|
249766
253407
|
|
|
249767
253408
|
// src/cli/dev/dev-server/routes/integrations.ts
|
|
249768
|
-
var
|
|
253409
|
+
var import_express4 = __toESM(require_express(), 1);
|
|
249769
253410
|
var import_multer = __toESM(require_multer(), 1);
|
|
249770
253411
|
import { createHash, randomUUID as randomUUID4 } from "node:crypto";
|
|
249771
253412
|
import fs28 from "node:fs";
|
|
@@ -249774,8 +253415,8 @@ function createFileToken(fileUri) {
|
|
|
249774
253415
|
return createHash("sha256").update(fileUri).digest("hex");
|
|
249775
253416
|
}
|
|
249776
253417
|
function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
249777
|
-
const router =
|
|
249778
|
-
const parseBody =
|
|
253418
|
+
const router = import_express4.Router({ mergeParams: true });
|
|
253419
|
+
const parseBody = import_express4.json();
|
|
249779
253420
|
const privateFilesDir = path18.join(mediaFilesDir, "private");
|
|
249780
253421
|
fs28.mkdirSync(mediaFilesDir, { recursive: true });
|
|
249781
253422
|
fs28.mkdirSync(privateFilesDir, { recursive: true });
|
|
@@ -249845,7 +253486,7 @@ function createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, logger) {
|
|
|
249845
253486
|
return router;
|
|
249846
253487
|
}
|
|
249847
253488
|
function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
249848
|
-
const router =
|
|
253489
|
+
const router = import_express4.Router({ mergeParams: true });
|
|
249849
253490
|
router.post("/:slug/:operationId", (req, res, next) => {
|
|
249850
253491
|
logger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
|
|
249851
253492
|
req.url = req.originalUrl;
|
|
@@ -251558,7 +255199,7 @@ async function createDevServer(options8) {
|
|
|
251558
255199
|
const port = userPort ?? await getPorts({ port: DEFAULT_PORT });
|
|
251559
255200
|
const baseUrl = `http://localhost:${port}`;
|
|
251560
255201
|
const { functions, entities, project: project2 } = await options8.loadResources();
|
|
251561
|
-
const app =
|
|
255202
|
+
const app = import_express5.default();
|
|
251562
255203
|
const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
|
|
251563
255204
|
target: BASE44_APP_URL,
|
|
251564
255205
|
changeOrigin: true
|
|
@@ -251583,12 +255224,12 @@ async function createDevServer(options8) {
|
|
|
251583
255224
|
R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
|
|
251584
255225
|
}
|
|
251585
255226
|
const db2 = new Database;
|
|
251586
|
-
db2.load(entities);
|
|
255227
|
+
await db2.load(entities);
|
|
251587
255228
|
if (db2.getCollectionNames().length > 0) {
|
|
251588
255229
|
R2.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
251589
255230
|
}
|
|
251590
255231
|
let emitEntityEvent = () => {};
|
|
251591
|
-
const entityRoutes = createEntityRoutes(db2, devLogger,
|
|
255232
|
+
const entityRoutes = await createEntityRoutes(db2, devLogger, (...args) => emitEntityEvent(...args));
|
|
251592
255233
|
app.use("/api/apps/:appId/entities", entityRoutes);
|
|
251593
255234
|
const { path: mediaFilesDir } = await $dir();
|
|
251594
255235
|
app.use("/media/private/:fileUri", (req, res, next) => {
|
|
@@ -251609,7 +255250,7 @@ async function createDevServer(options8) {
|
|
|
251609
255250
|
}
|
|
251610
255251
|
next();
|
|
251611
255252
|
});
|
|
251612
|
-
app.use("/media",
|
|
255253
|
+
app.use("/media", import_express5.default.static(mediaFilesDir));
|
|
251613
255254
|
const integrationRoutes = createIntegrationRoutes(mediaFilesDir, baseUrl, remoteProxy, devLogger);
|
|
251614
255255
|
app.use("/api/apps/:appId/integration-endpoints", integrationRoutes);
|
|
251615
255256
|
const customIntegrationRoutes = createCustomIntegrationRoutes(remoteProxy, devLogger);
|
|
@@ -251658,7 +255299,7 @@ async function createDevServer(options8) {
|
|
|
251658
255299
|
if (previousEntityCount > 0) {
|
|
251659
255300
|
devLogger.log("Entities directory changed, clearing data...");
|
|
251660
255301
|
}
|
|
251661
|
-
db2.load(entities2);
|
|
255302
|
+
await db2.load(entities2);
|
|
251662
255303
|
if (db2.getCollectionNames().length > 0) {
|
|
251663
255304
|
devLogger.log(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
251664
255305
|
}
|
|
@@ -256160,4 +259801,4 @@ export {
|
|
|
256160
259801
|
CLIExitError
|
|
256161
259802
|
};
|
|
256162
259803
|
|
|
256163
|
-
//# debugId=
|
|
259804
|
+
//# debugId=7F6DB6E03F5C038364756E2164756E21
|