scanoss 0.7.9 → 0.7.10
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/build/main/sdk/scanner/WfpProvider/WfpCalculator/WfpCalculator.d.ts +1 -1
- package/build/main/tsconfig.tsbuildinfo +1 -1
- package/build/module/sdk/scanner/WfpProvider/WfpCalculator/WfpCalculator.d.ts +1 -1
- package/build/module/tsconfig.module.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/.circleci/config.yml +0 -64
- package/.cspell.json +0 -36
- package/.editorconfig +0 -15
- package/.eslintrc.json +0 -37
- package/.github/workflows/reuse.yml +0 -15
- package/.github/workflows/scanoss.yml +0 -24
- package/.gitignore +0 -10
- package/.idea/.gitignore +0 -5
- package/.idea/codeStyles/Project.xml +0 -61
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/scanoss.js.iml +0 -12
- package/.idea/vcs.xml +0 -6
- package/.idea/workspace.xml +0 -313
- package/.nyc_output/3da9f448-90e4-4399-887b-e4fd1b8d7052.json +0 -1
- package/.nyc_output/processinfo/3da9f448-90e4-4399-887b-e4fd1b8d7052.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/.prettierignore +0 -2
- package/.reuse/dep5 +0 -16
- package/.vscode/extensions.json +0 -8
- package/.vscode/launch.json +0 -29
- package/.vscode/settings.json +0 -7
- package/LICENSES/CC0-1.0.txt +0 -121
- package/LICENSES/MIT.txt +0 -9
- package/assets/ReportHTMLTemplate/index.html +0 -1181
- package/build/main/package.json +0 -120
- package/build/main/sdk/filters/DefaultFilterForDependencies.d.ts +0 -16
- package/build/main/sdk/filters/DefaultFilterForDependencies.js +0 -145
- package/build/main/sdk/filters/DefaultFilterForScanning.d.ts +0 -16
- package/build/main/sdk/filters/DefaultFilterForScanning.js +0 -194
- package/build/main/sdk/filters/filtering.d.ts +0 -32
- package/build/main/sdk/filters/filtering.js +0 -228
- package/build/main/src/cli/bin/cli-bin.d.ts +0 -2
- package/build/main/src/cli/bin/cli-bin.js +0 -68
- package/build/main/src/cli/commands/dep.d.ts +0 -1
- package/build/main/src/cli/commands/dep.js +0 -38
- package/build/main/src/cli/commands/helpers.d.ts +0 -2
- package/build/main/src/cli/commands/helpers.js +0 -25
- package/build/main/src/cli/commands/scan.d.ts +0 -1
- package/build/main/src/cli/commands/scan.js +0 -138
- package/build/main/src/cli/commands/wfp.d.ts +0 -1
- package/build/main/src/cli/commands/wfp.js +0 -54
- package/build/main/src/index.d.ts +0 -14
- package/build/main/src/index.js +0 -30
- package/build/main/src/sdk/DataLayer/DataLayerTypes.d.ts +0 -108
- package/build/main/src/sdk/DataLayer/DataLayerTypes.js +0 -5
- package/build/main/src/sdk/DataLayer/DataProviderManager.d.ts +0 -7
- package/build/main/src/sdk/DataLayer/DataProviderManager.js +0 -24
- package/build/main/src/sdk/DataLayer/DataProviders/ComponentDataProvider.d.ts +0 -13
- package/build/main/src/sdk/DataLayer/DataProviders/ComponentDataProvider.js +0 -164
- package/build/main/src/sdk/DataLayer/DataProviders/DependencyDataProvider.d.ts +0 -9
- package/build/main/src/sdk/DataLayer/DataProviders/DependencyDataProvider.js +0 -37
- package/build/main/src/sdk/DataLayer/DataProviders/LicenseDataProvider.d.ts +0 -18
- package/build/main/src/sdk/DataLayer/DataProviders/LicenseDataProvider.js +0 -148
- package/build/main/src/sdk/DataLayer/DataProviders/SummaryDataProvider.d.ts +0 -11
- package/build/main/src/sdk/DataLayer/DataProviders/SummaryDataProvider.js +0 -33
- package/build/main/src/sdk/Decompress/DecompressionManager.d.ts +0 -12
- package/build/main/src/sdk/Decompress/DecompressionManager.js +0 -73
- package/build/main/src/sdk/Decompress/Decompressor/DecompressTgz.d.ts +0 -5
- package/build/main/src/sdk/Decompress/Decompressor/DecompressTgz.js +0 -22
- package/build/main/src/sdk/Decompress/Decompressor/DecompressZips.d.ts +0 -5
- package/build/main/src/sdk/Decompress/Decompressor/DecompressZips.js +0 -24
- package/build/main/src/sdk/Decompress/Decompressor/Decompressor.d.ts +0 -10
- package/build/main/src/sdk/Decompress/Decompressor/Decompressor.js +0 -18
- package/build/main/src/sdk/Dependencies/DependencyScanner.d.ts +0 -11
- package/build/main/src/sdk/Dependencies/DependencyScanner.js +0 -96
- package/build/main/src/sdk/Dependencies/DependencyScannerCfg.d.ts +0 -4
- package/build/main/src/sdk/Dependencies/DependencyScannerCfg.js +0 -10
- package/build/main/src/sdk/Dependencies/DependencyTypes.d.ts +0 -21
- package/build/main/src/sdk/Dependencies/DependencyTypes.js +0 -2
- package/build/main/src/sdk/Dependencies/LocalDependency/DependencyTypes.d.ts +0 -16
- package/build/main/src/sdk/Dependencies/LocalDependency/DependencyTypes.js +0 -2
- package/build/main/src/sdk/Dependencies/LocalDependency/LocalDependency.d.ts +0 -8
- package/build/main/src/sdk/Dependencies/LocalDependency/LocalDependency.js +0 -102
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/buildGradleParser.d.ts +0 -2
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/buildGradleParser.js +0 -95
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/golangParser.d.ts +0 -3
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/golangParser.js +0 -97
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/mavenParser.d.ts +0 -2
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/mavenParser.js +0 -183
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/npmParser.d.ts +0 -13
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/npmParser.js +0 -187
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/nugetParser.d.ts +0 -3
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/nugetParser.js +0 -58
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/pyParser.d.ts +0 -2
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/pyParser.js +0 -64
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/rubyParser.d.ts +0 -3
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/rubyParser.js +0 -132
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/utils.d.ts +0 -2
- package/build/main/src/sdk/Dependencies/LocalDependency/parsers/utils.js +0 -19
- package/build/main/src/sdk/Report/Report.d.ts +0 -8
- package/build/main/src/sdk/Report/Report.js +0 -26
- package/build/main/src/sdk/filters/DefaultFilterForDependencies.d.ts +0 -16
- package/build/main/src/sdk/filters/DefaultFilterForDependencies.js +0 -145
- package/build/main/src/sdk/filters/DefaultFilterForScanning.d.ts +0 -16
- package/build/main/src/sdk/filters/DefaultFilterForScanning.js +0 -194
- package/build/main/src/sdk/filters/filtering.d.ts +0 -32
- package/build/main/src/sdk/filters/filtering.js +0 -228
- package/build/main/src/sdk/grpc/GrpcDependencyService.d.ts +0 -11
- package/build/main/src/sdk/grpc/GrpcDependencyService.js +0 -86
- package/build/main/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_grpc_pb.d.ts +0 -0
- package/build/main/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_grpc_pb.js +0 -2
- package/build/main/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_pb.d.ts +0 -1
- package/build/main/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_pb.js +0 -404
- package/build/main/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_grpc_pb.d.ts +0 -39
- package/build/main/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_grpc_pb.js +0 -98
- package/build/main/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_pb.d.ts +0 -1
- package/build/main/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_pb.js +0 -1197
- package/build/main/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_grpc_pb.d.ts +0 -19
- package/build/main/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_grpc_pb.js +0 -66
- package/build/main/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_pb.d.ts +0 -1
- package/build/main/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_pb.js +0 -14
- package/build/main/src/sdk/scanner/Dispatcher/DispatchableItem.d.ts +0 -19
- package/build/main/src/sdk/scanner/Dispatcher/DispatchableItem.js +0 -43
- package/build/main/src/sdk/scanner/Dispatcher/Dispatcher.d.ts +0 -20
- package/build/main/src/sdk/scanner/Dispatcher/Dispatcher.js +0 -160
- package/build/main/src/sdk/scanner/Dispatcher/DispatcherResponse.d.ts +0 -12
- package/build/main/src/sdk/scanner/Dispatcher/DispatcherResponse.js +0 -33
- package/build/main/src/sdk/scanner/Dispatcher/GlobalControllerAborter.d.ts +0 -10
- package/build/main/src/sdk/scanner/Dispatcher/GlobalControllerAborter.js +0 -32
- package/build/main/src/sdk/scanner/Fingerprint.d.ts +0 -16
- package/build/main/src/sdk/scanner/Fingerprint.js +0 -78
- package/build/main/src/sdk/scanner/Scannable/ScannableItem.d.ts +0 -15
- package/build/main/src/sdk/scanner/Scannable/ScannableItem.js +0 -27
- package/build/main/src/sdk/scanner/Scanner.d.ts +0 -46
- package/build/main/src/sdk/scanner/Scanner.js +0 -283
- package/build/main/src/sdk/scanner/ScannerCfg.d.ts +0 -16
- package/build/main/src/sdk/scanner/ScannerCfg.js +0 -30
- package/build/main/src/sdk/scanner/ScannerTypes.d.ts +0 -121
- package/build/main/src/sdk/scanner/ScannerTypes.js +0 -48
- package/build/main/src/sdk/scanner/WfpProvider/FingerprintPackage.d.ts +0 -9
- package/build/main/src/sdk/scanner/WfpProvider/FingerprintPackage.js +0 -31
- package/build/main/src/sdk/scanner/WfpProvider/WfpCalculator/WfpCalculator.d.ts +0 -20
- package/build/main/src/sdk/scanner/WfpProvider/WfpCalculator/WfpCalculator.js +0 -492
- package/build/main/src/sdk/scanner/WfpProvider/WfpProvider.d.ts +0 -35
- package/build/main/src/sdk/scanner/WfpProvider/WfpProvider.js +0 -68
- package/build/main/src/sdk/scanner/WfpProvider/WfpSplitter/WfpSplitter.d.ts +0 -21
- package/build/main/src/sdk/scanner/WfpProvider/WfpSplitter/WfpSplitter.js +0 -139
- package/build/main/src/sdk/tree/File.d.ts +0 -7
- package/build/main/src/sdk/tree/File.js +0 -24
- package/build/main/src/sdk/tree/Filters/DecompressionFilter.d.ts +0 -7
- package/build/main/src/sdk/tree/Filters/DecompressionFilter.js +0 -21
- package/build/main/src/sdk/tree/Filters/DependencyFilter.d.ts +0 -7
- package/build/main/src/sdk/tree/Filters/DependencyFilter.js +0 -17
- package/build/main/src/sdk/tree/Filters/Filter.d.ts +0 -4
- package/build/main/src/sdk/tree/Filters/Filter.js +0 -6
- package/build/main/src/sdk/tree/Filters/ScanFilter.d.ts +0 -7
- package/build/main/src/sdk/tree/Filters/ScanFilter.js +0 -17
- package/build/main/src/sdk/tree/Folder.d.ts +0 -12
- package/build/main/src/sdk/tree/Folder.js +0 -58
- package/build/main/src/sdk/tree/Node.d.ts +0 -17
- package/build/main/src/sdk/tree/Node.js +0 -25
- package/build/main/src/sdk/tree/Tree.d.ts +0 -18
- package/build/main/src/sdk/tree/Tree.js +0 -70
- package/build/module/package.json +0 -120
- package/build/module/sdk/filters/DefaultFilterForDependencies.d.ts +0 -16
- package/build/module/sdk/filters/DefaultFilterForDependencies.js +0 -143
- package/build/module/sdk/filters/DefaultFilterForScanning.d.ts +0 -16
- package/build/module/sdk/filters/DefaultFilterForScanning.js +0 -192
- package/build/module/sdk/filters/filtering.d.ts +0 -32
- package/build/module/sdk/filters/filtering.js +0 -203
- package/build/module/src/cli/bin/cli-bin.d.ts +0 -2
- package/build/module/src/cli/bin/cli-bin.js +0 -67
- package/build/module/src/cli/commands/dep.d.ts +0 -1
- package/build/module/src/cli/commands/dep.js +0 -32
- package/build/module/src/cli/commands/helpers.d.ts +0 -2
- package/build/module/src/cli/commands/helpers.js +0 -19
- package/build/module/src/cli/commands/scan.d.ts +0 -1
- package/build/module/src/cli/commands/scan.js +0 -135
- package/build/module/src/cli/commands/wfp.d.ts +0 -1
- package/build/module/src/cli/commands/wfp.js +0 -48
- package/build/module/src/index.d.ts +0 -14
- package/build/module/src/index.js +0 -19
- package/build/module/src/sdk/DataLayer/DataLayerTypes.d.ts +0 -108
- package/build/module/src/sdk/DataLayer/DataLayerTypes.js +0 -5
- package/build/module/src/sdk/DataLayer/DataProviderManager.d.ts +0 -7
- package/build/module/src/sdk/DataLayer/DataProviderManager.js +0 -21
- package/build/module/src/sdk/DataLayer/DataProviders/ComponentDataProvider.d.ts +0 -13
- package/build/module/src/sdk/DataLayer/DataProviders/ComponentDataProvider.js +0 -159
- package/build/module/src/sdk/DataLayer/DataProviders/DependencyDataProvider.d.ts +0 -9
- package/build/module/src/sdk/DataLayer/DataProviders/DependencyDataProvider.js +0 -34
- package/build/module/src/sdk/DataLayer/DataProviders/LicenseDataProvider.d.ts +0 -18
- package/build/module/src/sdk/DataLayer/DataProviders/LicenseDataProvider.js +0 -145
- package/build/module/src/sdk/DataLayer/DataProviders/SummaryDataProvider.d.ts +0 -11
- package/build/module/src/sdk/DataLayer/DataProviders/SummaryDataProvider.js +0 -30
- package/build/module/src/sdk/Decompress/DecompressionManager.d.ts +0 -12
- package/build/module/src/sdk/Decompress/DecompressionManager.js +0 -67
- package/build/module/src/sdk/Decompress/Decompressor/DecompressTgz.d.ts +0 -5
- package/build/module/src/sdk/Decompress/Decompressor/DecompressTgz.js +0 -16
- package/build/module/src/sdk/Decompress/Decompressor/DecompressZips.d.ts +0 -5
- package/build/module/src/sdk/Decompress/Decompressor/DecompressZips.js +0 -18
- package/build/module/src/sdk/Decompress/Decompressor/Decompressor.d.ts +0 -10
- package/build/module/src/sdk/Decompress/Decompressor/Decompressor.js +0 -15
- package/build/module/src/sdk/Dependencies/DependencyScanner.d.ts +0 -11
- package/build/module/src/sdk/Dependencies/DependencyScanner.js +0 -93
- package/build/module/src/sdk/Dependencies/DependencyScannerCfg.d.ts +0 -4
- package/build/module/src/sdk/Dependencies/DependencyScannerCfg.js +0 -7
- package/build/module/src/sdk/Dependencies/DependencyTypes.d.ts +0 -21
- package/build/module/src/sdk/Dependencies/DependencyTypes.js +0 -2
- package/build/module/src/sdk/Dependencies/LocalDependency/DependencyTypes.d.ts +0 -16
- package/build/module/src/sdk/Dependencies/LocalDependency/DependencyTypes.js +0 -2
- package/build/module/src/sdk/Dependencies/LocalDependency/LocalDependency.d.ts +0 -8
- package/build/module/src/sdk/Dependencies/LocalDependency/LocalDependency.js +0 -96
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/buildGradleParser.d.ts +0 -2
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/buildGradleParser.js +0 -87
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/golangParser.d.ts +0 -3
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/golangParser.js +0 -88
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/mavenParser.d.ts +0 -2
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/mavenParser.js +0 -180
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/npmParser.d.ts +0 -13
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/npmParser.js +0 -175
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/nugetParser.d.ts +0 -3
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/nugetParser.js +0 -49
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/pyParser.d.ts +0 -2
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/pyParser.js +0 -57
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/rubyParser.d.ts +0 -3
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/rubyParser.js +0 -125
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/utils.d.ts +0 -2
- package/build/module/src/sdk/Dependencies/LocalDependency/parsers/utils.js +0 -15
- package/build/module/src/sdk/Report/Report.d.ts +0 -8
- package/build/module/src/sdk/Report/Report.js +0 -20
- package/build/module/src/sdk/filters/DefaultFilterForDependencies.d.ts +0 -16
- package/build/module/src/sdk/filters/DefaultFilterForDependencies.js +0 -143
- package/build/module/src/sdk/filters/DefaultFilterForScanning.d.ts +0 -16
- package/build/module/src/sdk/filters/DefaultFilterForScanning.js +0 -192
- package/build/module/src/sdk/filters/filtering.d.ts +0 -32
- package/build/module/src/sdk/filters/filtering.js +0 -203
- package/build/module/src/sdk/grpc/GrpcDependencyService.d.ts +0 -11
- package/build/module/src/sdk/grpc/GrpcDependencyService.js +0 -64
- package/build/module/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_grpc_pb.d.ts +0 -0
- package/build/module/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_grpc_pb.js +0 -2
- package/build/module/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_pb.d.ts +0 -1
- package/build/module/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_pb.js +0 -404
- package/build/module/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_grpc_pb.d.ts +0 -39
- package/build/module/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_grpc_pb.js +0 -98
- package/build/module/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_pb.d.ts +0 -1
- package/build/module/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_pb.js +0 -1197
- package/build/module/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_grpc_pb.d.ts +0 -19
- package/build/module/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_grpc_pb.js +0 -66
- package/build/module/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_pb.d.ts +0 -1
- package/build/module/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_pb.js +0 -14
- package/build/module/src/sdk/scanner/Dispatcher/DispatchableItem.d.ts +0 -19
- package/build/module/src/sdk/scanner/Dispatcher/DispatchableItem.js +0 -37
- package/build/module/src/sdk/scanner/Dispatcher/Dispatcher.d.ts +0 -20
- package/build/module/src/sdk/scanner/Dispatcher/Dispatcher.js +0 -135
- package/build/module/src/sdk/scanner/Dispatcher/DispatcherResponse.d.ts +0 -12
- package/build/module/src/sdk/scanner/Dispatcher/DispatcherResponse.js +0 -30
- package/build/module/src/sdk/scanner/Dispatcher/GlobalControllerAborter.d.ts +0 -10
- package/build/module/src/sdk/scanner/Dispatcher/GlobalControllerAborter.js +0 -26
- package/build/module/src/sdk/scanner/Fingerprint.d.ts +0 -16
- package/build/module/src/sdk/scanner/Fingerprint.js +0 -54
- package/build/module/src/sdk/scanner/Scannable/ScannableItem.d.ts +0 -15
- package/build/module/src/sdk/scanner/Scannable/ScannableItem.js +0 -24
- package/build/module/src/sdk/scanner/Scanner.d.ts +0 -46
- package/build/module/src/sdk/scanner/Scanner.js +0 -275
- package/build/module/src/sdk/scanner/ScannerCfg.d.ts +0 -16
- package/build/module/src/sdk/scanner/ScannerCfg.js +0 -27
- package/build/module/src/sdk/scanner/ScannerTypes.d.ts +0 -121
- package/build/module/src/sdk/scanner/ScannerTypes.js +0 -46
- package/build/module/src/sdk/scanner/WfpProvider/FingerprintPackage.d.ts +0 -9
- package/build/module/src/sdk/scanner/WfpProvider/FingerprintPackage.js +0 -28
- package/build/module/src/sdk/scanner/WfpProvider/WfpCalculator/WfpCalculator.d.ts +0 -20
- package/build/module/src/sdk/scanner/WfpProvider/WfpCalculator/WfpCalculator.js +0 -486
- package/build/module/src/sdk/scanner/WfpProvider/WfpProvider.d.ts +0 -35
- package/build/module/src/sdk/scanner/WfpProvider/WfpProvider.js +0 -65
- package/build/module/src/sdk/scanner/WfpProvider/WfpSplitter/WfpSplitter.d.ts +0 -21
- package/build/module/src/sdk/scanner/WfpProvider/WfpSplitter/WfpSplitter.js +0 -132
- package/build/module/src/sdk/tree/File.d.ts +0 -7
- package/build/module/src/sdk/tree/File.js +0 -19
- package/build/module/src/sdk/tree/Filters/DecompressionFilter.d.ts +0 -7
- package/build/module/src/sdk/tree/Filters/DecompressionFilter.js +0 -18
- package/build/module/src/sdk/tree/Filters/DependencyFilter.d.ts +0 -7
- package/build/module/src/sdk/tree/Filters/DependencyFilter.js +0 -14
- package/build/module/src/sdk/tree/Filters/Filter.d.ts +0 -4
- package/build/module/src/sdk/tree/Filters/Filter.js +0 -3
- package/build/module/src/sdk/tree/Filters/ScanFilter.d.ts +0 -7
- package/build/module/src/sdk/tree/Filters/ScanFilter.js +0 -14
- package/build/module/src/sdk/tree/Folder.d.ts +0 -12
- package/build/module/src/sdk/tree/Folder.js +0 -53
- package/build/module/src/sdk/tree/Node.d.ts +0 -17
- package/build/module/src/sdk/tree/Node.js +0 -22
- package/build/module/src/sdk/tree/Tree.d.ts +0 -18
- package/build/module/src/sdk/tree/Tree.js +0 -64
- package/package-lock.json +0 -17116
- package/src/cli/bin/cli-bin.ts +0 -81
- package/src/cli/commands/dep.ts +0 -37
- package/src/cli/commands/helpers.ts +0 -19
- package/src/cli/commands/scan.ts +0 -173
- package/src/cli/commands/wfp.ts +0 -60
- package/src/index.ts +0 -31
- package/src/sdk/DataLayer/DataLayerTypes.ts +0 -129
- package/src/sdk/DataLayer/DataProviderManager.ts +0 -27
- package/src/sdk/DataLayer/DataProviders/ComponentDataProvider.ts +0 -195
- package/src/sdk/DataLayer/DataProviders/DependencyDataProvider.ts +0 -48
- package/src/sdk/DataLayer/DataProviders/LicenseDataProvider.ts +0 -184
- package/src/sdk/DataLayer/DataProviders/SummaryDataProvider.ts +0 -47
- package/src/sdk/Decompress/DecompressionManager.ts +0 -91
- package/src/sdk/Decompress/Decompressor/DecompressTgz.ts +0 -20
- package/src/sdk/Decompress/Decompressor/DecompressZips.ts +0 -21
- package/src/sdk/Decompress/Decompressor/Decompressor.ts +0 -20
- package/src/sdk/Dependencies/DependencyScanner.ts +0 -108
- package/src/sdk/Dependencies/DependencyScannerCfg.ts +0 -7
- package/src/sdk/Dependencies/DependencyTypes.ts +0 -24
- package/src/sdk/Dependencies/LocalDependency/DependencyTypes.ts +0 -21
- package/src/sdk/Dependencies/LocalDependency/LocalDependency.ts +0 -111
- package/src/sdk/Dependencies/LocalDependency/parsers/buildGradleParser.ts +0 -115
- package/src/sdk/Dependencies/LocalDependency/parsers/golangParser.ts +0 -130
- package/src/sdk/Dependencies/LocalDependency/parsers/mavenParser.ts +0 -209
- package/src/sdk/Dependencies/LocalDependency/parsers/npmParser.ts +0 -227
- package/src/sdk/Dependencies/LocalDependency/parsers/nugetParser.ts +0 -64
- package/src/sdk/Dependencies/LocalDependency/parsers/pyParser.ts +0 -58
- package/src/sdk/Dependencies/LocalDependency/parsers/rubyParser.ts +0 -174
- package/src/sdk/Dependencies/LocalDependency/parsers/utils.ts +0 -15
- package/src/sdk/FileCount/FileCount.ts +0 -81
- package/src/sdk/FileCount/FileCountFilter.ts +0 -14
- package/src/sdk/FileCount/Interfaces.ts +0 -23
- package/src/sdk/Filtering/DefaultFilterForDependencies.ts +0 -148
- package/src/sdk/Filtering/DefaultFilterForScanning.ts +0 -206
- package/src/sdk/Filtering/Filtering.ts +0 -273
- package/src/sdk/Report/Report.ts +0 -30
- package/src/sdk/grpc/GrpcDependencyService.ts +0 -72
- package/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_grpc_pb.d.ts +0 -1
- package/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_grpc_pb.js +0 -1
- package/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_pb.d.ts +0 -79
- package/src/sdk/grpc/scanoss/api/common/v2/scanoss-common_pb.js +0 -482
- package/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_grpc_pb.d.ts +0 -30
- package/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_grpc_pb.js +0 -109
- package/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_pb.d.ts +0 -206
- package/src/sdk/grpc/scanoss/api/dependencies/v2/scanoss-dependencies_pb.js +0 -1489
- package/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_grpc_pb.d.ts +0 -25
- package/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_grpc_pb.js +0 -73
- package/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_pb.d.ts +0 -6
- package/src/sdk/grpc/scanoss/api/scanning/v2/scanoss-scanning_pb.js +0 -15
- package/src/sdk/scanner/Dispatcher/DispatchableItem.ts +0 -62
- package/src/sdk/scanner/Dispatcher/Dispatcher.ts +0 -173
- package/src/sdk/scanner/Dispatcher/DispatcherResponse.ts +0 -40
- package/src/sdk/scanner/Dispatcher/GlobalControllerAborter.ts +0 -33
- package/src/sdk/scanner/Fingerprint.ts +0 -82
- package/src/sdk/scanner/Scannable/ScannableItem.ts +0 -43
- package/src/sdk/scanner/Scanner.ts +0 -360
- package/src/sdk/scanner/ScannerCfg.ts +0 -43
- package/src/sdk/scanner/ScannerTypes.ts +0 -127
- package/src/sdk/scanner/WfpProvider/FingerprintPackage.ts +0 -34
- package/src/sdk/scanner/WfpProvider/WfpCalculator/WfpCalculator.ts +0 -516
- package/src/sdk/scanner/WfpProvider/WfpProvider.ts +0 -105
- package/src/sdk/scanner/WfpProvider/WfpSplitter/WfpSplitter.ts +0 -184
- package/src/sdk/tree/File.ts +0 -22
- package/src/sdk/tree/Filters/DecompressionFilter.ts +0 -22
- package/src/sdk/tree/Filters/DependencyFilter.ts +0 -22
- package/src/sdk/tree/Filters/Filter.ts +0 -5
- package/src/sdk/tree/Filters/ScanFilter.ts +0 -22
- package/src/sdk/tree/Folder.ts +0 -57
- package/src/sdk/tree/Node.ts +0 -39
- package/src/sdk/tree/Tree.ts +0 -82
- package/tests/scanoss.sh +0 -56
- package/tests/sdk/DataLayer/DataProviders/ComponentDataProvider.spec.ts +0 -176
- package/tests/sdk/DataLayer/DataProviders/DependencyDataProvider.spec.ts +0 -51
- package/tests/sdk/DataLayer/DataProviders/SummaryDataProvider.spec.ts +0 -35
- package/tests/sdk/DataLayer/DataProviders/samples/results-with-dep.json +0 -665
- package/tests/sdk/DataLayer/DataProviders/samples/results.json +0 -556
- package/tests/sdk/DataLayer/samples/simple/results-with-dep.json +0 -665
- package/tests/sdk/DataLayer/samples/simple-1/output1.json +0 -1196
- package/tests/sdk/Dependencies/LocalDependency/LocalDependency.spec.ts +0 -24
- package/tests/sdk/Dependencies/LocalDependency/Parsers/buildGradle.spec.ts +0 -48
- package/tests/sdk/Dependencies/LocalDependency/Parsers/golangParser.spec.ts +0 -146
- package/tests/sdk/Dependencies/LocalDependency/Parsers/npmParser.spec.ts +0 -135
- package/tests/sdk/Dependencies/LocalDependency/Parsers/nugetParser.spec.ts +0 -73
- package/tests/sdk/Dependencies/LocalDependency/Parsers/pomParser.spec.ts +0 -45
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile/1/Gemfile +0 -6
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile/1/Gemfile~ +0 -0
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile/2/Gemfile +0 -3
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile/2/Gemfile~ +0 -6
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile/3/Gemfile +0 -7
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile/3/Gemfile~ +0 -6
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile/4/Gemfile +0 -31
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile/4/Gemfile~ +0 -7
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile.lock/1/Gemfile.lock +0 -180
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile.lock/2/Gemfile.lock +0 -60
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/Gemfile.lock/2/Gemfile.lock~ +0 -0
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/go.sum/1/go.sum +0 -119
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/go.sum/depJSON.sh +0 -23
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/gradle/1/build.gradle +0 -26
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/gradle/2/build.gradle +0 -16
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/nuget/NoDependencies.csproj +0 -115
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/nuget/netcore-2.csproj +0 -18
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/nuget/netcore.csproj +0 -14
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/nuget/packageConfig-1/packages.config +0 -5
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/pom.xml/1/pom.xml +0 -670
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/pom.xml/2/pom.xml +0 -780
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/generate_expected_output.sh +0 -4
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1/yarn.lock +0 -50
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1/yarn.lock-expected +0 -13
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1-complex/yarn.lock +0 -27
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1-complex/yarn.lock-expected +0 -8
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1_2/scancode-out.json +0 -149662
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1_2/yarn.lock +0 -8409
- package/tests/sdk/Dependencies/LocalDependency/Parsers/samples/yarn-lock/v1_2/yarn.lock-expected +0 -1153
- package/tests/sdk/FileCount/FileCount.spec.ts +0 -35
- package/tests/sdk/FileCount/samples/16557/.y.ts +0 -27
- package/tests/sdk/FileCount/samples/16557/.z.ts +0 -129
- package/tests/sdk/FileCount/samples/16557/files/a.ts +0 -195
- package/tests/sdk/FileCount/samples/16557/files/b.ts +0 -184
- package/tests/sdk/FileCount/samples/16557/files/c.ts +0 -47
- package/tests/sdk/FileCount/samples/22036/files/a.ts +0 -195
- package/tests/sdk/FileCount/samples/22036/files/b.ts +0 -184
- package/tests/sdk/FileCount/samples/22036/files/c.ts +0 -47
- package/tests/sdk/FileCount/samples/22036/files/d.ts +0 -48
- package/tests/sdk/FileCount/samples/22036/y.ts +0 -27
- package/tests/sdk/FileCount/samples/22036/z.ts +0 -129
- package/tests/sdk/Scanner/WfpProvider/WfpCalculator/WfpCalculator.spec.ts +0 -102
- package/tests/sdk/Scanner/WfpProvider/WfpCalculator/samples/file1.c +0 -41
- package/tests/sdk/Scanner/WfpProvider/WfpCalculator/samples/file2.go +0 -87
- package/tests/sdk/Scanner/WfpProvider/WfpSplitter/WfpSplitter.spec.ts +0 -35
- package/tests/sdk/Scanner/WfpProvider/WfpSplitter/samples/wfp.wfp +0 -68
- package/tests/sdk/Scanner/WfpProvider/WfpSplitter/samples/wfp.wfp~ +0 -68
- package/tsconfig.json +0 -31
- package/tsconfig.module.json +0 -11
- package/yarn.lock +0 -5481
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
// ------ FILTERS SYNC WITH PYTHON CLIENT 06/10/2021 ------ //
|
|
2
|
-
import { FilterListType, FilterScope, FilterType, IFilter } from './Filtering';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export const defaultFilterForScanning: IFilter = {
|
|
6
|
-
type: FilterListType.BANNED,
|
|
7
|
-
filters: [
|
|
8
|
-
{ condition: '=', value: '0', ftype: FilterType.SIZE, scope: FilterScope.FILE },
|
|
9
|
-
|
|
10
|
-
//Folders and files filters
|
|
11
|
-
{ condition: 'starts', value: '.', ftype: FilterType.NAME, scope: FilterScope.ALL },
|
|
12
|
-
|
|
13
|
-
//Folder filters
|
|
14
|
-
{ condition: 'ends', value: '.egg-info', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
15
|
-
|
|
16
|
-
{ condition: 'fullmatch', value: 'nbproject', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
17
|
-
{ condition: 'fullmatch', value: 'nbbuild', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
18
|
-
{ condition: 'fullmatch', value: 'nbdist', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
19
|
-
{ condition: 'fullmatch', value: '__pycache__', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
20
|
-
{ condition: 'fullmatch', value: 'venv', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
21
|
-
{ condition: 'fullmatch', value: '_yardoc', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
22
|
-
{ condition: 'fullmatch', value: 'eggs', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
23
|
-
{ condition: 'fullmatch', value: 'wheels', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
24
|
-
{ condition: 'fullmatch', value: 'htmlcov', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
25
|
-
{ condition: 'fullmatch', value: '__pypackages__', ftype: FilterType.NAME, scope: FilterScope.FOLDER },
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//Files filters
|
|
29
|
-
|
|
30
|
-
{ condition: 'fullmatch', value: 'gradlew', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
31
|
-
{ condition: 'fullmatch', value: 'gradlew.bat', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
32
|
-
{ condition: 'fullmatch', value: 'mvnw', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
33
|
-
{ condition: 'fullmatch', value: 'mvnw.cmd', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
34
|
-
{ condition: 'fullmatch', value: 'gradle-wrapper.jar', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
35
|
-
{ condition: 'fullmatch', value: 'maven-wrapper.jar', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
36
|
-
{ condition: 'fullmatch', value: 'thumbs.db', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
37
|
-
{ condition: 'fullmatch', value: 'babel.config.js', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
38
|
-
{ condition: 'fullmatch', value: 'license.txt', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
39
|
-
{ condition: 'fullmatch', value: 'license.md', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
40
|
-
{ condition: 'fullmatch', value: 'copying.lib', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
41
|
-
{ condition: 'fullmatch', value: 'makefile', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{ condition: 'starts', value: '.asar', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{ condition: 'ends', value: 'news', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
48
|
-
{ condition: 'ends', value: 'authors', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{ condition: 'ends', value: '-doc', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
52
|
-
{ condition: 'ends', value: 'changelog', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
53
|
-
{ condition: 'ends', value: 'config', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
54
|
-
{ condition: 'ends', value: 'copying', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
55
|
-
{ condition: 'ends', value: 'license', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
56
|
-
{ condition: 'ends', value: 'licenses', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
57
|
-
{ condition: 'ends', value: 'notice', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
58
|
-
{ condition: 'ends', value: 'readme', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
59
|
-
{ condition: 'ends', value: 'swiftdoc', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
60
|
-
{ condition: 'ends', value: 'texidoc', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
61
|
-
{ condition: 'ends', value: 'todo', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
62
|
-
{ condition: 'ends', value: 'version', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
63
|
-
{ condition: 'ends', value: 'ignore', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
64
|
-
{ condition: 'ends', value: 'manifest', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
65
|
-
{ condition: 'ends', value: 'sqlite', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
66
|
-
{ condition: 'ends', value: 'sqlite3', ftype: FilterType.NAME, scope: FilterScope.FILE },
|
|
67
|
-
|
|
68
|
-
{ condition: '=', value: '.1', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
69
|
-
{ condition: '=', value: '.2', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
70
|
-
{ condition: '=', value: '.3', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
71
|
-
{ condition: '=', value: '.4', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
72
|
-
{ condition: '=', value: '.5', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
73
|
-
{ condition: '=', value: '.6', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
74
|
-
{ condition: '=', value: '.7', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
75
|
-
{ condition: '=', value: '.8', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
76
|
-
{ condition: '=', value: '.9', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
77
|
-
{ condition: '=', value: '.ac', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
78
|
-
{ condition: '=', value: '.adoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
79
|
-
{ condition: '=', value: '.am', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
80
|
-
{ condition: '=', value: '.asciidoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
81
|
-
{ condition: '=', value: '.bmp', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
82
|
-
{ condition: '=', value: '.build', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
83
|
-
{ condition: '=', value: '.cfg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
84
|
-
{ condition: '=', value: '.chm', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
85
|
-
{ condition: '=', value: '.class', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
86
|
-
{ condition: '=', value: '.cmake', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
87
|
-
{ condition: '=', value: '.cnf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
88
|
-
{ condition: '=', value: '.conf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
89
|
-
{ condition: '=', value: '.config', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
90
|
-
{ condition: '=', value: '.contributors', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
91
|
-
{ condition: '=', value: '.copying', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
92
|
-
{ condition: '=', value: '.crt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
93
|
-
{ condition: '=', value: '.csproj', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
94
|
-
{ condition: '=', value: '.css', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
95
|
-
{ condition: '=', value: '.csv', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
96
|
-
{ condition: '=', value: '.dat', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
97
|
-
{ condition: '=', value: '.data', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
98
|
-
{ condition: '=', value: '.doc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
99
|
-
{ condition: '=', value: '.docx', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
100
|
-
{ condition: '=', value: '.dtd', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
101
|
-
{ condition: '=', value: '.dts', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
102
|
-
{ condition: '=', value: '.iws', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
103
|
-
{ condition: '=', value: '.c9', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
104
|
-
{ condition: '=', value: '.c9revisions', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
105
|
-
{ condition: '=', value: '.dtsi', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
106
|
-
{ condition: '=', value: '.dump', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
107
|
-
{ condition: '=', value: '.eot', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
108
|
-
{ condition: '=', value: '.eps', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
109
|
-
{ condition: '=', value: '.geojson', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
110
|
-
{ condition: '=', value: '.gdoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
111
|
-
{ condition: '=', value: '.gif', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
112
|
-
{ condition: '=', value: '.glif', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
113
|
-
{ condition: '=', value: '.gmo', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
114
|
-
{ condition: '=', value: '.gradle', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
115
|
-
{ condition: '=', value: '.guess', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
116
|
-
{ condition: '=', value: '.hex', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
117
|
-
{ condition: '=', value: '.htm', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
118
|
-
{ condition: '=', value: '.html', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
119
|
-
{ condition: '=', value: '.ico', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
120
|
-
{ condition: '=', value: '.iml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
121
|
-
{ condition: '=', value: '.in', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
122
|
-
{ condition: '=', value: '.inc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
123
|
-
{ condition: '=', value: '.info', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
124
|
-
{ condition: '=', value: '.ini', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
125
|
-
{ condition: '=', value: '.ipynb', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
126
|
-
{ condition: '=', value: '.jpeg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
127
|
-
{ condition: '=', value: '.jpg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
128
|
-
{ condition: '=', value: '.json', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
129
|
-
{ condition: '=', value: '.jsonld', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
130
|
-
{ condition: '=', value: '.lock', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
131
|
-
{ condition: '=', value: '.log', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
132
|
-
{ condition: '=', value: '.m4', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
133
|
-
{ condition: '=', value: '.map', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
134
|
-
{ condition: '=', value: '.markdown', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
135
|
-
{ condition: '=', value: '.md', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
136
|
-
{ condition: '=', value: '.md5', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
137
|
-
{ condition: '=', value: '.meta', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
138
|
-
{ condition: '=', value: '.mk', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
139
|
-
{ condition: '=', value: '.mxml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
140
|
-
{ condition: '=', value: '.o', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
141
|
-
{ condition: '=', value: '.otf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
142
|
-
{ condition: '=', value: '.out', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
143
|
-
{ condition: '=', value: '.pbtxt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
144
|
-
{ condition: '=', value: '.pdf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
145
|
-
{ condition: '=', value: '.pem', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
146
|
-
{ condition: '=', value: '.phtml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
147
|
-
{ condition: '=', value: '.plist', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
148
|
-
{ condition: '=', value: '.png', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
149
|
-
{ condition: '=', value: '.po', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
150
|
-
{ condition: '=', value: '.ppt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
151
|
-
{ condition: '=', value: '.prefs', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
152
|
-
{ condition: '=', value: '.properties', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
153
|
-
{ condition: '=', value: '.pyc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
154
|
-
{ condition: '=', value: '.qdoc', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
155
|
-
{ condition: '=', value: '.result', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
156
|
-
{ condition: '=', value: '.rgb', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
157
|
-
{ condition: '=', value: '.rst', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
158
|
-
{ condition: '=', value: '.scss', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
159
|
-
{ condition: '=', value: '.sha', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
160
|
-
{ condition: '=', value: '.sha1', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
161
|
-
{ condition: '=', value: '.sha2', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
162
|
-
{ condition: '=', value: '.sha256', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
163
|
-
{ condition: '=', value: '.sln', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
164
|
-
{ condition: '=', value: '.spec', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
165
|
-
{ condition: '=', value: '.sql', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
166
|
-
{ condition: '=', value: '.sub', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
167
|
-
{ condition: '=', value: '.svg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
168
|
-
{ condition: '=', value: '.svn-base', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
169
|
-
{ condition: '=', value: '.tab', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
170
|
-
{ condition: '=', value: '.template', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
171
|
-
{ condition: '=', value: '.test', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
172
|
-
{ condition: '=', value: '.tex', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
173
|
-
{ condition: '=', value: '.tiff', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
174
|
-
{ condition: '=', value: '.toml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
175
|
-
{ condition: '=', value: '.ttf', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
176
|
-
{ condition: '=', value: '.txt', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
177
|
-
{ condition: '=', value: '.utf-8', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
178
|
-
{ condition: '=', value: '.vim', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
179
|
-
{ condition: '=', value: '.wav', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
180
|
-
{ condition: '=', value: '.whl', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
181
|
-
{ condition: '=', value: '.woff', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
182
|
-
{ condition: '=', value: '.xht', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
183
|
-
{ condition: '=', value: '.xhtml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
184
|
-
{ condition: '=', value: '.xls', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
185
|
-
{ condition: '=', value: '.xlsx', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
186
|
-
{ condition: '=', value: '.xml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
187
|
-
{ condition: '=', value: '.xpm', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
188
|
-
{ condition: '=', value: '.xsd', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
189
|
-
{ condition: '=', value: '.xul', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
190
|
-
{ condition: '=', value: '.yaml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
191
|
-
{ condition: '=', value: '.yml', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
192
|
-
{ condition: '=', value: '.wfp', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
193
|
-
{ condition: '=', value: '.editorconfig', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
194
|
-
{ condition: '=', value: '.dotcover', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
195
|
-
{ condition: '=', value: '.pid', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
196
|
-
{ condition: '=', value: '.lcov', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
197
|
-
{ condition: '=', value: '.egg', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
198
|
-
{ condition: '=', value: '.manifest', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
199
|
-
{ condition: '=', value: '.cache', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
200
|
-
{ condition: '=', value: '.coverage', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
201
|
-
{ condition: '=', value: '.cover', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
202
|
-
{ condition: '=', value: '.gem', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
203
|
-
{ condition: '=', value: '.lst', ftype: FilterType.EXTENSION, scope: FilterScope.FILE },
|
|
204
|
-
],
|
|
205
|
-
};
|
|
206
|
-
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import * as fpath from 'path';
|
|
3
|
-
import { isBinaryFileSync } from 'isbinaryfile';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export interface IFilter {
|
|
8
|
-
type: FilterListType.ALLOW | FilterListType.BANNED;
|
|
9
|
-
filters: Array<{
|
|
10
|
-
ftype: FilterType;
|
|
11
|
-
scope: FilterScope;
|
|
12
|
-
condition: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export enum FilterType {
|
|
18
|
-
NAME = 'NAME',
|
|
19
|
-
CONTENT = 'CONTENT',
|
|
20
|
-
EXTENSION = 'EXTENSION',
|
|
21
|
-
SIZE = 'SIZE',
|
|
22
|
-
DATE = 'DATE',
|
|
23
|
-
NULL = 'NONE'
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export enum FilterListType {
|
|
27
|
-
BANNED = 'BANNED',
|
|
28
|
-
ALLOW = 'ALLOW',
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export enum FilterScope {
|
|
32
|
-
FOLDER = 'FOLDER',
|
|
33
|
-
FILE = 'FILE',
|
|
34
|
-
ALL = 'ALL',
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
class AbstractFilter {
|
|
38
|
-
condition: string;
|
|
39
|
-
|
|
40
|
-
value: string;
|
|
41
|
-
|
|
42
|
-
ftype: FilterType;
|
|
43
|
-
|
|
44
|
-
scope: FilterScope;
|
|
45
|
-
|
|
46
|
-
constructor(condition: string, value: string) {
|
|
47
|
-
this.condition = condition;
|
|
48
|
-
this.value = value;
|
|
49
|
-
this.ftype = FilterType.NULL;
|
|
50
|
-
this.scope = FilterScope.ALL;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
evaluate(path: string): boolean {
|
|
54
|
-
return true;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export class NameFilter extends AbstractFilter {
|
|
59
|
-
static CONTAINS = 'contains';
|
|
60
|
-
static FULLMATCH = 'fullmatch';
|
|
61
|
-
static STARTS = 'starts';
|
|
62
|
-
static ENDS = 'ends';
|
|
63
|
-
|
|
64
|
-
constructor(condition: string, value: string, scope: FilterScope) {
|
|
65
|
-
super(condition, value);
|
|
66
|
-
this.ftype = FilterType.NAME;
|
|
67
|
-
this.scope = scope || super.scope;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
evaluate(path: string): boolean {
|
|
71
|
-
this.value = this.value.toLowerCase();
|
|
72
|
-
path = path.toLowerCase();
|
|
73
|
-
|
|
74
|
-
if (this.condition === NameFilter.CONTAINS) {
|
|
75
|
-
return !(path.indexOf(this.value) >= 0);
|
|
76
|
-
}
|
|
77
|
-
if (this.condition === NameFilter.FULLMATCH) return fpath.basename(path) !== this.value;
|
|
78
|
-
if (this.condition === NameFilter.STARTS) {
|
|
79
|
-
let filename: string;
|
|
80
|
-
filename = fpath.basename(path);
|
|
81
|
-
return !filename.startsWith(this.value);
|
|
82
|
-
}
|
|
83
|
-
if (this.condition === NameFilter.ENDS) {
|
|
84
|
-
let filename: string;
|
|
85
|
-
filename = fpath.basename(path);
|
|
86
|
-
return !filename.endsWith(this.value);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export class ContentFilter extends AbstractFilter {
|
|
94
|
-
static VALUE_BINARY = 'BINARY';
|
|
95
|
-
static VALUE_TEXT = 'TEXT';
|
|
96
|
-
static EQUAL = '=';
|
|
97
|
-
static NOT_EQUAL = '!=';
|
|
98
|
-
|
|
99
|
-
constructor(condition: string, value: string, scope: FilterScope) {
|
|
100
|
-
super(condition, value);
|
|
101
|
-
this.ftype = FilterType.CONTENT;
|
|
102
|
-
this.scope = scope || super.scope; // Verificar
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
evaluate(path: string): boolean {
|
|
106
|
-
const binary = isBinaryFileSync(path);
|
|
107
|
-
|
|
108
|
-
if (this.condition === ContentFilter.EQUAL && this.value === ContentFilter.VALUE_BINARY && binary) return false;
|
|
109
|
-
if (this.condition === ContentFilter.NOT_EQUAL && this.value === ContentFilter.VALUE_TEXT && binary) return false;
|
|
110
|
-
if (this.condition === ContentFilter.EQUAL && this.value === ContentFilter.VALUE_TEXT && !binary) return false;
|
|
111
|
-
if (this.condition === ContentFilter.NOT_EQUAL && this.value === ContentFilter.VALUE_BINARY && !binary) return false;
|
|
112
|
-
return true;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export class ExtensionFilter extends AbstractFilter {
|
|
117
|
-
|
|
118
|
-
constructor(condition: string, value: string, scope: FilterScope) {
|
|
119
|
-
super(condition, value);
|
|
120
|
-
this.ftype = FilterType.EXTENSION;
|
|
121
|
-
this.scope = scope || super.scope; // Verificar
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
evaluate(path: string): boolean {
|
|
125
|
-
path = path.toLowerCase();
|
|
126
|
-
this.value = this.value.toLowerCase();
|
|
127
|
-
return !path.endsWith(this.value);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export class SizeFilter extends AbstractFilter {
|
|
132
|
-
static BIGGER = '>'
|
|
133
|
-
static SMALLER = '<'
|
|
134
|
-
static EQUAL = '='
|
|
135
|
-
constructor(condition: string, value: string, scope: FilterScope) {
|
|
136
|
-
super(condition, value);
|
|
137
|
-
this.ftype = FilterType.SIZE;
|
|
138
|
-
this.scope = scope || super.scope; // Verificar
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
evaluate(path: string): boolean {
|
|
142
|
-
const stat = fs.statSync(path);
|
|
143
|
-
|
|
144
|
-
if (this.condition === SizeFilter.BIGGER) {
|
|
145
|
-
if (stat.size > parseInt(this.value, 10)) {
|
|
146
|
-
// console.log("NO aceptado por que NO es mayor");
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
return true;
|
|
150
|
-
}
|
|
151
|
-
if (this.condition === SizeFilter.SMALLER) {
|
|
152
|
-
if (stat.size < parseInt(this.value, 10)) {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
return true;
|
|
156
|
-
}
|
|
157
|
-
if (this.condition === SizeFilter.EQUAL) {
|
|
158
|
-
if (stat.size === parseInt(this.value, 10)) {
|
|
159
|
-
return false;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return true;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
return true;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
export class DateFilter extends AbstractFilter {
|
|
169
|
-
static BIGGER = '>'
|
|
170
|
-
static SMALLER = '<'
|
|
171
|
-
constructor(condition: string, value: string, scope: FilterScope) {
|
|
172
|
-
super(condition, value);
|
|
173
|
-
this.ftype = FilterType.NAME;
|
|
174
|
-
this.scope = scope || super.scope; // Verificar
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
evaluate(path: string): boolean {
|
|
178
|
-
const stats = fs.statSync(path);
|
|
179
|
-
|
|
180
|
-
modified = stats.mtime;
|
|
181
|
-
|
|
182
|
-
const lDate = new Date(this.value);
|
|
183
|
-
|
|
184
|
-
const ms: number = stats.mtimeMs;
|
|
185
|
-
var modified = new Date(ms);
|
|
186
|
-
// console.log(lDate);
|
|
187
|
-
// console.log(modified);
|
|
188
|
-
if (this.condition === DateFilter.BIGGER) {
|
|
189
|
-
if (modified > lDate) {
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
return true;
|
|
193
|
-
}
|
|
194
|
-
if (this.condition === DateFilter.SMALLER) {
|
|
195
|
-
if (modified < lDate) {
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
return true;
|
|
199
|
-
}
|
|
200
|
-
return true;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export class FilterList {
|
|
205
|
-
type: FilterListType;
|
|
206
|
-
|
|
207
|
-
filters: AbstractFilter[];
|
|
208
|
-
|
|
209
|
-
constructor(fList?: IFilter) {
|
|
210
|
-
this.filters = [];
|
|
211
|
-
if (fList) this.load(fList);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
public addFilter(filter: AbstractFilter): void {
|
|
215
|
-
this.filters.push(filter);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Returns false if the path match with some filter in the list
|
|
219
|
-
// IMPORTANT: This method DOES NOT honor the FilterType (BANNED | ALLOW)
|
|
220
|
-
// Use the method include to honor the FilterType
|
|
221
|
-
public evaluate(path: string): boolean {
|
|
222
|
-
const pathStat = fs.lstatSync(path);
|
|
223
|
-
|
|
224
|
-
let i: number;
|
|
225
|
-
for (i = 0; i < this.filters.length; i += 1) {
|
|
226
|
-
const evaluation = this.filters[i].evaluate(path);
|
|
227
|
-
|
|
228
|
-
if (this.filters[i].scope === FilterScope.FOLDER && pathStat.isDirectory() && !evaluation) return false;
|
|
229
|
-
|
|
230
|
-
if (this.filters[i].scope === FilterScope.FILE && pathStat.isFile() && !evaluation) return false;
|
|
231
|
-
|
|
232
|
-
if (this.filters[i].scope === FilterScope.ALL && !evaluation) return false;
|
|
233
|
-
}
|
|
234
|
-
return true;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
//
|
|
238
|
-
public include(path: string): boolean {
|
|
239
|
-
if(this.type === FilterListType.BANNED) return this.evaluate(path);
|
|
240
|
-
return !this.evaluate(path);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
public save(path: string) {
|
|
244
|
-
fs.writeFileSync(path, JSON.stringify(this.filters).toString());
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
public loadFromFile(path: string) {
|
|
248
|
-
const json = fs.readFileSync(path, 'utf8');
|
|
249
|
-
const filters = JSON.parse(json);
|
|
250
|
-
this.load(filters);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
public unload() {
|
|
254
|
-
this.filters = [];
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
public load(fList: IFilter) {
|
|
258
|
-
this.type = fList.type;
|
|
259
|
-
const a = fList.filters;
|
|
260
|
-
|
|
261
|
-
let i: number;
|
|
262
|
-
for (i = 0; i < a.length; i += 1) {
|
|
263
|
-
const scope = a[i].scope || FilterScope.ALL;
|
|
264
|
-
if (a[i].ftype === FilterType.NAME) this.addFilter(new NameFilter(a[i].condition, a[i].value, scope));
|
|
265
|
-
if (a[i].ftype === FilterType.DATE) this.addFilter(new DateFilter(a[i].condition, a[i].value, scope));
|
|
266
|
-
if (a[i].ftype === FilterType.SIZE) this.addFilter(new SizeFilter(a[i].condition, a[i].value, scope));
|
|
267
|
-
if (a[i].ftype === FilterType.EXTENSION) this.addFilter(new ExtensionFilter(a[i].condition, a[i].value, scope));
|
|
268
|
-
if (a[i].ftype === FilterType.CONTENT) this.addFilter(new ContentFilter(a[i].condition, a[i].value, scope));
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
package/src/sdk/Report/Report.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
import { DataProviderManager } from '../../sdk/DataLayer/DataProviderManager';
|
|
4
|
-
import { IDataLayers } from '../../sdk/DataLayer/DataLayerTypes';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const reportDefaultPath = path.join(__dirname,"../../../../assets/ReportHTMLTemplate/index.html");
|
|
8
|
-
|
|
9
|
-
export class Report {
|
|
10
|
-
|
|
11
|
-
private dataProviderManager: DataProviderManager;
|
|
12
|
-
|
|
13
|
-
private dataLayer: IDataLayers;
|
|
14
|
-
|
|
15
|
-
constructor(dpm: DataProviderManager = new DataProviderManager()) {
|
|
16
|
-
this.dataProviderManager = dpm;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
public setDataProviderManager(dpm: DataProviderManager) {
|
|
20
|
-
this.dataProviderManager = dpm;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
public async getHTML(): Promise<string> {
|
|
24
|
-
this.dataLayer = this.dataProviderManager.generateData();
|
|
25
|
-
const html = (await fs.promises.readFile(reportDefaultPath, 'utf-8'));
|
|
26
|
-
if(!html) throw new Error('Invalid template path');
|
|
27
|
-
return html.replace('#DATA',JSON.stringify(this.dataLayer));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import * as grpc from '@grpc/grpc-js';
|
|
2
|
-
import { DependenciesClient } from './scanoss/api/dependencies/v2/scanoss-dependencies_grpc_pb';
|
|
3
|
-
import * as DependenciesMessages from './scanoss/api/dependencies/v2/scanoss-dependencies_pb';
|
|
4
|
-
import * as CommonMessages from './scanoss/api/common/v2/scanoss-common_pb'
|
|
5
|
-
|
|
6
|
-
export class GrpcDependencyService {
|
|
7
|
-
|
|
8
|
-
private client: DependenciesClient;
|
|
9
|
-
|
|
10
|
-
private metadata;
|
|
11
|
-
|
|
12
|
-
constructor(endpoint: string, port: string, apiKey='') {
|
|
13
|
-
this.client = new DependenciesClient(endpoint + ':' + port, grpc.credentials.createSsl());
|
|
14
|
-
if(apiKey) {
|
|
15
|
-
this.metadata = new grpc.Metadata();
|
|
16
|
-
this.metadata.add('x-api-key', apiKey);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
public async get(req: DependenciesMessages.DependencyRequest): Promise<DependenciesMessages.DependencyResponse> {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
this.client.getDependencies(req, (err, response) => {
|
|
23
|
-
if (err) reject(err);
|
|
24
|
-
resolve(response);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
public buildDependencyRequestMsg(plainObj: DependenciesMessages.DependencyRequest.AsObject): DependenciesMessages.DependencyRequest {
|
|
30
|
-
try {
|
|
31
|
-
const depMessage = new DependenciesMessages.DependencyRequest();
|
|
32
|
-
for (const dependency of plainObj.filesList) {
|
|
33
|
-
const fileMsg = new DependenciesMessages.DependencyRequest.Files();
|
|
34
|
-
fileMsg.setFile(dependency.file);
|
|
35
|
-
for (const purl of dependency.purlsList) {
|
|
36
|
-
const purlMsg = new DependenciesMessages.DependencyRequest.Purls();
|
|
37
|
-
purlMsg.setPurl(purl.purl);
|
|
38
|
-
purlMsg.setRequirement(purl?.requirement);
|
|
39
|
-
fileMsg.addPurls(purlMsg);
|
|
40
|
-
}
|
|
41
|
-
depMessage.addFiles(fileMsg);
|
|
42
|
-
}
|
|
43
|
-
return depMessage;
|
|
44
|
-
} catch (e) {
|
|
45
|
-
console.error(e);
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
public async echo(req: CommonMessages.EchoRequest): Promise<CommonMessages.EchoResponse> {
|
|
52
|
-
return new Promise((resolve, reject) => {
|
|
53
|
-
this.client.echo(req, (err, response) => {
|
|
54
|
-
if (err) reject(err);
|
|
55
|
-
resolve(response);
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
public buildEchoRequestMsg(plainObj: CommonMessages.EchoRequest.AsObject): CommonMessages.EchoRequest {
|
|
62
|
-
try {
|
|
63
|
-
const echoMessage = new CommonMessages.EchoRequest();
|
|
64
|
-
echoMessage.setMessage(plainObj.message);
|
|
65
|
-
return echoMessage;
|
|
66
|
-
} catch (e) {
|
|
67
|
-
console.error(e);
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
// GENERATED CODE -- NO SERVICES IN PROTO
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// package: scanoss.api.common.v2
|
|
2
|
-
// file: scanoss/api/common/v2/scanoss-common.proto
|
|
3
|
-
|
|
4
|
-
import * as jspb from "google-protobuf";
|
|
5
|
-
|
|
6
|
-
export class StatusResponse extends jspb.Message {
|
|
7
|
-
getStatus(): StatusCodeMap[keyof StatusCodeMap];
|
|
8
|
-
setStatus(value: StatusCodeMap[keyof StatusCodeMap]): void;
|
|
9
|
-
|
|
10
|
-
getMessage(): string;
|
|
11
|
-
setMessage(value: string): void;
|
|
12
|
-
|
|
13
|
-
serializeBinary(): Uint8Array;
|
|
14
|
-
toObject(includeInstance?: boolean): StatusResponse.AsObject;
|
|
15
|
-
static toObject(includeInstance: boolean, msg: StatusResponse): StatusResponse.AsObject;
|
|
16
|
-
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
17
|
-
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
18
|
-
static serializeBinaryToWriter(message: StatusResponse, writer: jspb.BinaryWriter): void;
|
|
19
|
-
static deserializeBinary(bytes: Uint8Array): StatusResponse;
|
|
20
|
-
static deserializeBinaryFromReader(message: StatusResponse, reader: jspb.BinaryReader): StatusResponse;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export namespace StatusResponse {
|
|
24
|
-
export type AsObject = {
|
|
25
|
-
status: StatusCodeMap[keyof StatusCodeMap],
|
|
26
|
-
message: string,
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export class EchoRequest extends jspb.Message {
|
|
31
|
-
getMessage(): string;
|
|
32
|
-
setMessage(value: string): void;
|
|
33
|
-
|
|
34
|
-
serializeBinary(): Uint8Array;
|
|
35
|
-
toObject(includeInstance?: boolean): EchoRequest.AsObject;
|
|
36
|
-
static toObject(includeInstance: boolean, msg: EchoRequest): EchoRequest.AsObject;
|
|
37
|
-
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
38
|
-
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
39
|
-
static serializeBinaryToWriter(message: EchoRequest, writer: jspb.BinaryWriter): void;
|
|
40
|
-
static deserializeBinary(bytes: Uint8Array): EchoRequest;
|
|
41
|
-
static deserializeBinaryFromReader(message: EchoRequest, reader: jspb.BinaryReader): EchoRequest;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export namespace EchoRequest {
|
|
45
|
-
export type AsObject = {
|
|
46
|
-
message: string,
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export class EchoResponse extends jspb.Message {
|
|
51
|
-
getMessage(): string;
|
|
52
|
-
setMessage(value: string): void;
|
|
53
|
-
|
|
54
|
-
serializeBinary(): Uint8Array;
|
|
55
|
-
toObject(includeInstance?: boolean): EchoResponse.AsObject;
|
|
56
|
-
static toObject(includeInstance: boolean, msg: EchoResponse): EchoResponse.AsObject;
|
|
57
|
-
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
|
58
|
-
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
|
59
|
-
static serializeBinaryToWriter(message: EchoResponse, writer: jspb.BinaryWriter): void;
|
|
60
|
-
static deserializeBinary(bytes: Uint8Array): EchoResponse;
|
|
61
|
-
static deserializeBinaryFromReader(message: EchoResponse, reader: jspb.BinaryReader): EchoResponse;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export namespace EchoResponse {
|
|
65
|
-
export type AsObject = {
|
|
66
|
-
message: string,
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export interface StatusCodeMap {
|
|
71
|
-
UNSPECIFIED: 0;
|
|
72
|
-
SUCCESS: 1;
|
|
73
|
-
SUCCEEDED_WITH_WARNINGS: 2;
|
|
74
|
-
WARNING: 3;
|
|
75
|
-
FAILED: 4;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export const StatusCode: StatusCodeMap;
|
|
79
|
-
|