@coana-tech/cli 14.12.17 → 14.12.20
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/cli.mjs +7186 -5710
- package/package.json +1 -1
- package/reachability-analyzers-cli.mjs +378 -447
- package/repos/coana-tech/alucard/alucard.jar +0 -0
- package/repos/coana-tech/goana/bin/goana-darwin-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-darwin-arm64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-amd64.gz +0 -0
- package/repos/coana-tech/goana/bin/goana-linux-arm64.gz +0 -0
- package/repos/coana-tech/mambalade/dist/{mambalade-0.3.11-py3-none-any.whl → mambalade-0.3.12-py3-none-any.whl} +0 -0
- package/repos/coana-tech/mambalade/dist/typing_extensions-4.15.0-py3-none-any.whl +0 -0
- package/repos/coana-tech/mambalade/dist/typing_extensions-4.14.1-py3-none-any.whl +0 -0
|
@@ -6672,14 +6672,14 @@ var require_async_iterator = __commonJS({
|
|
|
6672
6672
|
};
|
|
6673
6673
|
}
|
|
6674
6674
|
function readAndResolve(iter) {
|
|
6675
|
-
var
|
|
6676
|
-
if (
|
|
6675
|
+
var resolve17 = iter[kLastResolve];
|
|
6676
|
+
if (resolve17 !== null) {
|
|
6677
6677
|
var data2 = iter[kStream].read();
|
|
6678
6678
|
if (data2 !== null) {
|
|
6679
6679
|
iter[kLastPromise] = null;
|
|
6680
6680
|
iter[kLastResolve] = null;
|
|
6681
6681
|
iter[kLastReject] = null;
|
|
6682
|
-
|
|
6682
|
+
resolve17(createIterResult(data2, false));
|
|
6683
6683
|
}
|
|
6684
6684
|
}
|
|
6685
6685
|
}
|
|
@@ -6687,13 +6687,13 @@ var require_async_iterator = __commonJS({
|
|
|
6687
6687
|
process.nextTick(readAndResolve, iter);
|
|
6688
6688
|
}
|
|
6689
6689
|
function wrapForNext(lastPromise, iter) {
|
|
6690
|
-
return function(
|
|
6690
|
+
return function(resolve17, reject) {
|
|
6691
6691
|
lastPromise.then(function() {
|
|
6692
6692
|
if (iter[kEnded]) {
|
|
6693
|
-
|
|
6693
|
+
resolve17(createIterResult(void 0, true));
|
|
6694
6694
|
return;
|
|
6695
6695
|
}
|
|
6696
|
-
iter[kHandlePromise](
|
|
6696
|
+
iter[kHandlePromise](resolve17, reject);
|
|
6697
6697
|
}, reject);
|
|
6698
6698
|
};
|
|
6699
6699
|
}
|
|
@@ -6713,12 +6713,12 @@ var require_async_iterator = __commonJS({
|
|
|
6713
6713
|
return Promise.resolve(createIterResult(void 0, true));
|
|
6714
6714
|
}
|
|
6715
6715
|
if (this[kStream].destroyed) {
|
|
6716
|
-
return new Promise(function(
|
|
6716
|
+
return new Promise(function(resolve17, reject) {
|
|
6717
6717
|
process.nextTick(function() {
|
|
6718
6718
|
if (_this[kError]) {
|
|
6719
6719
|
reject(_this[kError]);
|
|
6720
6720
|
} else {
|
|
6721
|
-
|
|
6721
|
+
resolve17(createIterResult(void 0, true));
|
|
6722
6722
|
}
|
|
6723
6723
|
});
|
|
6724
6724
|
});
|
|
@@ -6741,13 +6741,13 @@ var require_async_iterator = __commonJS({
|
|
|
6741
6741
|
return this;
|
|
6742
6742
|
}), _defineProperty(_Object$setPrototypeO, "return", function _return() {
|
|
6743
6743
|
var _this2 = this;
|
|
6744
|
-
return new Promise(function(
|
|
6744
|
+
return new Promise(function(resolve17, reject) {
|
|
6745
6745
|
_this2[kStream].destroy(null, function(err) {
|
|
6746
6746
|
if (err) {
|
|
6747
6747
|
reject(err);
|
|
6748
6748
|
return;
|
|
6749
6749
|
}
|
|
6750
|
-
|
|
6750
|
+
resolve17(createIterResult(void 0, true));
|
|
6751
6751
|
});
|
|
6752
6752
|
});
|
|
6753
6753
|
}), _Object$setPrototypeO), AsyncIteratorPrototype);
|
|
@@ -6769,15 +6769,15 @@ var require_async_iterator = __commonJS({
|
|
|
6769
6769
|
value: stream4._readableState.endEmitted,
|
|
6770
6770
|
writable: true
|
|
6771
6771
|
}), _defineProperty(_Object$create, kHandlePromise, {
|
|
6772
|
-
value: function value(
|
|
6772
|
+
value: function value(resolve17, reject) {
|
|
6773
6773
|
var data2 = iterator[kStream].read();
|
|
6774
6774
|
if (data2) {
|
|
6775
6775
|
iterator[kLastPromise] = null;
|
|
6776
6776
|
iterator[kLastResolve] = null;
|
|
6777
6777
|
iterator[kLastReject] = null;
|
|
6778
|
-
|
|
6778
|
+
resolve17(createIterResult(data2, false));
|
|
6779
6779
|
} else {
|
|
6780
|
-
iterator[kLastResolve] =
|
|
6780
|
+
iterator[kLastResolve] = resolve17;
|
|
6781
6781
|
iterator[kLastReject] = reject;
|
|
6782
6782
|
}
|
|
6783
6783
|
},
|
|
@@ -6796,12 +6796,12 @@ var require_async_iterator = __commonJS({
|
|
|
6796
6796
|
iterator[kError] = err;
|
|
6797
6797
|
return;
|
|
6798
6798
|
}
|
|
6799
|
-
var
|
|
6800
|
-
if (
|
|
6799
|
+
var resolve17 = iterator[kLastResolve];
|
|
6800
|
+
if (resolve17 !== null) {
|
|
6801
6801
|
iterator[kLastPromise] = null;
|
|
6802
6802
|
iterator[kLastResolve] = null;
|
|
6803
6803
|
iterator[kLastReject] = null;
|
|
6804
|
-
|
|
6804
|
+
resolve17(createIterResult(void 0, true));
|
|
6805
6805
|
}
|
|
6806
6806
|
iterator[kEnded] = true;
|
|
6807
6807
|
});
|
|
@@ -6816,7 +6816,7 @@ var require_async_iterator = __commonJS({
|
|
|
6816
6816
|
var require_from = __commonJS({
|
|
6817
6817
|
"../../node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from.js"(exports, module) {
|
|
6818
6818
|
"use strict";
|
|
6819
|
-
function asyncGeneratorStep(gen,
|
|
6819
|
+
function asyncGeneratorStep(gen, resolve17, reject, _next, _throw, key, arg) {
|
|
6820
6820
|
try {
|
|
6821
6821
|
var info = gen[key](arg);
|
|
6822
6822
|
var value = info.value;
|
|
@@ -6825,7 +6825,7 @@ var require_from = __commonJS({
|
|
|
6825
6825
|
return;
|
|
6826
6826
|
}
|
|
6827
6827
|
if (info.done) {
|
|
6828
|
-
|
|
6828
|
+
resolve17(value);
|
|
6829
6829
|
} else {
|
|
6830
6830
|
Promise.resolve(value).then(_next, _throw);
|
|
6831
6831
|
}
|
|
@@ -6833,13 +6833,13 @@ var require_from = __commonJS({
|
|
|
6833
6833
|
function _asyncToGenerator(fn) {
|
|
6834
6834
|
return function() {
|
|
6835
6835
|
var self2 = this, args = arguments;
|
|
6836
|
-
return new Promise(function(
|
|
6836
|
+
return new Promise(function(resolve17, reject) {
|
|
6837
6837
|
var gen = fn.apply(self2, args);
|
|
6838
6838
|
function _next(value) {
|
|
6839
|
-
asyncGeneratorStep(gen,
|
|
6839
|
+
asyncGeneratorStep(gen, resolve17, reject, _next, _throw, "next", value);
|
|
6840
6840
|
}
|
|
6841
6841
|
function _throw(err) {
|
|
6842
|
-
asyncGeneratorStep(gen,
|
|
6842
|
+
asyncGeneratorStep(gen, resolve17, reject, _next, _throw, "throw", err);
|
|
6843
6843
|
}
|
|
6844
6844
|
_next(void 0);
|
|
6845
6845
|
});
|
|
@@ -8676,10 +8676,10 @@ var require_awaitify = __commonJS({
|
|
|
8676
8676
|
if (typeof args[arity - 1] === "function") {
|
|
8677
8677
|
return asyncFn.apply(this, args);
|
|
8678
8678
|
}
|
|
8679
|
-
return new Promise((
|
|
8679
|
+
return new Promise((resolve17, reject) => {
|
|
8680
8680
|
args[arity - 1] = (err, ...cbArgs) => {
|
|
8681
8681
|
if (err) return reject(err);
|
|
8682
|
-
|
|
8682
|
+
resolve17(cbArgs.length > 1 ? cbArgs : cbArgs[0]);
|
|
8683
8683
|
};
|
|
8684
8684
|
asyncFn.apply(this, args);
|
|
8685
8685
|
});
|
|
@@ -9308,13 +9308,13 @@ var require_diagnostics = __commonJS({
|
|
|
9308
9308
|
if (adapters[i2](namespace2)) return true;
|
|
9309
9309
|
}
|
|
9310
9310
|
if (!async.length) return false;
|
|
9311
|
-
return new Promise(function pinky(
|
|
9311
|
+
return new Promise(function pinky(resolve17) {
|
|
9312
9312
|
Promise.all(
|
|
9313
9313
|
async.map(function prebind(fn) {
|
|
9314
9314
|
return fn(namespace2);
|
|
9315
9315
|
})
|
|
9316
9316
|
).then(function resolved(values) {
|
|
9317
|
-
|
|
9317
|
+
resolve17(values.some(Boolean));
|
|
9318
9318
|
});
|
|
9319
9319
|
});
|
|
9320
9320
|
}
|
|
@@ -35343,8 +35343,8 @@ var require_follow_redirects = __commonJS({
|
|
|
35343
35343
|
}
|
|
35344
35344
|
return parsed;
|
|
35345
35345
|
}
|
|
35346
|
-
function resolveUrl(
|
|
35347
|
-
return useNativeURL ? new URL3(
|
|
35346
|
+
function resolveUrl(relative8, base) {
|
|
35347
|
+
return useNativeURL ? new URL3(relative8, base) : parseUrl(url2.resolve(base, relative8));
|
|
35348
35348
|
}
|
|
35349
35349
|
function validateUrl(input) {
|
|
35350
35350
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -40901,8 +40901,8 @@ var require_util3 = __commonJS({
|
|
|
40901
40901
|
function createDeferredPromise() {
|
|
40902
40902
|
let res;
|
|
40903
40903
|
let rej;
|
|
40904
|
-
const promise = new Promise((
|
|
40905
|
-
res =
|
|
40904
|
+
const promise = new Promise((resolve17, reject) => {
|
|
40905
|
+
res = resolve17;
|
|
40906
40906
|
rej = reject;
|
|
40907
40907
|
});
|
|
40908
40908
|
return { promise, resolve: res, reject: rej };
|
|
@@ -42406,8 +42406,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r
|
|
|
42406
42406
|
});
|
|
42407
42407
|
}
|
|
42408
42408
|
});
|
|
42409
|
-
const busboyResolve = new Promise((
|
|
42410
|
-
busboy.on("finish",
|
|
42409
|
+
const busboyResolve = new Promise((resolve17, reject) => {
|
|
42410
|
+
busboy.on("finish", resolve17);
|
|
42411
42411
|
busboy.on("error", (err) => reject(new TypeError(err)));
|
|
42412
42412
|
});
|
|
42413
42413
|
if (this.body !== null) for await (const chunk2 of consumeBody(this[kState].body)) busboy.write(chunk2);
|
|
@@ -42941,9 +42941,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
42941
42941
|
}
|
|
42942
42942
|
close(callback) {
|
|
42943
42943
|
if (callback === void 0) {
|
|
42944
|
-
return new Promise((
|
|
42944
|
+
return new Promise((resolve17, reject) => {
|
|
42945
42945
|
this.close((err, data2) => {
|
|
42946
|
-
return err ? reject(err) :
|
|
42946
|
+
return err ? reject(err) : resolve17(data2);
|
|
42947
42947
|
});
|
|
42948
42948
|
});
|
|
42949
42949
|
}
|
|
@@ -42981,12 +42981,12 @@ var require_dispatcher_base = __commonJS({
|
|
|
42981
42981
|
err = null;
|
|
42982
42982
|
}
|
|
42983
42983
|
if (callback === void 0) {
|
|
42984
|
-
return new Promise((
|
|
42984
|
+
return new Promise((resolve17, reject) => {
|
|
42985
42985
|
this.destroy(err, (err2, data2) => {
|
|
42986
42986
|
return err2 ? (
|
|
42987
42987
|
/* istanbul ignore next: should never error */
|
|
42988
42988
|
reject(err2)
|
|
42989
|
-
) :
|
|
42989
|
+
) : resolve17(data2);
|
|
42990
42990
|
});
|
|
42991
42991
|
});
|
|
42992
42992
|
}
|
|
@@ -44046,16 +44046,16 @@ var require_client = __commonJS({
|
|
|
44046
44046
|
return this[kNeedDrain] < 2;
|
|
44047
44047
|
}
|
|
44048
44048
|
async [kClose]() {
|
|
44049
|
-
return new Promise((
|
|
44049
|
+
return new Promise((resolve17) => {
|
|
44050
44050
|
if (!this[kSize]) {
|
|
44051
|
-
|
|
44051
|
+
resolve17(null);
|
|
44052
44052
|
} else {
|
|
44053
|
-
this[kClosedResolve] =
|
|
44053
|
+
this[kClosedResolve] = resolve17;
|
|
44054
44054
|
}
|
|
44055
44055
|
});
|
|
44056
44056
|
}
|
|
44057
44057
|
async [kDestroy](err) {
|
|
44058
|
-
return new Promise((
|
|
44058
|
+
return new Promise((resolve17) => {
|
|
44059
44059
|
const requests = this[kQueue].splice(this[kPendingIdx]);
|
|
44060
44060
|
for (let i2 = 0; i2 < requests.length; i2++) {
|
|
44061
44061
|
const request = requests[i2];
|
|
@@ -44066,7 +44066,7 @@ var require_client = __commonJS({
|
|
|
44066
44066
|
this[kClosedResolve]();
|
|
44067
44067
|
this[kClosedResolve] = null;
|
|
44068
44068
|
}
|
|
44069
|
-
|
|
44069
|
+
resolve17();
|
|
44070
44070
|
};
|
|
44071
44071
|
if (this[kHTTP2Session] != null) {
|
|
44072
44072
|
util6.destroy(this[kHTTP2Session], err);
|
|
@@ -44646,7 +44646,7 @@ var require_client = __commonJS({
|
|
|
44646
44646
|
});
|
|
44647
44647
|
}
|
|
44648
44648
|
try {
|
|
44649
|
-
const socket = await new Promise((
|
|
44649
|
+
const socket = await new Promise((resolve17, reject) => {
|
|
44650
44650
|
client[kConnector]({
|
|
44651
44651
|
host,
|
|
44652
44652
|
hostname,
|
|
@@ -44658,7 +44658,7 @@ var require_client = __commonJS({
|
|
|
44658
44658
|
if (err) {
|
|
44659
44659
|
reject(err);
|
|
44660
44660
|
} else {
|
|
44661
|
-
|
|
44661
|
+
resolve17(socket2);
|
|
44662
44662
|
}
|
|
44663
44663
|
});
|
|
44664
44664
|
});
|
|
@@ -45282,12 +45282,12 @@ upgrade: ${upgrade}\r
|
|
|
45282
45282
|
cb();
|
|
45283
45283
|
}
|
|
45284
45284
|
}
|
|
45285
|
-
const waitForDrain = () => new Promise((
|
|
45285
|
+
const waitForDrain = () => new Promise((resolve17, reject) => {
|
|
45286
45286
|
assert9(callback === null);
|
|
45287
45287
|
if (socket[kError]) {
|
|
45288
45288
|
reject(socket[kError]);
|
|
45289
45289
|
} else {
|
|
45290
|
-
callback =
|
|
45290
|
+
callback = resolve17;
|
|
45291
45291
|
}
|
|
45292
45292
|
});
|
|
45293
45293
|
if (client[kHTTPConnVersion] === "h2") {
|
|
@@ -45632,8 +45632,8 @@ var require_pool_base = __commonJS({
|
|
|
45632
45632
|
if (this[kQueue].isEmpty()) {
|
|
45633
45633
|
return Promise.all(this[kClients].map((c) => c.close()));
|
|
45634
45634
|
} else {
|
|
45635
|
-
return new Promise((
|
|
45636
|
-
this[kClosedResolve] =
|
|
45635
|
+
return new Promise((resolve17) => {
|
|
45636
|
+
this[kClosedResolve] = resolve17;
|
|
45637
45637
|
});
|
|
45638
45638
|
}
|
|
45639
45639
|
}
|
|
@@ -46203,7 +46203,7 @@ var require_readable2 = __commonJS({
|
|
|
46203
46203
|
if (this.closed) {
|
|
46204
46204
|
return Promise.resolve(null);
|
|
46205
46205
|
}
|
|
46206
|
-
return new Promise((
|
|
46206
|
+
return new Promise((resolve17, reject) => {
|
|
46207
46207
|
const signalListenerCleanup = signal ? util6.addAbortListener(signal, () => {
|
|
46208
46208
|
this.destroy();
|
|
46209
46209
|
}) : noop4;
|
|
@@ -46212,7 +46212,7 @@ var require_readable2 = __commonJS({
|
|
|
46212
46212
|
if (signal && signal.aborted) {
|
|
46213
46213
|
reject(signal.reason || Object.assign(new Error("The operation was aborted"), { name: "AbortError" }));
|
|
46214
46214
|
} else {
|
|
46215
|
-
|
|
46215
|
+
resolve17(null);
|
|
46216
46216
|
}
|
|
46217
46217
|
}).on("error", noop4).on("data", function(chunk2) {
|
|
46218
46218
|
limit -= chunk2.length;
|
|
@@ -46234,11 +46234,11 @@ var require_readable2 = __commonJS({
|
|
|
46234
46234
|
throw new TypeError("unusable");
|
|
46235
46235
|
}
|
|
46236
46236
|
assert9(!stream4[kConsume]);
|
|
46237
|
-
return new Promise((
|
|
46237
|
+
return new Promise((resolve17, reject) => {
|
|
46238
46238
|
stream4[kConsume] = {
|
|
46239
46239
|
type,
|
|
46240
46240
|
stream: stream4,
|
|
46241
|
-
resolve:
|
|
46241
|
+
resolve: resolve17,
|
|
46242
46242
|
reject,
|
|
46243
46243
|
length: 0,
|
|
46244
46244
|
body: []
|
|
@@ -46273,12 +46273,12 @@ var require_readable2 = __commonJS({
|
|
|
46273
46273
|
}
|
|
46274
46274
|
}
|
|
46275
46275
|
function consumeEnd(consume2) {
|
|
46276
|
-
const { type, body, resolve:
|
|
46276
|
+
const { type, body, resolve: resolve17, stream: stream4, length } = consume2;
|
|
46277
46277
|
try {
|
|
46278
46278
|
if (type === "text") {
|
|
46279
|
-
|
|
46279
|
+
resolve17(toUSVString(Buffer.concat(body)));
|
|
46280
46280
|
} else if (type === "json") {
|
|
46281
|
-
|
|
46281
|
+
resolve17(JSON.parse(Buffer.concat(body)));
|
|
46282
46282
|
} else if (type === "arrayBuffer") {
|
|
46283
46283
|
const dst = new Uint8Array(length);
|
|
46284
46284
|
let pos2 = 0;
|
|
@@ -46286,12 +46286,12 @@ var require_readable2 = __commonJS({
|
|
|
46286
46286
|
dst.set(buf, pos2);
|
|
46287
46287
|
pos2 += buf.byteLength;
|
|
46288
46288
|
}
|
|
46289
|
-
|
|
46289
|
+
resolve17(dst.buffer);
|
|
46290
46290
|
} else if (type === "blob") {
|
|
46291
46291
|
if (!Blob2) {
|
|
46292
46292
|
Blob2 = __require("buffer").Blob;
|
|
46293
46293
|
}
|
|
46294
|
-
|
|
46294
|
+
resolve17(new Blob2(body, { type: stream4[kContentType] }));
|
|
46295
46295
|
}
|
|
46296
46296
|
consumeFinish(consume2);
|
|
46297
46297
|
} catch (err) {
|
|
@@ -46546,9 +46546,9 @@ var require_api_request = __commonJS({
|
|
|
46546
46546
|
};
|
|
46547
46547
|
function request(opts, callback) {
|
|
46548
46548
|
if (callback === void 0) {
|
|
46549
|
-
return new Promise((
|
|
46549
|
+
return new Promise((resolve17, reject) => {
|
|
46550
46550
|
request.call(this, opts, (err, data2) => {
|
|
46551
|
-
return err ? reject(err) :
|
|
46551
|
+
return err ? reject(err) : resolve17(data2);
|
|
46552
46552
|
});
|
|
46553
46553
|
});
|
|
46554
46554
|
}
|
|
@@ -46721,9 +46721,9 @@ var require_api_stream = __commonJS({
|
|
|
46721
46721
|
};
|
|
46722
46722
|
function stream4(opts, factory, callback) {
|
|
46723
46723
|
if (callback === void 0) {
|
|
46724
|
-
return new Promise((
|
|
46724
|
+
return new Promise((resolve17, reject) => {
|
|
46725
46725
|
stream4.call(this, opts, factory, (err, data2) => {
|
|
46726
|
-
return err ? reject(err) :
|
|
46726
|
+
return err ? reject(err) : resolve17(data2);
|
|
46727
46727
|
});
|
|
46728
46728
|
});
|
|
46729
46729
|
}
|
|
@@ -47004,9 +47004,9 @@ var require_api_upgrade = __commonJS({
|
|
|
47004
47004
|
};
|
|
47005
47005
|
function upgrade(opts, callback) {
|
|
47006
47006
|
if (callback === void 0) {
|
|
47007
|
-
return new Promise((
|
|
47007
|
+
return new Promise((resolve17, reject) => {
|
|
47008
47008
|
upgrade.call(this, opts, (err, data2) => {
|
|
47009
|
-
return err ? reject(err) :
|
|
47009
|
+
return err ? reject(err) : resolve17(data2);
|
|
47010
47010
|
});
|
|
47011
47011
|
});
|
|
47012
47012
|
}
|
|
@@ -47095,9 +47095,9 @@ var require_api_connect = __commonJS({
|
|
|
47095
47095
|
};
|
|
47096
47096
|
function connect(opts, callback) {
|
|
47097
47097
|
if (callback === void 0) {
|
|
47098
|
-
return new Promise((
|
|
47098
|
+
return new Promise((resolve17, reject) => {
|
|
47099
47099
|
connect.call(this, opts, (err, data2) => {
|
|
47100
|
-
return err ? reject(err) :
|
|
47100
|
+
return err ? reject(err) : resolve17(data2);
|
|
47101
47101
|
});
|
|
47102
47102
|
});
|
|
47103
47103
|
}
|
|
@@ -50715,7 +50715,7 @@ var require_fetch = __commonJS({
|
|
|
50715
50715
|
async function dispatch({ body }) {
|
|
50716
50716
|
const url2 = requestCurrentURL(request);
|
|
50717
50717
|
const agent = fetchParams.controller.dispatcher;
|
|
50718
|
-
return new Promise((
|
|
50718
|
+
return new Promise((resolve17, reject) => agent.dispatch(
|
|
50719
50719
|
{
|
|
50720
50720
|
path: url2.pathname + url2.search,
|
|
50721
50721
|
origin: url2.origin,
|
|
@@ -50791,7 +50791,7 @@ var require_fetch = __commonJS({
|
|
|
50791
50791
|
}
|
|
50792
50792
|
}
|
|
50793
50793
|
}
|
|
50794
|
-
|
|
50794
|
+
resolve17({
|
|
50795
50795
|
status,
|
|
50796
50796
|
statusText,
|
|
50797
50797
|
headersList: headers[kHeadersList],
|
|
@@ -50834,7 +50834,7 @@ var require_fetch = __commonJS({
|
|
|
50834
50834
|
const val2 = headersList[n + 1].toString("latin1");
|
|
50835
50835
|
headers[kHeadersList].append(key, val2);
|
|
50836
50836
|
}
|
|
50837
|
-
|
|
50837
|
+
resolve17({
|
|
50838
50838
|
status,
|
|
50839
50839
|
statusText: STATUS_CODES[status],
|
|
50840
50840
|
headersList: headers[kHeadersList],
|
|
@@ -54202,11 +54202,11 @@ var require_lib = __commonJS({
|
|
|
54202
54202
|
};
|
|
54203
54203
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
54204
54204
|
function adopt(value) {
|
|
54205
|
-
return value instanceof P ? value : new P(function(
|
|
54206
|
-
|
|
54205
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
54206
|
+
resolve17(value);
|
|
54207
54207
|
});
|
|
54208
54208
|
}
|
|
54209
|
-
return new (P || (P = Promise))(function(
|
|
54209
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
54210
54210
|
function fulfilled(value) {
|
|
54211
54211
|
try {
|
|
54212
54212
|
step(generator.next(value));
|
|
@@ -54222,7 +54222,7 @@ var require_lib = __commonJS({
|
|
|
54222
54222
|
}
|
|
54223
54223
|
}
|
|
54224
54224
|
function step(result) {
|
|
54225
|
-
result.done ?
|
|
54225
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
54226
54226
|
}
|
|
54227
54227
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
54228
54228
|
});
|
|
@@ -54308,26 +54308,26 @@ var require_lib = __commonJS({
|
|
|
54308
54308
|
}
|
|
54309
54309
|
readBody() {
|
|
54310
54310
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54311
|
-
return new Promise((
|
|
54311
|
+
return new Promise((resolve17) => __awaiter(this, void 0, void 0, function* () {
|
|
54312
54312
|
let output = Buffer.alloc(0);
|
|
54313
54313
|
this.message.on("data", (chunk2) => {
|
|
54314
54314
|
output = Buffer.concat([output, chunk2]);
|
|
54315
54315
|
});
|
|
54316
54316
|
this.message.on("end", () => {
|
|
54317
|
-
|
|
54317
|
+
resolve17(output.toString());
|
|
54318
54318
|
});
|
|
54319
54319
|
}));
|
|
54320
54320
|
});
|
|
54321
54321
|
}
|
|
54322
54322
|
readBodyBuffer() {
|
|
54323
54323
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54324
|
-
return new Promise((
|
|
54324
|
+
return new Promise((resolve17) => __awaiter(this, void 0, void 0, function* () {
|
|
54325
54325
|
const chunks = [];
|
|
54326
54326
|
this.message.on("data", (chunk2) => {
|
|
54327
54327
|
chunks.push(chunk2);
|
|
54328
54328
|
});
|
|
54329
54329
|
this.message.on("end", () => {
|
|
54330
|
-
|
|
54330
|
+
resolve17(Buffer.concat(chunks));
|
|
54331
54331
|
});
|
|
54332
54332
|
}));
|
|
54333
54333
|
});
|
|
@@ -54536,14 +54536,14 @@ var require_lib = __commonJS({
|
|
|
54536
54536
|
*/
|
|
54537
54537
|
requestRaw(info, data2) {
|
|
54538
54538
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54539
|
-
return new Promise((
|
|
54539
|
+
return new Promise((resolve17, reject) => {
|
|
54540
54540
|
function callbackForResult(err, res) {
|
|
54541
54541
|
if (err) {
|
|
54542
54542
|
reject(err);
|
|
54543
54543
|
} else if (!res) {
|
|
54544
54544
|
reject(new Error("Unknown error"));
|
|
54545
54545
|
} else {
|
|
54546
|
-
|
|
54546
|
+
resolve17(res);
|
|
54547
54547
|
}
|
|
54548
54548
|
}
|
|
54549
54549
|
this.requestRawWithCallback(info, data2, callbackForResult);
|
|
@@ -54725,12 +54725,12 @@ var require_lib = __commonJS({
|
|
|
54725
54725
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54726
54726
|
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
|
|
54727
54727
|
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
|
54728
|
-
return new Promise((
|
|
54728
|
+
return new Promise((resolve17) => setTimeout(() => resolve17(), ms));
|
|
54729
54729
|
});
|
|
54730
54730
|
}
|
|
54731
54731
|
_processResponse(res, options) {
|
|
54732
54732
|
return __awaiter(this, void 0, void 0, function* () {
|
|
54733
|
-
return new Promise((
|
|
54733
|
+
return new Promise((resolve17, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
54734
54734
|
const statusCode = res.message.statusCode || 0;
|
|
54735
54735
|
const response = {
|
|
54736
54736
|
statusCode,
|
|
@@ -54738,7 +54738,7 @@ var require_lib = __commonJS({
|
|
|
54738
54738
|
headers: {}
|
|
54739
54739
|
};
|
|
54740
54740
|
if (statusCode === HttpCodes.NotFound) {
|
|
54741
|
-
|
|
54741
|
+
resolve17(response);
|
|
54742
54742
|
}
|
|
54743
54743
|
function dateTimeDeserializer(key, value) {
|
|
54744
54744
|
if (typeof value === "string") {
|
|
@@ -54777,7 +54777,7 @@ var require_lib = __commonJS({
|
|
|
54777
54777
|
err.result = response.result;
|
|
54778
54778
|
reject(err);
|
|
54779
54779
|
} else {
|
|
54780
|
-
|
|
54780
|
+
resolve17(response);
|
|
54781
54781
|
}
|
|
54782
54782
|
}));
|
|
54783
54783
|
});
|
|
@@ -54794,11 +54794,11 @@ var require_auth = __commonJS({
|
|
|
54794
54794
|
"use strict";
|
|
54795
54795
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
54796
54796
|
function adopt(value) {
|
|
54797
|
-
return value instanceof P ? value : new P(function(
|
|
54798
|
-
|
|
54797
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
54798
|
+
resolve17(value);
|
|
54799
54799
|
});
|
|
54800
54800
|
}
|
|
54801
|
-
return new (P || (P = Promise))(function(
|
|
54801
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
54802
54802
|
function fulfilled(value) {
|
|
54803
54803
|
try {
|
|
54804
54804
|
step(generator.next(value));
|
|
@@ -54814,7 +54814,7 @@ var require_auth = __commonJS({
|
|
|
54814
54814
|
}
|
|
54815
54815
|
}
|
|
54816
54816
|
function step(result) {
|
|
54817
|
-
result.done ?
|
|
54817
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
54818
54818
|
}
|
|
54819
54819
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
54820
54820
|
});
|
|
@@ -54898,11 +54898,11 @@ var require_oidc_utils = __commonJS({
|
|
|
54898
54898
|
"use strict";
|
|
54899
54899
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
54900
54900
|
function adopt(value) {
|
|
54901
|
-
return value instanceof P ? value : new P(function(
|
|
54902
|
-
|
|
54901
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
54902
|
+
resolve17(value);
|
|
54903
54903
|
});
|
|
54904
54904
|
}
|
|
54905
|
-
return new (P || (P = Promise))(function(
|
|
54905
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
54906
54906
|
function fulfilled(value) {
|
|
54907
54907
|
try {
|
|
54908
54908
|
step(generator.next(value));
|
|
@@ -54918,7 +54918,7 @@ var require_oidc_utils = __commonJS({
|
|
|
54918
54918
|
}
|
|
54919
54919
|
}
|
|
54920
54920
|
function step(result) {
|
|
54921
|
-
result.done ?
|
|
54921
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
54922
54922
|
}
|
|
54923
54923
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
54924
54924
|
});
|
|
@@ -54996,11 +54996,11 @@ var require_summary = __commonJS({
|
|
|
54996
54996
|
"use strict";
|
|
54997
54997
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
54998
54998
|
function adopt(value) {
|
|
54999
|
-
return value instanceof P ? value : new P(function(
|
|
55000
|
-
|
|
54999
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
55000
|
+
resolve17(value);
|
|
55001
55001
|
});
|
|
55002
55002
|
}
|
|
55003
|
-
return new (P || (P = Promise))(function(
|
|
55003
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
55004
55004
|
function fulfilled(value) {
|
|
55005
55005
|
try {
|
|
55006
55006
|
step(generator.next(value));
|
|
@@ -55016,7 +55016,7 @@ var require_summary = __commonJS({
|
|
|
55016
55016
|
}
|
|
55017
55017
|
}
|
|
55018
55018
|
function step(result) {
|
|
55019
|
-
result.done ?
|
|
55019
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
55020
55020
|
}
|
|
55021
55021
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
55022
55022
|
});
|
|
@@ -55358,11 +55358,11 @@ var require_core = __commonJS({
|
|
|
55358
55358
|
};
|
|
55359
55359
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
55360
55360
|
function adopt(value) {
|
|
55361
|
-
return value instanceof P ? value : new P(function(
|
|
55362
|
-
|
|
55361
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
55362
|
+
resolve17(value);
|
|
55363
55363
|
});
|
|
55364
55364
|
}
|
|
55365
|
-
return new (P || (P = Promise))(function(
|
|
55365
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
55366
55366
|
function fulfilled(value) {
|
|
55367
55367
|
try {
|
|
55368
55368
|
step(generator.next(value));
|
|
@@ -55378,7 +55378,7 @@ var require_core = __commonJS({
|
|
|
55378
55378
|
}
|
|
55379
55379
|
}
|
|
55380
55380
|
function step(result) {
|
|
55381
|
-
result.done ?
|
|
55381
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
55382
55382
|
}
|
|
55383
55383
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
55384
55384
|
});
|
|
@@ -59000,11 +59000,11 @@ var require_utils3 = __commonJS({
|
|
|
59000
59000
|
"use strict";
|
|
59001
59001
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
59002
59002
|
function adopt(value) {
|
|
59003
|
-
return value instanceof P ? value : new P(function(
|
|
59004
|
-
|
|
59003
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
59004
|
+
resolve17(value);
|
|
59005
59005
|
});
|
|
59006
59006
|
}
|
|
59007
|
-
return new (P || (P = Promise))(function(
|
|
59007
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
59008
59008
|
function fulfilled(value) {
|
|
59009
59009
|
try {
|
|
59010
59010
|
step(generator.next(value));
|
|
@@ -59020,7 +59020,7 @@ var require_utils3 = __commonJS({
|
|
|
59020
59020
|
}
|
|
59021
59021
|
}
|
|
59022
59022
|
function step(result) {
|
|
59023
|
-
result.done ?
|
|
59023
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
59024
59024
|
}
|
|
59025
59025
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59026
59026
|
});
|
|
@@ -59230,19 +59230,19 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)}
|
|
|
59230
59230
|
exports.getProperRetention = getProperRetention;
|
|
59231
59231
|
function sleep(milliseconds) {
|
|
59232
59232
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59233
|
-
return new Promise((
|
|
59233
|
+
return new Promise((resolve17) => setTimeout(resolve17, milliseconds));
|
|
59234
59234
|
});
|
|
59235
59235
|
}
|
|
59236
59236
|
exports.sleep = sleep;
|
|
59237
59237
|
function digestForStream(stream4) {
|
|
59238
59238
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59239
|
-
return new Promise((
|
|
59239
|
+
return new Promise((resolve17, reject) => {
|
|
59240
59240
|
const crc64 = new crc64_1.default();
|
|
59241
59241
|
const md52 = crypto_1.default.createHash("md5");
|
|
59242
59242
|
stream4.on("data", (data2) => {
|
|
59243
59243
|
crc64.update(data2);
|
|
59244
59244
|
md52.update(data2);
|
|
59245
|
-
}).on("end", () =>
|
|
59245
|
+
}).on("end", () => resolve17({
|
|
59246
59246
|
crc64: crc64.digest("base64"),
|
|
59247
59247
|
md5: md52.digest("base64")
|
|
59248
59248
|
})).on("error", reject);
|
|
@@ -59366,11 +59366,11 @@ var require_upload_gzip = __commonJS({
|
|
|
59366
59366
|
};
|
|
59367
59367
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
59368
59368
|
function adopt(value) {
|
|
59369
|
-
return value instanceof P ? value : new P(function(
|
|
59370
|
-
|
|
59369
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
59370
|
+
resolve17(value);
|
|
59371
59371
|
});
|
|
59372
59372
|
}
|
|
59373
|
-
return new (P || (P = Promise))(function(
|
|
59373
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
59374
59374
|
function fulfilled(value) {
|
|
59375
59375
|
try {
|
|
59376
59376
|
step(generator.next(value));
|
|
@@ -59386,7 +59386,7 @@ var require_upload_gzip = __commonJS({
|
|
|
59386
59386
|
}
|
|
59387
59387
|
}
|
|
59388
59388
|
function step(result) {
|
|
59389
|
-
result.done ?
|
|
59389
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
59390
59390
|
}
|
|
59391
59391
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59392
59392
|
});
|
|
@@ -59399,14 +59399,14 @@ var require_upload_gzip = __commonJS({
|
|
|
59399
59399
|
}, i2);
|
|
59400
59400
|
function verb(n) {
|
|
59401
59401
|
i2[n] = o[n] && function(v) {
|
|
59402
|
-
return new Promise(function(
|
|
59403
|
-
v = o[n](v), settle2(
|
|
59402
|
+
return new Promise(function(resolve17, reject) {
|
|
59403
|
+
v = o[n](v), settle2(resolve17, reject, v.done, v.value);
|
|
59404
59404
|
});
|
|
59405
59405
|
};
|
|
59406
59406
|
}
|
|
59407
|
-
function settle2(
|
|
59407
|
+
function settle2(resolve17, reject, d, v) {
|
|
59408
59408
|
Promise.resolve(v).then(function(v2) {
|
|
59409
|
-
|
|
59409
|
+
resolve17({ value: v2, done: d });
|
|
59410
59410
|
}, reject);
|
|
59411
59411
|
}
|
|
59412
59412
|
};
|
|
@@ -59447,14 +59447,14 @@ var require_upload_gzip = __commonJS({
|
|
|
59447
59447
|
return Number.MAX_SAFE_INTEGER;
|
|
59448
59448
|
}
|
|
59449
59449
|
}
|
|
59450
|
-
return new Promise((
|
|
59450
|
+
return new Promise((resolve17, reject) => {
|
|
59451
59451
|
const inputStream = fs12.createReadStream(originalFilePath);
|
|
59452
59452
|
const gzip = zlib3.createGzip();
|
|
59453
59453
|
const outputStream = fs12.createWriteStream(tempFilePath);
|
|
59454
59454
|
inputStream.pipe(gzip).pipe(outputStream);
|
|
59455
59455
|
outputStream.on("finish", () => __awaiter(this, void 0, void 0, function* () {
|
|
59456
59456
|
const size = (yield stat3(tempFilePath)).size;
|
|
59457
|
-
|
|
59457
|
+
resolve17(size);
|
|
59458
59458
|
}));
|
|
59459
59459
|
outputStream.on("error", (error) => {
|
|
59460
59460
|
console.log(error);
|
|
@@ -59466,7 +59466,7 @@ var require_upload_gzip = __commonJS({
|
|
|
59466
59466
|
exports.createGZipFileOnDisk = createGZipFileOnDisk;
|
|
59467
59467
|
function createGZipFileInBuffer(originalFilePath) {
|
|
59468
59468
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59469
|
-
return new Promise((
|
|
59469
|
+
return new Promise((resolve17) => __awaiter(this, void 0, void 0, function* () {
|
|
59470
59470
|
var _a2, e_1, _b, _c;
|
|
59471
59471
|
const inputStream = fs12.createReadStream(originalFilePath);
|
|
59472
59472
|
const gzip = zlib3.createGzip();
|
|
@@ -59492,7 +59492,7 @@ var require_upload_gzip = __commonJS({
|
|
|
59492
59492
|
if (e_1) throw e_1.error;
|
|
59493
59493
|
}
|
|
59494
59494
|
}
|
|
59495
|
-
|
|
59495
|
+
resolve17(Buffer.concat(chunks));
|
|
59496
59496
|
}));
|
|
59497
59497
|
});
|
|
59498
59498
|
}
|
|
@@ -59533,11 +59533,11 @@ var require_requestUtils = __commonJS({
|
|
|
59533
59533
|
};
|
|
59534
59534
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
59535
59535
|
function adopt(value) {
|
|
59536
|
-
return value instanceof P ? value : new P(function(
|
|
59537
|
-
|
|
59536
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
59537
|
+
resolve17(value);
|
|
59538
59538
|
});
|
|
59539
59539
|
}
|
|
59540
|
-
return new (P || (P = Promise))(function(
|
|
59540
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
59541
59541
|
function fulfilled(value) {
|
|
59542
59542
|
try {
|
|
59543
59543
|
step(generator.next(value));
|
|
@@ -59553,7 +59553,7 @@ var require_requestUtils = __commonJS({
|
|
|
59553
59553
|
}
|
|
59554
59554
|
}
|
|
59555
59555
|
function step(result) {
|
|
59556
|
-
result.done ?
|
|
59556
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
59557
59557
|
}
|
|
59558
59558
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59559
59559
|
});
|
|
@@ -59650,11 +59650,11 @@ var require_upload_http_client = __commonJS({
|
|
|
59650
59650
|
};
|
|
59651
59651
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
59652
59652
|
function adopt(value) {
|
|
59653
|
-
return value instanceof P ? value : new P(function(
|
|
59654
|
-
|
|
59653
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
59654
|
+
resolve17(value);
|
|
59655
59655
|
});
|
|
59656
59656
|
}
|
|
59657
|
-
return new (P || (P = Promise))(function(
|
|
59657
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
59658
59658
|
function fulfilled(value) {
|
|
59659
59659
|
try {
|
|
59660
59660
|
step(generator.next(value));
|
|
@@ -59670,7 +59670,7 @@ var require_upload_http_client = __commonJS({
|
|
|
59670
59670
|
}
|
|
59671
59671
|
}
|
|
59672
59672
|
function step(result) {
|
|
59673
|
-
result.done ?
|
|
59673
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
59674
59674
|
}
|
|
59675
59675
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
59676
59676
|
});
|
|
@@ -60042,11 +60042,11 @@ var require_download_http_client = __commonJS({
|
|
|
60042
60042
|
};
|
|
60043
60043
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
60044
60044
|
function adopt(value) {
|
|
60045
|
-
return value instanceof P ? value : new P(function(
|
|
60046
|
-
|
|
60045
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
60046
|
+
resolve17(value);
|
|
60047
60047
|
});
|
|
60048
60048
|
}
|
|
60049
|
-
return new (P || (P = Promise))(function(
|
|
60049
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
60050
60050
|
function fulfilled(value) {
|
|
60051
60051
|
try {
|
|
60052
60052
|
step(generator.next(value));
|
|
@@ -60062,7 +60062,7 @@ var require_download_http_client = __commonJS({
|
|
|
60062
60062
|
}
|
|
60063
60063
|
}
|
|
60064
60064
|
function step(result) {
|
|
60065
|
-
result.done ?
|
|
60065
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
60066
60066
|
}
|
|
60067
60067
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60068
60068
|
});
|
|
@@ -60195,10 +60195,10 @@ var require_download_http_client = __commonJS({
|
|
|
60195
60195
|
};
|
|
60196
60196
|
const resetDestinationStream = (fileDownloadPath) => __awaiter(this, void 0, void 0, function* () {
|
|
60197
60197
|
destinationStream.close();
|
|
60198
|
-
yield new Promise((
|
|
60199
|
-
destinationStream.on("close",
|
|
60198
|
+
yield new Promise((resolve17) => {
|
|
60199
|
+
destinationStream.on("close", resolve17);
|
|
60200
60200
|
if (destinationStream.writableFinished) {
|
|
60201
|
-
|
|
60201
|
+
resolve17();
|
|
60202
60202
|
}
|
|
60203
60203
|
});
|
|
60204
60204
|
yield (0, utils_1.rmFile)(fileDownloadPath);
|
|
@@ -60247,7 +60247,7 @@ var require_download_http_client = __commonJS({
|
|
|
60247
60247
|
*/
|
|
60248
60248
|
pipeResponseToFile(response, destinationStream, isGzip) {
|
|
60249
60249
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60250
|
-
yield new Promise((
|
|
60250
|
+
yield new Promise((resolve17, reject) => {
|
|
60251
60251
|
if (isGzip) {
|
|
60252
60252
|
const gunzip = zlib3.createGunzip();
|
|
60253
60253
|
response.message.on("error", (error) => {
|
|
@@ -60260,7 +60260,7 @@ var require_download_http_client = __commonJS({
|
|
|
60260
60260
|
destinationStream.close();
|
|
60261
60261
|
reject(error);
|
|
60262
60262
|
}).pipe(destinationStream).on("close", () => {
|
|
60263
|
-
|
|
60263
|
+
resolve17();
|
|
60264
60264
|
}).on("error", (error) => {
|
|
60265
60265
|
core.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`);
|
|
60266
60266
|
reject(error);
|
|
@@ -60271,7 +60271,7 @@ var require_download_http_client = __commonJS({
|
|
|
60271
60271
|
destinationStream.close();
|
|
60272
60272
|
reject(error);
|
|
60273
60273
|
}).pipe(destinationStream).on("close", () => {
|
|
60274
|
-
|
|
60274
|
+
resolve17();
|
|
60275
60275
|
}).on("error", (error) => {
|
|
60276
60276
|
core.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`);
|
|
60277
60277
|
reject(error);
|
|
@@ -60385,11 +60385,11 @@ var require_artifact_client = __commonJS({
|
|
|
60385
60385
|
};
|
|
60386
60386
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
60387
60387
|
function adopt(value) {
|
|
60388
|
-
return value instanceof P ? value : new P(function(
|
|
60389
|
-
|
|
60388
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
60389
|
+
resolve17(value);
|
|
60390
60390
|
});
|
|
60391
60391
|
}
|
|
60392
|
-
return new (P || (P = Promise))(function(
|
|
60392
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
60393
60393
|
function fulfilled(value) {
|
|
60394
60394
|
try {
|
|
60395
60395
|
step(generator.next(value));
|
|
@@ -60405,7 +60405,7 @@ var require_artifact_client = __commonJS({
|
|
|
60405
60405
|
}
|
|
60406
60406
|
}
|
|
60407
60407
|
function step(result) {
|
|
60408
|
-
result.done ?
|
|
60408
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
60409
60409
|
}
|
|
60410
60410
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
60411
60411
|
});
|
|
@@ -67828,10 +67828,10 @@ var require_adm_zip = __commonJS({
|
|
|
67828
67828
|
* @param {function|string} [props.namefix] - optional function to help fix filename
|
|
67829
67829
|
*/
|
|
67830
67830
|
addLocalFolderPromise: function(localPath2, props) {
|
|
67831
|
-
return new Promise((
|
|
67831
|
+
return new Promise((resolve17, reject) => {
|
|
67832
67832
|
this.addLocalFolderAsync2(Object.assign({ localPath: localPath2 }, props), (err, done) => {
|
|
67833
67833
|
if (err) reject(err);
|
|
67834
|
-
if (done)
|
|
67834
|
+
if (done) resolve17(this);
|
|
67835
67835
|
});
|
|
67836
67836
|
});
|
|
67837
67837
|
},
|
|
@@ -68018,12 +68018,12 @@ var require_adm_zip = __commonJS({
|
|
|
68018
68018
|
keepOriginalPermission = get_Bool(false, keepOriginalPermission);
|
|
68019
68019
|
overwrite = get_Bool(false, overwrite);
|
|
68020
68020
|
if (!callback) {
|
|
68021
|
-
return new Promise((
|
|
68021
|
+
return new Promise((resolve17, reject) => {
|
|
68022
68022
|
this.extractAllToAsync(targetPath, overwrite, keepOriginalPermission, function(err) {
|
|
68023
68023
|
if (err) {
|
|
68024
68024
|
reject(err);
|
|
68025
68025
|
} else {
|
|
68026
|
-
|
|
68026
|
+
resolve17(this);
|
|
68027
68027
|
}
|
|
68028
68028
|
});
|
|
68029
68029
|
});
|
|
@@ -68121,11 +68121,11 @@ var require_adm_zip = __commonJS({
|
|
|
68121
68121
|
*/
|
|
68122
68122
|
writeZipPromise: function(targetFileName, props) {
|
|
68123
68123
|
const { overwrite, perm } = Object.assign({ overwrite: true }, props);
|
|
68124
|
-
return new Promise((
|
|
68124
|
+
return new Promise((resolve17, reject) => {
|
|
68125
68125
|
if (!targetFileName && opts.filename) targetFileName = opts.filename;
|
|
68126
68126
|
if (!targetFileName) reject("ADM-ZIP: ZIP File Name Missing");
|
|
68127
68127
|
this.toBufferPromise().then((zipData) => {
|
|
68128
|
-
const ret = (done) => done ?
|
|
68128
|
+
const ret = (done) => done ? resolve17(done) : reject("ADM-ZIP: Wasn't able to write zip file");
|
|
68129
68129
|
filetools.writeFileToAsync(targetFileName, zipData, overwrite, perm, ret);
|
|
68130
68130
|
}, reject);
|
|
68131
68131
|
});
|
|
@@ -68134,8 +68134,8 @@ var require_adm_zip = __commonJS({
|
|
|
68134
68134
|
* @returns {Promise<Buffer>} A promise to the Buffer.
|
|
68135
68135
|
*/
|
|
68136
68136
|
toBufferPromise: function() {
|
|
68137
|
-
return new Promise((
|
|
68138
|
-
_zip.toAsyncBuffer(
|
|
68137
|
+
return new Promise((resolve17, reject) => {
|
|
68138
|
+
_zip.toAsyncBuffer(resolve17, reject);
|
|
68139
68139
|
});
|
|
68140
68140
|
},
|
|
68141
68141
|
/**
|
|
@@ -68830,20 +68830,20 @@ var CLILogger = class {
|
|
|
68830
68830
|
* in errors that are swallowed by the 'error' event listener in this function.
|
|
68831
68831
|
*/
|
|
68832
68832
|
async finish() {
|
|
68833
|
-
return new Promise((
|
|
68833
|
+
return new Promise((resolve17) => {
|
|
68834
68834
|
if (this.logger instanceof Console || this.logger.writableEnded) {
|
|
68835
|
-
|
|
68835
|
+
resolve17();
|
|
68836
68836
|
return;
|
|
68837
68837
|
}
|
|
68838
68838
|
this.logger.on("error", () => {
|
|
68839
68839
|
});
|
|
68840
68840
|
this.logger.end(() => {
|
|
68841
68841
|
if (!this.writeStream || this.writeStream.writableEnded) {
|
|
68842
|
-
|
|
68842
|
+
resolve17();
|
|
68843
68843
|
return;
|
|
68844
68844
|
}
|
|
68845
68845
|
if (!this.writeStream.writableEnded) {
|
|
68846
|
-
this.writeStream.end(
|
|
68846
|
+
this.writeStream.end(resolve17);
|
|
68847
68847
|
}
|
|
68848
68848
|
});
|
|
68849
68849
|
});
|
|
@@ -68878,11 +68878,11 @@ var E_ALREADY_LOCKED = new Error("mutex already locked");
|
|
|
68878
68878
|
var E_CANCELED = new Error("request for lock canceled");
|
|
68879
68879
|
var __awaiter$2 = function(thisArg, _arguments, P, generator) {
|
|
68880
68880
|
function adopt(value) {
|
|
68881
|
-
return value instanceof P ? value : new P(function(
|
|
68882
|
-
|
|
68881
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
68882
|
+
resolve17(value);
|
|
68883
68883
|
});
|
|
68884
68884
|
}
|
|
68885
|
-
return new (P || (P = Promise))(function(
|
|
68885
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
68886
68886
|
function fulfilled(value) {
|
|
68887
68887
|
try {
|
|
68888
68888
|
step(generator.next(value));
|
|
@@ -68898,7 +68898,7 @@ var __awaiter$2 = function(thisArg, _arguments, P, generator) {
|
|
|
68898
68898
|
}
|
|
68899
68899
|
}
|
|
68900
68900
|
function step(result) {
|
|
68901
|
-
result.done ?
|
|
68901
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
68902
68902
|
}
|
|
68903
68903
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
68904
68904
|
});
|
|
@@ -68913,8 +68913,8 @@ var Semaphore = class {
|
|
|
68913
68913
|
acquire(weight = 1, priority = 0) {
|
|
68914
68914
|
if (weight <= 0)
|
|
68915
68915
|
throw new Error(`invalid weight ${weight}: must be positive`);
|
|
68916
|
-
return new Promise((
|
|
68917
|
-
const task = { resolve:
|
|
68916
|
+
return new Promise((resolve17, reject) => {
|
|
68917
|
+
const task = { resolve: resolve17, reject, weight, priority };
|
|
68918
68918
|
const i2 = findIndexFromEnd(this._queue, (other) => priority <= other.priority);
|
|
68919
68919
|
if (i2 === -1 && weight <= this._value) {
|
|
68920
68920
|
this._dispatchItem(task);
|
|
@@ -68939,10 +68939,10 @@ var Semaphore = class {
|
|
|
68939
68939
|
if (this._couldLockImmediately(weight, priority)) {
|
|
68940
68940
|
return Promise.resolve();
|
|
68941
68941
|
} else {
|
|
68942
|
-
return new Promise((
|
|
68942
|
+
return new Promise((resolve17) => {
|
|
68943
68943
|
if (!this._weightedWaiters[weight - 1])
|
|
68944
68944
|
this._weightedWaiters[weight - 1] = [];
|
|
68945
|
-
insertSorted(this._weightedWaiters[weight - 1], { resolve:
|
|
68945
|
+
insertSorted(this._weightedWaiters[weight - 1], { resolve: resolve17, priority });
|
|
68946
68946
|
});
|
|
68947
68947
|
}
|
|
68948
68948
|
}
|
|
@@ -69025,11 +69025,11 @@ function findIndexFromEnd(a2, predicate) {
|
|
|
69025
69025
|
}
|
|
69026
69026
|
var __awaiter$1 = function(thisArg, _arguments, P, generator) {
|
|
69027
69027
|
function adopt(value) {
|
|
69028
|
-
return value instanceof P ? value : new P(function(
|
|
69029
|
-
|
|
69028
|
+
return value instanceof P ? value : new P(function(resolve17) {
|
|
69029
|
+
resolve17(value);
|
|
69030
69030
|
});
|
|
69031
69031
|
}
|
|
69032
|
-
return new (P || (P = Promise))(function(
|
|
69032
|
+
return new (P || (P = Promise))(function(resolve17, reject) {
|
|
69033
69033
|
function fulfilled(value) {
|
|
69034
69034
|
try {
|
|
69035
69035
|
step(generator.next(value));
|
|
@@ -69045,7 +69045,7 @@ var __awaiter$1 = function(thisArg, _arguments, P, generator) {
|
|
|
69045
69045
|
}
|
|
69046
69046
|
}
|
|
69047
69047
|
function step(result) {
|
|
69048
|
-
result.done ?
|
|
69048
|
+
result.done ? resolve17(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
69049
69049
|
}
|
|
69050
69050
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
69051
69051
|
});
|
|
@@ -70446,10 +70446,10 @@ utils_default.inherits(CanceledError, AxiosError_default, {
|
|
|
70446
70446
|
var CanceledError_default = CanceledError;
|
|
70447
70447
|
|
|
70448
70448
|
// ../../node_modules/.pnpm/axios@1.8.2/node_modules/axios/lib/core/settle.js
|
|
70449
|
-
function settle(
|
|
70449
|
+
function settle(resolve17, reject, response) {
|
|
70450
70450
|
const validateStatus2 = response.config.validateStatus;
|
|
70451
70451
|
if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
|
|
70452
|
-
|
|
70452
|
+
resolve17(response);
|
|
70453
70453
|
} else {
|
|
70454
70454
|
reject(new AxiosError_default(
|
|
70455
70455
|
"Request failed with status code " + response.status,
|
|
@@ -70950,7 +70950,7 @@ function setProxy(options, configProxy, location) {
|
|
|
70950
70950
|
}
|
|
70951
70951
|
var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
|
|
70952
70952
|
var wrapAsync = (asyncExecutor) => {
|
|
70953
|
-
return new Promise((
|
|
70953
|
+
return new Promise((resolve17, reject) => {
|
|
70954
70954
|
let onDone;
|
|
70955
70955
|
let isDone;
|
|
70956
70956
|
const done = (value, isRejected) => {
|
|
@@ -70960,7 +70960,7 @@ var wrapAsync = (asyncExecutor) => {
|
|
|
70960
70960
|
};
|
|
70961
70961
|
const _resolve = (value) => {
|
|
70962
70962
|
done(value);
|
|
70963
|
-
|
|
70963
|
+
resolve17(value);
|
|
70964
70964
|
};
|
|
70965
70965
|
const _reject = (reason) => {
|
|
70966
70966
|
done(reason, true);
|
|
@@ -70980,7 +70980,7 @@ var resolveFamily = ({ address, family }) => {
|
|
|
70980
70980
|
};
|
|
70981
70981
|
var buildAddressEntry = (address, family) => resolveFamily(utils_default.isObject(address) ? address : { address, family });
|
|
70982
70982
|
var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
70983
|
-
return wrapAsync(async function dispatchHttpRequest(
|
|
70983
|
+
return wrapAsync(async function dispatchHttpRequest(resolve17, reject, onDone) {
|
|
70984
70984
|
let { data: data2, lookup, family } = config2;
|
|
70985
70985
|
const { responseType, responseEncoding } = config2;
|
|
70986
70986
|
const method = config2.method.toUpperCase();
|
|
@@ -71032,7 +71032,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
71032
71032
|
if (protocol === "data:") {
|
|
71033
71033
|
let convertedData;
|
|
71034
71034
|
if (method !== "GET") {
|
|
71035
|
-
return settle(
|
|
71035
|
+
return settle(resolve17, reject, {
|
|
71036
71036
|
status: 405,
|
|
71037
71037
|
statusText: "method not allowed",
|
|
71038
71038
|
headers: {},
|
|
@@ -71054,7 +71054,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
71054
71054
|
} else if (responseType === "stream") {
|
|
71055
71055
|
convertedData = stream3.Readable.from(convertedData);
|
|
71056
71056
|
}
|
|
71057
|
-
return settle(
|
|
71057
|
+
return settle(resolve17, reject, {
|
|
71058
71058
|
data: convertedData,
|
|
71059
71059
|
status: 200,
|
|
71060
71060
|
statusText: "OK",
|
|
@@ -71272,7 +71272,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
71272
71272
|
};
|
|
71273
71273
|
if (responseType === "stream") {
|
|
71274
71274
|
response.data = responseStream;
|
|
71275
|
-
settle(
|
|
71275
|
+
settle(resolve17, reject, response);
|
|
71276
71276
|
} else {
|
|
71277
71277
|
const responseBuffer = [];
|
|
71278
71278
|
let totalResponseBytes = 0;
|
|
@@ -71320,7 +71320,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config2) {
|
|
|
71320
71320
|
} catch (err) {
|
|
71321
71321
|
return reject(AxiosError_default.from(err, null, config2, response.request, response));
|
|
71322
71322
|
}
|
|
71323
|
-
settle(
|
|
71323
|
+
settle(resolve17, reject, response);
|
|
71324
71324
|
});
|
|
71325
71325
|
}
|
|
71326
71326
|
emitter.once("abort", (err) => {
|
|
@@ -71547,7 +71547,7 @@ var resolveConfig_default = (config2) => {
|
|
|
71547
71547
|
// ../../node_modules/.pnpm/axios@1.8.2/node_modules/axios/lib/adapters/xhr.js
|
|
71548
71548
|
var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
|
|
71549
71549
|
var xhr_default = isXHRAdapterSupported && function(config2) {
|
|
71550
|
-
return new Promise(function dispatchXhrRequest(
|
|
71550
|
+
return new Promise(function dispatchXhrRequest(resolve17, reject) {
|
|
71551
71551
|
const _config = resolveConfig_default(config2);
|
|
71552
71552
|
let requestData = _config.data;
|
|
71553
71553
|
const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize();
|
|
@@ -71581,7 +71581,7 @@ var xhr_default = isXHRAdapterSupported && function(config2) {
|
|
|
71581
71581
|
request
|
|
71582
71582
|
};
|
|
71583
71583
|
settle(function _resolve(value) {
|
|
71584
|
-
|
|
71584
|
+
resolve17(value);
|
|
71585
71585
|
done();
|
|
71586
71586
|
}, function _reject(err) {
|
|
71587
71587
|
reject(err);
|
|
@@ -71924,8 +71924,8 @@ var fetch_default = isFetchSupported && (async (config2) => {
|
|
|
71924
71924
|
responseType = responseType || "text";
|
|
71925
71925
|
let responseData = await resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config2);
|
|
71926
71926
|
!isStreamResponse && unsubscribe && unsubscribe();
|
|
71927
|
-
return await new Promise((
|
|
71928
|
-
settle(
|
|
71927
|
+
return await new Promise((resolve17, reject) => {
|
|
71928
|
+
settle(resolve17, reject, {
|
|
71929
71929
|
data: responseData,
|
|
71930
71930
|
headers: AxiosHeaders_default.from(response.headers),
|
|
71931
71931
|
status: response.status,
|
|
@@ -72291,8 +72291,8 @@ var CancelToken = class _CancelToken {
|
|
|
72291
72291
|
throw new TypeError("executor must be a function.");
|
|
72292
72292
|
}
|
|
72293
72293
|
let resolvePromise;
|
|
72294
|
-
this.promise = new Promise(function promiseExecutor(
|
|
72295
|
-
resolvePromise =
|
|
72294
|
+
this.promise = new Promise(function promiseExecutor(resolve17) {
|
|
72295
|
+
resolvePromise = resolve17;
|
|
72296
72296
|
});
|
|
72297
72297
|
const token = this;
|
|
72298
72298
|
this.promise.then((cancel) => {
|
|
@@ -72305,9 +72305,9 @@ var CancelToken = class _CancelToken {
|
|
|
72305
72305
|
});
|
|
72306
72306
|
this.promise.then = (onfulfilled) => {
|
|
72307
72307
|
let _resolve;
|
|
72308
|
-
const promise = new Promise((
|
|
72309
|
-
token.subscribe(
|
|
72310
|
-
_resolve =
|
|
72308
|
+
const promise = new Promise((resolve17) => {
|
|
72309
|
+
token.subscribe(resolve17);
|
|
72310
|
+
_resolve = resolve17;
|
|
72311
72311
|
}).then(onfulfilled);
|
|
72312
72312
|
promise.cancel = function reject() {
|
|
72313
72313
|
token.unsubscribe(_resolve);
|
|
@@ -72636,8 +72636,8 @@ var axiosRetry = (axiosInstance, defaultOptions2) => {
|
|
|
72636
72636
|
}
|
|
72637
72637
|
config2.transformRequest = [(data2) => data2];
|
|
72638
72638
|
await onRetry(currentState.retryCount, error, config2);
|
|
72639
|
-
return new Promise((
|
|
72640
|
-
setTimeout(() =>
|
|
72639
|
+
return new Promise((resolve17) => {
|
|
72640
|
+
setTimeout(() => resolve17(axiosInstance(config2)), delay);
|
|
72641
72641
|
});
|
|
72642
72642
|
}
|
|
72643
72643
|
await handleMaxRetryTimesExceeded(currentState, error);
|
|
@@ -72848,12 +72848,12 @@ function serializeMavenDependencyToPackageUrl(mavenDep) {
|
|
|
72848
72848
|
// ../web-compat-utils/src/nuget-dependency-utils.ts
|
|
72849
72849
|
var import_packageurl_js2 = __toESM(require_packageurl_js(), 1);
|
|
72850
72850
|
function prettyPrintNugetDependency({ packageName, version: version3 }) {
|
|
72851
|
-
return `${packageName}/${version3}
|
|
72851
|
+
return `${packageName}/${version3}`.toLocaleLowerCase();
|
|
72852
72852
|
}
|
|
72853
72853
|
function deserializeNugetDependency(s2) {
|
|
72854
72854
|
const [packageName, version3] = s2.split("/");
|
|
72855
72855
|
return {
|
|
72856
|
-
packageName,
|
|
72856
|
+
packageName: packageName.toLocaleLowerCase(),
|
|
72857
72857
|
version: version3.trim() || null,
|
|
72858
72858
|
resolvedType: "unknown"
|
|
72859
72859
|
};
|
|
@@ -72864,7 +72864,7 @@ function parsePackageUrlToNugetDependency(purlString) {
|
|
|
72864
72864
|
throw new Error(`Expected nuget package URL, got ${purl.type}`);
|
|
72865
72865
|
}
|
|
72866
72866
|
return {
|
|
72867
|
-
packageName: purl.name,
|
|
72867
|
+
packageName: purl.name.toLocaleLowerCase(),
|
|
72868
72868
|
version: purl.version ?? null,
|
|
72869
72869
|
resolvedType: "unknown"
|
|
72870
72870
|
};
|
|
@@ -72972,7 +72972,7 @@ function deserializeRustDependencyChainNode(s2) {
|
|
|
72972
72972
|
|
|
72973
72973
|
// dist/main.js
|
|
72974
72974
|
var import_lodash19 = __toESM(require_lodash(), 1);
|
|
72975
|
-
import { relative as
|
|
72975
|
+
import { relative as relative7, resolve as resolve16 } from "path";
|
|
72976
72976
|
|
|
72977
72977
|
// ../utils/src/dashboard-api/coana-api.ts
|
|
72978
72978
|
import { writeFile } from "fs/promises";
|
|
@@ -73196,8 +73196,8 @@ function getCoanaAPI() {
|
|
|
73196
73196
|
|
|
73197
73197
|
// ../utils/src/dashboard-api/socket-api.ts
|
|
73198
73198
|
var import_form_data2 = __toESM(require_form_data2(), 1);
|
|
73199
|
-
import { readFile as readFile2 } from "fs/promises";
|
|
73200
|
-
import { join } from "path";
|
|
73199
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
73200
|
+
import { join, relative, resolve } from "node:path";
|
|
73201
73201
|
|
|
73202
73202
|
// ../web-compat-utils/src/ghsa.ts
|
|
73203
73203
|
function extractGHSAIdFromUrl(url2) {
|
|
@@ -73608,7 +73608,7 @@ ${stderr}`) ? em.slice(0, -stderr.length - 1) : em}`);
|
|
|
73608
73608
|
logger[logLevel](`stderr: ${stderr}`);
|
|
73609
73609
|
}
|
|
73610
73610
|
async function execNeverFail(cmd, dir, options) {
|
|
73611
|
-
return new Promise((
|
|
73611
|
+
return new Promise((resolve17) => {
|
|
73612
73612
|
let args;
|
|
73613
73613
|
if (typeof cmd !== "string") [cmd, ...args] = cmd;
|
|
73614
73614
|
const childProcess = execFile(
|
|
@@ -73616,7 +73616,7 @@ async function execNeverFail(cmd, dir, options) {
|
|
|
73616
73616
|
args,
|
|
73617
73617
|
{ ...options, cwd: dir, maxBuffer: 1024 * 1024 * 1024, shell: args === void 0 },
|
|
73618
73618
|
(error, stdout, stderr) => {
|
|
73619
|
-
|
|
73619
|
+
resolve17({ error, stdout, stderr });
|
|
73620
73620
|
}
|
|
73621
73621
|
);
|
|
73622
73622
|
if (options?.pipe) {
|
|
@@ -73699,7 +73699,7 @@ var import_lodash3 = __toESM(require_lodash(), 1);
|
|
|
73699
73699
|
var import_micromatch = __toESM(require_micromatch(), 1);
|
|
73700
73700
|
import { existsSync } from "fs";
|
|
73701
73701
|
import { access, cp, readdir, stat } from "fs/promises";
|
|
73702
|
-
import { basename, join as join2, relative, resolve } from "path";
|
|
73702
|
+
import { basename, join as join2, relative as relative2, resolve as resolve2 } from "path";
|
|
73703
73703
|
|
|
73704
73704
|
// ../web-compat-utils/src/async.ts
|
|
73705
73705
|
async function asyncMap(array, mapper, concurrency = 1) {
|
|
@@ -73725,12 +73725,6 @@ async function asyncForEach(array, fn, concurrency = 1) {
|
|
|
73725
73725
|
}
|
|
73726
73726
|
await Promise.all(Array.from({ length: concurrency }, async () => worker()));
|
|
73727
73727
|
}
|
|
73728
|
-
async function applySeries(arr, fn) {
|
|
73729
|
-
let i2 = 0;
|
|
73730
|
-
for (const item of arr) {
|
|
73731
|
-
await fn(item, i2++);
|
|
73732
|
-
}
|
|
73733
|
-
}
|
|
73734
73728
|
async function asyncFilter(arr, predicate, concurrency = 1) {
|
|
73735
73729
|
const results = await asyncMap(arr, predicate, concurrency);
|
|
73736
73730
|
return arr.filter((_v, index2) => results[index2]);
|
|
@@ -73740,21 +73734,21 @@ async function asyncFilter(arr, predicate, concurrency = 1) {
|
|
|
73740
73734
|
var { uniq } = import_lodash3.default;
|
|
73741
73735
|
var { isMatch } = import_micromatch.default;
|
|
73742
73736
|
function excludeFiles(excludedDirsRoot, filesRoot, files, excludeDirs) {
|
|
73743
|
-
return files.map((f2) =>
|
|
73744
|
-
(file) => !isMatch(
|
|
73737
|
+
return files.map((f2) => resolve2(filesRoot, f2)).filter(
|
|
73738
|
+
(file) => !isMatch(relative2(excludedDirsRoot, file), excludeDirs) && // also exclude files in directories that are excluded
|
|
73745
73739
|
!isMatch(
|
|
73746
|
-
|
|
73740
|
+
relative2(excludedDirsRoot, file),
|
|
73747
73741
|
excludeDirs.map((ed) => `${ed}/**/*`)
|
|
73748
73742
|
) && !excludeDirs.some(
|
|
73749
|
-
(excludeDir) =>
|
|
73743
|
+
(excludeDir) => relative2(excludedDirsRoot, file).startsWith(excludeDir.endsWith("/") ? excludeDir : `${excludeDir}/`)
|
|
73750
73744
|
)
|
|
73751
|
-
).map((f2) =>
|
|
73745
|
+
).map((f2) => relative2(filesRoot, f2));
|
|
73752
73746
|
}
|
|
73753
73747
|
function* parents(dir) {
|
|
73754
73748
|
let [curr, last2] = [dir, dir];
|
|
73755
73749
|
do {
|
|
73756
73750
|
yield curr;
|
|
73757
|
-
[last2, curr] = [curr,
|
|
73751
|
+
[last2, curr] = [curr, resolve2(curr, "..")];
|
|
73758
73752
|
} while (curr !== last2);
|
|
73759
73753
|
return void 0;
|
|
73760
73754
|
}
|
|
@@ -73824,7 +73818,7 @@ ${error.message}`);
|
|
|
73824
73818
|
var import_lodash17 = __toESM(require_lodash(), 1);
|
|
73825
73819
|
var import_semver3 = __toESM(require_semver2(), 1);
|
|
73826
73820
|
import assert8 from "assert";
|
|
73827
|
-
import { relative as
|
|
73821
|
+
import { relative as relative6 } from "path";
|
|
73828
73822
|
|
|
73829
73823
|
// ../utils/src/promise-queue.ts
|
|
73830
73824
|
var PromiseQueue = class {
|
|
@@ -73885,14 +73879,14 @@ var PromiseQueue = class {
|
|
|
73885
73879
|
this.runNextTask();
|
|
73886
73880
|
}
|
|
73887
73881
|
async onIdle() {
|
|
73888
|
-
return new Promise((
|
|
73882
|
+
return new Promise((resolve17, reject) => {
|
|
73889
73883
|
if (this.error) {
|
|
73890
73884
|
reject(this.error);
|
|
73891
73885
|
this.error = null;
|
|
73892
73886
|
} else if (this.queue.length === 0 && this.activeTasks === 0) {
|
|
73893
|
-
|
|
73887
|
+
resolve17();
|
|
73894
73888
|
} else {
|
|
73895
|
-
this.idleResolver =
|
|
73889
|
+
this.idleResolver = resolve17;
|
|
73896
73890
|
this.idleRejector = reject;
|
|
73897
73891
|
}
|
|
73898
73892
|
});
|
|
@@ -73992,12 +73986,12 @@ function getVulnReachability(c) {
|
|
|
73992
73986
|
// dist/analyzers/pip-analyzer.js
|
|
73993
73987
|
var import_lodash16 = __toESM(require_lodash(), 1);
|
|
73994
73988
|
import assert7 from "assert";
|
|
73995
|
-
import { resolve as
|
|
73989
|
+
import { resolve as resolve14 } from "path";
|
|
73996
73990
|
|
|
73997
73991
|
// ../utils/src/pip-utils.ts
|
|
73998
73992
|
import { existsSync as existsSync2 } from "fs";
|
|
73999
73993
|
import { readFile as readFile4 } from "fs/promises";
|
|
74000
|
-
import { resolve as
|
|
73994
|
+
import { resolve as resolve4 } from "path";
|
|
74001
73995
|
import util4 from "util";
|
|
74002
73996
|
|
|
74003
73997
|
// ../utils/src/python-versions-manager.ts
|
|
@@ -74006,7 +74000,7 @@ var import_semver = __toESM(require_semver2(), 1);
|
|
|
74006
74000
|
import { execFileSync } from "child_process";
|
|
74007
74001
|
import { constants as constants2 } from "fs";
|
|
74008
74002
|
import { access as access2, readFile as readFile3 } from "fs/promises";
|
|
74009
|
-
import { join as join4, resolve as
|
|
74003
|
+
import { join as join4, resolve as resolve3 } from "path";
|
|
74010
74004
|
import util3 from "util";
|
|
74011
74005
|
var { once } = import_lodash4.default;
|
|
74012
74006
|
var systemPython = once(() => execFileSync("which", ["python"], { encoding: "utf8" }).trim());
|
|
@@ -74040,14 +74034,14 @@ var PythonVersionsManager = class _PythonVersionsManager {
|
|
|
74040
74034
|
}
|
|
74041
74035
|
// Extracts the python version specifier from the workspace and returns it as an array of semver parts.
|
|
74042
74036
|
async getPythonSpecifier(workspacePath, checkPyProject = true) {
|
|
74043
|
-
const absPath =
|
|
74037
|
+
const absPath = resolve3(this.projectDir, workspacePath);
|
|
74044
74038
|
for (const parent2 of parents(absPath))
|
|
74045
74039
|
try {
|
|
74046
74040
|
return [(await readFile3(join4(parent2, ".python-version"), "utf-8")).split("\n")[0].trim()];
|
|
74047
74041
|
} catch (e) {
|
|
74048
74042
|
if (e.code !== "ENOENT") logger.warn("Failed to read python version file with error", e);
|
|
74049
74043
|
}
|
|
74050
|
-
const pipfile =
|
|
74044
|
+
const pipfile = resolve3(absPath, "Pipfile");
|
|
74051
74045
|
try {
|
|
74052
74046
|
await access2(pipfile, constants2.R_OK);
|
|
74053
74047
|
try {
|
|
@@ -74097,7 +74091,7 @@ var PythonVersionsManager = class _PythonVersionsManager {
|
|
|
74097
74091
|
);
|
|
74098
74092
|
} else if (!await hasPyenv() || _PythonVersionsManager.getGlobalPythonVersion() === "system")
|
|
74099
74093
|
return systemPython();
|
|
74100
|
-
return
|
|
74094
|
+
return resolve3(await _PythonVersionsManager.getPythonPrefixMatchingSpecifier(semVerSpec), "bin", "python");
|
|
74101
74095
|
}
|
|
74102
74096
|
// Throws an error if the python version is not installed.
|
|
74103
74097
|
static async getPythonPrefixForVersion(version3) {
|
|
@@ -74107,7 +74101,7 @@ var PythonVersionsManager = class _PythonVersionsManager {
|
|
|
74107
74101
|
const versions = await this.getInstalledPythonVersions();
|
|
74108
74102
|
return [
|
|
74109
74103
|
...versions.map(
|
|
74110
|
-
(v) => [v, async () =>
|
|
74104
|
+
(v) => [v, async () => resolve3(await this.getPythonPrefixForVersion(v), "bin", "python")]
|
|
74111
74105
|
),
|
|
74112
74106
|
[await getPythonVersion(systemPython()), async () => systemPython()]
|
|
74113
74107
|
];
|
|
@@ -74201,7 +74195,7 @@ async function parseTomlFile(file) {
|
|
|
74201
74195
|
return JSON.parse(await runCommandResolveStdOut(["python", "-SIc", parseTomlProgram, file]));
|
|
74202
74196
|
}
|
|
74203
74197
|
async function getPyProjectParsed(dir) {
|
|
74204
|
-
const pyprojectLoc =
|
|
74198
|
+
const pyprojectLoc = resolve4(dir, "pyproject.toml");
|
|
74205
74199
|
if (!existsSync2(pyprojectLoc)) return void 0;
|
|
74206
74200
|
return parseTomlFile(pyprojectLoc);
|
|
74207
74201
|
}
|
|
@@ -74233,7 +74227,7 @@ var MambaladeHeuristics = {
|
|
|
74233
74227
|
// dist/whole-program-code-aware-vulnerability-scanner/python/phantom-deps.js
|
|
74234
74228
|
var import_lodash15 = __toESM(require_lodash(), 1);
|
|
74235
74229
|
import fs11 from "fs/promises";
|
|
74236
|
-
import path8, { resolve as
|
|
74230
|
+
import path8, { resolve as resolve13 } from "path";
|
|
74237
74231
|
|
|
74238
74232
|
// ../utils/src/vulnerable-paths-utils.ts
|
|
74239
74233
|
function mkTrie() {
|
|
@@ -74256,7 +74250,7 @@ var import_lodash14 = __toESM(require_lodash(), 1);
|
|
|
74256
74250
|
import assert6 from "assert";
|
|
74257
74251
|
import { existsSync as existsSync10 } from "fs";
|
|
74258
74252
|
import { cp as cp5, readdir as readdir3, readFile as readFile10, rm as rm5, writeFile as writeFile8 } from "fs/promises";
|
|
74259
|
-
import { basename as basename9, dirname as dirname12, join as join20, resolve as
|
|
74253
|
+
import { basename as basename9, dirname as dirname12, join as join20, resolve as resolve12, sep as sep3 } from "path";
|
|
74260
74254
|
import util5 from "util";
|
|
74261
74255
|
|
|
74262
74256
|
// ../utils/src/constants.ts
|
|
@@ -74305,10 +74299,10 @@ async function downloadFile(fileUrl, outputFile) {
|
|
|
74305
74299
|
// ../utils/src/file-tree-utils.ts
|
|
74306
74300
|
import { closeSync, lstatSync, openSync, readdirSync as readdirSync2, readSync } from "fs";
|
|
74307
74301
|
import { readdir as readdir2 } from "fs/promises";
|
|
74308
|
-
import { basename as basename3, join as join7, relative as
|
|
74302
|
+
import { basename as basename3, join as join7, relative as relative4, resolve as resolve6 } from "path";
|
|
74309
74303
|
|
|
74310
74304
|
// ../utils/src/package-utils.ts
|
|
74311
|
-
import { parse as parse2, join as join6, resolve as
|
|
74305
|
+
import { parse as parse2, join as join6, resolve as resolve5, normalize, dirname as dirname2, basename as basename2, relative as relative3 } from "path";
|
|
74312
74306
|
import { existsSync as existsSync4, readFileSync, readdirSync, statSync, writeFileSync } from "fs";
|
|
74313
74307
|
function getPackageJsonObject(workspaceRoot) {
|
|
74314
74308
|
const packageJSONContent = getPackageJsonContent(workspaceRoot);
|
|
@@ -74340,7 +74334,7 @@ async function findFilesInPythonProjectMatching(projectDir, fileMatcher, maxDept
|
|
|
74340
74334
|
if (shouldIgnoreDir(fileOrDirectory.name, projectDir === path9)) continue;
|
|
74341
74335
|
directoriesToTraverse.push(fileOrDirectory.name);
|
|
74342
74336
|
} else if (fileOrDirectory.isFile()) {
|
|
74343
|
-
if (fileMatcher(fullPath)) files.push(
|
|
74337
|
+
if (fileMatcher(fullPath)) files.push(relative4(projectDir, fullPath));
|
|
74344
74338
|
}
|
|
74345
74339
|
}
|
|
74346
74340
|
if (depthLeft === 0) return;
|
|
@@ -74383,24 +74377,10 @@ async function withTmpDirectory(prefix, fn, deleteTmpDir = true) {
|
|
|
74383
74377
|
|
|
74384
74378
|
// ../web-compat-utils/src/vuln-chain-detail-utils.ts
|
|
74385
74379
|
var ROOT_NODE_STR = "";
|
|
74386
|
-
function computeParentsMap(d) {
|
|
74387
|
-
const parentsMap = /* @__PURE__ */ new Map();
|
|
74388
|
-
const addToMap = (children2, id) => {
|
|
74389
|
-
children2?.forEach((dep) => {
|
|
74390
|
-
if (!parentsMap.has(dep)) parentsMap.set(dep, []);
|
|
74391
|
-
parentsMap.get(dep).push(id);
|
|
74392
|
-
});
|
|
74393
|
-
};
|
|
74394
|
-
for (const [id, node] of Object.entries(d.transitiveDependencies)) {
|
|
74395
|
-
addToMap(node.children, id);
|
|
74396
|
-
}
|
|
74397
|
-
addToMap(d.children, ROOT_NODE_STR);
|
|
74398
|
-
return parentsMap;
|
|
74399
|
-
}
|
|
74400
74380
|
|
|
74401
74381
|
// dist/whole-program-code-aware-vulnerability-scanner/code-aware-vulnerability-scanner.js
|
|
74402
74382
|
var import_lodash13 = __toESM(require_lodash(), 1);
|
|
74403
|
-
import { resolve as
|
|
74383
|
+
import { resolve as resolve11 } from "path";
|
|
74404
74384
|
|
|
74405
74385
|
// dist/whole-program-code-aware-vulnerability-scanner/dotnet/dotnet-code-aware-vulnerability-scanner.js
|
|
74406
74386
|
var import_lodash6 = __toESM(require_lodash(), 1);
|
|
@@ -76343,10 +76323,10 @@ function compareDocumentPosition(nodeA, nodeB) {
|
|
|
76343
76323
|
function uniqueSort(nodes) {
|
|
76344
76324
|
nodes = nodes.filter((node, i2, arr) => !arr.includes(node, i2 + 1));
|
|
76345
76325
|
nodes.sort((a2, b) => {
|
|
76346
|
-
const
|
|
76347
|
-
if (
|
|
76326
|
+
const relative8 = compareDocumentPosition(a2, b);
|
|
76327
|
+
if (relative8 & DocumentPosition.PRECEDING) {
|
|
76348
76328
|
return -1;
|
|
76349
|
-
} else if (
|
|
76329
|
+
} else if (relative8 & DocumentPosition.FOLLOWING) {
|
|
76350
76330
|
return 1;
|
|
76351
76331
|
}
|
|
76352
76332
|
return 0;
|
|
@@ -88577,130 +88557,6 @@ async function convertSocketArtifacts2(artifacts, tmpDir) {
|
|
|
88577
88557
|
return deps;
|
|
88578
88558
|
}
|
|
88579
88559
|
|
|
88580
|
-
// dist/whole-program-code-aware-vulnerability-scanner/js/jelly-runner.js
|
|
88581
|
-
var import_lodash9 = __toESM(require_lodash(), 1);
|
|
88582
|
-
import { readFile as readFile7, rm as rm2, writeFile as writeFile5 } from "fs/promises";
|
|
88583
|
-
import { relative as relative4, resolve as resolve6 } from "path";
|
|
88584
|
-
var { map: map2, uniq: uniq4 } = import_lodash9.default;
|
|
88585
|
-
var PRINT_JELLY_COMMAND = false;
|
|
88586
|
-
async function runJellyAnalysis(mainProjectRoot, projectRoot, jellyOptions, reachabilityAnalysisOptions, vulnerabilities, experiment) {
|
|
88587
|
-
const tmpFolder = await createTmpDirectory("jelly-analysis");
|
|
88588
|
-
try {
|
|
88589
|
-
const filesToAnalyze = reachabilityAnalysisOptions.entryPoints ? reachabilityAnalysisOptions.entryPoints : [projectRoot];
|
|
88590
|
-
const jellyExecutable = resolve6(COANA_REPOS_PATH(), "jelly-private", "dist", "bundle", "jelly.js");
|
|
88591
|
-
const vulnerabilitiesInJellyFormat = vulnerabilities.map((v) => ({
|
|
88592
|
-
osv: v,
|
|
88593
|
-
patterns: v.vulnerabilityAccessPaths.map((p) => experiment === "AUGMENT_IMPORT_PATHS_EXPERIMENT" ? p.replace(">", "/**>") : p)
|
|
88594
|
-
// Repalce > with /**> to ensure Jelly also matches call <PKG/dist/index.js>.foo for pattern <PKG>.foo
|
|
88595
|
-
}));
|
|
88596
|
-
const vulnerabilitiesFile = resolve6(tmpFolder, "vulnerabilities.json");
|
|
88597
|
-
const diagnosticsFile = resolve6(tmpFolder, "diagnostics.json");
|
|
88598
|
-
const matchesFile = resolve6(tmpFolder, "matches.json");
|
|
88599
|
-
const callStackFile = resolve6(tmpFolder, "call-stacks.json");
|
|
88600
|
-
const logFile = reachabilityAnalysisOptions.analysisLogFile ?? (reachabilityAnalysisOptions.printLogFile && resolve6(projectRoot, "js-analysis.log"));
|
|
88601
|
-
await writeFile5(vulnerabilitiesFile, JSON.stringify(vulnerabilitiesInJellyFormat));
|
|
88602
|
-
let excludeEntries;
|
|
88603
|
-
if (reachabilityAnalysisOptions.excludeDirs?.length) {
|
|
88604
|
-
const excludeDirsRelativeToProjectRoot = reachabilityAnalysisOptions.excludeDirs.map((d) => relative4(projectRoot, resolve6(mainProjectRoot, d)));
|
|
88605
|
-
const excludeDirsRelativeToProjectRootWithWildcards = excludeDirsRelativeToProjectRoot.map((d) => `${d}/**`);
|
|
88606
|
-
excludeEntries = [...excludeDirsRelativeToProjectRoot, ...excludeDirsRelativeToProjectRootWithWildcards];
|
|
88607
|
-
}
|
|
88608
|
-
const jellyCmd = [
|
|
88609
|
-
"node",
|
|
88610
|
-
`--max-old-space-size=${reachabilityAnalysisOptions.memoryLimitInMB ?? 8192}`,
|
|
88611
|
-
jellyExecutable,
|
|
88612
|
-
"--basedir",
|
|
88613
|
-
mainProjectRoot,
|
|
88614
|
-
"--timeout",
|
|
88615
|
-
"" + (reachabilityAnalysisOptions.timeoutInSeconds ?? 60),
|
|
88616
|
-
"--vulnerabilities",
|
|
88617
|
-
vulnerabilitiesFile,
|
|
88618
|
-
...excludeEntries ? ["--exclude-entries", ...excludeEntries] : [],
|
|
88619
|
-
"--diagnostics-json",
|
|
88620
|
-
diagnosticsFile,
|
|
88621
|
-
...jellyOptions.maxIndirections ? ["--max-indirections", "" + jellyOptions.maxIndirections] : [],
|
|
88622
|
-
...jellyOptions.includePackages ? ["--include-packages", ...jellyOptions.includePackages] : [],
|
|
88623
|
-
...jellyOptions.approx ? ["--approx"] : [],
|
|
88624
|
-
...logFile ? ["--logfile", logFile] : [],
|
|
88625
|
-
"--matches-file",
|
|
88626
|
-
matchesFile,
|
|
88627
|
-
"--vulnerabilities-callstacks",
|
|
88628
|
-
callStackFile,
|
|
88629
|
-
...filesToAnalyze
|
|
88630
|
-
];
|
|
88631
|
-
if (PRINT_JELLY_COMMAND)
|
|
88632
|
-
logger.info("Jelly command:", jellyCmd.join(" "));
|
|
88633
|
-
await runCommandResolveStdOut(
|
|
88634
|
-
jellyCmd,
|
|
88635
|
-
void 0,
|
|
88636
|
-
// If it is an experimental run, make sure to crash the process if Jelly takes more than 50% longer than the timeout.
|
|
88637
|
-
// This is done to mitigate the scenario where the Jelly process gets close to the memory limit and thus ends up spending most of its time on garbage collection, which can increase the time between timeout checks dramatically.
|
|
88638
|
-
experiment && reachabilityAnalysisOptions.timeoutInSeconds ? { timeout: reachabilityAnalysisOptions.timeoutInSeconds * 1e3 * 1.5 } : void 0
|
|
88639
|
-
);
|
|
88640
|
-
if (reachabilityAnalysisOptions.printLogFile)
|
|
88641
|
-
logger.info("JS analysis log file:", await readFile7(logFile, "utf-8"));
|
|
88642
|
-
const analysisDiagnostics = JSON.parse(await readFile7(diagnosticsFile, "utf-8"));
|
|
88643
|
-
analysisDiagnostics.time = analysisDiagnostics.analysisTime;
|
|
88644
|
-
delete analysisDiagnostics.analysisTime;
|
|
88645
|
-
analysisDiagnostics.timings = {
|
|
88646
|
-
analysisTime: analysisDiagnostics.time,
|
|
88647
|
-
patternMatchingTime: analysisDiagnostics.patternMatchingTime
|
|
88648
|
-
};
|
|
88649
|
-
const callStacks = JSON.parse(await readFile7(callStackFile, "utf-8"));
|
|
88650
|
-
const matches = {};
|
|
88651
|
-
for (const { vulnerability, paths } of callStacks) {
|
|
88652
|
-
const transformedStacks = transformJellyCallStacks(projectRoot, paths);
|
|
88653
|
-
if (matches[vulnerability.osv.url]) {
|
|
88654
|
-
matches[vulnerability.osv.url].stacks.push(...transformedStacks.stacks);
|
|
88655
|
-
} else
|
|
88656
|
-
matches[vulnerability.osv.url] = transformedStacks;
|
|
88657
|
-
}
|
|
88658
|
-
return {
|
|
88659
|
-
matches,
|
|
88660
|
-
analysisDiagnostics
|
|
88661
|
-
};
|
|
88662
|
-
} finally {
|
|
88663
|
-
await rm2(tmpFolder, { recursive: true });
|
|
88664
|
-
}
|
|
88665
|
-
}
|
|
88666
|
-
async function runJellyPhantomDependencyAnalysis(projectRoot) {
|
|
88667
|
-
const tmpFolder = await createTmpDirectory("jelly-analysis");
|
|
88668
|
-
try {
|
|
88669
|
-
const jellyExecutable = resolve6(COANA_REPOS_PATH(), "jelly-private", "dist", "bundle", "jelly.js");
|
|
88670
|
-
const reachablePackagesFile = resolve6(tmpFolder, "reachable-packages.json");
|
|
88671
|
-
const jellyCmd = [
|
|
88672
|
-
"node",
|
|
88673
|
-
jellyExecutable,
|
|
88674
|
-
"--basedir",
|
|
88675
|
-
projectRoot,
|
|
88676
|
-
"--modules-only",
|
|
88677
|
-
"--ignore-dependencies",
|
|
88678
|
-
"--reachable-packages-file",
|
|
88679
|
-
reachablePackagesFile,
|
|
88680
|
-
projectRoot
|
|
88681
|
-
];
|
|
88682
|
-
await runCommandResolveStdOut(jellyCmd);
|
|
88683
|
-
return JSON.parse(await readFile7(reachablePackagesFile, "utf-8"));
|
|
88684
|
-
} finally {
|
|
88685
|
-
await rm2(tmpFolder, { recursive: true });
|
|
88686
|
-
}
|
|
88687
|
-
}
|
|
88688
|
-
function relativizeSourceLocations(projectDir, paths) {
|
|
88689
|
-
return {
|
|
88690
|
-
...paths,
|
|
88691
|
-
stacks: paths.stacks.map((stack) => stack.map((s2) => ({
|
|
88692
|
-
...s2,
|
|
88693
|
-
sourceLocation: { ...s2.sourceLocation, filename: relative4(projectDir, s2.sourceLocation.filename) }
|
|
88694
|
-
})))
|
|
88695
|
-
};
|
|
88696
|
-
}
|
|
88697
|
-
function transformJellyCallStacks(projectRoot, paths) {
|
|
88698
|
-
return {
|
|
88699
|
-
...relativizeSourceLocations(projectRoot, paths),
|
|
88700
|
-
affectedPackages: uniq4(paths.stacks.flatMap((stack) => map2(stack, "package")))
|
|
88701
|
-
};
|
|
88702
|
-
}
|
|
88703
|
-
|
|
88704
88560
|
// dist/whole-program-code-aware-vulnerability-scanner/js/js-code-aware-vulnerability-scanner.js
|
|
88705
88561
|
import { mkdtempSync } from "fs";
|
|
88706
88562
|
import { cp as cp3, mkdir as mkdir7, rm as rm3, writeFile as writeFile6 } from "fs/promises";
|
|
@@ -88708,7 +88564,7 @@ import { tmpdir as tmpdir2 } from "os";
|
|
|
88708
88564
|
import { join as join16 } from "path";
|
|
88709
88565
|
|
|
88710
88566
|
// dist/whole-program-code-aware-vulnerability-scanner/js/dependency-preparation.js
|
|
88711
|
-
var
|
|
88567
|
+
var import_lodash9 = __toESM(require_lodash(), 1);
|
|
88712
88568
|
import { existsSync as existsSync8 } from "fs";
|
|
88713
88569
|
import { mkdir as mkdir6, symlink } from "fs/promises";
|
|
88714
88570
|
import { availableParallelism } from "os";
|
|
@@ -89447,10 +89303,10 @@ var Minipass = class extends EventEmitter2 {
|
|
|
89447
89303
|
* Return a void Promise that resolves once the stream ends.
|
|
89448
89304
|
*/
|
|
89449
89305
|
async promise() {
|
|
89450
|
-
return new Promise((
|
|
89306
|
+
return new Promise((resolve17, reject) => {
|
|
89451
89307
|
this.on(DESTROYED, () => reject(new Error("stream destroyed")));
|
|
89452
89308
|
this.on("error", (er) => reject(er));
|
|
89453
|
-
this.on("end", () =>
|
|
89309
|
+
this.on("end", () => resolve17());
|
|
89454
89310
|
});
|
|
89455
89311
|
}
|
|
89456
89312
|
/**
|
|
@@ -89474,7 +89330,7 @@ var Minipass = class extends EventEmitter2 {
|
|
|
89474
89330
|
return Promise.resolve({ done: false, value: res });
|
|
89475
89331
|
if (this[EOF])
|
|
89476
89332
|
return stop();
|
|
89477
|
-
let
|
|
89333
|
+
let resolve17;
|
|
89478
89334
|
let reject;
|
|
89479
89335
|
const onerr = (er) => {
|
|
89480
89336
|
this.off("data", ondata);
|
|
@@ -89488,19 +89344,19 @@ var Minipass = class extends EventEmitter2 {
|
|
|
89488
89344
|
this.off("end", onend);
|
|
89489
89345
|
this.off(DESTROYED, ondestroy);
|
|
89490
89346
|
this.pause();
|
|
89491
|
-
|
|
89347
|
+
resolve17({ value, done: !!this[EOF] });
|
|
89492
89348
|
};
|
|
89493
89349
|
const onend = () => {
|
|
89494
89350
|
this.off("error", onerr);
|
|
89495
89351
|
this.off("data", ondata);
|
|
89496
89352
|
this.off(DESTROYED, ondestroy);
|
|
89497
89353
|
stop();
|
|
89498
|
-
|
|
89354
|
+
resolve17({ done: true, value: void 0 });
|
|
89499
89355
|
};
|
|
89500
89356
|
const ondestroy = () => onerr(new Error("stream destroyed"));
|
|
89501
89357
|
return new Promise((res2, rej) => {
|
|
89502
89358
|
reject = rej;
|
|
89503
|
-
|
|
89359
|
+
resolve17 = res2;
|
|
89504
89360
|
this.once(DESTROYED, ondestroy);
|
|
89505
89361
|
this.once("error", onerr);
|
|
89506
89362
|
this.once("end", onend);
|
|
@@ -91956,9 +91812,9 @@ var listFile = (opt, _files) => {
|
|
|
91956
91812
|
const parse15 = new Parser3(opt);
|
|
91957
91813
|
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
91958
91814
|
const file = opt.file;
|
|
91959
|
-
const p = new Promise((
|
|
91815
|
+
const p = new Promise((resolve17, reject) => {
|
|
91960
91816
|
parse15.on("error", reject);
|
|
91961
|
-
parse15.on("end",
|
|
91817
|
+
parse15.on("end", resolve17);
|
|
91962
91818
|
fs2.stat(file, (er, stat3) => {
|
|
91963
91819
|
if (er) {
|
|
91964
91820
|
reject(er);
|
|
@@ -94464,9 +94320,9 @@ var extractFile = (opt, _) => {
|
|
|
94464
94320
|
const u = new Unpack(opt);
|
|
94465
94321
|
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
94466
94322
|
const file = opt.file;
|
|
94467
|
-
const p = new Promise((
|
|
94323
|
+
const p = new Promise((resolve17, reject) => {
|
|
94468
94324
|
u.on("error", reject);
|
|
94469
|
-
u.on("close",
|
|
94325
|
+
u.on("close", resolve17);
|
|
94470
94326
|
fs9.stat(file, (er, stat3) => {
|
|
94471
94327
|
if (er) {
|
|
94472
94328
|
reject(er);
|
|
@@ -94600,7 +94456,7 @@ var replaceAsync = (opt, files) => {
|
|
|
94600
94456
|
};
|
|
94601
94457
|
fs10.read(fd, headBuf, 0, 512, position, onread);
|
|
94602
94458
|
};
|
|
94603
|
-
const promise = new Promise((
|
|
94459
|
+
const promise = new Promise((resolve17, reject) => {
|
|
94604
94460
|
p.on("error", reject);
|
|
94605
94461
|
let flag = "r+";
|
|
94606
94462
|
const onopen = (er, fd) => {
|
|
@@ -94625,7 +94481,7 @@ var replaceAsync = (opt, files) => {
|
|
|
94625
94481
|
});
|
|
94626
94482
|
p.pipe(stream4);
|
|
94627
94483
|
stream4.on("error", reject);
|
|
94628
|
-
stream4.on("close",
|
|
94484
|
+
stream4.on("close", resolve17);
|
|
94629
94485
|
addFilesAsync2(p, files);
|
|
94630
94486
|
});
|
|
94631
94487
|
});
|
|
@@ -94704,7 +94560,7 @@ var mtimeFilter = (opt) => {
|
|
|
94704
94560
|
};
|
|
94705
94561
|
|
|
94706
94562
|
// dist/whole-program-code-aware-vulnerability-scanner/js/dependency-preparation.js
|
|
94707
|
-
var { chunk } =
|
|
94563
|
+
var { chunk } = import_lodash9.default;
|
|
94708
94564
|
async function prepareNpmDependencies(subprojectDir, workspaceDir, artifactIdToArtifact, directDependencies, packageNamesToInstall) {
|
|
94709
94565
|
if (existsSync8(resolve8(subprojectDir, "node_modules")))
|
|
94710
94566
|
return { failedPackages: [], installedPackages: [] };
|
|
@@ -94928,6 +94784,122 @@ function computePackagesOnVulnPathExcludingVulnerablePackage(vulnerabilities) {
|
|
|
94928
94784
|
return [...packagesToAnalyze];
|
|
94929
94785
|
}
|
|
94930
94786
|
|
|
94787
|
+
// dist/whole-program-code-aware-vulnerability-scanner/js/jelly-runner.js
|
|
94788
|
+
var import_lodash10 = __toESM(require_lodash(), 1);
|
|
94789
|
+
import { readFile as readFile7, rm as rm2, writeFile as writeFile5 } from "fs/promises";
|
|
94790
|
+
import { relative as relative5, resolve as resolve9 } from "path";
|
|
94791
|
+
var { map: map2, uniq: uniq4 } = import_lodash10.default;
|
|
94792
|
+
var PRINT_JELLY_COMMAND = false;
|
|
94793
|
+
async function runJellyAnalysis(mainProjectRoot, projectRoot, jellyOptions, reachabilityAnalysisOptions, vulnerabilities, experiment) {
|
|
94794
|
+
const tmpFolder = await createTmpDirectory("jelly-analysis");
|
|
94795
|
+
try {
|
|
94796
|
+
const filesToAnalyze = reachabilityAnalysisOptions.entryPoints ? reachabilityAnalysisOptions.entryPoints : [projectRoot];
|
|
94797
|
+
const jellyExecutable = resolve9(COANA_REPOS_PATH(), "jelly-private", "dist", "bundle", "jelly.js");
|
|
94798
|
+
const vulnerabilitiesInJellyFormat = vulnerabilities.map((v) => ({
|
|
94799
|
+
osv: v,
|
|
94800
|
+
patterns: v.vulnerabilityAccessPaths.map((p) => experiment === "AUGMENT_IMPORT_PATHS_EXPERIMENT" ? p.replace(">", "/**>") : p)
|
|
94801
|
+
// Replace > with /**> to ensure Jelly also matches call <PKG/dist/index.js>.foo for pattern <PKG>.foo
|
|
94802
|
+
}));
|
|
94803
|
+
const vulnerabilitiesFile = resolve9(tmpFolder, "vulnerabilities.json");
|
|
94804
|
+
const diagnosticsFile = resolve9(tmpFolder, "diagnostics.json");
|
|
94805
|
+
const matchesFile = resolve9(tmpFolder, "matches.json");
|
|
94806
|
+
const callStackFile = resolve9(tmpFolder, "call-stacks.json");
|
|
94807
|
+
const logFile = reachabilityAnalysisOptions.analysisLogFile ?? (reachabilityAnalysisOptions.printLogFile && resolve9(projectRoot, "js-analysis.log"));
|
|
94808
|
+
await writeFile5(vulnerabilitiesFile, JSON.stringify(vulnerabilitiesInJellyFormat));
|
|
94809
|
+
let excludeEntries;
|
|
94810
|
+
if (reachabilityAnalysisOptions.excludeDirs?.length) {
|
|
94811
|
+
const excludeDirsRelativeToProjectRoot = reachabilityAnalysisOptions.excludeDirs.map((d) => relative5(projectRoot, resolve9(mainProjectRoot, d)));
|
|
94812
|
+
const excludeDirsRelativeToProjectRootWithWildcards = excludeDirsRelativeToProjectRoot.map((d) => `${d}/**`);
|
|
94813
|
+
excludeEntries = [...excludeDirsRelativeToProjectRoot, ...excludeDirsRelativeToProjectRootWithWildcards];
|
|
94814
|
+
}
|
|
94815
|
+
const jellyCmd = [
|
|
94816
|
+
"node",
|
|
94817
|
+
`--max-old-space-size=${reachabilityAnalysisOptions.memoryLimitInMB ?? 8192}`,
|
|
94818
|
+
jellyExecutable,
|
|
94819
|
+
"--basedir",
|
|
94820
|
+
mainProjectRoot,
|
|
94821
|
+
"--timeout",
|
|
94822
|
+
"" + (reachabilityAnalysisOptions.timeoutInSeconds ?? 60),
|
|
94823
|
+
"--vulnerabilities",
|
|
94824
|
+
vulnerabilitiesFile,
|
|
94825
|
+
...excludeEntries ? ["--exclude-entries", ...excludeEntries] : [],
|
|
94826
|
+
"--diagnostics-json",
|
|
94827
|
+
diagnosticsFile,
|
|
94828
|
+
...jellyOptions.maxIndirections ? ["--max-indirections", "" + jellyOptions.maxIndirections] : [],
|
|
94829
|
+
...jellyOptions.includePackages ? ["--include-packages", ...jellyOptions.includePackages] : [],
|
|
94830
|
+
...jellyOptions.approx ? ["--approx"] : [],
|
|
94831
|
+
...logFile ? ["--logfile", logFile] : [],
|
|
94832
|
+
"--matches-file",
|
|
94833
|
+
matchesFile,
|
|
94834
|
+
"--vulnerabilities-callstacks",
|
|
94835
|
+
callStackFile,
|
|
94836
|
+
...filesToAnalyze
|
|
94837
|
+
];
|
|
94838
|
+
if (PRINT_JELLY_COMMAND)
|
|
94839
|
+
logger.info("Jelly command:", jellyCmd.join(" "));
|
|
94840
|
+
await runCommandResolveStdOut(
|
|
94841
|
+
jellyCmd,
|
|
94842
|
+
void 0,
|
|
94843
|
+
// If it is an experimental run, make sure to crash the process if Jelly takes more than 50% longer than the timeout.
|
|
94844
|
+
// This is done to mitigate the scenario where the Jelly process gets close to the memory limit and thus ends up spending most of its time on garbage collection, which can increase the time between timeout checks dramatically.
|
|
94845
|
+
experiment && reachabilityAnalysisOptions.timeoutInSeconds ? { timeout: reachabilityAnalysisOptions.timeoutInSeconds * 1e3 * 1.5 } : void 0
|
|
94846
|
+
);
|
|
94847
|
+
if (reachabilityAnalysisOptions.printLogFile)
|
|
94848
|
+
logger.info("JS analysis log file:", await readFile7(logFile, "utf-8"));
|
|
94849
|
+
const analysisDiagnostics = JSON.parse(await readFile7(diagnosticsFile, "utf-8"));
|
|
94850
|
+
analysisDiagnostics.time = analysisDiagnostics.analysisTime;
|
|
94851
|
+
delete analysisDiagnostics.analysisTime;
|
|
94852
|
+
analysisDiagnostics.timings = {
|
|
94853
|
+
analysisTime: analysisDiagnostics.time,
|
|
94854
|
+
patternMatchingTime: analysisDiagnostics.patternMatchingTime
|
|
94855
|
+
};
|
|
94856
|
+
const callStacks = JSON.parse(await readFile7(callStackFile, "utf-8"));
|
|
94857
|
+
const matches = {};
|
|
94858
|
+
for (const { vulnerability, paths } of callStacks) {
|
|
94859
|
+
const transformedStacks = transformJellyCallStacks(projectRoot, paths);
|
|
94860
|
+
if (matches[vulnerability.osv.url]) {
|
|
94861
|
+
matches[vulnerability.osv.url].stacks.push(...transformedStacks.stacks);
|
|
94862
|
+
} else
|
|
94863
|
+
matches[vulnerability.osv.url] = transformedStacks;
|
|
94864
|
+
}
|
|
94865
|
+
return {
|
|
94866
|
+
matches,
|
|
94867
|
+
analysisDiagnostics
|
|
94868
|
+
};
|
|
94869
|
+
} finally {
|
|
94870
|
+
await rm2(tmpFolder, { recursive: true });
|
|
94871
|
+
}
|
|
94872
|
+
}
|
|
94873
|
+
async function runJellyPhantomDependencyAnalysis(projectRoot, options) {
|
|
94874
|
+
const tmpFolder = await createTmpDirectory("jelly-analysis");
|
|
94875
|
+
try {
|
|
94876
|
+
const jellyExecutable = resolve9(COANA_REPOS_PATH(), "jelly-private", "dist", "bundle", "jelly.js");
|
|
94877
|
+
const reachablePackagesFile = resolve9(tmpFolder, "reachable-packages.json");
|
|
94878
|
+
const jellyCmd = cmdt`node --max-old-space-size=${options.memoryLimitInMB}
|
|
94879
|
+
${jellyExecutable} --basedir ${projectRoot} --modules-only --ignore-dependencies
|
|
94880
|
+
--reachable-packages-file ${reachablePackagesFile} ${projectRoot}`;
|
|
94881
|
+
await runCommandResolveStdOut(jellyCmd);
|
|
94882
|
+
return JSON.parse(await readFile7(reachablePackagesFile, "utf-8"));
|
|
94883
|
+
} finally {
|
|
94884
|
+
await rm2(tmpFolder, { recursive: true });
|
|
94885
|
+
}
|
|
94886
|
+
}
|
|
94887
|
+
function relativizeSourceLocations(projectDir, paths) {
|
|
94888
|
+
return {
|
|
94889
|
+
...paths,
|
|
94890
|
+
stacks: paths.stacks.map((stack) => stack.map((s2) => ({
|
|
94891
|
+
...s2,
|
|
94892
|
+
sourceLocation: { ...s2.sourceLocation, filename: relative5(projectDir, s2.sourceLocation.filename) }
|
|
94893
|
+
})))
|
|
94894
|
+
};
|
|
94895
|
+
}
|
|
94896
|
+
function transformJellyCallStacks(projectRoot, paths) {
|
|
94897
|
+
return {
|
|
94898
|
+
...relativizeSourceLocations(projectRoot, paths),
|
|
94899
|
+
affectedPackages: uniq4(paths.stacks.flatMap((stack) => map2(stack, "package")))
|
|
94900
|
+
};
|
|
94901
|
+
}
|
|
94902
|
+
|
|
94931
94903
|
// dist/whole-program-code-aware-vulnerability-scanner/js/js-code-aware-vulnerability-scanner.js
|
|
94932
94904
|
var JSCodeAwareVulnerabilityScanner = class _JSCodeAwareVulnerabilityScanner {
|
|
94933
94905
|
mainProjectDir;
|
|
@@ -94969,7 +94941,7 @@ var JSCodeAwareVulnerabilityScanner = class _JSCodeAwareVulnerabilityScanner {
|
|
|
94969
94941
|
computeDetectedOccurrences: ({ url: url2 }) => transformSourceLocations3(matches[url2] ?? [])
|
|
94970
94942
|
};
|
|
94971
94943
|
} catch (e) {
|
|
94972
|
-
logger.
|
|
94944
|
+
logger.debug("Error while running analysis: ", e.stack);
|
|
94973
94945
|
return { type: "error", message: e.message };
|
|
94974
94946
|
} finally {
|
|
94975
94947
|
this.numberAnalysesRun++;
|
|
@@ -95103,7 +95075,7 @@ import assert4 from "assert";
|
|
|
95103
95075
|
import { existsSync as existsSync9, createReadStream, createWriteStream as createWriteStream2 } from "fs";
|
|
95104
95076
|
import { readFile as readFile8, rm as rm4, cp as cp4 } from "fs/promises";
|
|
95105
95077
|
import zlib2 from "zlib";
|
|
95106
|
-
import { join as join17, resolve as
|
|
95078
|
+
import { join as join17, resolve as resolve10, sep } from "path";
|
|
95107
95079
|
|
|
95108
95080
|
// dist/whole-program-code-aware-vulnerability-scanner/go/heuristics.js
|
|
95109
95081
|
var GoanaHeuristics = {
|
|
@@ -95207,7 +95179,7 @@ ${stderr}`);
|
|
|
95207
95179
|
const projectDir = await createTmpDirectory("go-run-on-dependency-chain-");
|
|
95208
95180
|
try {
|
|
95209
95181
|
await cp4(Dir, projectDir, { recursive: true });
|
|
95210
|
-
const projGoMod =
|
|
95182
|
+
const projGoMod = resolve10(projectDir, "go.mod");
|
|
95211
95183
|
if (!existsSync9(projGoMod))
|
|
95212
95184
|
await cp4(GoMod, projGoMod);
|
|
95213
95185
|
await exec(cmdt`chmod --recursive +w ${projectDir}`);
|
|
@@ -96408,7 +96380,7 @@ async function runWithJSHeuristics(cb) {
|
|
|
96408
96380
|
return result;
|
|
96409
96381
|
}
|
|
96410
96382
|
async function getCurrentCommitHash(project) {
|
|
96411
|
-
return (await runCommandResolveStdOut("git rev-parse HEAD",
|
|
96383
|
+
return (await runCommandResolveStdOut("git rev-parse HEAD", resolve11(COANA_REPOS_PATH(), project))).trim();
|
|
96412
96384
|
}
|
|
96413
96385
|
function detectedOccurrencesFromAPMatches(matches, pathPrefixToRemove) {
|
|
96414
96386
|
for (const match of Object.values(matches))
|
|
@@ -96575,10 +96547,13 @@ ${errors.join("\n")}`);
|
|
|
96575
96547
|
var trunc = trunc2;
|
|
96576
96548
|
const exc = e;
|
|
96577
96549
|
msg = util5.format("Error running mambalade:\n%O\nStdout:\n%s\nStderr:\n%s", pick(exc, ["code", "signal"]), trunc2(exc.stdout), trunc2(exc.stderr));
|
|
96578
|
-
if (exc.signal ?? (exc.stderr.endsWith("MemoryError\n") || exc.stderr.includes("OSError: [Errno 12] Cannot allocate memory")))
|
|
96550
|
+
if (exc.signal ?? (exc.stderr.endsWith("MemoryError\n") || exc.stderr.includes("OSError: [Errno 12] Cannot allocate memory"))) {
|
|
96579
96551
|
msg = `Mambalade ran out of memory:
|
|
96580
96552
|
${msg}`;
|
|
96581
|
-
|
|
96553
|
+
logger.debug(msg);
|
|
96554
|
+
} else {
|
|
96555
|
+
logger.error(msg);
|
|
96556
|
+
}
|
|
96582
96557
|
} else
|
|
96583
96558
|
logger.error("Unexpected error:", e);
|
|
96584
96559
|
return { type: "error", message: msg };
|
|
@@ -96663,7 +96638,7 @@ ${msg}`;
|
|
|
96663
96638
|
}
|
|
96664
96639
|
// public for testing only
|
|
96665
96640
|
async tryUsingPreinstalledVirtualEnv(packages) {
|
|
96666
|
-
const preinstallVirtualEnvPath =
|
|
96641
|
+
const preinstallVirtualEnvPath = resolve12(this.projectDir, ".venv");
|
|
96667
96642
|
if (!existsSync10(preinstallVirtualEnvPath))
|
|
96668
96643
|
return false;
|
|
96669
96644
|
logger.info(`Checking preinstalled virtual environment at ${preinstallVirtualEnvPath}`);
|
|
@@ -96864,7 +96839,7 @@ async function processVenv(venvDir) {
|
|
|
96864
96839
|
const nodeToPackage = /* @__PURE__ */ new Map();
|
|
96865
96840
|
const root3 = mkTrie();
|
|
96866
96841
|
await asyncForEach(Object.entries(installedPackages), async ([packageName, { distInfoDir }]) => {
|
|
96867
|
-
const record =
|
|
96842
|
+
const record = resolve13(venvDir, distInfoDir, "RECORD");
|
|
96868
96843
|
if (!await exists(record))
|
|
96869
96844
|
return;
|
|
96870
96845
|
const files = (await fs11.readFile(record, "utf-8")).split("\n").map((line) => line.split(",", 1)[0]);
|
|
@@ -96959,7 +96934,7 @@ var PipAnalyzer = class {
|
|
|
96959
96934
|
} else if (workspaceData.type === "socket") {
|
|
96960
96935
|
declaredDeps = new Set(workspaceData.data.artifacts.map((a2) => normalizePackageName(a2.name)));
|
|
96961
96936
|
}
|
|
96962
|
-
return (await findDirectDependencies(
|
|
96937
|
+
return (await findDirectDependencies(resolve14(subprojectDir, workspacePath), resolve14(info.virtualEnvFolder, ".venv"))).filter((d) => !declaredDeps.has(d));
|
|
96963
96938
|
}
|
|
96964
96939
|
async runReachabilityAnalysis(vulns, analysisMetadataCollector, statusUpdater) {
|
|
96965
96940
|
try {
|
|
@@ -97009,7 +96984,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97009
96984
|
let analysisNumber = 0;
|
|
97010
96985
|
const newAnalysisRunListener = () => statusUpdater?.(`Static analysis run number ${++analysisNumber} in progress...`);
|
|
97011
96986
|
const ecosystem = vulnerabilities[0].ecosystem ?? "NPM";
|
|
97012
|
-
const expHeuristicName = process.env.ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES === "true" ? "ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES" : await getExperimentName(
|
|
96987
|
+
const expHeuristicName = process.env.ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES === "true" ? "ONLY_APPLICATION_SOURCE_FILES_FOR_KNOWN_LANGUAGES" : await getExperimentName(relative6(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, ecosystem, COANA_REPORT_ID, apiKey);
|
|
97013
96988
|
let bucketsToAnalyze = state.otherAnalysisOptions.lightweightReachability ? void 0 : await getBucketsBasedOnPreviousResults();
|
|
97014
96989
|
let useExperimentalHeuristic = Boolean(expHeuristicName && bucketsToAnalyze);
|
|
97015
96990
|
if (!bucketsToAnalyze)
|
|
@@ -97044,7 +97019,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97044
97019
|
}
|
|
97045
97020
|
async function analyzeWithExperimentalHeuristic(buckets) {
|
|
97046
97021
|
try {
|
|
97047
|
-
const previousAnalysisResults = await getPreviousAnalysisResults(
|
|
97022
|
+
const previousAnalysisResults = await getPreviousAnalysisResults(relative6(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, COANA_REPORT_ID, apiKey);
|
|
97048
97023
|
if (!expHeuristicName || !previousAnalysisResults)
|
|
97049
97024
|
return;
|
|
97050
97025
|
const experimentalRes = await analyzeAndAugmentVulns(buckets, void 0, true, expHeuristicName);
|
|
@@ -97080,7 +97055,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97080
97055
|
} catch (e) {
|
|
97081
97056
|
logger.warn("Error while running experimental heuristic - scan will continue in normal mode.", e);
|
|
97082
97057
|
sendWarningToDashboard("Error while running experimental heuristic", {
|
|
97083
|
-
subprojectPath:
|
|
97058
|
+
subprojectPath: relative6(state.rootWorkingDir, state.subprojectDir) || ".",
|
|
97084
97059
|
workspacePath: state.workspacePath,
|
|
97085
97060
|
errorMessage: e.message,
|
|
97086
97061
|
errorStack: e.stack
|
|
@@ -97091,7 +97066,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97091
97066
|
async function getBucketsBasedOnPreviousResults() {
|
|
97092
97067
|
if (state.otherAnalysisOptions.skipCacheUsage || !SOCKET_MODE && (!COANA_REPORT_ID || apiKey.type === "missing"))
|
|
97093
97068
|
return void 0;
|
|
97094
|
-
const bucketsFromLastAnalysisAndCliVersion = await dashboardAPI.getBucketsForLastReport(
|
|
97069
|
+
const bucketsFromLastAnalysisAndCliVersion = await dashboardAPI.getBucketsForLastReport(relative6(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, vulnerabilities[0].ecosystem ?? "NPM", COANA_REPORT_ID, apiKey);
|
|
97095
97070
|
if (!bucketsFromLastAnalysisAndCliVersion)
|
|
97096
97071
|
return void 0;
|
|
97097
97072
|
const { cliVersion, buckets: bucketsFromLastAnalysis } = bucketsFromLastAnalysisAndCliVersion;
|
|
@@ -97106,7 +97081,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97106
97081
|
const duplicateUrls = findDuplicateVulnsInBuckets(bucketsFromLastAnalysis);
|
|
97107
97082
|
if (duplicateUrls.length > 0) {
|
|
97108
97083
|
sendWarningToDashboard(`Assertion error: Detected bucket(s) with non-unique vulnerability URLs. Non-unique URLs: ${duplicateUrls.join(" ")}.`, {
|
|
97109
|
-
subprojectPath:
|
|
97084
|
+
subprojectPath: relative6(state.rootWorkingDir, state.subprojectDir) || ".",
|
|
97110
97085
|
workspacePath: state.workspacePath
|
|
97111
97086
|
}, bucketsFromLastAnalysisAndCliVersion, COANA_REPORT_ID, apiKey);
|
|
97112
97087
|
return void 0;
|
|
@@ -97247,7 +97222,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97247
97222
|
const oldMd = oldAnalysisMetadata.find((oldMd2) => newMd.vulnUrls.some((vulnUrl) => oldMd2.vulnUrls.includes(vulnUrl)));
|
|
97248
97223
|
if (!oldMd) {
|
|
97249
97224
|
sendWarningToDashboard("Could not find corresponding analysis metadata to compare time regressions with", {
|
|
97250
|
-
subprojectPath:
|
|
97225
|
+
subprojectPath: relative6(state.rootWorkingDir, state.subprojectDir) || ".",
|
|
97251
97226
|
workspacePath: state.workspacePath
|
|
97252
97227
|
}, void 0, COANA_REPORT_ID, apiKey);
|
|
97253
97228
|
return;
|
|
@@ -97274,7 +97249,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97274
97249
|
});
|
|
97275
97250
|
if (regressions.length === 0)
|
|
97276
97251
|
return;
|
|
97277
|
-
sendRegressionsToDashboard(regressions,
|
|
97252
|
+
sendRegressionsToDashboard(regressions, relative6(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, COANA_REPORT_ID, apiKey);
|
|
97278
97253
|
}
|
|
97279
97254
|
function sendReachabilityRegressionsToDashboard(heuristicName, experimentName, origRes, experimentRes) {
|
|
97280
97255
|
const regressions = Object.keys(origRes).filter((vulnUrl) => experimentRes[vulnUrl] && origRes[vulnUrl] !== experimentRes[vulnUrl]).map((vulnUrl) => ({
|
|
@@ -97286,7 +97261,7 @@ async function analyzeWithHeuristics(state, vulns, heuristicsInOrder, doNotRecom
|
|
|
97286
97261
|
originalResult: origRes[vulnUrl],
|
|
97287
97262
|
experimentResult: experimentRes[vulnUrl]
|
|
97288
97263
|
}));
|
|
97289
|
-
sendRegressionsToDashboard(regressions,
|
|
97264
|
+
sendRegressionsToDashboard(regressions, relative6(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, COANA_REPORT_ID, apiKey);
|
|
97290
97265
|
}
|
|
97291
97266
|
}
|
|
97292
97267
|
function getHeuristicFromName(state, heuristicName, ecosystem) {
|
|
@@ -97439,7 +97414,7 @@ var MavenAnalyzer = class {
|
|
|
97439
97414
|
// dist/analyzers/npm-analyzer.js
|
|
97440
97415
|
import { existsSync as existsSync11 } from "fs";
|
|
97441
97416
|
import { rm as rm6 } from "fs/promises";
|
|
97442
|
-
import { resolve as
|
|
97417
|
+
import { resolve as resolve15 } from "path";
|
|
97443
97418
|
var NpmAnalyzer = class {
|
|
97444
97419
|
state;
|
|
97445
97420
|
projectDir;
|
|
@@ -97449,9 +97424,9 @@ var NpmAnalyzer = class {
|
|
|
97449
97424
|
}
|
|
97450
97425
|
async runPhantomDependencyAnalysis() {
|
|
97451
97426
|
try {
|
|
97452
|
-
return (await runJellyPhantomDependencyAnalysis(this.projectDir)).map((r) => r.name);
|
|
97427
|
+
return (await runJellyPhantomDependencyAnalysis(this.projectDir, this.state.reachabilityAnalysisOptions)).map((r) => r.name);
|
|
97453
97428
|
} catch (e) {
|
|
97454
|
-
|
|
97429
|
+
logger.debug("Error while running jelly phantom dependency analysis: ", e);
|
|
97455
97430
|
}
|
|
97456
97431
|
}
|
|
97457
97432
|
async runReachabilityAnalysis(vulns, analysisMetadataCollector, statusUpdater) {
|
|
@@ -97461,16 +97436,16 @@ var NpmAnalyzer = class {
|
|
|
97461
97436
|
heuristics.ONLY_VULN_PATH_PACKAGES_EXCEPT_VULNERABLE_PACKAGE_AND_MAX_ROUNDS_2
|
|
97462
97437
|
];
|
|
97463
97438
|
const vulnerabilityScanner = new JSCodeAwareVulnerabilityScanner(this.state.rootWorkingDir, this.projectDir, this.state.reachabilityAnalysisOptions);
|
|
97464
|
-
const nodeModulesAlreadyExisted = existsSync11(
|
|
97439
|
+
const nodeModulesAlreadyExisted = existsSync11(resolve15(this.state.subprojectDir, "node_modules"));
|
|
97465
97440
|
try {
|
|
97466
97441
|
await vulnerabilityScanner.prepareDependencies(this.state, heuristicsInOrder[0]);
|
|
97467
97442
|
return await analyzeWithHeuristics(this.state, vulns, heuristicsInOrder, true, vulnerabilityScanner, analysisMetadataCollector, statusUpdater);
|
|
97468
97443
|
} finally {
|
|
97469
97444
|
if (!nodeModulesAlreadyExisted) {
|
|
97470
|
-
if (existsSync11(
|
|
97471
|
-
await rm6(
|
|
97472
|
-
if (existsSync11(
|
|
97473
|
-
await rm6(
|
|
97445
|
+
if (existsSync11(resolve15(this.state.subprojectDir, "node_modules")))
|
|
97446
|
+
await rm6(resolve15(this.state.subprojectDir, "node_modules"), { recursive: true });
|
|
97447
|
+
if (existsSync11(resolve15(this.projectDir, "node_modules")))
|
|
97448
|
+
await rm6(resolve15(this.projectDir, "node_modules"), { recursive: true });
|
|
97474
97449
|
}
|
|
97475
97450
|
}
|
|
97476
97451
|
}
|
|
@@ -97518,46 +97493,6 @@ var RustAnalyzer = class {
|
|
|
97518
97493
|
}
|
|
97519
97494
|
};
|
|
97520
97495
|
|
|
97521
|
-
// dist/apply-precomputed-reachability-results.js
|
|
97522
|
-
async function addPrecomputedResultsToVulnerabilities(analyzer, vulnerabilities) {
|
|
97523
|
-
const phantomDependencies = await analyzer.runPhantomDependencyAnalysis();
|
|
97524
|
-
if (!phantomDependencies)
|
|
97525
|
-
return;
|
|
97526
|
-
await applySeries(vulnerabilities, async (v) => {
|
|
97527
|
-
const dismissVulnerability = canDismissVulnerability(phantomDependencies, v.vulnChainDetails);
|
|
97528
|
-
v.unreachableByPrecomputation = dismissVulnerability ? "YES" : "NO";
|
|
97529
|
-
});
|
|
97530
|
-
}
|
|
97531
|
-
function canDismissVulnerability(phantomDependencies, vulnChainDetails) {
|
|
97532
|
-
const parentsMap = computeParentsMap(vulnChainDetails);
|
|
97533
|
-
const [vulnNodeIdentifier] = Object.entries(vulnChainDetails.transitiveDependencies).find(([_identifier, node]) => node.vulnerable);
|
|
97534
|
-
let canDismiss = true;
|
|
97535
|
-
const recHelper = (nodeIdentifier, depth) => {
|
|
97536
|
-
if (depth === 0)
|
|
97537
|
-
return void 0;
|
|
97538
|
-
const parents3 = parentsMap.get(nodeIdentifier).filter((parent2) => parent2 !== ROOT_NODE_STR);
|
|
97539
|
-
const thisReachabilityPrecomp = nodeIdentifier === vulnNodeIdentifier ? "Reachable" : vulnChainDetails.transitiveDependencies[nodeIdentifier].reachabilityPrecomp;
|
|
97540
|
-
if (!thisReachabilityPrecomp)
|
|
97541
|
-
return void 0;
|
|
97542
|
-
const thisMayReachVulnerableNode = ["Reachable", "Unknown"].includes(thisReachabilityPrecomp);
|
|
97543
|
-
if (parents3.length === 0 && thisMayReachVulnerableNode) {
|
|
97544
|
-
canDismiss = false;
|
|
97545
|
-
}
|
|
97546
|
-
if (parents3) {
|
|
97547
|
-
const parentsReachabilityPrecomp = parents3.map((p) => recHelper(p, depth - 1));
|
|
97548
|
-
if (parentsReachabilityPrecomp.some((reachabilityPrecomp) => !reachabilityPrecomp) && thisMayReachVulnerableNode) {
|
|
97549
|
-
canDismiss = false;
|
|
97550
|
-
}
|
|
97551
|
-
}
|
|
97552
|
-
if (thisMayReachVulnerableNode && phantomDependencies.includes(nodeIdentifier)) {
|
|
97553
|
-
canDismiss = false;
|
|
97554
|
-
}
|
|
97555
|
-
return thisReachabilityPrecomp;
|
|
97556
|
-
};
|
|
97557
|
-
recHelper(vulnNodeIdentifier, 5);
|
|
97558
|
-
return canDismiss;
|
|
97559
|
-
}
|
|
97560
|
-
|
|
97561
97496
|
// dist/main.js
|
|
97562
97497
|
var { partition: partition3 } = import_lodash19.default;
|
|
97563
97498
|
var ecosystemAnalyzer = {
|
|
@@ -97571,20 +97506,16 @@ var ecosystemAnalyzer = {
|
|
|
97571
97506
|
var apiKey2 = COANA_API_KEY ? { type: "present", value: COANA_API_KEY } : { type: "missing" };
|
|
97572
97507
|
var dashboardAPI2 = new DashboardAPI(process.env.SOCKET_MODE === "true", process.env.DISABLE_ANALYTICS_SHARING === "true");
|
|
97573
97508
|
async function runReachabilityAnalysis(state) {
|
|
97574
|
-
const projectDir =
|
|
97509
|
+
const projectDir = resolve16(state.subprojectDir, state.workspacePath);
|
|
97575
97510
|
const ecosystem = state.workspaceData.data.type;
|
|
97576
|
-
logger.info(`Preparing for running reachability analysis for project at "${
|
|
97511
|
+
logger.info(`Preparing for running reachability analysis for project at "${relative7(state.rootWorkingDir, projectDir) || "."}" (${ecosystem})`);
|
|
97577
97512
|
const constructor = ecosystemAnalyzer[ecosystem];
|
|
97578
97513
|
if (!constructor)
|
|
97579
97514
|
throw Error(`No analyzer associated with ecosystem ${ecosystem}`);
|
|
97580
97515
|
const analyzer = new constructor(state, projectDir);
|
|
97581
|
-
try {
|
|
97582
|
-
await addPrecomputedResultsToVulnerabilities(analyzer, state.vulnerabilities);
|
|
97583
|
-
} catch (e) {
|
|
97584
|
-
}
|
|
97585
97516
|
const [vulnerabilitiesWithPrecomputedResults, vulnerabilitiesWithoutPrecomputedResults] = partition3(state.vulnerabilities, (v) => "results" in v);
|
|
97586
97517
|
const augmentedVulnerabilities = await runWholeProgramCodeAwareVulnerabilityScanner(analyzer, vulnerabilitiesWithoutPrecomputedResults, async (amd) => {
|
|
97587
|
-
await dashboardAPI2.registerAnalysisMetadata(
|
|
97518
|
+
await dashboardAPI2.registerAnalysisMetadata(relative7(state.rootWorkingDir, state.subprojectDir) || ".", state.workspacePath, state.workspaceData.data.type, amd, COANA_REPORT_ID, apiKey2);
|
|
97588
97519
|
});
|
|
97589
97520
|
return [...vulnerabilitiesWithPrecomputedResults, ...augmentedVulnerabilities];
|
|
97590
97521
|
}
|