scanoss 0.2.26 → 0.3.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/.github/workflows/reuse.yml +15 -0
- package/.github/workflows/scanoss.yml +24 -0
- package/.gitignore +0 -1
- package/.idea/.gitignore +5 -0
- package/.idea/codeStyles/Project.xml +61 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/scanoss.js.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +366 -0
- package/.nyc_output/a25d3ac4-ee71-4c5e-926e-3a17714555cd.json +1 -0
- package/.nyc_output/processinfo/a25d3ac4-ee71-4c5e-926e-3a17714555cd.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.reuse/dep5 +16 -0
- package/LICENSES/CC0-1.0.txt +121 -0
- package/LICENSES/MIT.txt +9 -0
- package/README.md +9 -0
- package/build/main/bin/cli-bin.js +5 -3
- package/build/main/commands/dep.js +1 -2
- package/build/main/commands/fingerprint.js +20 -12
- package/build/main/commands/helpers.js +1 -2
- package/build/main/commands/scan.js +7 -2
- package/build/main/index.js +1 -2
- package/build/main/lib/dependencies/DependencyScanner.d.ts +1 -1
- package/build/main/lib/dependencies/DependencyScanner.js +23 -12
- package/build/main/lib/dependencies/DependencyScannerCfg.js +1 -2
- package/build/main/lib/dependencies/DependencyTypes.js +0 -1
- package/build/main/lib/dependencies/LocalDependency/DependencyTypes.js +0 -1
- package/build/main/lib/dependencies/LocalDependency/LocalDependency.js +3 -2
- package/build/main/lib/dependencies/LocalDependency/parsers/golangParser.d.ts +1 -0
- package/build/main/lib/dependencies/LocalDependency/parsers/golangParser.js +50 -16
- package/build/main/lib/dependencies/LocalDependency/parsers/mavenParser.js +130 -15
- package/build/main/lib/dependencies/LocalDependency/parsers/npmParser.d.ts +10 -0
- package/build/main/lib/dependencies/LocalDependency/parsers/npmParser.js +146 -10
- package/build/main/lib/dependencies/LocalDependency/parsers/pyParser.js +1 -2
- package/build/main/lib/dependencies/LocalDependency/parsers/rubyParser.js +1 -2
- package/build/main/lib/dependencies/LocalDependency/parsers/utils.js +1 -2
- package/build/main/lib/filters/defaultFilter.js +1 -2
- package/build/main/lib/filters/filtering.js +1 -2
- package/build/main/lib/grpc/GrpcDependencyService.js +1 -2
- package/build/main/lib/grpc/scanoss/api/components/v2/scanoss-components_grpc_pb.d.ts +62 -0
- package/build/main/lib/grpc/scanoss/api/components/v2/scanoss-components_grpc_pb.js +128 -0
- package/build/main/lib/grpc/scanoss/api/components/v2/scanoss-components_pb.d.ts +1 -0
- package/build/main/lib/grpc/scanoss/api/components/v2/scanoss-components_pb.js +1403 -0
- package/build/main/lib/scanner/Dispatcher/DispatchableItem.d.ts +14 -5
- package/build/main/lib/scanner/Dispatcher/DispatchableItem.js +30 -10
- package/build/main/lib/scanner/Dispatcher/Dispatcher.d.ts +2 -2
- package/build/main/lib/scanner/Dispatcher/Dispatcher.js +10 -15
- package/build/main/lib/scanner/Dispatcher/DispatcherResponse.js +1 -2
- package/build/main/lib/scanner/Dispatcher/GlobalControllerAborter.js +1 -2
- package/build/main/lib/scanner/Scannable/ScannableItem.js +1 -2
- package/build/main/lib/scanner/Scanner.js +13 -9
- package/build/main/lib/scanner/ScannerCfg.js +2 -3
- package/build/main/lib/scanner/ScannerQueue.d.ts +3 -0
- package/build/main/lib/scanner/ScannerQueue.js +8 -0
- package/build/main/lib/scanner/ScannerTypes.d.ts +9 -2
- package/build/main/lib/scanner/ScannerTypes.js +8 -3
- package/build/main/lib/scanner/WfpProvider/FingerprintPackage.d.ts +9 -0
- package/build/main/lib/scanner/WfpProvider/FingerprintPackage.js +31 -0
- package/build/main/lib/scanner/WfpProvider/WfpCalculator/WfpCalculator.js +178 -21
- package/build/main/lib/scanner/WfpProvider/WfpCalculator/Winnower.d.ts +3 -0
- package/build/main/lib/scanner/WfpProvider/WfpCalculator/Winnower.js +211 -0
- package/build/main/lib/scanner/WfpProvider/WfpProvider.d.ts +2 -2
- package/build/main/lib/scanner/WfpProvider/WfpProvider.js +6 -7
- package/build/main/lib/scanner/WfpProvider/WfpSplitter/WfpSplitter.js +1 -2
- package/build/main/lib/tree/File.js +1 -2
- package/build/main/lib/tree/Folder.js +1 -2
- package/build/main/lib/tree/Node.js +1 -2
- package/build/main/lib/tree/Tree.js +1 -2
- package/build/module/bin/cli-bin.js +5 -2
- package/build/module/commands/fingerprint.js +25 -16
- package/build/module/commands/scan.js +8 -2
- package/build/module/lib/dependencies/DependencyScanner.d.ts +1 -1
- package/build/module/lib/dependencies/DependencyScanner.js +23 -11
- package/build/module/lib/dependencies/LocalDependency/LocalDependency.js +5 -3
- package/build/module/lib/dependencies/LocalDependency/parsers/golangParser.d.ts +1 -0
- package/build/module/lib/dependencies/LocalDependency/parsers/golangParser.js +47 -14
- package/build/module/lib/dependencies/LocalDependency/parsers/mavenParser.js +130 -14
- package/build/module/lib/dependencies/LocalDependency/parsers/npmParser.d.ts +10 -0
- package/build/module/lib/dependencies/LocalDependency/parsers/npmParser.js +140 -8
- package/build/module/lib/grpc/scanoss/api/components/v2/scanoss-components_grpc_pb.d.ts +62 -0
- package/build/module/lib/grpc/scanoss/api/components/v2/scanoss-components_grpc_pb.js +128 -0
- package/build/module/lib/grpc/scanoss/api/components/v2/scanoss-components_pb.d.ts +1 -0
- package/build/module/lib/grpc/scanoss/api/components/v2/scanoss-components_pb.js +1403 -0
- package/build/module/lib/scanner/Dispatcher/DispatchableItem.d.ts +14 -5
- package/build/module/lib/scanner/Dispatcher/DispatchableItem.js +32 -10
- package/build/module/lib/scanner/Dispatcher/Dispatcher.d.ts +2 -2
- package/build/module/lib/scanner/Dispatcher/Dispatcher.js +10 -14
- package/build/module/lib/scanner/Scanner.js +12 -8
- package/build/module/lib/scanner/ScannerCfg.js +2 -2
- package/build/module/lib/scanner/ScannerQueue.d.ts +3 -0
- package/build/module/lib/scanner/ScannerQueue.js +4 -0
- package/build/module/lib/scanner/ScannerTypes.d.ts +9 -2
- package/build/module/lib/scanner/ScannerTypes.js +7 -1
- package/build/module/lib/scanner/WfpProvider/FingerprintPackage.d.ts +9 -0
- package/build/module/lib/scanner/WfpProvider/FingerprintPackage.js +30 -0
- package/build/module/lib/scanner/WfpProvider/WfpCalculator/WfpCalculator.js +178 -20
- package/build/module/lib/scanner/WfpProvider/WfpCalculator/Winnower.d.ts +3 -0
- package/build/module/lib/scanner/WfpProvider/WfpCalculator/Winnower.js +211 -0
- package/build/module/lib/scanner/WfpProvider/WfpProvider.d.ts +2 -2
- package/build/module/lib/scanner/WfpProvider/WfpProvider.js +6 -6
- package/build/tsconfig.module.tsbuildinfo +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -17
- package/src/bin/cli-bin.ts +4 -1
- package/src/commands/fingerprint.ts +26 -17
- package/src/commands/scan.ts +16 -3
- package/src/lib/dependencies/DependencyScanner.ts +20 -13
- package/src/lib/dependencies/LocalDependency/LocalDependency.ts +8 -2
- package/src/lib/dependencies/LocalDependency/parsers/golangParser.ts +67 -15
- package/src/lib/dependencies/LocalDependency/parsers/mavenParser.ts +143 -16
- package/src/lib/dependencies/LocalDependency/parsers/npmParser.ts +182 -7
- package/src/lib/scanner/Dispatcher/DispatchableItem.ts +45 -11
- package/src/lib/scanner/Dispatcher/Dispatcher.ts +11 -14
- package/src/lib/scanner/Scanner.ts +17 -13
- package/src/lib/scanner/ScannerCfg.ts +2 -1
- package/src/lib/scanner/ScannerTypes.ts +10 -2
- package/src/lib/scanner/WfpProvider/{FingerprintPacket.ts → FingerprintPackage.ts} +4 -14
- package/src/lib/scanner/WfpProvider/WfpCalculator/WfpCalculator.ts +177 -20
- package/src/lib/scanner/WfpProvider/WfpProvider.ts +5 -5
- package/tests/WfpCalculator.spec.ts +103 -0
- package/tests/data/dependencies/Gemfile/1/Gemfile +6 -0
- package/tests/data/dependencies/Gemfile/1/Gemfile~ +0 -0
- package/tests/data/dependencies/Gemfile/2/Gemfile +3 -0
- package/tests/data/dependencies/Gemfile/2/Gemfile~ +6 -0
- package/tests/data/dependencies/Gemfile/3/Gemfile +7 -0
- package/tests/data/dependencies/Gemfile/3/Gemfile~ +6 -0
- package/tests/data/dependencies/Gemfile/4/Gemfile +31 -0
- package/tests/data/dependencies/Gemfile/4/Gemfile~ +7 -0
- package/tests/data/dependencies/Gemfile.lock/1/Gemfile.lock +180 -0
- package/tests/data/dependencies/Gemfile.lock/2/Gemfile.lock +60 -0
- package/tests/data/dependencies/Gemfile.lock/2/Gemfile.lock~ +0 -0
- package/tests/data/dependencies/go.sum/1/go.sum +119 -0
- package/tests/data/dependencies/go.sum/depJSON.sh +23 -0
- package/tests/data/dependencies/package-lock/1/package-lock.json +715 -0
- package/tests/data/dependencies/package-lock/2/package-lock.json +32069 -0
- package/tests/data/dependencies/package-lock/3/package-lock.json +9013 -0
- package/tests/data/dependencies/pom.xml/1/pom.xml +162 -0
- package/tests/data/dependencies/yarn-lock/generate_expected_output.sh +4 -0
- package/tests/data/dependencies/yarn-lock/v1/yarn.lock +50 -0
- package/tests/data/dependencies/yarn-lock/v1/yarn.lock-expected +13 -0
- package/tests/data/dependencies/yarn-lock/v1-complex/yarn.lock +27 -0
- package/tests/data/dependencies/yarn-lock/v1-complex/yarn.lock-expected +8 -0
- package/tests/data/dependencies/yarn-lock/v1-complex2/yarn.lock +220 -0
- package/tests/data/dependencies/yarn-lock/v2/yarn.lock +31 -0
- package/tests/data/dependencies/yarn-lock/v2/yarn.lock-expected +57 -0
- package/tests/data/dependencies/yarn-lock/v2-local/yarn.lock +11 -0
- package/tests/data/dependencies/yarn-lock/v2-local/yarn.lock-expected +27204 -0
- package/tests/data/scanner/file1.c +41 -0
- package/tests/data/scanner/file2.go +87 -0
- package/tests/dependencies/golangParser.goModParser.specs.ts +146 -0
- package/tests/dependencies/npmParser.spec.ts +133 -0
- package/tsconfig.json +4 -3
- package/yarn.lock +4596 -5321
- package/examples/defaultFilter.json +0 -203
- package/package-lock.json +0 -18588
- package/src/lib/scanner/Winnower/WinnowerExtractor.ts +0 -37
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
|
|
3
|
-
export class WinnowerExtractor {
|
|
4
|
-
|
|
5
|
-
private winnowing: string;
|
|
6
|
-
|
|
7
|
-
private winnowingFilePath: string;
|
|
8
|
-
|
|
9
|
-
private blocksIndex: Array<number>;
|
|
10
|
-
|
|
11
|
-
private currentBlock: number;
|
|
12
|
-
|
|
13
|
-
constructor() {
|
|
14
|
-
this.init();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
private init() {
|
|
18
|
-
this.winnowing = '';
|
|
19
|
-
this.currentBlock = 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public loadFile(path: string) {
|
|
23
|
-
this.init();
|
|
24
|
-
this.winnowingFilePath = path;
|
|
25
|
-
this.winnowing = fs.readFileSync(path, 'utf-8');
|
|
26
|
-
const reg = /file=/g;
|
|
27
|
-
this.blocksIndex = [...((this.winnowing).matchAll(reg))].map(x => x.index);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
public extractWinBlock(): string {
|
|
31
|
-
let res = '';
|
|
32
|
-
if (this.currentBlock < this.blocksIndex.length-1)
|
|
33
|
-
res = this.winnowing.substring(this.blocksIndex[this.currentBlock], this.blocksIndex[this.currentBlock+1]);
|
|
34
|
-
this.currentBlock+=1;
|
|
35
|
-
return res;
|
|
36
|
-
}
|
|
37
|
-
}
|