@snyk/code-client
Advanced tools
Comparing version 4.23.5 to 4.23.6
@@ -22,3 +22,3 @@ "use strict"; | ||
// Ensure requestId is set. | ||
requestId: (_a = connectionOptions.requestId) !== null && _a !== void 0 ? _a : uuid_1.v4(), | ||
requestId: (_a = connectionOptions.requestId) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)(), | ||
}; | ||
@@ -38,3 +38,3 @@ } | ||
while (true) { | ||
analysisResponse = await http_1.getAnalysis(options); | ||
analysisResponse = await (0, http_1.getAnalysis)(options); | ||
if (analysisResponse.type === 'error') { | ||
@@ -77,3 +77,3 @@ return analysisResponse; | ||
return Object.entries(files).reduce((obj, [path, positions]) => { | ||
const filePath = files_1.resolveBundleFilePath(baseDir, path); | ||
const filePath = (0, files_1.resolveBundleFilePath)(baseDir, path); | ||
obj[filePath] = positions; | ||
@@ -91,3 +91,3 @@ return obj; | ||
const analysisContext = getAnalysisContext(options.analysisContext); | ||
const fileBundle = await bundles_1.createBundleFromFolders({ | ||
const fileBundle = await (0, bundles_1.createBundleFromFolders)({ | ||
...connectionOptions, | ||
@@ -103,3 +103,3 @@ ...options.fileOptions, | ||
...options.analysisOptions, | ||
shard: files_1.calcHash(fileBundle.baseDir), | ||
shard: (0, files_1.calcHash)(fileBundle.baseDir), | ||
...analysisContext, | ||
@@ -113,3 +113,3 @@ }; | ||
// Analyze and upload bundle results. | ||
const reportRes = await report_1.reportBundle({ | ||
const reportRes = await (0, report_1.reportBundle)({ | ||
...config, | ||
@@ -222,5 +222,5 @@ report: options.reportOptions, | ||
// expand relative file names to absolute ones only for legacy results | ||
const changedFiles = [...limitToFiles, ...removedFiles].map(path => files_1.resolveBundleFilePath(baseDir, path)); | ||
const changedFiles = [...limitToFiles, ...removedFiles].map(path => (0, files_1.resolveBundleFilePath)(baseDir, path)); | ||
const files = { | ||
...lodash_omit_1.default(oldAnalysisResults.files, changedFiles), | ||
...(0, lodash_omit_1.default)(oldAnalysisResults.files, changedFiles), | ||
...newFiles, | ||
@@ -235,3 +235,3 @@ }; | ||
async function extendAnalysis(options) { | ||
const { files, removedFiles } = await files_1.prepareExtendingBundle(options.fileBundle.baseDir, options.fileBundle.supportedFiles, options.fileBundle.fileIgnores, options.files, options.fileOptions.symlinksEnabled); | ||
const { files, removedFiles } = await (0, files_1.prepareExtendingBundle)(options.fileBundle.baseDir, options.fileBundle.supportedFiles, options.fileBundle.fileIgnores, options.files, options.fileOptions.symlinksEnabled); | ||
if (!files.length && !removedFiles.length) { | ||
@@ -241,3 +241,3 @@ return null; // nothing to extend, just return null | ||
// Extend remote bundle | ||
const remoteBundle = await bundles_1.remoteBundleFactory({ | ||
const remoteBundle = await (0, bundles_1.remoteBundleFactory)({ | ||
...options.connection, | ||
@@ -260,3 +260,3 @@ bundleHash: options.fileBundle.bundleHash, | ||
...options.analysisOptions, | ||
shard: files_1.calcHash(fileBundle.baseDir), | ||
shard: (0, files_1.calcHash)(fileBundle.baseDir), | ||
limitToFiles, | ||
@@ -275,3 +275,3 @@ }); | ||
const analysisContext = getAnalysisContext(options.analysisContext); | ||
const { analysisResult: analysisResults, uploadResult: reportResults } = await report_1.reportScm({ | ||
const { analysisResult: analysisResults, uploadResult: reportResults } = await (0, report_1.reportScm)({ | ||
...connectionOptions, | ||
@@ -278,0 +278,0 @@ ...options.analysisOptions, |
@@ -20,5 +20,5 @@ "use strict"; | ||
emitter_1.emitter.createBundleProgress(cumulativeProgress, options.files.length); | ||
for (const chunkedFiles of files_1.composeFilePayloads(options.files)) { | ||
for (const chunkedFiles of (0, files_1.composeFilePayloads)(options.files)) { | ||
const apiParams = { | ||
...lodash_pick_1.default(options, [ | ||
...(0, lodash_pick_1.default)(options, [ | ||
'baseURL', | ||
@@ -41,7 +41,7 @@ 'sessionToken', | ||
// eslint-disable-next-line no-await-in-loop | ||
response = await http_1.createBundle(apiParams); | ||
response = await (0, http_1.createBundle)(apiParams); | ||
} | ||
else { | ||
// eslint-disable-next-line no-await-in-loop | ||
response = await http_1.extendBundle({ bundleHash, ...apiParams }); | ||
response = await (0, http_1.extendBundle)({ bundleHash, ...apiParams }); | ||
} | ||
@@ -68,3 +68,3 @@ cumulativeProgress += chunkedFiles.length; | ||
emitter_1.emitter.uploadBundleProgress(0, options.files.length); | ||
const apiParams = lodash_pick_1.default(options, [ | ||
const apiParams = (0, lodash_pick_1.default)(options, [ | ||
'baseURL', | ||
@@ -81,6 +81,6 @@ 'sessionToken', | ||
// Note: we specifically create __new__ isolated bundles here to faster files upload | ||
const resp = await http_1.createBundle({ | ||
const resp = await (0, http_1.createBundle)({ | ||
...apiParams, | ||
files: bucketFiles.reduce((d, f) => { | ||
d[f.bundlePath] = lodash_pick_1.default(f, ['hash', 'content']); | ||
d[f.bundlePath] = (0, lodash_pick_1.default)(f, ['hash', 'content']); | ||
return d; | ||
@@ -95,6 +95,6 @@ }, {}), | ||
const files = []; | ||
for (const bucketFiles of files_1.composeFilePayloads(options.files)) { | ||
for (const bucketFiles of (0, files_1.composeFilePayloads)(options.files)) { | ||
files.push(bucketFiles); | ||
} | ||
await p_map_1.default(files, async (task) => await uploadFileChunks(task), { | ||
await (0, p_map_1.default)(files, async (task) => await uploadFileChunks(task), { | ||
concurrency: constants_1.UPLOAD_CONCURRENCY, | ||
@@ -109,3 +109,3 @@ }); | ||
let { remoteBundle } = options; | ||
const connectionOptions = lodash_pick_1.default(options, [ | ||
const connectionOptions = (0, lodash_pick_1.default)(options, [ | ||
'baseURL', | ||
@@ -120,3 +120,3 @@ 'sessionToken', | ||
while (remoteBundle.missingFiles.length && attempts < (options.maxAttempts || constants_1.MAX_UPLOAD_ATTEMPTS)) { | ||
const missingFiles = await files_1.resolveBundleFiles(options.baseDir, remoteBundle.missingFiles); | ||
const missingFiles = await (0, files_1.resolveBundleFiles)(options.baseDir, remoteBundle.missingFiles); | ||
await uploadRemoteBundle({ | ||
@@ -127,3 +127,3 @@ ...connectionOptions, | ||
}); | ||
const bundleResponse = await http_1.checkBundle({ ...connectionOptions, bundleHash: remoteBundle.bundleHash }); | ||
const bundleResponse = await (0, http_1.checkBundle)({ ...connectionOptions, bundleHash: remoteBundle.bundleHash }); | ||
if (bundleResponse.type === 'error') { | ||
@@ -140,3 +140,3 @@ throw new Error('Failed to get remote bundle'); | ||
let remoteBundle = null; | ||
const baseOptions = lodash_pick_1.default(options, [ | ||
const baseOptions = (0, lodash_pick_1.default)(options, [ | ||
'baseURL', | ||
@@ -151,3 +151,3 @@ 'sessionToken', | ||
]); | ||
const bundleFactory = prepareRemoteBundle(lodash_omit_1.default(options, ['baseDir'])); | ||
const bundleFactory = prepareRemoteBundle((0, lodash_omit_1.default)(options, ['baseDir'])); | ||
for await (const response of bundleFactory) { | ||
@@ -174,3 +174,3 @@ if (response.type === 'error') { | ||
emitter_1.emitter.supportedFilesLoaded(null); | ||
const resp = await http_1.getFilters({ | ||
const resp = await (0, http_1.getFilters)({ | ||
baseURL, | ||
@@ -227,4 +227,4 @@ source, | ||
// Scan for custom ignore rules | ||
const filePolicies = await files_1.collectFilePolicies(options.paths, options.symlinksEnabled, options.defaultFileIgnores); | ||
const baseDir = files_1.determineBaseDir(options.paths); | ||
const filePolicies = await (0, files_1.collectFilePolicies)(options.paths, options.symlinksEnabled, options.defaultFileIgnores); | ||
const baseDir = (0, files_1.determineBaseDir)(options.paths); | ||
emitter_1.emitter.scanFilesProgress(0); | ||
@@ -234,4 +234,4 @@ const bundleFiles = []; | ||
let totalFiles = 0; | ||
const bundleFileCollector = files_1.collectBundleFiles({ | ||
...lodash_pick_1.default(options, ['paths', 'symlinksEnabled']), | ||
const bundleFileCollector = (0, files_1.collectBundleFiles)({ | ||
...(0, lodash_pick_1.default)(options, ['paths', 'symlinksEnabled']), | ||
baseDir, | ||
@@ -247,3 +247,3 @@ filePolicies, | ||
const bundleOptions = { | ||
...lodash_pick_1.default(options, ['baseURL', 'sessionToken', 'source', 'requestId', 'org', 'orgId', 'extraHeaders']), | ||
...(0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'requestId', 'org', 'orgId', 'extraHeaders']), | ||
baseDir, | ||
@@ -250,0 +250,0 @@ files: bundleFiles, |
@@ -32,3 +32,3 @@ "use strict"; | ||
async function filtersAction(options) { | ||
const response = await bundles_1.getSupportedFiles(options.url, options.source, undefined, [], options.orgId); | ||
const response = await (0, bundles_1.getSupportedFiles)(options.url, options.source, undefined, [], options.orgId); | ||
console.log(JSON.stringify(response, null, 2)); | ||
@@ -45,6 +45,6 @@ } | ||
if ((_b = options.patterns) === null || _b === void 0 ? void 0 : _b.length) { | ||
bundle = await bundles_1.createBundleWithCustomFiles(opts, { configFiles: [], extensions: (_c = options.patterns) !== null && _c !== void 0 ? _c : [] }); | ||
bundle = await (0, bundles_1.createBundleWithCustomFiles)(opts, { configFiles: [], extensions: (_c = options.patterns) !== null && _c !== void 0 ? _c : [] }); | ||
} | ||
else { | ||
bundle = await bundles_1.createBundleFromFolders(opts); | ||
bundle = await (0, bundles_1.createBundleFromFolders)(opts); | ||
} | ||
@@ -66,3 +66,3 @@ if (bundle === null) { | ||
}; | ||
const bundle = await http_1.checkBundle(opts); | ||
const bundle = await (0, http_1.checkBundle)(opts); | ||
if (bundle.type === 'error') { | ||
@@ -78,3 +78,3 @@ process.exitCode = 1; | ||
}; | ||
const bundle = await analysis_1.analyzeBundle(opts); | ||
const bundle = await (0, analysis_1.analyzeBundle)(opts); | ||
console.log(JSON.stringify(bundle, null, 2)); | ||
@@ -81,0 +81,0 @@ } |
@@ -47,2 +47,2 @@ export declare const MAX_PAYLOAD: number; | ||
}; | ||
export declare type GenericErrorTypes = ErrorCodes.serverError | ErrorCodes.badGateway | ErrorCodes.serviceUnavailable | ErrorCodes.timeout | ErrorCodes.connectionRefused | ErrorCodes.dnsNotFound; | ||
export type GenericErrorTypes = ErrorCodes.serverError | ErrorCodes.badGateway | ErrorCodes.serviceUnavailable | ErrorCodes.timeout | ErrorCodes.connectionRefused | ErrorCodes.dnsNotFound; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -70,3 +74,3 @@ if (k2 === undefined) k2 = k; | ||
const patters = getGlobPatterns(supportedFiles); | ||
return multimatch_1.default(files, patters, multiMatchOptions); | ||
return (0, multimatch_1.default)(files, patters, multiMatchOptions); | ||
} | ||
@@ -121,3 +125,3 @@ function parseIgnoreRulesToGlobs(rules, baseDir) { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
const parsed = yaml_1.parse(f); | ||
const parsed = (0, yaml_1.parse)(f); | ||
const codeIgnoredPaths = parsed.exclude.code || []; | ||
@@ -199,3 +203,3 @@ const globalIgnoredPaths = parsed.exclude.global || []; | ||
// Find .snyk and .[*]ignore files inside this directory. | ||
const allIgnoredFiles = await fast_glob_1.default(constants_1.IGNORE_FILES_NAMES.map(i => `*${i}`), { | ||
const allIgnoredFiles = await (0, fast_glob_1.default)(constants_1.IGNORE_FILES_NAMES.map(i => `*${i}`), { | ||
...fgOptions, | ||
@@ -207,7 +211,7 @@ cwd: folder, | ||
const snykFiles = allIgnoredFiles.filter(f => f.endsWith(constants_1.DOTSNYK_FILENAME)); | ||
const snykExcludeRules = lodash_union_1.default(...snykFiles.map(parseFileIgnores)); | ||
const snykExcludeRules = (0, lodash_union_1.default)(...snykFiles.map(parseFileIgnores)); | ||
// Parse rules from relevant .[*]ignore files inside this directory. | ||
// Exclude ignore files under paths excluded by .snyk files. | ||
const ignoreFiles = allIgnoredFiles.filter(f => !f.endsWith(constants_1.DOTSNYK_FILENAME) && multimatch_1.default([nodePath.dirname(f)], snykExcludeRules).length === 0); | ||
const ignoreFileRules = lodash_union_1.default(...ignoreFiles.map(parseFileIgnores)); | ||
const ignoreFiles = allIgnoredFiles.filter(f => !f.endsWith(constants_1.DOTSNYK_FILENAME) && (0, multimatch_1.default)([nodePath.dirname(f)], snykExcludeRules).length === 0); | ||
const ignoreFileRules = (0, lodash_union_1.default)(...ignoreFiles.map(parseFileIgnores)); | ||
return { | ||
@@ -220,5 +224,5 @@ excludes: snykExcludeRules, | ||
return { | ||
excludes: lodash_union_1.default(...collectedRules.map(policies => policies.excludes)), | ||
excludes: (0, lodash_union_1.default)(...collectedRules.map(policies => policies.excludes)), | ||
// Merge external and collected ignore rules | ||
ignores: lodash_union_1.default(fileIgnores, ...collectedRules.map(policies => policies.ignores)), | ||
ignores: (0, lodash_union_1.default)(fileIgnores, ...collectedRules.map(policies => policies.ignores)), | ||
}; | ||
@@ -341,3 +345,3 @@ } | ||
} | ||
const entries = await fast_glob_1.default(processingFiles, { | ||
const entries = await (0, fast_glob_1.default)(processingFiles, { | ||
...fgOptions, | ||
@@ -483,5 +487,5 @@ cwd: baseDir, | ||
function isMatch(filePath, rules) { | ||
return !!multimatch_1.default([filePath], rules, { ...multiMatchOptions, matchBase: false }).length; | ||
return !!(0, multimatch_1.default)([filePath], rules, { ...multiMatchOptions, matchBase: false }).length; | ||
} | ||
exports.isMatch = isMatch; | ||
//# sourceMappingURL=files.js.map |
@@ -6,7 +6,7 @@ /// <reference types="node" /> | ||
import { AnalysisContext, AnalysisOptions, ReportOptions, ScmReportOptions } from './interfaces/analysis-options.interface'; | ||
declare type ResultSuccess<T> = { | ||
type ResultSuccess<T> = { | ||
type: 'success'; | ||
value: T; | ||
}; | ||
export declare type ResultError<E> = { | ||
export type ResultError<E> = { | ||
type: 'error'; | ||
@@ -20,3 +20,3 @@ error: { | ||
}; | ||
export declare type Result<T, E> = ResultSuccess<T> | ResultError<E>; | ||
export type Result<T, E> = ResultSuccess<T> | ResultError<E>; | ||
export interface ConnectionOptions { | ||
@@ -33,3 +33,3 @@ baseURL: string; | ||
} | ||
declare type StartSessionResponseDto = { | ||
type StartSessionResponseDto = { | ||
readonly draftToken: string; | ||
@@ -45,3 +45,3 @@ readonly loginURL: string; | ||
export declare function getVerifyCallbackUrl(authHost: string): string; | ||
export declare type IpFamily = 6 | undefined; | ||
export type IpFamily = 6 | undefined; | ||
/** | ||
@@ -53,3 +53,3 @@ * Dispatches a FORCED IPv6 request to test client's ISP and network capability. | ||
export declare function getIpFamily(authHost: string): Promise<IpFamily>; | ||
declare type CheckSessionErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.loginInProgress; | ||
type CheckSessionErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.loginInProgress; | ||
interface CheckSessionOptions { | ||
@@ -70,7 +70,7 @@ readonly authHost: string; | ||
export declare function getFilters({ baseURL, orgId, attempts, source, extraHeaders, requestId, }: FilterArgs): Promise<Result<SupportedFiles, GenericErrorTypes>>; | ||
export declare type RemoteBundle = { | ||
export type RemoteBundle = { | ||
readonly bundleHash: string; | ||
readonly missingFiles: string[]; | ||
}; | ||
export declare type CreateBundleErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.unauthorizedBundleAccess | ErrorCodes.bigPayload | ErrorCodes.badRequest | ErrorCodes.notFound; | ||
export type CreateBundleErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.unauthorizedBundleAccess | ErrorCodes.bigPayload | ErrorCodes.badRequest | ErrorCodes.notFound; | ||
interface CreateBundleOptions extends ConnectionOptions { | ||
@@ -80,3 +80,3 @@ files: BundleFiles; | ||
export declare function createBundle(options: CreateBundleOptions): Promise<Result<RemoteBundle, CreateBundleErrorCodes>>; | ||
export declare type CheckBundleErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.unauthorizedBundleAccess | ErrorCodes.notFound; | ||
export type CheckBundleErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.unauthorizedBundleAccess | ErrorCodes.notFound; | ||
interface CheckBundleOptions extends ConnectionOptions { | ||
@@ -86,3 +86,3 @@ bundleHash: string; | ||
export declare function checkBundle(options: CheckBundleOptions): Promise<Result<RemoteBundle, CheckBundleErrorCodes>>; | ||
export declare type ExtendBundleErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.badRequest | ErrorCodes.unauthorizedBundleAccess | ErrorCodes.bigPayload | ErrorCodes.notFound; | ||
export type ExtendBundleErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.badRequest | ErrorCodes.unauthorizedBundleAccess | ErrorCodes.bigPayload | ErrorCodes.notFound; | ||
interface ExtendBundleOptions extends ConnectionOptions { | ||
@@ -102,11 +102,11 @@ readonly bundleHash: string; | ||
} | ||
export declare type AnalysisResponseProgress = { | ||
export type AnalysisResponseProgress = { | ||
readonly status: AnalysisStatus.waiting | AnalysisStatus.fetching | AnalysisStatus.analyzing | AnalysisStatus.done; | ||
readonly progress: number; | ||
}; | ||
export declare type AnalysisFailedResponse = { | ||
export type AnalysisFailedResponse = { | ||
readonly status: AnalysisStatus.failed; | ||
}; | ||
export declare type GetAnalysisResponseDto = AnalysisResult | AnalysisFailedResponse | AnalysisResponseProgress; | ||
export declare type GetAnalysisErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.unauthorizedBundleAccess | ErrorCodes.badRequest | ErrorCodes.notFound; | ||
export type GetAnalysisResponseDto = AnalysisResult | AnalysisFailedResponse | AnalysisResponseProgress; | ||
export type GetAnalysisErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.unauthorizedBundleAccess | ErrorCodes.badRequest | ErrorCodes.notFound; | ||
export interface GetAnalysisOptions extends ConnectionOptions, AnalysisOptions, AnalysisContext { | ||
@@ -116,3 +116,3 @@ bundleHash: string; | ||
export declare function getAnalysis(options: GetAnalysisOptions): Promise<Result<GetAnalysisResponseDto, GetAnalysisErrorCodes>>; | ||
export declare type ReportErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.unauthorizedBundleAccess | ErrorCodes.badRequest | ErrorCodes.notFound; | ||
export type ReportErrorCodes = GenericErrorTypes | ErrorCodes.unauthorizedUser | ErrorCodes.unauthorizedBundleAccess | ErrorCodes.badRequest | ErrorCodes.notFound; | ||
export interface UploadReportOptions extends GetAnalysisOptions { | ||
@@ -126,9 +126,9 @@ report: ReportOptions; | ||
} | ||
export declare type InitUploadResponseDto = { | ||
export type InitUploadResponseDto = { | ||
reportId: string; | ||
}; | ||
export declare type InitScmUploadResponseDto = { | ||
export type InitScmUploadResponseDto = { | ||
testId: string; | ||
}; | ||
export declare type UploadReportResponseDto = ReportResult | AnalysisFailedResponse | AnalysisResponseProgress; | ||
export type UploadReportResponseDto = ReportResult | AnalysisFailedResponse | AnalysisResponseProgress; | ||
/** | ||
@@ -135,0 +135,0 @@ * Trigger a file-based test with reporting. |
@@ -21,3 +21,3 @@ "use strict"; | ||
if (errors) { | ||
return httpUtils_1.generateErrorWithDetail(errors[0], errorCode, apiName); | ||
return (0, httpUtils_1.generateErrorWithDetail)(errors[0], errorCode, apiName); | ||
} | ||
@@ -48,3 +48,3 @@ if (!isSubsetErrorCode(errorCode, messages)) { | ||
// encode payload and compress; | ||
const deflate = util_1.promisify(zlib_1.gzip); | ||
const deflate = (0, util_1.promisify)(zlib_1.gzip); | ||
return await deflate(Buffer.from(JSON.stringify(payload)).toString('base64')); | ||
@@ -55,3 +55,3 @@ } | ||
const { source, authHost } = options; | ||
const draftToken = uuid_1.v4(); | ||
const draftToken = (0, uuid_1.v4)(); | ||
return { | ||
@@ -75,3 +75,3 @@ draftToken, | ||
// Dispatch a FORCED IPv6 request to test client's ISP and network capability | ||
const res = await needle_1.makeRequest({ | ||
const res = await (0, needle_1.makeRequest)({ | ||
url: getVerifyCallbackUrl(authHost), | ||
@@ -95,3 +95,3 @@ method: 'post', | ||
}; | ||
const res = await needle_1.makeRequest({ | ||
const res = await (0, needle_1.makeRequest)({ | ||
url: getVerifyCallbackUrl(options.authHost), | ||
@@ -117,3 +117,3 @@ body: { | ||
try { | ||
url = httpUtils_1.getURL(baseURL, '/' + apiName, orgId); | ||
url = (0, httpUtils_1.getURL)(baseURL, '/' + apiName, orgId); | ||
} | ||
@@ -123,3 +123,3 @@ catch (err) { | ||
} | ||
const res = await needle_1.makeRequest({ | ||
const res = await (0, needle_1.makeRequest)({ | ||
headers: { | ||
@@ -160,3 +160,3 @@ source, | ||
try { | ||
url = httpUtils_1.getURL(options.baseURL, '/bundle', options.orgId); | ||
url = (0, httpUtils_1.getURL)(options.baseURL, '/bundle', options.orgId); | ||
} | ||
@@ -177,3 +177,3 @@ catch (err) { | ||
}; | ||
const res = await needle_1.makeRequest(payload); | ||
const res = await (0, needle_1.makeRequest)(payload); | ||
if (res.success) { | ||
@@ -194,3 +194,3 @@ return { type: 'success', value: res.body }; | ||
try { | ||
url = httpUtils_1.getURL(options.baseURL, `/bundle/${options.bundleHash}`, options.orgId); | ||
url = (0, httpUtils_1.getURL)(options.baseURL, `/bundle/${options.bundleHash}`, options.orgId); | ||
} | ||
@@ -200,3 +200,3 @@ catch (err) { | ||
} | ||
const res = await needle_1.makeRequest({ | ||
const res = await (0, needle_1.makeRequest)({ | ||
headers: { | ||
@@ -222,6 +222,6 @@ ...commonHttpHeaders(options), | ||
async function extendBundle(options) { | ||
const payloadBody = await compressAndEncode(lodash_pick_1.default(options, ['files', 'removedFiles'])); | ||
const payloadBody = await compressAndEncode((0, lodash_pick_1.default)(options, ['files', 'removedFiles'])); | ||
let url; | ||
try { | ||
url = httpUtils_1.getURL(options.baseURL, `/bundle/${options.bundleHash}`, options.orgId); | ||
url = (0, httpUtils_1.getURL)(options.baseURL, `/bundle/${options.bundleHash}`, options.orgId); | ||
} | ||
@@ -231,3 +231,3 @@ catch (err) { | ||
} | ||
const res = await needle_1.makeRequest({ | ||
const res = await (0, needle_1.makeRequest)({ | ||
headers: { | ||
@@ -269,3 +269,3 @@ 'content-type': 'application/octet-stream', | ||
try { | ||
url = httpUtils_1.getURL(options.baseURL, '/analysis', options.orgId); | ||
url = (0, httpUtils_1.getURL)(options.baseURL, '/analysis', options.orgId); | ||
} | ||
@@ -288,6 +288,6 @@ catch (err) { | ||
}, | ||
...lodash_pick_1.default(options, ['severity', 'prioritized', 'legacy', 'analysisContext']), | ||
...(0, lodash_pick_1.default)(options, ['severity', 'prioritized', 'legacy', 'analysisContext']), | ||
}, | ||
}; | ||
const res = await needle_1.makeRequest(config); | ||
const res = await (0, needle_1.makeRequest)(config); | ||
if (res.success) { | ||
@@ -313,3 +313,3 @@ return { type: 'success', value: res.body }; | ||
try { | ||
url = httpUtils_1.getURL(options.baseURL, `/report`, options.orgId); | ||
url = (0, httpUtils_1.getURL)(options.baseURL, `/report`, options.orgId); | ||
} | ||
@@ -338,6 +338,6 @@ catch (err) { | ||
}, | ||
...lodash_pick_1.default(options, ['severity', 'prioritized', 'legacy', 'analysisContext']), | ||
...(0, lodash_pick_1.default)(options, ['severity', 'prioritized', 'legacy', 'analysisContext']), | ||
}, | ||
}; | ||
const res = await needle_1.makeRequest(config); | ||
const res = await (0, needle_1.makeRequest)(config); | ||
if (res.success) | ||
@@ -355,3 +355,3 @@ return { type: 'success', value: res.body.reportId }; | ||
try { | ||
url = httpUtils_1.getURL(options.baseURL, `/report/${options.pollId}`, options.orgId); | ||
url = (0, httpUtils_1.getURL)(options.baseURL, `/report/${options.pollId}`, options.orgId); | ||
} | ||
@@ -368,3 +368,3 @@ catch (err) { | ||
}; | ||
const res = await needle_1.makeRequest(config); | ||
const res = await (0, needle_1.makeRequest)(config); | ||
if (res.success) | ||
@@ -381,3 +381,3 @@ return { type: 'success', value: res.body }; | ||
try { | ||
url = httpUtils_1.getURL(options.baseURL, `/test`, options.orgId); | ||
url = (0, httpUtils_1.getURL)(options.baseURL, `/test`, options.orgId); | ||
} | ||
@@ -398,6 +398,6 @@ catch (err) { | ||
}, | ||
...lodash_pick_1.default(options, ['severity', 'prioritized', 'analysisContext']), | ||
...(0, lodash_pick_1.default)(options, ['severity', 'prioritized', 'analysisContext']), | ||
}, | ||
}; | ||
const res = await needle_1.makeRequest(config); | ||
const res = await (0, needle_1.makeRequest)(config); | ||
if (res.success) | ||
@@ -415,3 +415,3 @@ return { type: 'success', value: res.body.testId }; | ||
try { | ||
url = httpUtils_1.getURL(options.baseURL, `/test/${options.pollId}`, options.orgId); | ||
url = (0, httpUtils_1.getURL)(options.baseURL, `/test/${options.pollId}`, options.orgId); | ||
} | ||
@@ -428,3 +428,3 @@ catch (err) { | ||
}; | ||
const res = await needle_1.makeRequest(config); | ||
const res = await (0, needle_1.makeRequest)(config); | ||
if (res.success) | ||
@@ -431,0 +431,0 @@ return { type: 'success', value: res.body }; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -28,3 +28,3 @@ import { Log } from 'sarif'; | ||
} | ||
export declare type Point = [number, number]; | ||
export type Point = [number, number]; | ||
export interface Marker { | ||
@@ -85,3 +85,3 @@ msg: Point; | ||
} | ||
export declare type AnalysisResult = AnalysisResultSarif | AnalysisResultLegacy; | ||
export type AnalysisResult = AnalysisResultSarif | AnalysisResultLegacy; | ||
export interface ScmAnalysis { | ||
@@ -88,0 +88,0 @@ analysisResults: AnalysisResultSarif; |
@@ -9,3 +9,3 @@ import { AnalysisResult } from '..'; | ||
} | ||
export declare type BundleFiles = { | ||
export type BundleFiles = { | ||
[filePath: string]: string | File; | ||
@@ -20,3 +20,3 @@ }; | ||
} | ||
export declare type SupportedFiles = { | ||
export type SupportedFiles = { | ||
configFiles: string[]; | ||
@@ -23,0 +23,0 @@ extensions: string[]; |
@@ -6,3 +6,3 @@ declare enum Classification { | ||
} | ||
declare type JsonApiErrorSource = { | ||
type JsonApiErrorSource = { | ||
pointer: string; | ||
@@ -14,3 +14,3 @@ } | { | ||
}; | ||
export declare type JsonApiErrorObject = { | ||
export type JsonApiErrorObject = { | ||
id?: string; | ||
@@ -17,0 +17,0 @@ links?: { |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { OutgoingHttpHeaders } from 'http'; | ||
@@ -23,3 +27,3 @@ import needle from 'needle'; | ||
} | ||
export declare type FailedResponse = { | ||
export type FailedResponse = { | ||
success: false; | ||
@@ -26,0 +30,0 @@ errorCode: number; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -84,3 +88,3 @@ if (k2 === undefined) k2 = k; | ||
try { | ||
response = await needle_1.default(method, url, data, options); | ||
response = await (0, needle_1.default)(method, url, data, options); | ||
emitter_1.emitter.apiRequestLog(`<= Response: ${response.statusCode} ${JSON.stringify(response.body)}`); | ||
@@ -87,0 +91,0 @@ const success = !!(response.statusCode && response.statusCode >= 200 && response.statusCode < 300); |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -49,3 +53,3 @@ if (k2 === undefined) k2 = k; | ||
apiResponse = await getReportFunc({ | ||
...lodash_pick_1.default(options, ['baseURL', 'sessionToken', 'source', 'requestId', 'org', 'orgId']), | ||
...(0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'requestId', 'org', 'orgId']), | ||
pollId, | ||
@@ -52,0 +56,0 @@ }); |
@@ -94,3 +94,3 @@ { | ||
}, | ||
"version": "4.23.5" | ||
"version": "4.23.6" | ||
} |
# code-client | ||
Typescript consumer of the Snyk Code public API | ||
Typescript consumer of the Snyk Code public APi | ||
@@ -5,0 +5,0 @@ [![npm version](https://img.shields.io/npm/v/@snyk/code-client.svg?style=flat-square)](https://www.npmjs.org/package/@snyk/code-client) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
186297
2681