@snyk/code-client
Advanced tools
Comparing version 4.16.2 to 4.16.3
@@ -24,4 +24,2 @@ import { FileInfo, SupportedFiles } from './interfaces/files.interface'; | ||
export declare function remoteBundleFactory(options: RemoteBundleFactoryOptions): Promise<RemoteBundle | null>; | ||
interface CreateBundleFromFoldersOptions extends ConnectionOptions, AnalyzeFoldersOptions { | ||
} | ||
export interface FileBundle extends RemoteBundle { | ||
@@ -33,2 +31,4 @@ baseDir: string; | ||
} | ||
interface CreateBundleFromFoldersOptions extends ConnectionOptions, AnalyzeFoldersOptions { | ||
} | ||
/** | ||
@@ -41,2 +41,11 @@ * Creates a remote bundle and returns response from the bundle API | ||
export declare function createBundleFromFolders(options: CreateBundleFromFoldersOptions): Promise<FileBundle | null>; | ||
/** | ||
* Creates a remote bundle and returns response from the bundle API | ||
* This function is used to create a bundle with a custom list of supported file extensions | ||
* | ||
* @param {CreateBundleFromFoldersOptions} options | ||
* @param {SupportedFiles} supportedFiles | ||
* @returns {Promise<FileBundle | null>} | ||
*/ | ||
export declare function createBundleWithCustomFiles(options: CreateBundleFromFoldersOptions, supportedFiles: SupportedFiles): Promise<FileBundle | null>; | ||
export {}; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createBundleFromFolders = exports.remoteBundleFactory = exports.uploadRemoteBundle = void 0; | ||
exports.createBundleWithCustomFiles = exports.createBundleFromFolders = exports.remoteBundleFactory = exports.uploadRemoteBundle = void 0; | ||
/* eslint-disable no-await-in-loop */ | ||
@@ -155,9 +155,20 @@ const lodash_pick_1 = __importDefault(require("lodash.pick")); | ||
async function createBundleFromFolders(options) { | ||
// Fetch supported files to save network traffic | ||
const supportedFiles = await getSupportedFiles(options.baseURL, options.source, options.requestId, options.languages); | ||
// Collect files and create a remote bundle | ||
return await createBundleWithCustomFiles(options, supportedFiles); | ||
} | ||
exports.createBundleFromFolders = createBundleFromFolders; | ||
/** | ||
* Creates a remote bundle and returns response from the bundle API | ||
* This function is used to create a bundle with a custom list of supported file extensions | ||
* | ||
* @param {CreateBundleFromFoldersOptions} options | ||
* @param {SupportedFiles} supportedFiles | ||
* @returns {Promise<FileBundle | null>} | ||
*/ | ||
async function createBundleWithCustomFiles(options, supportedFiles) { | ||
// Scan for custom ignore rules | ||
const fileIgnores = await (0, files_1.collectIgnoreRules)(options.paths, options.symlinksEnabled, options.defaultFileIgnores); | ||
const baseDir = (0, files_1.determineBaseDir)(options.paths); | ||
const [supportedFiles, fileIgnores] = await Promise.all([ | ||
// Fetch supporte files to save network traffic | ||
getSupportedFiles(options.baseURL, options.source, options.requestId, options.languages), | ||
// Scan for custom ignore rules | ||
(0, files_1.collectIgnoreRules)(options.paths, options.symlinksEnabled, options.defaultFileIgnores), | ||
]); | ||
emitter_1.emitter.scanFilesProgress(0); | ||
@@ -197,3 +208,3 @@ const bundleFiles = []; | ||
} | ||
exports.createBundleFromFolders = createBundleFromFolders; | ||
exports.createBundleWithCustomFiles = createBundleWithCustomFiles; | ||
//# sourceMappingURL=bundles.js.map |
import { analyzeFolders, extendAnalysis } from './analysis'; | ||
import { createBundleFromFolders } from './bundles'; | ||
import { createBundleFromFolders, createBundleWithCustomFiles } from './bundles'; | ||
import { emitter } from './emitter'; | ||
@@ -11,2 +11,2 @@ import { startSession, checkSession, getAnalysis, getIpFamily, IpFamily } from './http'; | ||
import { AnalysisResult, AnalysisResultSarif, AnalysisResultLegacy, FilePath, FileSuggestion, Suggestion, Marker, ReportResult } from './interfaces/analysis-result.interface'; | ||
export { getGlobPatterns, analyzeFolders, createBundleFromFolders, extendAnalysis, emitter, MAX_FILE_SIZE, constants, AnalysisSeverity, AnalysisResult, AnalysisResultSarif, AnalysisResultLegacy, SupportedFiles, FileAnalysis, FilePath, FileSuggestion, Suggestion, Marker, getAnalysis, startSession, checkSession, getIpFamily, IpFamily, AnalysisContext, ReportResult, }; | ||
export { getGlobPatterns, analyzeFolders, createBundleFromFolders, createBundleWithCustomFiles, extendAnalysis, emitter, MAX_FILE_SIZE, constants, AnalysisSeverity, AnalysisResult, AnalysisResultSarif, AnalysisResultLegacy, SupportedFiles, FileAnalysis, FilePath, FileSuggestion, Suggestion, Marker, getAnalysis, startSession, checkSession, getIpFamily, IpFamily, AnalysisContext, ReportResult, }; |
@@ -26,3 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getIpFamily = exports.checkSession = exports.startSession = exports.getAnalysis = exports.AnalysisSeverity = exports.constants = exports.MAX_FILE_SIZE = exports.emitter = exports.extendAnalysis = exports.createBundleFromFolders = exports.analyzeFolders = exports.getGlobPatterns = void 0; | ||
exports.getIpFamily = exports.checkSession = exports.startSession = exports.getAnalysis = exports.AnalysisSeverity = exports.constants = exports.MAX_FILE_SIZE = exports.emitter = exports.extendAnalysis = exports.createBundleWithCustomFiles = exports.createBundleFromFolders = exports.analyzeFolders = exports.getGlobPatterns = void 0; | ||
const analysis_1 = require("./analysis"); | ||
@@ -33,2 +33,3 @@ Object.defineProperty(exports, "analyzeFolders", { enumerable: true, get: function () { return analysis_1.analyzeFolders; } }); | ||
Object.defineProperty(exports, "createBundleFromFolders", { enumerable: true, get: function () { return bundles_1.createBundleFromFolders; } }); | ||
Object.defineProperty(exports, "createBundleWithCustomFiles", { enumerable: true, get: function () { return bundles_1.createBundleWithCustomFiles; } }); | ||
const emitter_1 = require("./emitter"); | ||
@@ -35,0 +36,0 @@ Object.defineProperty(exports, "emitter", { enumerable: true, get: function () { return emitter_1.emitter; } }); |
@@ -90,3 +90,3 @@ { | ||
}, | ||
"version": "4.16.2" | ||
"version": "4.16.3" | ||
} |
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
146960
2069