snyk 1.1061.0 → 1.1063.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/263.index.js +12 -59
- package/dist/cli/263.index.js.map +1 -1
- package/dist/cli/784.index.js +9 -17
- package/dist/cli/784.index.js.map +1 -1
- package/dist/cli/thirdPartyNotice.json +2 -2
- package/dist/lib/code-config.d.ts +0 -1
- package/dist/lib/ecosystems/unmanaged/types.d.ts +1 -0
- package/dist/lib/init.gradle +21 -8
- package/package.json +1 -1
package/dist/cli/263.index.js
CHANGED
|
@@ -5797,7 +5797,7 @@ async function* prepareRemoteBundle(options) {
|
|
|
5797
5797
|
emitter_1.emitter.createBundleProgress(cumulativeProgress, options.files.length);
|
|
5798
5798
|
for (const chunkedFiles of (0, files_1.composeFilePayloads)(options.files, constants_1.MAX_PAYLOAD)) {
|
|
5799
5799
|
const apiParams = {
|
|
5800
|
-
...(0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'removedFiles', 'requestId', '
|
|
5800
|
+
...(0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'removedFiles', 'requestId', 'org']),
|
|
5801
5801
|
files: chunkedFiles.reduce((d, f) => {
|
|
5802
5802
|
// deepcode ignore PrototypePollution: FP this is an internal code
|
|
5803
5803
|
d[f.bundlePath] = f.hash;
|
|
@@ -5832,15 +5832,7 @@ async function* prepareRemoteBundle(options) {
|
|
|
5832
5832
|
async function uploadRemoteBundle(options) {
|
|
5833
5833
|
let uploadedFiles = 0;
|
|
5834
5834
|
emitter_1.emitter.uploadBundleProgress(0, options.files.length);
|
|
5835
|
-
const apiParams = (0, lodash_pick_1.default)(options, [
|
|
5836
|
-
'baseURL',
|
|
5837
|
-
'sessionToken',
|
|
5838
|
-
'source',
|
|
5839
|
-
'bundleHash',
|
|
5840
|
-
'requestId',
|
|
5841
|
-
'base64Encoding',
|
|
5842
|
-
'org',
|
|
5843
|
-
]);
|
|
5835
|
+
const apiParams = (0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'bundleHash', 'requestId', 'org']);
|
|
5844
5836
|
const uploadFileChunks = async (bucketFiles) => {
|
|
5845
5837
|
// Note: we specifically create __new__ isolated bundles here to faster files upload
|
|
5846
5838
|
const resp = await (0, http_1.createBundle)({
|
|
@@ -5869,7 +5861,7 @@ async function fullfillRemoteBundle(options) {
|
|
|
5869
5861
|
// Check remove bundle to make sure no missing files left
|
|
5870
5862
|
let attempts = 0;
|
|
5871
5863
|
let { remoteBundle } = options;
|
|
5872
|
-
const connectionOptions = (0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'requestId', '
|
|
5864
|
+
const connectionOptions = (0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'requestId', 'org']);
|
|
5873
5865
|
while (remoteBundle.missingFiles.length && attempts < (options.maxAttempts || constants_1.MAX_UPLOAD_ATTEMPTS)) {
|
|
5874
5866
|
const missingFiles = await (0, files_1.resolveBundleFiles)(options.baseDir, remoteBundle.missingFiles);
|
|
5875
5867
|
await uploadRemoteBundle({
|
|
@@ -5889,15 +5881,7 @@ async function fullfillRemoteBundle(options) {
|
|
|
5889
5881
|
}
|
|
5890
5882
|
async function remoteBundleFactory(options) {
|
|
5891
5883
|
let remoteBundle = null;
|
|
5892
|
-
const baseOptions = (0, lodash_pick_1.default)(options, [
|
|
5893
|
-
'baseURL',
|
|
5894
|
-
'sessionToken',
|
|
5895
|
-
'source',
|
|
5896
|
-
'baseDir',
|
|
5897
|
-
'requestId',
|
|
5898
|
-
'base64Encoding',
|
|
5899
|
-
'org',
|
|
5900
|
-
]);
|
|
5884
|
+
const baseOptions = (0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'baseDir', 'requestId', 'org']);
|
|
5901
5885
|
const bundleFactory = prepareRemoteBundle((0, lodash_omit_1.default)(options, ['baseDir']));
|
|
5902
5886
|
for await (const response of bundleFactory) {
|
|
5903
5887
|
if (response.type === 'error') {
|
|
@@ -5969,7 +5953,7 @@ async function createBundleFromFolders(options) {
|
|
|
5969
5953
|
emitter_1.emitter.scanFilesProgress(totalFiles);
|
|
5970
5954
|
}
|
|
5971
5955
|
const bundleOptions = {
|
|
5972
|
-
...(0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'requestId'
|
|
5956
|
+
...(0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'requestId']),
|
|
5973
5957
|
baseDir,
|
|
5974
5958
|
files: bundleFiles,
|
|
5975
5959
|
...(((_b = (_a = options.analysisContext) === null || _a === void 0 ? void 0 : _a.org) === null || _b === void 0 ? void 0 : _b.name) ? { org: options.analysisContext.org.name } : {}),
|
|
@@ -6627,14 +6611,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6627
6611
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6628
6612
|
};
|
|
6629
6613
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
6630
|
-
exports.getVerifyCallbackUrl = exports.getAnalysis = exports.AnalysisStatus = exports.extendBundle = exports.checkBundle = exports.createBundle = exports.getFilters = exports.checkSession = exports.getIpFamily = exports.startSession = exports.compressAndEncode =
|
|
6614
|
+
exports.getVerifyCallbackUrl = exports.getAnalysis = exports.AnalysisStatus = exports.extendBundle = exports.checkBundle = exports.createBundle = exports.getFilters = exports.checkSession = exports.getIpFamily = exports.startSession = exports.compressAndEncode = void 0;
|
|
6631
6615
|
const uuid_1 = __webpack_require__(42277);
|
|
6632
6616
|
const lodash_pick_1 = __importDefault(__webpack_require__(25030));
|
|
6633
6617
|
const zlib_1 = __webpack_require__(78761);
|
|
6634
6618
|
const util_1 = __webpack_require__(31669);
|
|
6635
6619
|
const constants_1 = __webpack_require__(65765);
|
|
6636
6620
|
const needle_1 = __webpack_require__(14577);
|
|
6637
|
-
const url_1 = __webpack_require__(78835);
|
|
6638
6621
|
// The trick to typecast union type alias
|
|
6639
6622
|
function isSubsetErrorCode(code, messages) {
|
|
6640
6623
|
if (code in messages) {
|
|
@@ -6665,22 +6648,6 @@ const GENERIC_ERROR_MESSAGES = {
|
|
|
6665
6648
|
[constants_1.ErrorCodes.dnsNotFound]: constants_1.DEFAULT_ERROR_MESSAGES[constants_1.ErrorCodes.dnsNotFound],
|
|
6666
6649
|
[constants_1.ErrorCodes.connectionRefused]: constants_1.DEFAULT_ERROR_MESSAGES[constants_1.ErrorCodes.connectionRefused],
|
|
6667
6650
|
};
|
|
6668
|
-
function setBase64Encoding(options) {
|
|
6669
|
-
if (!options.base64Encoding) {
|
|
6670
|
-
const { hostname } = new url_1.URL(options.baseURL);
|
|
6671
|
-
const rg = new RegExp('^(|dev.)snyk.io');
|
|
6672
|
-
if (rg.test(hostname.slice(hostname.indexOf('.') + 1))) {
|
|
6673
|
-
return options.base64Encoding;
|
|
6674
|
-
}
|
|
6675
|
-
else {
|
|
6676
|
-
return true;
|
|
6677
|
-
}
|
|
6678
|
-
}
|
|
6679
|
-
else {
|
|
6680
|
-
return options.base64Encoding;
|
|
6681
|
-
}
|
|
6682
|
-
}
|
|
6683
|
-
exports.setBase64Encoding = setBase64Encoding;
|
|
6684
6651
|
async function compressAndEncode(payload) {
|
|
6685
6652
|
// encode payload and compress;
|
|
6686
6653
|
const deflate = (0, util_1.promisify)(zlib_1.gzip);
|
|
@@ -6770,26 +6737,19 @@ const CREATE_BUNDLE_ERROR_MESSAGES = {
|
|
|
6770
6737
|
[constants_1.ErrorCodes.notFound]: 'Unable to resolve requested oid',
|
|
6771
6738
|
};
|
|
6772
6739
|
async function createBundle(options) {
|
|
6773
|
-
const
|
|
6774
|
-
let payloadBody;
|
|
6775
|
-
if (base64Encoding) {
|
|
6776
|
-
payloadBody = await compressAndEncode(options.files);
|
|
6777
|
-
}
|
|
6778
|
-
else {
|
|
6779
|
-
payloadBody = options.files;
|
|
6780
|
-
}
|
|
6740
|
+
const payloadBody = await compressAndEncode(options.files);
|
|
6781
6741
|
const payload = {
|
|
6782
6742
|
headers: {
|
|
6783
6743
|
...prepareTokenHeaders(options.sessionToken),
|
|
6784
6744
|
source: options.source,
|
|
6785
6745
|
...(options.requestId && { 'snyk-request-id': options.requestId }),
|
|
6786
|
-
...
|
|
6746
|
+
...{ 'content-type': 'application/octet-stream', 'content-encoding': 'gzip' },
|
|
6787
6747
|
...(options.org && { 'snyk-org-name': options.org }),
|
|
6788
6748
|
},
|
|
6789
6749
|
url: `${options.baseURL}/bundle`,
|
|
6790
6750
|
method: 'post',
|
|
6791
6751
|
body: payloadBody,
|
|
6792
|
-
isJson:
|
|
6752
|
+
isJson: false,
|
|
6793
6753
|
};
|
|
6794
6754
|
const res = await (0, needle_1.makeRequest)(payload);
|
|
6795
6755
|
if (res.success) {
|
|
@@ -6829,26 +6789,19 @@ const EXTEND_BUNDLE_ERROR_MESSAGES = {
|
|
|
6829
6789
|
[constants_1.ErrorCodes.notFound]: 'Parent bundle has expired',
|
|
6830
6790
|
};
|
|
6831
6791
|
async function extendBundle(options) {
|
|
6832
|
-
const
|
|
6833
|
-
let payloadBody;
|
|
6834
|
-
if (base64Encoding) {
|
|
6835
|
-
payloadBody = await compressAndEncode((0, lodash_pick_1.default)(options, ['files', 'removedFiles']));
|
|
6836
|
-
}
|
|
6837
|
-
else {
|
|
6838
|
-
payloadBody = (0, lodash_pick_1.default)(options, ['files', 'removedFiles']);
|
|
6839
|
-
}
|
|
6792
|
+
const payloadBody = await compressAndEncode((0, lodash_pick_1.default)(options, ['files', 'removedFiles']));
|
|
6840
6793
|
const res = await (0, needle_1.makeRequest)({
|
|
6841
6794
|
headers: {
|
|
6842
6795
|
...prepareTokenHeaders(options.sessionToken),
|
|
6843
6796
|
source: options.source,
|
|
6844
6797
|
...(options.requestId && { 'snyk-request-id': options.requestId }),
|
|
6845
|
-
...
|
|
6798
|
+
...{ 'content-type': 'application/octet-stream', 'content-encoding': 'gzip' },
|
|
6846
6799
|
...(options.org && { 'snyk-org-name': options.org }),
|
|
6847
6800
|
},
|
|
6848
6801
|
url: `${options.baseURL}/bundle/${options.bundleHash}`,
|
|
6849
6802
|
method: 'put',
|
|
6850
6803
|
body: payloadBody,
|
|
6851
|
-
isJson:
|
|
6804
|
+
isJson: false,
|
|
6852
6805
|
});
|
|
6853
6806
|
if (res.success)
|
|
6854
6807
|
return { type: 'success', value: res.body };
|