@dataparade/cli 0.0.9 → 0.0.11
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/README.md +1 -1
- package/dist/package.json +1 -1
- package/dist/src/ai-enrichment/lambda-init-error.d.ts +5 -0
- package/dist/src/ai-enrichment/lambda-init-error.js +38 -0
- package/dist/src/ai-enrichment/providers/platform-proxy-provider.d.ts +5 -0
- package/dist/src/ai-enrichment/providers/platform-proxy-provider.js +27 -1
- package/dist/src/analyzers/cpp/cpp-detection-config.d.ts +73 -0
- package/dist/src/analyzers/cpp/cpp-detection-config.js +137 -0
- package/dist/src/analyzers/cpp/dependency-manifests.d.ts +8 -0
- package/dist/src/analyzers/cpp/dependency-manifests.js +130 -0
- package/dist/src/analyzers/cpp/detector.d.ts +3 -0
- package/dist/src/analyzers/cpp/detector.js +21 -0
- package/dist/src/analyzers/cpp/index.d.ts +2 -0
- package/dist/src/analyzers/cpp/index.js +11 -0
- package/dist/src/analyzers/cpp/manifest-parsers.d.ts +13 -0
- package/dist/src/analyzers/cpp/manifest-parsers.js +104 -0
- package/dist/src/analyzers/cpp/parser.d.ts +35 -0
- package/dist/src/analyzers/cpp/parser.js +206 -0
- package/dist/src/analyzers/cpp/patterns.d.ts +3 -0
- package/dist/src/analyzers/cpp/patterns.js +37 -0
- package/dist/src/analyzers/csharp/csharp-detection-config.d.ts +100 -0
- package/dist/src/analyzers/csharp/csharp-detection-config.js +160 -0
- package/dist/src/analyzers/csharp/dependency-manifests.d.ts +13 -0
- package/dist/src/analyzers/csharp/dependency-manifests.js +184 -0
- package/dist/src/analyzers/csharp/detector.d.ts +3 -0
- package/dist/src/analyzers/csharp/detector.js +21 -0
- package/dist/src/analyzers/csharp/index.d.ts +2 -0
- package/dist/src/analyzers/csharp/index.js +11 -0
- package/dist/src/analyzers/csharp/manifest-parsers.d.ts +34 -0
- package/dist/src/analyzers/csharp/manifest-parsers.js +130 -0
- package/dist/src/analyzers/csharp/parser.d.ts +48 -0
- package/dist/src/analyzers/csharp/parser.js +277 -0
- package/dist/src/analyzers/csharp/patterns.d.ts +3 -0
- package/dist/src/analyzers/csharp/patterns.js +57 -0
- package/dist/src/analyzers/go/dependency-manifests.d.ts +10 -0
- package/dist/src/analyzers/go/dependency-manifests.js +117 -0
- package/dist/src/analyzers/go/detector.d.ts +3 -0
- package/dist/src/analyzers/go/detector.js +21 -0
- package/dist/src/analyzers/go/go-detection-config.d.ts +97 -0
- package/dist/src/analyzers/go/go-detection-config.js +164 -0
- package/dist/src/analyzers/go/index.d.ts +2 -0
- package/dist/src/analyzers/go/index.js +11 -0
- package/dist/src/analyzers/go/manifest-parsers.d.ts +20 -0
- package/dist/src/analyzers/go/manifest-parsers.js +104 -0
- package/dist/src/analyzers/go/parser.d.ts +40 -0
- package/dist/src/analyzers/go/parser.js +186 -0
- package/dist/src/analyzers/go/patterns.d.ts +3 -0
- package/dist/src/analyzers/go/patterns.js +50 -0
- package/dist/src/analyzers/jvm/dependency-manifests.d.ts +16 -0
- package/dist/src/analyzers/jvm/dependency-manifests.js +205 -0
- package/dist/src/analyzers/jvm/detector.d.ts +3 -0
- package/dist/src/analyzers/jvm/detector.js +21 -0
- package/dist/src/analyzers/jvm/index.d.ts +9 -0
- package/dist/src/analyzers/jvm/index.js +18 -0
- package/dist/src/analyzers/jvm/jvm-detection-config.d.ts +136 -0
- package/dist/src/analyzers/jvm/jvm-detection-config.js +195 -0
- package/dist/src/analyzers/jvm/manifest-parsers.d.ts +61 -0
- package/dist/src/analyzers/jvm/manifest-parsers.js +246 -0
- package/dist/src/analyzers/jvm/parser.d.ts +54 -0
- package/dist/src/analyzers/jvm/parser.js +419 -0
- package/dist/src/analyzers/jvm/patterns.d.ts +3 -0
- package/dist/src/analyzers/jvm/patterns.js +64 -0
- package/dist/src/analyzers/python/detector.js +1 -1
- package/dist/src/analyzers/python/parser.d.ts +1 -0
- package/dist/src/analyzers/python/parser.js +7 -0
- package/dist/src/analyzers/python/patterns.d.ts +1 -0
- package/dist/src/analyzers/python/patterns.js +22 -77
- package/dist/src/analyzers/python/python-detection-config.d.ts +18 -0
- package/dist/src/analyzers/python/python-detection-config.js +20 -0
- package/dist/src/analyzers/registry.js +15 -0
- package/dist/src/analyzers/shared/c-family-calls.d.ts +26 -0
- package/dist/src/analyzers/shared/c-family-calls.js +118 -0
- package/dist/src/analyzers/shared/strip-comments.d.ts +32 -0
- package/dist/src/analyzers/shared/strip-comments.js +167 -0
- package/dist/src/analyzers/typescript/detector.js +1 -1
- package/dist/src/analyzers/typescript/typescript-detection-config.d.ts +37 -0
- package/dist/src/analyzers/typescript/typescript-detection-config.js +48 -0
- package/dist/src/analyzers/typescript/typescript-detection.d.ts +1 -0
- package/dist/src/analyzers/typescript/typescript-detection.js +27 -29
- package/dist/src/cli.js +28 -1
- package/dist/src/config/file.js +5 -0
- package/dist/src/config/resolve.js +5 -0
- package/dist/src/core/pipeline/graph-mapping.js +3 -0
- package/dist/src/core/pipeline/structural-scan.js +154 -31
- package/dist/src/core/schema/scan-config.schema.d.ts +5 -0
- package/dist/src/core/schema/scan-config.schema.js +5 -0
- package/dist/src/core/schema/scan-result.schema.d.ts +5 -0
- package/dist/src/core/schema/scan-result.schema.js +5 -0
- package/dist/src/core/sectioning/discover-service-sections.js +27 -1
- package/dist/src/core/types/file.d.ts +1 -1
- package/dist/src/ingest/file-system.js +27 -0
- package/dist/src/patterns/config.d.ts +8 -0
- package/dist/src/patterns/config.js +136 -0
- package/dist/src/patterns/detectors/cpp.d.ts +8 -0
- package/dist/src/patterns/detectors/cpp.js +243 -0
- package/dist/src/patterns/detectors/csharp.d.ts +9 -0
- package/dist/src/patterns/detectors/csharp.js +385 -0
- package/dist/src/patterns/detectors/go.d.ts +9 -0
- package/dist/src/patterns/detectors/go.js +298 -0
- package/dist/src/patterns/detectors/helpers.d.ts +3 -0
- package/dist/src/patterns/detectors/helpers.js +5 -0
- package/dist/src/patterns/detectors/jvm.d.ts +15 -0
- package/dist/src/patterns/detectors/jvm.js +537 -0
- package/dist/src/patterns/detectors/python.d.ts +1 -0
- package/dist/src/patterns/detectors/python.js +92 -5
- package/dist/src/patterns/detectors/typescript.d.ts +2 -0
- package/dist/src/patterns/detectors/typescript.js +156 -4
- package/dist/src/patterns/engine.d.ts +18 -0
- package/dist/src/patterns/engine.js +30 -0
- package/dist/src/patterns/scan-exclusions.js +20 -0
- package/dist/src/platform-api/telemetry-client.d.ts +6 -0
- package/dist/src/platform-api/telemetry-client.js +65 -0
- package/dist/src/platform-api/telemetry.types.d.ts +13 -0
- package/dist/src/platform-api/telemetry.types.js +2 -0
- package/dist/src/platform-api/upload-client.d.ts +2 -0
- package/dist/src/platform-api/upload-client.js +4 -0
- package/dist/src/platform-api/upload.types.d.ts +2 -0
- package/dist/src/upload/build-preview-url.d.ts +2 -2
- package/dist/src/upload/build-preview-url.js +10 -3
- package/dist/src/upload/run-upload.js +62 -19
- package/dist/src/upload/types.d.ts +2 -0
- package/dist/tests/unit/ai-enrichment/lambda-init-error.spec.d.ts +1 -0
- package/dist/tests/unit/ai-enrichment/lambda-init-error.spec.js +11 -0
- package/dist/tests/unit/ai-enrichment/platform-proxy-provider.spec.js +80 -0
- package/dist/tests/unit/analyzers/cpp/dependency-manifests.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/cpp/dependency-manifests.spec.js +66 -0
- package/dist/tests/unit/analyzers/cpp/parser.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/cpp/parser.spec.js +80 -0
- package/dist/tests/unit/analyzers/cpp/patterns.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/cpp/patterns.spec.js +141 -0
- package/dist/tests/unit/analyzers/csharp/dependency-manifests.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/csharp/dependency-manifests.spec.js +75 -0
- package/dist/tests/unit/analyzers/csharp/parser.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/csharp/parser.spec.js +118 -0
- package/dist/tests/unit/analyzers/csharp/patterns.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/csharp/patterns.spec.js +210 -0
- package/dist/tests/unit/analyzers/go/dependency-manifests.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/go/dependency-manifests.spec.js +96 -0
- package/dist/tests/unit/analyzers/go/parser.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/go/parser.spec.js +110 -0
- package/dist/tests/unit/analyzers/go/patterns.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/go/patterns.spec.js +239 -0
- package/dist/tests/unit/analyzers/jvm/dependency-manifests.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/jvm/dependency-manifests.spec.js +179 -0
- package/dist/tests/unit/analyzers/jvm/parser.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/jvm/parser.spec.js +195 -0
- package/dist/tests/unit/analyzers/jvm/patterns.spec.d.ts +1 -0
- package/dist/tests/unit/analyzers/jvm/patterns.spec.js +284 -0
- package/dist/tests/unit/analyzers/python/patterns.spec.js +169 -0
- package/dist/tests/unit/analyzers/typescript/detector.spec.js +188 -0
- package/dist/tests/unit/core/cpp-dotnet-scan.spec.d.ts +1 -0
- package/dist/tests/unit/core/cpp-dotnet-scan.spec.js +67 -0
- package/dist/tests/unit/core/cpp-dotnet-sections.spec.d.ts +1 -0
- package/dist/tests/unit/core/cpp-dotnet-sections.spec.js +46 -0
- package/dist/tests/unit/core/go-scan.spec.d.ts +1 -0
- package/dist/tests/unit/core/go-scan.spec.js +78 -0
- package/dist/tests/unit/core/graph-mapping.spec.js +75 -0
- package/dist/tests/unit/core/jvm-scan.spec.d.ts +1 -0
- package/dist/tests/unit/core/jvm-scan.spec.js +94 -0
- package/dist/tests/unit/ingest/cpp-dotnet-languages.spec.d.ts +1 -0
- package/dist/tests/unit/ingest/cpp-dotnet-languages.spec.js +56 -0
- package/dist/tests/unit/ingest/jvm-languages.spec.d.ts +1 -0
- package/dist/tests/unit/ingest/jvm-languages.spec.js +47 -0
- package/dist/tests/unit/platform-api/telemetry-client.spec.d.ts +1 -0
- package/dist/tests/unit/platform-api/telemetry-client.spec.js +48 -0
- package/dist/tests/unit/upload/build-preview-url.spec.js +10 -0
- package/dist/tests/unit/upload/run-upload.spec.js +18 -0
- package/package.json +1 -1
- package/patterns/cpp.md +176 -0
- package/patterns/cpp.patterns.yaml +314 -0
- package/patterns/csharp.md +211 -0
- package/patterns/csharp.patterns.yaml +375 -0
- package/patterns/go.md +211 -0
- package/patterns/go.patterns.yaml +429 -0
- package/patterns/jvm.md +160 -0
- package/patterns/jvm.patterns.yaml +884 -0
- package/patterns/python.patterns.yaml +177 -0
- package/patterns/third-party.patterns.yaml +5 -0
- package/patterns/typescript.patterns.yaml +222 -0
package/dist/src/cli.js
CHANGED
|
@@ -40,6 +40,7 @@ exports.run = run;
|
|
|
40
40
|
require("./config/load-cli-env");
|
|
41
41
|
const path_1 = __importDefault(require("path"));
|
|
42
42
|
const commander_1 = require("commander");
|
|
43
|
+
const crypto_1 = require("crypto");
|
|
43
44
|
const package_json_1 = __importDefault(require("../package.json"));
|
|
44
45
|
const json_1 = require("./output/json");
|
|
45
46
|
const upload_env_1 = require("./config/upload-env");
|
|
@@ -50,6 +51,7 @@ const resolve_1 = require("./config/resolve");
|
|
|
50
51
|
const scan_env_1 = require("./config/scan-env");
|
|
51
52
|
const validate_scan_ai_1 = require("./config/validate-scan-ai");
|
|
52
53
|
const scan_sentry_1 = require("./observability/scan-sentry");
|
|
54
|
+
const telemetry_client_1 = require("./platform-api/telemetry-client");
|
|
53
55
|
const scan_config_schema_1 = require("./core/schema/scan-config.schema");
|
|
54
56
|
const file_system_1 = require("./ingest/file-system");
|
|
55
57
|
function formatEvidence(detail) {
|
|
@@ -121,7 +123,7 @@ function createProgram() {
|
|
|
121
123
|
.option("-o, --output <file>", "Write dataflow.json wrapper to the given file (default: ./dataflow.json)")
|
|
122
124
|
.option("--exclude <pattern...>", "One or more glob patterns to exclude from scanning")
|
|
123
125
|
.option("--minimum-confidence <number>", "Minimum confidence (0-1) for including detections")
|
|
124
|
-
.option("--language <language...>", "Limit scanning to specific languages (e.g. typescript, javascript)")
|
|
126
|
+
.option("--language <language...>", "Limit scanning to specific languages (e.g. typescript, javascript, python, go, java, kotlin, cpp, csharp, terraform)")
|
|
125
127
|
.option("--project-name <name>", "Override the inferred project name used for the application asset")
|
|
126
128
|
.option("--deep-analysis", "Enable deeper, potentially slower structural analysis where supported")
|
|
127
129
|
.option("--terraform-json <path>", "Merge resource addresses from a saved `terraform show -json` file (absolute or relative to scan root)")
|
|
@@ -159,6 +161,15 @@ function createProgram() {
|
|
|
159
161
|
const workspaceApiKey = options.workspaceApiKey?.trim() ||
|
|
160
162
|
options.apiKey?.trim() ||
|
|
161
163
|
(0, scan_env_1.resolveWorkspaceApiKey)(process.env);
|
|
164
|
+
const usageSessionId = (0, crypto_1.randomUUID)();
|
|
165
|
+
await (0, telemetry_client_1.reportCliUsageEvent)({
|
|
166
|
+
sessionId: usageSessionId,
|
|
167
|
+
event: "scan_started",
|
|
168
|
+
command: "scan",
|
|
169
|
+
hasApiKey: Boolean(workspaceApiKey),
|
|
170
|
+
apiKey: workspaceApiKey,
|
|
171
|
+
cliVersion: package_json_1.default.version,
|
|
172
|
+
});
|
|
162
173
|
try {
|
|
163
174
|
const rootPathArg = path || ".";
|
|
164
175
|
// Load dataparade.config.json from the directory being scanned, not
|
|
@@ -438,6 +449,8 @@ function createProgram() {
|
|
|
438
449
|
projectName: resolvedProjectName,
|
|
439
450
|
scanJobId: cliQuotaJobId,
|
|
440
451
|
logPrefix: "[scan]",
|
|
452
|
+
cliUsageSessionId: usageSessionId,
|
|
453
|
+
command: "scan",
|
|
441
454
|
});
|
|
442
455
|
}
|
|
443
456
|
catch (uploadError) {
|
|
@@ -516,6 +529,17 @@ function createProgram() {
|
|
|
516
529
|
process.exitCode = 1;
|
|
517
530
|
}
|
|
518
531
|
finally {
|
|
532
|
+
const scanFailed = (process.exitCode ?? 0) !== 0;
|
|
533
|
+
await (0, telemetry_client_1.reportCliUsageEvent)({
|
|
534
|
+
sessionId: usageSessionId,
|
|
535
|
+
event: scanFailed ? "scan_failed" : "scan_succeeded",
|
|
536
|
+
command: "scan",
|
|
537
|
+
hasApiKey: Boolean(workspaceApiKey),
|
|
538
|
+
apiKey: workspaceApiKey,
|
|
539
|
+
cliVersion: package_json_1.default.version,
|
|
540
|
+
errorCode: scanFailed ? "scan_failed" : undefined,
|
|
541
|
+
errorMessage: scanFailed ? fallbackFailureMessage : undefined,
|
|
542
|
+
});
|
|
519
543
|
if (platformQuotaApiKey && cliQuotaJobId && !quotaCompletionReported) {
|
|
520
544
|
try {
|
|
521
545
|
const { cliScanComplete } = await Promise.resolve().then(() => __importStar(require("./platform-api/scan-quota-client")));
|
|
@@ -548,6 +572,7 @@ function createProgram() {
|
|
|
548
572
|
const apiKey = options.workspaceApiKey?.trim() ||
|
|
549
573
|
options.apiKey?.trim() ||
|
|
550
574
|
(0, scan_env_1.resolveWorkspaceApiKey)(process.env);
|
|
575
|
+
const usageSessionId = (0, crypto_1.randomUUID)();
|
|
551
576
|
const filePath = path_1.default.resolve(process.cwd(), file || "dataflow.json");
|
|
552
577
|
let dataflow;
|
|
553
578
|
try {
|
|
@@ -575,6 +600,8 @@ function createProgram() {
|
|
|
575
600
|
apiKey,
|
|
576
601
|
dataflow,
|
|
577
602
|
projectName,
|
|
603
|
+
cliUsageSessionId: usageSessionId,
|
|
604
|
+
command: "upload",
|
|
578
605
|
});
|
|
579
606
|
}
|
|
580
607
|
catch (err) {
|
package/dist/src/config/file.js
CHANGED
|
@@ -84,6 +84,9 @@ function mapComponentToNode(component, sectionIndex, indexWithinSection) {
|
|
|
84
84
|
if (component.subType) {
|
|
85
85
|
baseData.componentSubType = component.subType;
|
|
86
86
|
}
|
|
87
|
+
if (typeof component.confidence === "number") {
|
|
88
|
+
baseData.scanConfidence = component.confidence;
|
|
89
|
+
}
|
|
87
90
|
if (component.detectedFrom?.length) {
|
|
88
91
|
baseData.detectedFrom = component.detectedFrom.map((ref) => stripCodeFromDetectedFromRef(ref));
|
|
89
92
|
}
|
|
@@ -13,8 +13,16 @@ const terraform_module_manifest_1 = require("../../analyzers/terraform/terraform
|
|
|
13
13
|
const terraform_show_json_1 = require("../../analyzers/terraform/terraform-show-json");
|
|
14
14
|
const terraform_exec_1 = require("../../analyzers/terraform/terraform-exec");
|
|
15
15
|
const parser_1 = require("../../analyzers/python/parser");
|
|
16
|
+
const parser_2 = require("../../analyzers/go/parser");
|
|
17
|
+
const parser_3 = require("../../analyzers/jvm/parser");
|
|
18
|
+
const parser_4 = require("../../analyzers/cpp/parser");
|
|
19
|
+
const parser_5 = require("../../analyzers/csharp/parser");
|
|
16
20
|
const dependency_manifests_1 = require("../../analyzers/python/dependency-manifests");
|
|
17
|
-
const dependency_manifests_2 = require("../../analyzers/
|
|
21
|
+
const dependency_manifests_2 = require("../../analyzers/go/dependency-manifests");
|
|
22
|
+
const dependency_manifests_3 = require("../../analyzers/jvm/dependency-manifests");
|
|
23
|
+
const dependency_manifests_4 = require("../../analyzers/cpp/dependency-manifests");
|
|
24
|
+
const dependency_manifests_5 = require("../../analyzers/csharp/dependency-manifests");
|
|
25
|
+
const dependency_manifests_6 = require("../../analyzers/typescript/dependency-manifests");
|
|
18
26
|
const discover_service_sections_1 = require("../sectioning/discover-service-sections");
|
|
19
27
|
const classifier_phase_1 = require("./classifier-phase");
|
|
20
28
|
const dataflow_phase_1 = require("./dataflow-phase");
|
|
@@ -33,6 +41,41 @@ function patternToRegex(pattern) {
|
|
|
33
41
|
escaped = escaped.replace(/\\\?/g, "[^/]"); // ?
|
|
34
42
|
return new RegExp(`^${escaped}$`);
|
|
35
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse every file of one language for reporting stats, surfacing parser
|
|
46
|
+
* warnings without failing the scan.
|
|
47
|
+
*/
|
|
48
|
+
function collectLanguageParserStats(files, language, parse, warn) {
|
|
49
|
+
const languageFiles = files.filter((file) => file.language === language);
|
|
50
|
+
if (languageFiles.length === 0)
|
|
51
|
+
return undefined;
|
|
52
|
+
let functionsIndexed = 0;
|
|
53
|
+
let moduleLevelCallsIndexed = 0;
|
|
54
|
+
const parserWarnings = [];
|
|
55
|
+
for (const file of languageFiles) {
|
|
56
|
+
try {
|
|
57
|
+
const counts = parse(file);
|
|
58
|
+
functionsIndexed += counts.functionsIndexed;
|
|
59
|
+
moduleLevelCallsIndexed += counts.callsIndexed;
|
|
60
|
+
parserWarnings.push(...counts.warnings.map((w) => `${language}-parser (${file.path}): ${w}`));
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
const message = err instanceof Error
|
|
64
|
+
? err.message
|
|
65
|
+
: `Unknown error in ${language} parser.`;
|
|
66
|
+
parserWarnings.push(`${language}-parser (${file.path}): ${message}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
for (const warning of parserWarnings)
|
|
70
|
+
warn(warning);
|
|
71
|
+
return {
|
|
72
|
+
language,
|
|
73
|
+
filesParsed: languageFiles.length,
|
|
74
|
+
functionsIndexed,
|
|
75
|
+
moduleLevelCallsIndexed,
|
|
76
|
+
warnings: parserWarnings,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
36
79
|
async function runStructuralScanPhase(rootPath, config, onWarning) {
|
|
37
80
|
const warn = (warning) => {
|
|
38
81
|
if (onWarning)
|
|
@@ -60,36 +103,60 @@ async function runStructuralScanPhase(rootPath, config, onWarning) {
|
|
|
60
103
|
return sum + file.content.split(/\r?\n/g).length;
|
|
61
104
|
}, 0);
|
|
62
105
|
const languageStats = [];
|
|
63
|
-
//
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
106
|
+
// Per-language parser stats (DP-P0-CLI-702).
|
|
107
|
+
const pythonStats = collectLanguageParserStats(files, "python", (file) => {
|
|
108
|
+
const moduleModel = (0, parser_1.parsePythonModule)(file);
|
|
109
|
+
return {
|
|
110
|
+
functionsIndexed: moduleModel.functions.length,
|
|
111
|
+
callsIndexed: moduleModel.moduleLevelCalls.length,
|
|
112
|
+
warnings: moduleModel.warnings,
|
|
113
|
+
};
|
|
114
|
+
}, warn);
|
|
115
|
+
if (pythonStats)
|
|
116
|
+
languageStats.push(pythonStats);
|
|
117
|
+
const goStats = collectLanguageParserStats(files, "go", (file) => {
|
|
118
|
+
const unit = (0, parser_2.parseGoSourceFile)(file);
|
|
119
|
+
return {
|
|
120
|
+
functionsIndexed: unit.functions.length,
|
|
121
|
+
callsIndexed: unit.calls.length,
|
|
122
|
+
warnings: unit.warnings,
|
|
123
|
+
};
|
|
124
|
+
}, warn);
|
|
125
|
+
if (goStats)
|
|
126
|
+
languageStats.push(goStats);
|
|
127
|
+
// One parser, reported per language so the stats stay attributable.
|
|
128
|
+
for (const jvmLanguage of ["java", "kotlin"]) {
|
|
129
|
+
const jvmStats = collectLanguageParserStats(files, jvmLanguage, (file) => {
|
|
130
|
+
const unit = (0, parser_3.parseJvmSourceFile)(file);
|
|
131
|
+
return {
|
|
132
|
+
functionsIndexed: unit.methods.length,
|
|
133
|
+
callsIndexed: unit.calls.length,
|
|
134
|
+
warnings: unit.warnings,
|
|
135
|
+
};
|
|
136
|
+
}, warn);
|
|
137
|
+
if (jvmStats)
|
|
138
|
+
languageStats.push(jvmStats);
|
|
92
139
|
}
|
|
140
|
+
const cppStats = collectLanguageParserStats(files, "cpp", (file) => {
|
|
141
|
+
const unit = (0, parser_4.parseCppTranslationUnit)(file);
|
|
142
|
+
return {
|
|
143
|
+
functionsIndexed: unit.functions.length,
|
|
144
|
+
callsIndexed: unit.calls.length,
|
|
145
|
+
warnings: unit.warnings,
|
|
146
|
+
};
|
|
147
|
+
}, warn);
|
|
148
|
+
if (cppStats)
|
|
149
|
+
languageStats.push(cppStats);
|
|
150
|
+
const cSharpStats = collectLanguageParserStats(files, "csharp", (file) => {
|
|
151
|
+
const unit = (0, parser_5.parseCSharpCompilationUnit)(file);
|
|
152
|
+
return {
|
|
153
|
+
functionsIndexed: unit.methods.length,
|
|
154
|
+
callsIndexed: unit.calls.length,
|
|
155
|
+
warnings: unit.warnings,
|
|
156
|
+
};
|
|
157
|
+
}, warn);
|
|
158
|
+
if (cSharpStats)
|
|
159
|
+
languageStats.push(cSharpStats);
|
|
93
160
|
const minimumConfidence = config.minimumConfidence;
|
|
94
161
|
const tfFiles = files.filter((f) => f.language === "terraform");
|
|
95
162
|
const terraformModuleManifest = tfFiles.length > 0
|
|
@@ -160,12 +227,68 @@ async function runStructuralScanPhase(rootPath, config, onWarning) {
|
|
|
160
227
|
warn(`python-manifests: ${message}`);
|
|
161
228
|
}
|
|
162
229
|
}
|
|
230
|
+
// Third-party service and dependency detection from Go module manifests.
|
|
231
|
+
if (!config.languages || config.languages.includes("go")) {
|
|
232
|
+
try {
|
|
233
|
+
findings.push(...(await (0, dependency_manifests_2.detectGoPatternsFromDependencyManifests)(scanRootDir, {
|
|
234
|
+
onWarning: warn,
|
|
235
|
+
excludePaths: config.excludePaths,
|
|
236
|
+
})));
|
|
237
|
+
}
|
|
238
|
+
catch (err) {
|
|
239
|
+
const message = err instanceof Error ? err.message : "Unknown error parsing manifests.";
|
|
240
|
+
warn(`go-manifests: ${message}`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
// Third-party service and dependency detection from JVM build manifests
|
|
244
|
+
// (Maven / Gradle), plus Spring datasource configuration.
|
|
245
|
+
if (!config.languages ||
|
|
246
|
+
config.languages.includes("java") ||
|
|
247
|
+
config.languages.includes("kotlin")) {
|
|
248
|
+
try {
|
|
249
|
+
findings.push(...(await (0, dependency_manifests_3.detectJvmPatternsFromDependencyManifests)(scanRootDir, {
|
|
250
|
+
onWarning: warn,
|
|
251
|
+
excludePaths: config.excludePaths,
|
|
252
|
+
})));
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
const message = err instanceof Error ? err.message : "Unknown error parsing manifests.";
|
|
256
|
+
warn(`jvm-manifests: ${message}`);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
// Third-party service and dependency detection from C++ package manifests
|
|
260
|
+
// (vcpkg / Conan / CMake).
|
|
261
|
+
if (!config.languages || config.languages.includes("cpp")) {
|
|
262
|
+
try {
|
|
263
|
+
findings.push(...(await (0, dependency_manifests_4.detectCppPatternsFromDependencyManifests)(scanRootDir, {
|
|
264
|
+
onWarning: warn,
|
|
265
|
+
excludePaths: config.excludePaths,
|
|
266
|
+
})));
|
|
267
|
+
}
|
|
268
|
+
catch (err) {
|
|
269
|
+
const message = err instanceof Error ? err.message : "Unknown error parsing manifests.";
|
|
270
|
+
warn(`cpp-manifests: ${message}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
// .NET project manifests (PackageReference) and appsettings connection strings.
|
|
274
|
+
if (!config.languages || config.languages.includes("csharp")) {
|
|
275
|
+
try {
|
|
276
|
+
findings.push(...(await (0, dependency_manifests_5.detectDotnetPatternsFromManifests)(scanRootDir, {
|
|
277
|
+
onWarning: warn,
|
|
278
|
+
excludePaths: config.excludePaths,
|
|
279
|
+
})));
|
|
280
|
+
}
|
|
281
|
+
catch (err) {
|
|
282
|
+
const message = err instanceof Error ? err.message : "Unknown error parsing manifests.";
|
|
283
|
+
warn(`dotnet-manifests: ${message}`);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
163
286
|
// Language-agnostic third-party service detection from Node/TypeScript manifests.
|
|
164
287
|
const wantsTsOrJs = !config.languages ||
|
|
165
288
|
config.languages.some((l) => l === "typescript" || l === "javascript");
|
|
166
289
|
if (wantsTsOrJs) {
|
|
167
290
|
try {
|
|
168
|
-
findings.push(...(await (0,
|
|
291
|
+
findings.push(...(await (0, dependency_manifests_6.detectTypeScriptPatternsFromDependencyManifests)(scanRootDir, {
|
|
169
292
|
onWarning: warn,
|
|
170
293
|
excludePaths: config.excludePaths,
|
|
171
294
|
})));
|
|
@@ -13,6 +13,11 @@ export declare const scanConfigurationSchema: z.ZodObject<{
|
|
|
13
13
|
yaml: "yaml";
|
|
14
14
|
env: "env";
|
|
15
15
|
python: "python";
|
|
16
|
+
cpp: "cpp";
|
|
17
|
+
csharp: "csharp";
|
|
18
|
+
go: "go";
|
|
19
|
+
java: "java";
|
|
20
|
+
kotlin: "kotlin";
|
|
16
21
|
terraform: "terraform";
|
|
17
22
|
dockerfile: "dockerfile";
|
|
18
23
|
}>>>;
|
|
@@ -17,6 +17,11 @@ export declare const fileInfoSchema: z.ZodObject<{
|
|
|
17
17
|
yaml: "yaml";
|
|
18
18
|
env: "env";
|
|
19
19
|
python: "python";
|
|
20
|
+
cpp: "cpp";
|
|
21
|
+
csharp: "csharp";
|
|
22
|
+
go: "go";
|
|
23
|
+
java: "java";
|
|
24
|
+
kotlin: "kotlin";
|
|
20
25
|
terraform: "terraform";
|
|
21
26
|
dockerfile: "dockerfile";
|
|
22
27
|
}>;
|
|
@@ -74,7 +74,33 @@ async function walkForManifests(currentDirAbs, rootDirAbs, excludePaths, accumul
|
|
|
74
74
|
const isRequirements = lower.startsWith("requirements") && lower.endsWith(".txt");
|
|
75
75
|
const isPyproject = lower === "pyproject.toml";
|
|
76
76
|
const isPipfile = lower === "pipfile";
|
|
77
|
-
|
|
77
|
+
const isDotnetProject = lower.endsWith(".csproj") ||
|
|
78
|
+
lower.endsWith(".fsproj") ||
|
|
79
|
+
lower.endsWith(".vbproj");
|
|
80
|
+
// `CMakeLists.txt` is deliberately excluded: C++ projects place one in
|
|
81
|
+
// nearly every subdirectory, which would shatter the graph into sections.
|
|
82
|
+
// go.mod is the canonical Go module root, so it maps exactly onto a
|
|
83
|
+
// service boundary in a multi-module repository.
|
|
84
|
+
const isGoModule = lower === "go.mod";
|
|
85
|
+
// Maven and Gradle both place a build file at each module root, and on the
|
|
86
|
+
// JVM a module is the deployable unit — unlike `CMakeLists.txt`, one build
|
|
87
|
+
// file per directory *is* the service boundary. `settings.gradle` marks the
|
|
88
|
+
// root of a multi-project build rather than a module, so it is not a
|
|
89
|
+
// marker; the root's own `build.gradle` already covers that directory.
|
|
90
|
+
const isJvmManifest = lower === "pom.xml" ||
|
|
91
|
+
lower === "build.gradle" ||
|
|
92
|
+
lower === "build.gradle.kts";
|
|
93
|
+
const isCppManifest = lower === "vcpkg.json" ||
|
|
94
|
+
lower === "conanfile.txt" ||
|
|
95
|
+
lower === "conanfile.py";
|
|
96
|
+
if (!isTsManifest &&
|
|
97
|
+
!isRequirements &&
|
|
98
|
+
!isPyproject &&
|
|
99
|
+
!isPipfile &&
|
|
100
|
+
!isDotnetProject &&
|
|
101
|
+
!isGoModule &&
|
|
102
|
+
!isJvmManifest &&
|
|
103
|
+
!isCppManifest) {
|
|
78
104
|
continue;
|
|
79
105
|
}
|
|
80
106
|
const manifestRel = path_1.default.relative(rootDirAbs, entryPathAbs);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type FileLanguage = "typescript" | "javascript" | "json" | "yaml" | "env" | "python" | "terraform" | "dockerfile";
|
|
1
|
+
export type FileLanguage = "typescript" | "javascript" | "json" | "yaml" | "env" | "python" | "cpp" | "csharp" | "go" | "java" | "kotlin" | "terraform" | "dockerfile";
|
|
2
2
|
export interface FileInfo {
|
|
3
3
|
path: string;
|
|
4
4
|
name: string;
|
|
@@ -76,6 +76,33 @@ function getFileLanguage(filePath) {
|
|
|
76
76
|
if (ext === ".py") {
|
|
77
77
|
return "python";
|
|
78
78
|
}
|
|
79
|
+
if (ext === ".cpp" ||
|
|
80
|
+
ext === ".cc" ||
|
|
81
|
+
ext === ".cxx" ||
|
|
82
|
+
ext === ".c++" ||
|
|
83
|
+
ext === ".hpp" ||
|
|
84
|
+
ext === ".hh" ||
|
|
85
|
+
ext === ".hxx" ||
|
|
86
|
+
ext === ".ipp" ||
|
|
87
|
+
ext === ".inl" ||
|
|
88
|
+
ext === ".h") {
|
|
89
|
+
return "cpp";
|
|
90
|
+
}
|
|
91
|
+
if (ext === ".cs" || ext === ".cshtml" || ext === ".razor") {
|
|
92
|
+
return "csharp";
|
|
93
|
+
}
|
|
94
|
+
if (ext === ".go") {
|
|
95
|
+
return "go";
|
|
96
|
+
}
|
|
97
|
+
if (ext === ".java") {
|
|
98
|
+
return "java";
|
|
99
|
+
}
|
|
100
|
+
// `.kts` covers Kotlin scripts, including Gradle build scripts — those are
|
|
101
|
+
// build configuration rather than application code, but they are also where
|
|
102
|
+
// a Kotlin service declares its dependencies.
|
|
103
|
+
if (ext === ".kt" || ext === ".kts") {
|
|
104
|
+
return "kotlin";
|
|
105
|
+
}
|
|
79
106
|
if (ext === ".json") {
|
|
80
107
|
return "json";
|
|
81
108
|
}
|
|
@@ -4,6 +4,10 @@ import type { ThirdPartyDetectionConfig } from "../config/third-party-detection-
|
|
|
4
4
|
import type { TypeScriptPatternConfig } from "../analyzers/typescript/typescript-detection-config";
|
|
5
5
|
import type { ClassifierConfig } from "../classifier/config";
|
|
6
6
|
import type { PythonPatternConfig } from "../analyzers/python/python-detection-config";
|
|
7
|
+
import type { GoPatternConfig } from "../analyzers/go/go-detection-config";
|
|
8
|
+
import type { JvmPatternConfig } from "../analyzers/jvm/jvm-detection-config";
|
|
9
|
+
import type { CppPatternConfig } from "../analyzers/cpp/cpp-detection-config";
|
|
10
|
+
import type { CSharpPatternConfig } from "../analyzers/csharp/csharp-detection-config";
|
|
7
11
|
import type { TerraformPatternConfig } from "../analyzers/terraform/terraform-detection-config";
|
|
8
12
|
export interface UnifiedPatternConfig {
|
|
9
13
|
actors: ActorDetectionConfig;
|
|
@@ -12,6 +16,10 @@ export interface UnifiedPatternConfig {
|
|
|
12
16
|
typescript: TypeScriptPatternConfig;
|
|
13
17
|
classifier: ClassifierConfig;
|
|
14
18
|
python: PythonPatternConfig;
|
|
19
|
+
go: GoPatternConfig;
|
|
20
|
+
jvm: JvmPatternConfig;
|
|
21
|
+
cpp: CppPatternConfig;
|
|
22
|
+
csharp: CSharpPatternConfig;
|
|
15
23
|
terraform: TerraformPatternConfig;
|
|
16
24
|
}
|
|
17
25
|
/**
|
|
@@ -7,6 +7,10 @@ const third_party_detection_config_1 = require("../config/third-party-detection-
|
|
|
7
7
|
const typescript_detection_config_1 = require("../analyzers/typescript/typescript-detection-config");
|
|
8
8
|
const config_1 = require("../classifier/config");
|
|
9
9
|
const python_detection_config_1 = require("../analyzers/python/python-detection-config");
|
|
10
|
+
const go_detection_config_1 = require("../analyzers/go/go-detection-config");
|
|
11
|
+
const jvm_detection_config_1 = require("../analyzers/jvm/jvm-detection-config");
|
|
12
|
+
const cpp_detection_config_1 = require("../analyzers/cpp/cpp-detection-config");
|
|
13
|
+
const csharp_detection_config_1 = require("../analyzers/csharp/csharp-detection-config");
|
|
10
14
|
const terraform_detection_config_1 = require("../analyzers/terraform/terraform-detection-config");
|
|
11
15
|
let cachedUnifiedConfig;
|
|
12
16
|
function validateUnifiedPatternConfig(unified) {
|
|
@@ -26,6 +30,15 @@ function validateUnifiedPatternConfig(unified) {
|
|
|
26
30
|
for (const lib of unified.typescript.auth.libraries) {
|
|
27
31
|
emittedPatternIds.add(String(lib.patternId));
|
|
28
32
|
}
|
|
33
|
+
for (const handler of unified.typescript.serverless.handlers) {
|
|
34
|
+
emittedPatternIds.add(String(handler.patternId));
|
|
35
|
+
}
|
|
36
|
+
for (const client of unified.typescript.externalApis.httpClients) {
|
|
37
|
+
emittedPatternIds.add(String(client.patternId));
|
|
38
|
+
}
|
|
39
|
+
for (const loader of unified.typescript.configLoaders) {
|
|
40
|
+
emittedPatternIds.add(String(loader.patternId));
|
|
41
|
+
}
|
|
29
42
|
emittedPatternIds.add(String(unified.typescript.heuristics.sqlKeyword.patternId));
|
|
30
43
|
for (const key of unified.typescript.configKeys.keys) {
|
|
31
44
|
emittedPatternIds.add(String(key.patternId));
|
|
@@ -44,6 +57,12 @@ function validateUnifiedPatternConfig(unified) {
|
|
|
44
57
|
for (const d of unified.python.auth.decorators) {
|
|
45
58
|
emittedPatternIds.add(String(d.patternId));
|
|
46
59
|
}
|
|
60
|
+
for (const lib of unified.python.auth.libraries) {
|
|
61
|
+
emittedPatternIds.add(String(lib.patternId));
|
|
62
|
+
}
|
|
63
|
+
for (const handler of unified.python.serverless.handlers) {
|
|
64
|
+
emittedPatternIds.add(String(handler.patternId));
|
|
65
|
+
}
|
|
47
66
|
for (const fw of unified.python.routes.frameworks) {
|
|
48
67
|
emittedPatternIds.add(String(fw.patternId));
|
|
49
68
|
}
|
|
@@ -59,6 +78,115 @@ function validateUnifiedPatternConfig(unified) {
|
|
|
59
78
|
for (const c of unified.python.externalApis.httpClients) {
|
|
60
79
|
emittedPatternIds.add(String(c.patternId));
|
|
61
80
|
}
|
|
81
|
+
// Go.
|
|
82
|
+
for (const db of unified.go.dbClients) {
|
|
83
|
+
emittedPatternIds.add(String(db.patternId));
|
|
84
|
+
}
|
|
85
|
+
if (unified.go.sqlOpen) {
|
|
86
|
+
emittedPatternIds.add(String(unified.go.sqlOpen.patternId));
|
|
87
|
+
}
|
|
88
|
+
for (const lib of unified.go.auth.libraries) {
|
|
89
|
+
emittedPatternIds.add(String(lib.patternId));
|
|
90
|
+
}
|
|
91
|
+
for (const fw of unified.go.routes.frameworks) {
|
|
92
|
+
emittedPatternIds.add(String(fw.patternId));
|
|
93
|
+
}
|
|
94
|
+
for (const handler of unified.go.serverless.handlers) {
|
|
95
|
+
emittedPatternIds.add(String(handler.patternId));
|
|
96
|
+
}
|
|
97
|
+
if (unified.go.envConfig.envVariable) {
|
|
98
|
+
emittedPatternIds.add(String(unified.go.envConfig.envVariable.patternId));
|
|
99
|
+
}
|
|
100
|
+
if (unified.go.envConfig.configLoaders) {
|
|
101
|
+
emittedPatternIds.add(String(unified.go.envConfig.configLoaders.patternId));
|
|
102
|
+
}
|
|
103
|
+
if (unified.go.envConfig.configFile) {
|
|
104
|
+
emittedPatternIds.add(String(unified.go.envConfig.configFile.patternId));
|
|
105
|
+
}
|
|
106
|
+
for (const c of unified.go.externalApis.httpClients) {
|
|
107
|
+
emittedPatternIds.add(String(c.patternId));
|
|
108
|
+
}
|
|
109
|
+
// JVM (Java + Kotlin).
|
|
110
|
+
for (const db of unified.jvm.dbClients) {
|
|
111
|
+
emittedPatternIds.add(String(db.patternId));
|
|
112
|
+
}
|
|
113
|
+
if (unified.jvm.jdbcUrl) {
|
|
114
|
+
emittedPatternIds.add(String(unified.jvm.jdbcUrl.patternId));
|
|
115
|
+
}
|
|
116
|
+
for (const lib of unified.jvm.auth.libraries) {
|
|
117
|
+
emittedPatternIds.add(String(lib.patternId));
|
|
118
|
+
}
|
|
119
|
+
for (const annotation of unified.jvm.auth.annotations) {
|
|
120
|
+
emittedPatternIds.add(String(annotation.patternId));
|
|
121
|
+
}
|
|
122
|
+
for (const fw of unified.jvm.routes.frameworks) {
|
|
123
|
+
emittedPatternIds.add(String(fw.patternId));
|
|
124
|
+
}
|
|
125
|
+
for (const handler of unified.jvm.serverless.handlers) {
|
|
126
|
+
emittedPatternIds.add(String(handler.patternId));
|
|
127
|
+
}
|
|
128
|
+
if (unified.jvm.envConfig.envVariable) {
|
|
129
|
+
emittedPatternIds.add(String(unified.jvm.envConfig.envVariable.patternId));
|
|
130
|
+
}
|
|
131
|
+
if (unified.jvm.envConfig.propertyKeys) {
|
|
132
|
+
emittedPatternIds.add(String(unified.jvm.envConfig.propertyKeys.patternId));
|
|
133
|
+
}
|
|
134
|
+
if (unified.jvm.envConfig.configLoaders) {
|
|
135
|
+
emittedPatternIds.add(String(unified.jvm.envConfig.configLoaders.patternId));
|
|
136
|
+
}
|
|
137
|
+
if (unified.jvm.envConfig.configFile) {
|
|
138
|
+
emittedPatternIds.add(String(unified.jvm.envConfig.configFile.patternId));
|
|
139
|
+
}
|
|
140
|
+
for (const c of unified.jvm.externalApis.httpClients) {
|
|
141
|
+
emittedPatternIds.add(String(c.patternId));
|
|
142
|
+
}
|
|
143
|
+
// C++.
|
|
144
|
+
for (const db of unified.cpp.dbClients) {
|
|
145
|
+
emittedPatternIds.add(String(db.patternId));
|
|
146
|
+
}
|
|
147
|
+
for (const lib of unified.cpp.auth.libraries) {
|
|
148
|
+
emittedPatternIds.add(String(lib.patternId));
|
|
149
|
+
}
|
|
150
|
+
for (const fw of unified.cpp.routes.frameworks) {
|
|
151
|
+
emittedPatternIds.add(String(fw.patternId));
|
|
152
|
+
}
|
|
153
|
+
if (unified.cpp.envConfig.envVariable) {
|
|
154
|
+
emittedPatternIds.add(String(unified.cpp.envConfig.envVariable.patternId));
|
|
155
|
+
}
|
|
156
|
+
if (unified.cpp.envConfig.configFile) {
|
|
157
|
+
emittedPatternIds.add(String(unified.cpp.envConfig.configFile.patternId));
|
|
158
|
+
}
|
|
159
|
+
for (const c of unified.cpp.externalApis.httpClients) {
|
|
160
|
+
emittedPatternIds.add(String(c.patternId));
|
|
161
|
+
}
|
|
162
|
+
// C# / .NET.
|
|
163
|
+
for (const db of unified.csharp.dbClients) {
|
|
164
|
+
emittedPatternIds.add(String(db.patternId));
|
|
165
|
+
}
|
|
166
|
+
for (const lib of unified.csharp.auth.libraries) {
|
|
167
|
+
emittedPatternIds.add(String(lib.patternId));
|
|
168
|
+
}
|
|
169
|
+
for (const attr of unified.csharp.auth.attributes) {
|
|
170
|
+
emittedPatternIds.add(String(attr.patternId));
|
|
171
|
+
}
|
|
172
|
+
for (const fw of unified.csharp.routes.frameworks) {
|
|
173
|
+
emittedPatternIds.add(String(fw.patternId));
|
|
174
|
+
}
|
|
175
|
+
for (const handler of unified.csharp.serverless.handlers) {
|
|
176
|
+
emittedPatternIds.add(String(handler.patternId));
|
|
177
|
+
}
|
|
178
|
+
if (unified.csharp.envConfig.envVariable) {
|
|
179
|
+
emittedPatternIds.add(String(unified.csharp.envConfig.envVariable.patternId));
|
|
180
|
+
}
|
|
181
|
+
if (unified.csharp.envConfig.configurationKeys) {
|
|
182
|
+
emittedPatternIds.add(String(unified.csharp.envConfig.configurationKeys.patternId));
|
|
183
|
+
}
|
|
184
|
+
if (unified.csharp.envConfig.configFile) {
|
|
185
|
+
emittedPatternIds.add(String(unified.csharp.envConfig.configFile.patternId));
|
|
186
|
+
}
|
|
187
|
+
for (const c of unified.csharp.externalApis.httpClients) {
|
|
188
|
+
emittedPatternIds.add(String(c.patternId));
|
|
189
|
+
}
|
|
62
190
|
// Third-party external API pattern.
|
|
63
191
|
for (const svc of unified.thirdParty.services) {
|
|
64
192
|
emittedPatternIds.add(String(svc.patternId));
|
|
@@ -101,6 +229,10 @@ function loadUnifiedPatternConfig() {
|
|
|
101
229
|
const typescript = (0, typescript_detection_config_1.loadTypeScriptPatternConfig)();
|
|
102
230
|
const classifier = (0, config_1.loadClassifierConfig)();
|
|
103
231
|
const python = (0, python_detection_config_1.loadPythonPatternConfig)();
|
|
232
|
+
const go = (0, go_detection_config_1.loadGoPatternConfig)();
|
|
233
|
+
const jvm = (0, jvm_detection_config_1.loadJvmPatternConfig)();
|
|
234
|
+
const cpp = (0, cpp_detection_config_1.loadCppPatternConfig)();
|
|
235
|
+
const csharp = (0, csharp_detection_config_1.loadCSharpPatternConfig)();
|
|
104
236
|
const terraform = (0, terraform_detection_config_1.loadTerraformPatternConfig)();
|
|
105
237
|
const unified = {
|
|
106
238
|
actors,
|
|
@@ -109,6 +241,10 @@ function loadUnifiedPatternConfig() {
|
|
|
109
241
|
typescript,
|
|
110
242
|
classifier,
|
|
111
243
|
python,
|
|
244
|
+
go,
|
|
245
|
+
jvm,
|
|
246
|
+
cpp,
|
|
247
|
+
csharp,
|
|
112
248
|
terraform,
|
|
113
249
|
};
|
|
114
250
|
validateUnifiedPatternConfig(unified);
|